# HG changeset patch # User Wuzzy # Date 1492018544 -7200 # Node ID 2e725778e107106062ece4c569f353ceb077ed30 # Parent 05fb32410350f078db527a34f67b339d7cec6fa5 Add home button to DLC page diff -r 05fb32410350 -r 2e725778e107 QTfrontend/hedgewars.qrc --- a/QTfrontend/hedgewars.qrc Wed Apr 12 00:23:10 2017 +0200 +++ b/QTfrontend/hedgewars.qrc Wed Apr 12 19:35:44 2017 +0200 @@ -149,6 +149,7 @@ res/iconScript.png res/dice.png res/Star.png + res/home.png res/inverse-corner-bl.png res/Flake.png res/Egg.png diff -r 05fb32410350 -r 2e725778e107 QTfrontend/res/home.png Binary file QTfrontend/res/home.png has changed diff -r 05fb32410350 -r 2e725778e107 QTfrontend/res/home.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/QTfrontend/res/home.svg Wed Apr 12 19:35:44 2017 +0200 @@ -0,0 +1,201 @@ + +image/svg+xmlOpenclipart2010-03-10T10:25:42Home icon from <A href="http://tango.freedesktop.org/Tango_Desktop_Project"> Tango Project </A> \n<BR><BR>\nSince version 0.8.90 Tango Project icons are Public Domain: <A href="http://tango.freedesktop.org/Frequently_Asked_Questions#Terms_of_Use.3F"> Tango Project FAQ </A>https://openclipart.org/detail/30805/tango-go-home-by-warszawiankawarszawiankaarchitecturebuildingexternalsourcehomehouseicontango \ No newline at end of file diff -r 05fb32410350 -r 2e725778e107 QTfrontend/ui/page/pagedata.cpp --- a/QTfrontend/ui/page/pagedata.cpp Wed Apr 12 00:23:10 2017 +0200 +++ b/QTfrontend/ui/page/pagedata.cpp Wed Apr 12 19:35:44 2017 +0200 @@ -54,7 +54,12 @@ QHBoxLayout * bottomLayout = new QHBoxLayout(); bottomLayout->setStretch(0, 1); - pbOpenDir = addButton(tr("Open packages directory"), bottomLayout, 1, false, Qt::AlignBottom); + pbHome = addButton(":/res/home.png", bottomLayout, 1, true, Qt::AlignBottom); + pbHome->setMinimumHeight(50); + pbHome->setMinimumWidth(50); + pbHome->setWhatsThis(tr("Return to the start page")); + + pbOpenDir = addButton(tr("Open packages directory"), bottomLayout, 2, false, Qt::AlignBottom); pbOpenDir->setMinimumHeight(50); bottomLayout->setStretch(2, 1); @@ -67,6 +72,7 @@ connect(web, SIGNAL(anchorClicked(QUrl)), this, SLOT(request(const QUrl&))); connect(this, SIGNAL(goBack()), this, SLOT(onPageLeave())); connect(pbOpenDir, SIGNAL(clicked()), this, SLOT(openPackagesDir())); + connect(pbHome, SIGNAL(clicked()), this, SLOT(fetchList())); } PageDataDownload::PageDataDownload(QWidget* parent) : AbstractPage(parent) @@ -85,7 +91,12 @@ void PageDataDownload::request(const QUrl &url) { QUrl finalUrl; - if(url.host().isEmpty()) + if(url.isEmpty()) + { + qWarning() << "Empty URL requested"; + return; + } + else if(url.host().isEmpty()) finalUrl = QUrl("https://www.hedgewars.org" + url.path()); else finalUrl = url; @@ -199,7 +210,6 @@ request(QUrl("https://hedgewars.org/content.html")); } - void PageDataDownload::onPageLeave() { if (m_contentDownloaded) diff -r 05fb32410350 -r 2e725778e107 QTfrontend/ui/page/pagedata.h --- a/QTfrontend/ui/page/pagedata.h Wed Apr 12 00:23:10 2017 +0200 +++ b/QTfrontend/ui/page/pagedata.h Wed Apr 12 19:35:44 2017 +0200 @@ -48,6 +48,7 @@ QHash progressBars; QVBoxLayout *progressBarsLayout; QPushButtonWithSound * pbOpenDir; + QPushButtonWithSound * pbHome; bool m_contentDownloaded; ///< true if something was downloaded since last page leave