# HG changeset patch # User koda # Date 1318611631 -7200 # Node ID dad168522e3b6d0f6c9d4cd630b2771ec7bc2538 # Parent a9495e0bd4187c0fc86c0efd9da97b2c9f078ce8 display a message when network is down or server is not reachable, nemo also made the page refresh at display time diff -r a9495e0bd418 -r dad168522e3b QTfrontend/hwform.cpp --- a/QTfrontend/hwform.cpp Wed Oct 12 04:14:38 2011 +0200 +++ b/QTfrontend/hwform.cpp Fri Oct 14 19:00:31 2011 +0200 @@ -471,6 +471,10 @@ #ifdef USE_XFIRE updateXfire(); #endif + if (id == ID_PAGE_DATADOWNLOAD) + { + ui.pageDataDownload->fetchList(); + } if (id == ID_PAGE_DRAWMAP) { DrawMapScene * scene; if(lastid == ID_PAGE_MULTIPLAYER) diff -r a9495e0bd418 -r dad168522e3b QTfrontend/pagedata.cpp --- 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("

Hedgewars Downloadable Content



Loading, please wait
"); } void PageDataDownload::request(const QUrl &url) @@ -95,7 +95,7 @@ { QNetworkReply * reply = qobject_cast(sender()); - if(reply) + if(reply && (reply->error() == QNetworkReply::NoError)) { QString html = QString::fromUtf8(reply->readAll()); int begin = html.indexOf(""); @@ -107,6 +107,10 @@ } web->setHtml(html); } + else + { + web->setHtml("

Hedgewars Downloadable Content



This page requires an internet connection.

"); + } } 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)