missingwadsdialog.h
1 //------------------------------------------------------------------------------
2 // missingwadsdialog.h
3 //------------------------------------------------------------------------------
4 //
5 // This library is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation; either
8 // version 2.1 of the License, or (at your option) any later version.
9 //
10 // This library 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 GNU
13 // Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with this library; 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 id6b2989fd_5c98_4e31_ad64_cf57b7231a67
24 #define id6b2989fd_5c98_4e31_ad64_cf57b7231a67
25 
26 #include "dptr.h"
27 #include <QDialog>
28 #include <QList>
29 #include <QStringList>
30 
31 class PWad;
32 
33 class MissingWadsDialog : public QDialog
34 {
35  Q_OBJECT;
36 
37 public:
38  enum MissingWadsProceed
39  {
40  Ignore,
41  Cancel,
42  Install
43  };
44 
45  MissingWadsDialog(const QList<PWad> &wads, QWidget *parent);
47 
48  MissingWadsProceed decision() const;
49  QStringList filesToDownload() const;
50  void setAllowIgnore(bool);
51 
52 private:
54 
55  QStringList downloadableFiles() const;
56  QStringList forbiddenFiles() const;
57  QStringList optionalFiles() const;
58 
59  bool hasAnyAllowedFile() const;
60  bool isFreedoomReplaceableOnList(const QStringList &files) const;
61  QStringList selectedOptionalFiles() const;
62  void setup();
63  void setupForbiddenFilesArea();
64  void setupDownloadableFilesArea();
65  void setupOptionalFilesArea();
66  void setupWadseekerIsRunning();
67  void setupWadseekerNotRunning();
68 
69 private slots:
70  void ignoreMissingFiles();
71  void installFreedoom();
72  void installMissingFiles();
73  void updateStateAccordingToFileSelection();
74 };
75 
76 #endif
PWAD hosted on a server.