diff -r 28e859ea393b -r 8d266b2d0f9c QTfrontend/ui/page/pagedata.cpp --- a/QTfrontend/ui/page/pagedata.cpp Sun Oct 08 16:50:47 2017 +0200 +++ b/QTfrontend/ui/page/pagedata.cpp Sun Oct 08 19:04:20 2017 +0200 @@ -136,22 +136,34 @@ void PageDataDownload::pageDownloaded() { QNetworkReply * reply = qobject_cast(sender()); + const char *html = + "

Hedgewars Downloadable Content



" + "

%1

"; - if (reply && (reply->error() == QNetworkReply::NoError)) { - QString html = QString::fromUtf8(reply->readAll()); - int begin = html.indexOf(""); - int end = html.indexOf(""); - if(begin != -1 && begin < end) + if (reply) { + if (reply->error() == QNetworkReply::NoError) { - html.truncate(end); - html.remove(0, begin); + QString html = QString::fromUtf8(reply->readAll()); + int begin = html.indexOf(""); + int end = html.indexOf(""); + if(begin != -1 && begin < end) + { + html.truncate(end); + html.remove(0, begin); + } + web->setHtml(html); } - web->setHtml(html); - } else - web->setHtml(QString( - "

Hedgewars Downloadable Content



" - "

%1

") - .arg(tr("This page requires an internet connection."))); + else + { + QString message = reply->error() == QNetworkReply::UnknownNetworkError ? + tr("Unknown network error (possibly missing SSL library).") : + QString(tr("This feature requires an Internet connection, but you don't appear to be online (error code: %1).")).arg(reply->error()); + web->setHtml(QString(html).arg(message)); + } + } + else { + web->setHtml(QString(html).arg(tr("Internal error: Reply object is invalid."))); + } } void PageDataDownload::fileDownloaded()