QTfrontend/ui/page/pagedata.h
author Wuzzy <Wuzzy2@mail.ru>
Thu, 25 Jun 2020 17:44:22 +0200
changeset 15636 34c32a11203e
parent 12234 2e725778e107
permissions -rw-r--r--
Teach AI to use laser sight
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5271
48d18e329298 ack. forgot to add my stub files
nemo
parents:
diff changeset
     1
/*
48d18e329298 ack. forgot to add my stub files
nemo
parents:
diff changeset
     2
 * Hedgewars, a free turn based strategy game
11046
47a8c19ecb60 more copyright fixes
sheepluva
parents: 10108
diff changeset
     3
 * Copyright (c) 2004-2015 Andrey Korotaev <unC0Rr@gmail.com>
5271
48d18e329298 ack. forgot to add my stub files
nemo
parents:
diff changeset
     4
 *
48d18e329298 ack. forgot to add my stub files
nemo
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
48d18e329298 ack. forgot to add my stub files
nemo
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License as published by
48d18e329298 ack. forgot to add my stub files
nemo
parents:
diff changeset
     7
 * the Free Software Foundation; version 2 of the License
48d18e329298 ack. forgot to add my stub files
nemo
parents:
diff changeset
     8
 *
48d18e329298 ack. forgot to add my stub files
nemo
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
48d18e329298 ack. forgot to add my stub files
nemo
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
48d18e329298 ack. forgot to add my stub files
nemo
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
48d18e329298 ack. forgot to add my stub files
nemo
parents:
diff changeset
    12
 * GNU General Public License for more details.
48d18e329298 ack. forgot to add my stub files
nemo
parents:
diff changeset
    13
 *
48d18e329298 ack. forgot to add my stub files
nemo
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
48d18e329298 ack. forgot to add my stub files
nemo
parents:
diff changeset
    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
48d18e329298 ack. forgot to add my stub files
nemo
parents:
diff changeset
    17
 */
48d18e329298 ack. forgot to add my stub files
nemo
parents:
diff changeset
    18
48d18e329298 ack. forgot to add my stub files
nemo
parents:
diff changeset
    19
#ifndef PAGE_DATA_H
48d18e329298 ack. forgot to add my stub files
nemo
parents:
diff changeset
    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
48d18e329298 ack. forgot to add my stub files
nemo
parents:
diff changeset
    23
#include "AbstractPage.h"
48d18e329298 ack. forgot to add my stub files
nemo
parents:
diff changeset
    24
5755
a079b4dea081 Implement DataBrowser which downloads resources (images, css) on its own.
unc0rr
parents: 5754
diff changeset
    25
class DataBrowser;
5754
583b7a683b17 - Implement progressbars to show download progress
unc0rr
parents: 5746
diff changeset
    26
class QProgressBar;
583b7a683b17 - Implement progressbars to show download progress
unc0rr
parents: 5746
diff changeset
    27
class QNetworkReply;
583b7a683b17 - Implement progressbars to show download progress
unc0rr
parents: 5746
diff changeset
    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
1804dd141015 'Open packages directory' button on dlc page
unc0rr
parents: 9080
diff changeset
    30
5271
48d18e329298 ack. forgot to add my stub files
nemo
parents:
diff changeset
    31
class PageDataDownload : public AbstractPage
48d18e329298 ack. forgot to add my stub files
nemo
parents:
diff changeset
    32
{
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    33
        Q_OBJECT
5271
48d18e329298 ack. forgot to add my stub files
nemo
parents:
diff changeset
    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
48d18e329298 ack. forgot to add my stub files
nemo
parents:
diff changeset
    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
583b7a683b17 - Implement progressbars to show download progress
unc0rr
parents: 5746
diff changeset
    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
1804dd141015 'Open packages directory' button on dlc page
unc0rr
parents: 9080
diff changeset
    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
1804dd141015 'Open packages directory' button on dlc page
unc0rr
parents: 9080
diff changeset
    50
        QPushButtonWithSound * pbOpenDir;
12234
2e725778e107 Add home button to DLC page
Wuzzy <almikes@aol.com>
parents: 11046
diff changeset
    51
        QPushButtonWithSound * pbHome;
5567
44c9a577b082 Tiny bit of progress on download page - hooked it up to "Info" button for now.
nemo
parents: 5271
diff changeset
    52
6932
005393616925 make DLC trigger data reload
sheepluva
parents: 6700
diff changeset
    53
        bool m_contentDownloaded; ///< true if something was downloaded since last page leave
005393616925 make DLC trigger data reload
sheepluva
parents: 6700
diff changeset
    54
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    55
    private slots:
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    56
        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
    57
6616
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    58
        void pageDownloaded();
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    59
        void fileDownloaded();
f77bb02b669f astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents: 6060
diff changeset
    60
        void downloadProgress(qint64, qint64);
9829
1804dd141015 'Open packages directory' button on dlc page
unc0rr
parents: 9080
diff changeset
    61
        void openPackagesDir();
6932
005393616925 make DLC trigger data reload
sheepluva
parents: 6700
diff changeset
    62
005393616925 make DLC trigger data reload
sheepluva
parents: 6700
diff changeset
    63
        void onPageLeave();
5271
48d18e329298 ack. forgot to add my stub files
nemo
parents:
diff changeset
    64
};
48d18e329298 ack. forgot to add my stub files
nemo
parents:
diff changeset
    65
48d18e329298 ack. forgot to add my stub files
nemo
parents:
diff changeset
    66
#endif