1 /* |
|
2 * ZCinema: Zandronum demo launcher |
|
3 * Copyright (C) 2013 Santeri Piippo |
|
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, either version 3 of the License, or |
|
8 * (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, see <http://www.gnu.org/licenses/>. |
|
17 */ |
|
18 |
|
19 #ifndef ZCINEMA_VERSIONEDITOR_H |
|
20 #define ZCINEMA_VERSIONEDITOR_H |
|
21 |
|
22 #include <QDialog> |
|
23 #include "types.h" |
|
24 |
|
25 class QCheckBox; |
|
26 class Ui_VersionEditor; |
|
27 class Ui_AddVersion; |
|
28 |
|
29 class VersionEditor : public QDialog { |
|
30 Q_OBJECT |
|
31 |
|
32 public: |
|
33 enum { |
|
34 NameColumn, |
|
35 ReleaseColumn, |
|
36 PathColumn |
|
37 }; |
|
38 |
|
39 explicit VersionEditor (QWidget* parent = 0, Qt::WindowFlags f = 0); |
|
40 virtual ~VersionEditor(); |
|
41 |
|
42 public slots: |
|
43 void add(); |
|
44 void edit(); |
|
45 void remove(); |
|
46 void clear(); |
|
47 void saveChanges(); |
|
48 void selectionChanged (int row); |
|
49 |
|
50 private: |
|
51 Ui_VersionEditor* m_ui; |
|
52 |
|
53 void initVersions(); |
|
54 void addVersion (str name, str path, bool isRelease); |
|
55 QCheckBox* getReleaseCheckbox (int i); |
|
56 }; |
|
57 |
|
58 class AddVersionPrompt : public QDialog { |
|
59 Q_OBJECT |
|
60 |
|
61 public: |
|
62 explicit AddVersionPrompt (QWidget* parent = 0, Qt::WindowFlags f = 0); |
|
63 virtual ~AddVersionPrompt(); |
|
64 |
|
65 public: |
|
66 str name(); |
|
67 str path(); |
|
68 bool release(); |
|
69 void setName (const str& a); |
|
70 void setPath (const str& a); |
|
71 void setRelease (bool a); |
|
72 |
|
73 public slots: |
|
74 void findPath(); |
|
75 void fieldsChanged(); |
|
76 |
|
77 private: |
|
78 Ui_AddVersion* m_ui; |
|
79 }; |
|
80 |
|
81 #endif // ZCINEMA_VERSIONEDITOR_H |
|