summaryrefslogtreecommitdiff
path: root/src/webtab/webpage.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2013-06-10 11:50:45 +0200
committerAndrea Diamantini <adjam7@gmail.com>2013-06-10 11:54:28 +0200
commit7330968510ffd83ab208ae0ffa8febe49c4dbcdb (patch)
treea5cd146787d922e66484b3887f93b8010b8aa698 /src/webtab/webpage.cpp
parenti18n: toEncoded -> toString (diff)
downloadrekonq-7330968510ffd83ab208ae0ffa8febe49c4dbcdb.tar.xz
Link custom rekonq QNAM to KDE proxy settings
This is a first attempt to link our needed QNAM to KDE proxy settings. It will try to fix proxy problems when used. Oh... I also added some new error strings in case of proxy problems :) CCBUG: 304378 CCBUG: 315598
Diffstat (limited to 'src/webtab/webpage.cpp')
-rw-r--r--src/webtab/webpage.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/webtab/webpage.cpp b/src/webtab/webpage.cpp
index bae10f5a..01116e73 100644
--- a/src/webtab/webpage.cpp
+++ b/src/webtab/webpage.cpp
@@ -726,7 +726,39 @@ QString WebPage::errorPage(QNetworkReply *reply)
return html;
}
+ QString errString = reply->errorString().toLower();
+ if (errString.contains(QL1S("proxy")))
+ {
+ msg += QL1S("<h2>") + i18n("Oops... Proxy problems!") + QL1S("</h2>");
+
+ QString faceIconPath = QString("file://") + KIconLoader::global()->iconPath("face-surprise" , -KIconLoader::SizeHuge, false);
+ msg += QL1S("<table>");
+ msg += QL1S("<tr><td width=\"100px\">");
+ msg += QL1S("<img style=\"margin: 0 auto;\" src=\"") + faceIconPath + QL1S("\" />");
+ msg += QL1S("</td><td>");
+
+ msg += QL1S("<p><em>") + reply->errorString() + QL1S("</em></p>");
+
+ msg += QL1S("<p>");
+
+ msg += i18n("It seems you are having problems with your <a href=\"%1\">proxy settings</a>. Try checking them, <br /><br />then <a href=\"%4\">try again</a>.<br />", QL1S("rekonq:settings/proxy"), urlString);
+
+ msg += QL1S("</p>");
+ msg += QL1S("</td></tr></table>");
+
+ // done. Replace variables and show it
+ QString html = QL1S(file.readAll());
+
+ html.replace(QL1S("$DEFAULT_PATH"), dataPath);
+ html.replace(QL1S("$PAGE_TITLE"), title);
+ html.replace(QL1S("$MAIN_CONTENT"), msg);
+ html.replace(QL1S("$GENERAL_FONT"), QWebSettings::globalSettings()->fontFamily(QWebSettings::StandardFont));
+
+ return html;
+ }
+
+ // general error page
msg += QL1S("<h2>") + i18n("Oops! Cannot load <em>%1</em>", urlString) + QL1S("</h1>");
QString faceIconPath = QString("file://") + KIconLoader::global()->iconPath("face-surprise" , -KIconLoader::SizeHuge, false);