--- a/QTfrontend/hwform.cpp Sat Apr 06 01:02:28 2013 +0200
+++ b/QTfrontend/hwform.cpp Sat Apr 06 01:11:49 2013 +0200
@@ -2010,8 +2010,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()
--- a/QTfrontend/hwform.h Sat Apr 06 01:02:28 2013 +0200
+++ b/QTfrontend/hwform.h Sat Apr 06 01:11:49 2013 +0200
@@ -129,6 +129,7 @@
void UpdateCampaignPageProgress(int index);
void InitCampaignPage();
void showFeedbackDialog();
+ void showFeedbackDialogNetChecked();
void NetGameChangeStatus(bool isMaster);
void NetGameMaster();