QTfrontend/ui/page/pagedata.cpp
changeset 8876 bd8df772dbe6
parent 8059 07661fb20586
child 9080 9b42757d7e71
--- a/QTfrontend/ui/page/pagedata.cpp	Fri Apr 05 22:57:31 2013 +0200
+++ b/QTfrontend/ui/page/pagedata.cpp	Sat Apr 06 01:02:28 2013 +0200
@@ -60,7 +60,10 @@
 
     web->setOpenLinks(false);
 //    fetchList();
-
+    web->setHtml(QString(
+        "<center><h2>Hedgewars Downloadable Content</h2><br><br>"
+        "<i>%1</i></center>")
+        .arg(tr("Loading, please wait.")));
     m_contentDownloaded = false;
 }
 
@@ -106,8 +109,7 @@
 {
     QNetworkReply * reply = qobject_cast<QNetworkReply *>(sender());
 
-    if(reply)
-    {
+    if (reply && (reply->error() == QNetworkReply::NoError)) {
         QString html = QString::fromUtf8(reply->readAll());
         int begin = html.indexOf("<!-- BEGIN -->");
         int end = html.indexOf("<!-- END -->");
@@ -117,7 +119,11 @@
             html.remove(0, begin);
         }
         web->setHtml(html);
-    }
+    } else
+        web->setHtml(QString(
+            "<center><h2>Hedgewars Downloadable Content</h2><br><br>"
+            "<p><i><h4>%1</i></h4></p></center>")
+            .arg(tr("This page requires an internet connection.")));
 }
 
 void PageDataDownload::fileDownloaded()