diff -r db677d321cf4 -r 2c368cf5cc19 src/config.h --- a/src/config.h Fri Jun 05 19:13:44 2015 +0300 +++ b/src/config.h Sat Jun 06 22:03:00 2015 +0300 @@ -21,35 +21,61 @@ #include "main.h" #include "types.h" +// +// ------------------------------------------------------------------------------------------------- +// +// A ZandronumVersion represented in the config window. +// + +struct VersionGuiEntry +{ + class QTableWidgetItem* labelItem; + class QTableWidgetItem* pathItem; + QString name; + bool isRelease; + + ZandronumVersion toNonGuiVersion() const; +}; + +// +// ------------------------------------------------------------------------------------------------- +// + class ConfigWindow : public QDialog { Q_OBJECT - + public: - typedef QMap ZanBinaryMap; + enum + { + LabelColumn, + PathColumn, + }; + + typedef QMap VersionEntryMap; ConfigWindow (QWidget* parent = NULL, Qt::WindowFlags f = 0); virtual ~ConfigWindow(); - void addPath (QString path); - void initFromSettings(); - void saveSettings(); - void initVersions(); - - static QString getBinaryPath (QWidget* parent); - + public slots: - void addPath(); - void findPath(); - void delPath(); - void findZanBinary(); + void addWadPath(); + void findWadPath(); + void removeCurrentWadPath(); void buttonPressed (class QAbstractButton* btn); - + void newVersion(); + void removeCurrentVersion(); + void editExePressed(); + void clearExePathsClicked(); + private: - class Ui_ConfigBox* ui; - ZanBinaryMap m_pathInputFields; - QList m_binaryLayoutWidgets; - class QVBoxLayout* m_releaseLayout; - class QVBoxLayout* m_testLayout; - - void addVersion (const ZandronumVersion& version); + class Ui_ConfigBox& ui; + QList m_versionEntries; + VersionEntryMap m_versionEntryMap; + + void addWadPath (QString path); + VersionGuiEntry* addVersion (const ZandronumVersion& version); + VersionGuiEntry* currentVersionEntry(); + void initFromSettings(); + void removeVersion (VersionGuiEntry* entry); + void saveSettings(); }; \ No newline at end of file