author | Wuzzy <almikes@aol.com> |
Thu, 18 May 2017 00:44:16 +0200 | |
changeset 12428 | 8b1df6f6229e |
parent 12240 | 88b31fdc760b |
child 12482 | eeeb7e8de95c |
permissions | -rw-r--r-- |
5271 | 1 |
/* |
2 |
* Hedgewars, a free turn based strategy game |
|
11046 | 3 |
* Copyright (c) 2004-2015 Andrey Korotaev <unC0Rr@gmail.com> |
5271 | 4 |
* |
5 |
* This program is free software; you can redistribute it and/or modify |
|
6 |
* it under the terms of the GNU General Public License as published by |
|
7 |
* the Free Software Foundation; version 2 of the License |
|
8 |
* |
|
9 |
* This program is distributed in the hope that it will be useful, |
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU General Public License for more details. |
|
13 |
* |
|
14 |
* You should have received a copy of the GNU General Public License |
|
15 |
* along with this program; if not, write to the Free Software |
|
10108
c68cf030eded
update FSF address. note: two sdl include files (by Sam Lantinga) still have the old FSF address in their copyright - but I ain't gonna touch their copyright headers
sheepluva
parents:
9998
diff
changeset
|
16 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
5271 | 17 |
*/ |
18 |
||
19 |
#include <QGridLayout> |
|
20 |
#include <QPushButton> |
|
5567
44c9a577b082
Tiny bit of progress on download page - hooked it up to "Info" button for now.
nemo
parents:
5271
diff
changeset
|
21 |
#include <QNetworkAccessManager> |
44c9a577b082
Tiny bit of progress on download page - hooked it up to "Info" button for now.
nemo
parents:
5271
diff
changeset
|
22 |
#include <QNetworkRequest> |
5746
fbc52bb92cad
Use QTextBrowser instead of WebKit for downloadable contents page (currently only shows the page itself)
unc0rr
parents:
5582
diff
changeset
|
23 |
#include <QNetworkReply> |
5567
44c9a577b082
Tiny bit of progress on download page - hooked it up to "Info" button for now.
nemo
parents:
5271
diff
changeset
|
24 |
#include <QFileInfo> |
44c9a577b082
Tiny bit of progress on download page - hooked it up to "Info" button for now.
nemo
parents:
5271
diff
changeset
|
25 |
#include <QFileDialog> |
5754 | 26 |
#include <QDebug> |
27 |
#include <QProgressBar> |
|
5756 | 28 |
#include <QBuffer> |
9829 | 29 |
#include <QDesktopServices> |
5271 | 30 |
|
31 |
#include "pagedata.h" |
|
5755
a079b4dea081
Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
5754
diff
changeset
|
32 |
#include "databrowser.h" |
5762 | 33 |
#include "hwconsts.h" |
6932 | 34 |
#include "DataManager.h" |
8055
04dd8b7fb605
- Download .hwp files into Data folder and mount them immediately (yes, could cause problems in case of overlapped contents)
unc0rr
parents:
7824
diff
changeset
|
35 |
#include "FileEngine.h" |
5754 | 36 |
|
6042
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
37 |
QLayout * PageDataDownload::bodyLayoutDefinition() |
5271 | 38 |
{ |
6042
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
39 |
QGridLayout * pageLayout = new QGridLayout(); |
5271 | 40 |
pageLayout->setColumnStretch(0, 1); |
41 |
pageLayout->setColumnStretch(1, 1); |
|
42 |
pageLayout->setColumnStretch(2, 1); |
|
43 |
||
5755
a079b4dea081
Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
5754
diff
changeset
|
44 |
web = new DataBrowser(this); |
5271 | 45 |
pageLayout->addWidget(web, 0, 0, 1, 3); |
5746
fbc52bb92cad
Use QTextBrowser instead of WebKit for downloadable contents page (currently only shows the page itself)
unc0rr
parents:
5582
diff
changeset
|
46 |
|
5769 | 47 |
progressBarsLayout = new QVBoxLayout(); |
5754 | 48 |
pageLayout->addLayout(progressBarsLayout, 1, 0, 1, 3); |
6042
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
49 |
return pageLayout; |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
50 |
} |
5746
fbc52bb92cad
Use QTextBrowser instead of WebKit for downloadable contents page (currently only shows the page itself)
unc0rr
parents:
5582
diff
changeset
|
51 |
|
9829 | 52 |
QLayout * PageDataDownload::footerLayoutDefinition() |
53 |
{ |
|
54 |
QHBoxLayout * bottomLayout = new QHBoxLayout(); |
|
55 |
bottomLayout->setStretch(0, 1); |
|
56 |
||
12234 | 57 |
pbHome = addButton(":/res/home.png", bottomLayout, 1, true, Qt::AlignBottom); |
58 |
pbHome->setMinimumHeight(50); |
|
59 |
pbHome->setMinimumWidth(50); |
|
12238 | 60 |
pbHome->setWhatsThis(tr("Load the start page")); |
12234 | 61 |
|
62 |
pbOpenDir = addButton(tr("Open packages directory"), bottomLayout, 2, false, Qt::AlignBottom); |
|
12236
a0ed4caa6d35
Apply minimal padding to all text buttons in frontend
Wuzzy <almikes@aol.com>
parents:
12234
diff
changeset
|
63 |
pbOpenDir->setStyleSheet("padding: 5px 10px"); |
12240
88b31fdc760b
Add a few WhatsThis texts in frontend, rename “Stereo rendering” to “Stereoscopy”
Wuzzy <almikes@aol.com>
parents:
12238
diff
changeset
|
64 |
pbOpenDir->setWhatsThis(tr("Open the directory in which the downloaded files are stored in your system")); |
11819
7642955690bc
Tweak sizes and icons of most footer buttons of frontend
Wuzzy <almikes@aol.com>
parents:
11626
diff
changeset
|
65 |
pbOpenDir->setMinimumHeight(50); |
9829 | 66 |
|
67 |
bottomLayout->setStretch(2, 1); |
|
68 |
||
69 |
return bottomLayout; |
|
70 |
} |
|
71 |
||
6042
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
72 |
void PageDataDownload::connectSignals() |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
73 |
{ |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
74 |
connect(web, SIGNAL(anchorClicked(QUrl)), this, SLOT(request(const QUrl&))); |
6932 | 75 |
connect(this, SIGNAL(goBack()), this, SLOT(onPageLeave())); |
9829 | 76 |
connect(pbOpenDir, SIGNAL(clicked()), this, SLOT(openPackagesDir())); |
12234 | 77 |
connect(pbHome, SIGNAL(clicked()), this, SLOT(fetchList())); |
6042
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
78 |
} |
6009 | 79 |
|
6042
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
80 |
PageDataDownload::PageDataDownload(QWidget* parent) : AbstractPage(parent) |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
81 |
{ |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
82 |
initPage(); |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
83 |
|
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6009
diff
changeset
|
84 |
web->setOpenLinks(false); |
6384
8b7e8ff1b16a
Disable loading content.html on startup, it is fetched on pushing to top of stack already.
nemo
parents:
6131
diff
changeset
|
85 |
// fetchList(); |
8876
bd8df772dbe6
reintroduce the notification message in case you access dlc page without internet connection
koda
parents:
8059
diff
changeset
|
86 |
web->setHtml(QString( |
bd8df772dbe6
reintroduce the notification message in case you access dlc page without internet connection
koda
parents:
8059
diff
changeset
|
87 |
"<center><h2>Hedgewars Downloadable Content</h2><br><br>" |
bd8df772dbe6
reintroduce the notification message in case you access dlc page without internet connection
koda
parents:
8059
diff
changeset
|
88 |
"<i>%1</i></center>") |
bd8df772dbe6
reintroduce the notification message in case you access dlc page without internet connection
koda
parents:
8059
diff
changeset
|
89 |
.arg(tr("Loading, please wait."))); |
6932 | 90 |
m_contentDownloaded = false; |
5271 | 91 |
} |
5567
44c9a577b082
Tiny bit of progress on download page - hooked it up to "Info" button for now.
nemo
parents:
5271
diff
changeset
|
92 |
|
5765
e87f6756773e
Allow surfing, download and extract only .zip files
unc0rr
parents:
5764
diff
changeset
|
93 |
void PageDataDownload::request(const QUrl &url) |
5567
44c9a577b082
Tiny bit of progress on download page - hooked it up to "Info" button for now.
nemo
parents:
5271
diff
changeset
|
94 |
{ |
5768 | 95 |
QUrl finalUrl; |
12234 | 96 |
if(url.isEmpty()) |
97 |
{ |
|
98 |
qWarning() << "Empty URL requested"; |
|
99 |
return; |
|
100 |
} |
|
101 |
else if(url.host().isEmpty()) |
|
11626 | 102 |
finalUrl = QUrl("https://www.hedgewars.org" + url.path()); |
5768 | 103 |
else |
104 |
finalUrl = url; |
|
105 |
||
8059 | 106 |
if(url.path().endsWith(".hwp") || url.path().endsWith(".zip")) |
5765
e87f6756773e
Allow surfing, download and extract only .zip files
unc0rr
parents:
5764
diff
changeset
|
107 |
{ |
e87f6756773e
Allow surfing, download and extract only .zip files
unc0rr
parents:
5764
diff
changeset
|
108 |
qWarning() << "Download Request" << url.toString(); |
e87f6756773e
Allow surfing, download and extract only .zip files
unc0rr
parents:
5764
diff
changeset
|
109 |
QString fileName = QFileInfo(url.toString()).fileName(); |
5754 | 110 |
|
5768 | 111 |
QNetworkRequest newRequest(finalUrl); |
5765
e87f6756773e
Allow surfing, download and extract only .zip files
unc0rr
parents:
5764
diff
changeset
|
112 |
newRequest.setAttribute(QNetworkRequest::User, fileName); |
5567
44c9a577b082
Tiny bit of progress on download page - hooked it up to "Info" button for now.
nemo
parents:
5271
diff
changeset
|
113 |
|
5765
e87f6756773e
Allow surfing, download and extract only .zip files
unc0rr
parents:
5764
diff
changeset
|
114 |
QNetworkAccessManager *manager = new QNetworkAccessManager(this); |
e87f6756773e
Allow surfing, download and extract only .zip files
unc0rr
parents:
5764
diff
changeset
|
115 |
QNetworkReply *reply = manager->get(newRequest); |
e87f6756773e
Allow surfing, download and extract only .zip files
unc0rr
parents:
5764
diff
changeset
|
116 |
connect(reply, SIGNAL(finished()), this, SLOT(fileDownloaded())); |
e87f6756773e
Allow surfing, download and extract only .zip files
unc0rr
parents:
5764
diff
changeset
|
117 |
connect(reply, SIGNAL(downloadProgress(qint64, qint64)), this, SLOT(downloadProgress(qint64, qint64))); |
5567
44c9a577b082
Tiny bit of progress on download page - hooked it up to "Info" button for now.
nemo
parents:
5271
diff
changeset
|
118 |
|
5765
e87f6756773e
Allow surfing, download and extract only .zip files
unc0rr
parents:
5764
diff
changeset
|
119 |
QProgressBar *progressBar = new QProgressBar(this); |
e87f6756773e
Allow surfing, download and extract only .zip files
unc0rr
parents:
5764
diff
changeset
|
120 |
progressBarsLayout->addWidget(progressBar); |
e87f6756773e
Allow surfing, download and extract only .zip files
unc0rr
parents:
5764
diff
changeset
|
121 |
progressBars.insert(reply, progressBar); |
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6384
diff
changeset
|
122 |
} |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6384
diff
changeset
|
123 |
else |
5765
e87f6756773e
Allow surfing, download and extract only .zip files
unc0rr
parents:
5764
diff
changeset
|
124 |
{ |
e87f6756773e
Allow surfing, download and extract only .zip files
unc0rr
parents:
5764
diff
changeset
|
125 |
qWarning() << "Page Request" << url.toString(); |
e87f6756773e
Allow surfing, download and extract only .zip files
unc0rr
parents:
5764
diff
changeset
|
126 |
|
5768 | 127 |
QNetworkRequest newRequest(finalUrl); |
5765
e87f6756773e
Allow surfing, download and extract only .zip files
unc0rr
parents:
5764
diff
changeset
|
128 |
|
e87f6756773e
Allow surfing, download and extract only .zip files
unc0rr
parents:
5764
diff
changeset
|
129 |
QNetworkAccessManager *manager = new QNetworkAccessManager(this); |
e87f6756773e
Allow surfing, download and extract only .zip files
unc0rr
parents:
5764
diff
changeset
|
130 |
QNetworkReply *reply = manager->get(newRequest); |
e87f6756773e
Allow surfing, download and extract only .zip files
unc0rr
parents:
5764
diff
changeset
|
131 |
connect(reply, SIGNAL(finished()), this, SLOT(pageDownloaded())); |
e87f6756773e
Allow surfing, download and extract only .zip files
unc0rr
parents:
5764
diff
changeset
|
132 |
} |
5567
44c9a577b082
Tiny bit of progress on download page - hooked it up to "Info" button for now.
nemo
parents:
5271
diff
changeset
|
133 |
} |
5746
fbc52bb92cad
Use QTextBrowser instead of WebKit for downloadable contents page (currently only shows the page itself)
unc0rr
parents:
5582
diff
changeset
|
134 |
|
fbc52bb92cad
Use QTextBrowser instead of WebKit for downloadable contents page (currently only shows the page itself)
unc0rr
parents:
5582
diff
changeset
|
135 |
|
5754 | 136 |
void PageDataDownload::pageDownloaded() |
5746
fbc52bb92cad
Use QTextBrowser instead of WebKit for downloadable contents page (currently only shows the page itself)
unc0rr
parents:
5582
diff
changeset
|
137 |
{ |
fbc52bb92cad
Use QTextBrowser instead of WebKit for downloadable contents page (currently only shows the page itself)
unc0rr
parents:
5582
diff
changeset
|
138 |
QNetworkReply * reply = qobject_cast<QNetworkReply *>(sender()); |
fbc52bb92cad
Use QTextBrowser instead of WebKit for downloadable contents page (currently only shows the page itself)
unc0rr
parents:
5582
diff
changeset
|
139 |
|
8876
bd8df772dbe6
reintroduce the notification message in case you access dlc page without internet connection
koda
parents:
8059
diff
changeset
|
140 |
if (reply && (reply->error() == QNetworkReply::NoError)) { |
5766 | 141 |
QString html = QString::fromUtf8(reply->readAll()); |
5768 | 142 |
int begin = html.indexOf("<!-- BEGIN -->"); |
143 |
int end = html.indexOf("<!-- END -->"); |
|
144 |
if(begin != -1 && begin < end) |
|
145 |
{ |
|
146 |
html.truncate(end); |
|
147 |
html.remove(0, begin); |
|
148 |
} |
|
5764
d785d7e23113
truncate page on comment tags, as suggested by unc0rr
nemo
parents:
5762
diff
changeset
|
149 |
web->setHtml(html); |
8876
bd8df772dbe6
reintroduce the notification message in case you access dlc page without internet connection
koda
parents:
8059
diff
changeset
|
150 |
} else |
bd8df772dbe6
reintroduce the notification message in case you access dlc page without internet connection
koda
parents:
8059
diff
changeset
|
151 |
web->setHtml(QString( |
bd8df772dbe6
reintroduce the notification message in case you access dlc page without internet connection
koda
parents:
8059
diff
changeset
|
152 |
"<center><h2>Hedgewars Downloadable Content</h2><br><br>" |
bd8df772dbe6
reintroduce the notification message in case you access dlc page without internet connection
koda
parents:
8059
diff
changeset
|
153 |
"<p><i><h4>%1</i></h4></p></center>") |
bd8df772dbe6
reintroduce the notification message in case you access dlc page without internet connection
koda
parents:
8059
diff
changeset
|
154 |
.arg(tr("This page requires an internet connection."))); |
5746
fbc52bb92cad
Use QTextBrowser instead of WebKit for downloadable contents page (currently only shows the page itself)
unc0rr
parents:
5582
diff
changeset
|
155 |
} |
fbc52bb92cad
Use QTextBrowser instead of WebKit for downloadable contents page (currently only shows the page itself)
unc0rr
parents:
5582
diff
changeset
|
156 |
|
5754 | 157 |
void PageDataDownload::fileDownloaded() |
158 |
{ |
|
159 |
QNetworkReply * reply = qobject_cast<QNetworkReply *>(sender()); |
|
5746
fbc52bb92cad
Use QTextBrowser instead of WebKit for downloadable contents page (currently only shows the page itself)
unc0rr
parents:
5582
diff
changeset
|
160 |
|
5754 | 161 |
if(reply) |
162 |
{ |
|
163 |
QProgressBar *progressBar = progressBars.value(reply, 0); |
|
164 |
||
165 |
if(progressBar) |
|
166 |
{ |
|
167 |
progressBars.remove(reply); |
|
168 |
progressBar->deleteLater(); |
|
169 |
} |
|
5756 | 170 |
|
8055
04dd8b7fb605
- Download .hwp files into Data folder and mount them immediately (yes, could cause problems in case of overlapped contents)
unc0rr
parents:
7824
diff
changeset
|
171 |
QDir extractDir(*cfgdir); |
04dd8b7fb605
- Download .hwp files into Data folder and mount them immediately (yes, could cause problems in case of overlapped contents)
unc0rr
parents:
7824
diff
changeset
|
172 |
extractDir.cd("Data"); |
04dd8b7fb605
- Download .hwp files into Data folder and mount them immediately (yes, could cause problems in case of overlapped contents)
unc0rr
parents:
7824
diff
changeset
|
173 |
|
04dd8b7fb605
- Download .hwp files into Data folder and mount them immediately (yes, could cause problems in case of overlapped contents)
unc0rr
parents:
7824
diff
changeset
|
174 |
QString fileName = extractDir.filePath(QFileInfo(reply->url().path()).fileName()); |
8059 | 175 |
if(fileName.endsWith(".zip")) |
176 |
fileName = fileName.left(fileName.length() - 4) + ".hwp"; |
|
8055
04dd8b7fb605
- Download .hwp files into Data folder and mount them immediately (yes, could cause problems in case of overlapped contents)
unc0rr
parents:
7824
diff
changeset
|
177 |
|
04dd8b7fb605
- Download .hwp files into Data folder and mount them immediately (yes, could cause problems in case of overlapped contents)
unc0rr
parents:
7824
diff
changeset
|
178 |
QFile out(fileName); |
04dd8b7fb605
- Download .hwp files into Data folder and mount them immediately (yes, could cause problems in case of overlapped contents)
unc0rr
parents:
7824
diff
changeset
|
179 |
if(!out.open(QFile::WriteOnly)) |
04dd8b7fb605
- Download .hwp files into Data folder and mount them immediately (yes, could cause problems in case of overlapped contents)
unc0rr
parents:
7824
diff
changeset
|
180 |
{ |
04dd8b7fb605
- Download .hwp files into Data folder and mount them immediately (yes, could cause problems in case of overlapped contents)
unc0rr
parents:
7824
diff
changeset
|
181 |
qWarning() << "out.open():" << out.errorString(); |
04dd8b7fb605
- Download .hwp files into Data folder and mount them immediately (yes, could cause problems in case of overlapped contents)
unc0rr
parents:
7824
diff
changeset
|
182 |
return ; |
04dd8b7fb605
- Download .hwp files into Data folder and mount them immediately (yes, could cause problems in case of overlapped contents)
unc0rr
parents:
7824
diff
changeset
|
183 |
} |
04dd8b7fb605
- Download .hwp files into Data folder and mount them immediately (yes, could cause problems in case of overlapped contents)
unc0rr
parents:
7824
diff
changeset
|
184 |
|
04dd8b7fb605
- Download .hwp files into Data folder and mount them immediately (yes, could cause problems in case of overlapped contents)
unc0rr
parents:
7824
diff
changeset
|
185 |
out.write(reply->readAll()); |
04dd8b7fb605
- Download .hwp files into Data folder and mount them immediately (yes, could cause problems in case of overlapped contents)
unc0rr
parents:
7824
diff
changeset
|
186 |
|
04dd8b7fb605
- Download .hwp files into Data folder and mount them immediately (yes, could cause problems in case of overlapped contents)
unc0rr
parents:
7824
diff
changeset
|
187 |
out.close(); |
04dd8b7fb605
- Download .hwp files into Data folder and mount them immediately (yes, could cause problems in case of overlapped contents)
unc0rr
parents:
7824
diff
changeset
|
188 |
|
04dd8b7fb605
- Download .hwp files into Data folder and mount them immediately (yes, could cause problems in case of overlapped contents)
unc0rr
parents:
7824
diff
changeset
|
189 |
// now mount it |
04dd8b7fb605
- Download .hwp files into Data folder and mount them immediately (yes, could cause problems in case of overlapped contents)
unc0rr
parents:
7824
diff
changeset
|
190 |
FileEngineHandler::mount(fileName); |
5754 | 191 |
} |
192 |
} |
|
193 |
||
194 |
void PageDataDownload::downloadProgress(qint64 bytesRecieved, qint64 bytesTotal) |
|
195 |
{ |
|
196 |
QNetworkReply * reply = qobject_cast<QNetworkReply *>(sender()); |
|
5746
fbc52bb92cad
Use QTextBrowser instead of WebKit for downloadable contents page (currently only shows the page itself)
unc0rr
parents:
5582
diff
changeset
|
197 |
|
5754 | 198 |
if(reply) |
199 |
{ |
|
200 |
QProgressBar *progressBar = progressBars.value(reply, 0); |
|
5746
fbc52bb92cad
Use QTextBrowser instead of WebKit for downloadable contents page (currently only shows the page itself)
unc0rr
parents:
5582
diff
changeset
|
201 |
|
5754 | 202 |
if(progressBar) |
203 |
{ |
|
204 |
progressBar->setValue(bytesRecieved); |
|
205 |
progressBar->setMaximum(bytesTotal); |
|
206 |
} |
|
207 |
} |
|
208 |
} |
|
209 |
||
210 |
void PageDataDownload::fetchList() |
|
211 |
{ |
|
11626 | 212 |
request(QUrl("https://hedgewars.org/content.html")); |
5754 | 213 |
} |
5756 | 214 |
|
6932 | 215 |
void PageDataDownload::onPageLeave() |
216 |
{ |
|
217 |
if (m_contentDownloaded) |
|
218 |
{ |
|
219 |
m_contentDownloaded = false; |
|
7824 | 220 |
//DataManager::instance().reload(); |
6932 | 221 |
} |
222 |
} |
|
9829 | 223 |
|
224 |
void PageDataDownload::openPackagesDir() |
|
225 |
{ |
|
226 |
QString path = QDir::toNativeSeparators(cfgdir->absolutePath() + "/Data"); |
|
227 |
QDesktopServices::openUrl(QUrl("file:///" + path)); |
|
228 |
} |