QTfrontend/pagedata.cpp
branch0.9.16
changeset 5999 dad168522e3b
parent 5769 09aca6e1317a
--- a/QTfrontend/pagedata.cpp	Wed Oct 12 04:14:38 2011 +0200
+++ b/QTfrontend/pagedata.cpp	Fri Oct 14 19:00:31 2011 +0200
@@ -51,7 +51,7 @@
     progressBarsLayout = new QVBoxLayout();
     pageLayout->addLayout(progressBarsLayout, 1, 0, 1, 3);
 
-    fetchList();
+    web->setHtml("<center><h2>Hedgewars Downloadable Content</h2><br><br><i>Loading, please wait</i></center>");
 }
 
 void PageDataDownload::request(const QUrl &url)
@@ -95,7 +95,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 -->");
@@ -107,6 +107,10 @@
         }
         web->setHtml(html);
     }
+    else
+    {
+        web->setHtml("<center><h2>Hedgewars Downloadable Content</h2><br><br><p><i><h4>This page requires an internet connection.</i></h4></center>");
+    }
 }
 
 void PageDataDownload::fileDownloaded()
@@ -146,7 +150,7 @@
 
 void PageDataDownload::fetchList()
 {
-    request(QUrl("http://hedgewars.org/content.html"));
+    request(QUrl("http://www.hedgewars.org/content.html"));
 }
 
 bool PageDataDownload::extractDataPack(QByteArray * buf)