freedoomdialog.h
1 //------------------------------------------------------------------------------
2 // freedoomdialog.h
3 //------------------------------------------------------------------------------
4 //
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 // 02110-1301, USA.
19 //
20 //------------------------------------------------------------------------------
21 // Copyright (C) 2015 "Zalewa" <zalewapl@gmail.com>
22 //------------------------------------------------------------------------------
23 #ifndef idf158b01c_04e9_4734_8b12_f66ddbea5cbc
24 #define idf158b01c_04e9_4734_8b12_f66ddbea5cbc
25 
26 #include "dptr.h"
27 #include <QDialog>
28 #include <QString>
29 
30 class ModFile;
31 class ModSet;
32 
33 class FreedoomDialog : public QDialog
34 {
35  Q_OBJECT;
36 
37 public:
38  FreedoomDialog(QWidget *parent);
39  ~FreedoomDialog();
40 
41 public slots:
42  void accept();
43 
44 private:
45  enum Column
46  {
47  ColName,
48  ColStatus,
49  ColInstall
50  };
51 
53 
54  void insertModFile(const ModFile &file);
55  void resetProgressBar();
56  ModSet selectedModFiles() const;
57  void setupInstallPaths();
58  void setupWadsTable();
59  void showError(const QString &text);
60  void showModInfo(const ModSet &modSet);
61  void showStatus(const QString &text);
62  void updateConfig();
63 
64 private slots:
65  void applyFreedoomVersionInfo();
66  void fetchInfo();
67  void onModInstallFinished();
68  void showFileDownloadProgress(const QString &file, qint64 current, qint64 total);
69 };
70 
71 #endif