19 #pragma once |
19 #pragma once |
20 #include <QDialog> |
20 #include <QDialog> |
21 #include "main.h" |
21 #include "main.h" |
22 #include "types.h" |
22 #include "types.h" |
23 |
23 |
|
24 // |
|
25 // ------------------------------------------------------------------------------------------------- |
|
26 // |
|
27 // A ZandronumVersion represented in the config window. |
|
28 // |
|
29 |
|
30 struct VersionGuiEntry |
|
31 { |
|
32 class QTableWidgetItem* labelItem; |
|
33 class QTableWidgetItem* pathItem; |
|
34 QString name; |
|
35 bool isRelease; |
|
36 |
|
37 ZandronumVersion toNonGuiVersion() const; |
|
38 }; |
|
39 |
|
40 // |
|
41 // ------------------------------------------------------------------------------------------------- |
|
42 // |
|
43 |
24 class ConfigWindow : public QDialog |
44 class ConfigWindow : public QDialog |
25 { |
45 { |
26 Q_OBJECT |
46 Q_OBJECT |
27 |
47 |
28 public: |
48 public: |
29 typedef QMap<QString, class QLineEdit*> ZanBinaryMap; |
49 enum |
|
50 { |
|
51 LabelColumn, |
|
52 PathColumn, |
|
53 }; |
|
54 |
|
55 typedef QMap<class QTableWidgetItem*, VersionGuiEntry*> VersionEntryMap; |
30 |
56 |
31 ConfigWindow (QWidget* parent = NULL, Qt::WindowFlags f = 0); |
57 ConfigWindow (QWidget* parent = NULL, Qt::WindowFlags f = 0); |
32 virtual ~ConfigWindow(); |
58 virtual ~ConfigWindow(); |
33 void addPath (QString path); |
59 |
|
60 public slots: |
|
61 void addWadPath(); |
|
62 void findWadPath(); |
|
63 void removeCurrentWadPath(); |
|
64 void buttonPressed (class QAbstractButton* btn); |
|
65 void newVersion(); |
|
66 void removeCurrentVersion(); |
|
67 void editExePressed(); |
|
68 void clearExePathsClicked(); |
|
69 |
|
70 private: |
|
71 class Ui_ConfigBox& ui; |
|
72 QList<VersionGuiEntry*> m_versionEntries; |
|
73 VersionEntryMap m_versionEntryMap; |
|
74 |
|
75 void addWadPath (QString path); |
|
76 VersionGuiEntry* addVersion (const ZandronumVersion& version); |
|
77 VersionGuiEntry* currentVersionEntry(); |
34 void initFromSettings(); |
78 void initFromSettings(); |
|
79 void removeVersion (VersionGuiEntry* entry); |
35 void saveSettings(); |
80 void saveSettings(); |
36 void initVersions(); |
|
37 |
|
38 static QString getBinaryPath (QWidget* parent); |
|
39 |
|
40 public slots: |
|
41 void addPath(); |
|
42 void findPath(); |
|
43 void delPath(); |
|
44 void findZanBinary(); |
|
45 void buttonPressed (class QAbstractButton* btn); |
|
46 |
|
47 private: |
|
48 class Ui_ConfigBox* ui; |
|
49 ZanBinaryMap m_pathInputFields; |
|
50 QList<QWidget*> m_binaryLayoutWidgets; |
|
51 class QVBoxLayout* m_releaseLayout; |
|
52 class QVBoxLayout* m_testLayout; |
|
53 |
|
54 void addVersion (const ZandronumVersion& version); |
|
55 }; |
81 }; |