author | sheepluva |
Tue, 21 Jan 2014 01:38:06 +0100 | |
changeset 10031 | 9353632dc661 |
parent 9998 | 736015b847e3 |
child 10108 | c68cf030eded |
permissions | -rw-r--r-- |
5271 | 1 |
/* |
2 |
* Hedgewars, a free turn based strategy game |
|
9998 | 3 |
* Copyright (c) 2004-2014 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 |
|
16 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
|
17 |
*/ |
|
18 |
||
19 |
#ifndef PAGE_DATA_H |
|
20 |
#define PAGE_DATA_H |
|
5746
fbc52bb92cad
Use QTextBrowser instead of WebKit for downloadable contents page (currently only shows the page itself)
unc0rr
parents:
5582
diff
changeset
|
21 |
|
5567
44c9a577b082
Tiny bit of progress on download page - hooked it up to "Info" button for now.
nemo
parents:
5271
diff
changeset
|
22 |
#include <QUrl> |
5271 | 23 |
#include "AbstractPage.h" |
24 |
||
5755
a079b4dea081
Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents:
5754
diff
changeset
|
25 |
class DataBrowser; |
5754 | 26 |
class QProgressBar; |
27 |
class QNetworkReply; |
|
28 |
class QVBoxLayout; |
|
5746
fbc52bb92cad
Use QTextBrowser instead of WebKit for downloadable contents page (currently only shows the page itself)
unc0rr
parents:
5582
diff
changeset
|
29 |
|
9829 | 30 |
|
5271 | 31 |
class PageDataDownload : public AbstractPage |
32 |
{ |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
33 |
Q_OBJECT |
5271 | 34 |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
35 |
public: |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
36 |
PageDataDownload(QWidget* parent = 0); |
5271 | 37 |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
38 |
public slots: |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
39 |
void fetchList(); |
5754 | 40 |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
41 |
protected: |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
42 |
QLayout * bodyLayoutDefinition(); |
9829 | 43 |
QLayout * footerLayoutDefinition(); |
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
44 |
void connectSignals(); |
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
|
45 |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
46 |
private: |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
47 |
DataBrowser *web; |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
48 |
QHash<QNetworkReply*, QProgressBar *> progressBars; |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
49 |
QVBoxLayout *progressBarsLayout; |
9829 | 50 |
QPushButtonWithSound * pbOpenDir; |
5567
44c9a577b082
Tiny bit of progress on download page - hooked it up to "Info" button for now.
nemo
parents:
5271
diff
changeset
|
51 |
|
6932 | 52 |
bool m_contentDownloaded; ///< true if something was downloaded since last page leave |
53 |
||
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
54 |
private slots: |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
55 |
void request(const QUrl &url); |
5746
fbc52bb92cad
Use QTextBrowser instead of WebKit for downloadable contents page (currently only shows the page itself)
unc0rr
parents:
5582
diff
changeset
|
56 |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
57 |
void pageDownloaded(); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
58 |
void fileDownloaded(); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
59 |
void downloadProgress(qint64, qint64); |
9829 | 60 |
void openPackagesDir(); |
6932 | 61 |
|
62 |
void onPageLeave(); |
|
5271 | 63 |
}; |
64 |
||
65 |
#endif |