--- a/QTfrontend/hwform.cpp Tue Mar 26 18:52:42 2013 +0100
+++ b/QTfrontend/hwform.cpp Sun Apr 07 22:53:40 2013 +0200
@@ -361,7 +361,7 @@
{
if(hwnet && (hwnet->clientState() != HWNewNet::Disconnected))
{
- xfire_setvalue(XFIRE_SERVER, !hwnet->getHost().compare(QString("netserver.hedgewars.org:%1").arg(NETGAME_DEFAULT_PORT)) ? "Official server" : hwnet->getHost().toAscii());
+ xfire_setvalue(XFIRE_SERVER, !hwnet->getHost().compare(QString("%1:%2").arg(NETGAME_DEFAULT_SERVER).arg(NETGAME_DEFAULT_PORT)) ? "Official server" : hwnet->getHost().toAscii());
switch(hwnet->clientState())
{
case HWNewNet::Connecting: // Connecting
@@ -1014,7 +1014,7 @@
void HWForm::NetConnectOfficialServer()
{
- NetConnectServer("netserver.hedgewars.org", NETGAME_DEFAULT_PORT);
+ NetConnectServer(NETGAME_DEFAULT_SERVER, NETGAME_DEFAULT_PORT);
}
void HWForm::NetPassword(const QString & nick)
@@ -1351,7 +1351,7 @@
//nick and pass stuff
QString nickname = config->value("net/nick", "").toString();
- hwnet->m_private_game = !(hostName == "netserver.hedgewars.org" && port == NETGAME_DEFAULT_PORT);
+ hwnet->m_private_game = !(hostName == NETGAME_DEFAULT_SERVER && port == NETGAME_DEFAULT_PORT);
if (hwnet->m_private_game == false)
if (AskForNickAndPwd() != 0)
return;
@@ -2016,8 +2016,22 @@
void HWForm::showFeedbackDialog()
{
- FeedbackDialog dialog(this);
- dialog.exec();
+ QNetworkRequest newRequest(QUrl("http://www.hedgewars.org"));
+
+ QNetworkAccessManager *manager = new QNetworkAccessManager(this);
+ QNetworkReply *reply = manager->get(newRequest);
+ connect(reply, SIGNAL(finished()), this, SLOT(showFeedbackDialogNetChecked()));
+}
+
+void HWForm::showFeedbackDialogNetChecked()
+{
+ QNetworkReply *reply = qobject_cast<QNetworkReply *>(sender());
+
+ if (reply && (reply->error() == QNetworkReply::NoError)) {
+ FeedbackDialog dialog(this);
+ dialog.exec();
+ } else
+ MessageDialog::ShowErrorMessage(tr("This page requires an internet connection."), this);
}
void HWForm::startGame()