QTfrontend/hwform.cpp
changeset 8878 b03dc99f2f2e
parent 8803 b3f37e7f9ff4
child 8887 539380a498e4
--- 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()