diff options
Diffstat (limited to 'utils/themeeditor/gui/configdocument.h')
-rw-r--r-- | utils/themeeditor/gui/configdocument.h | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/utils/themeeditor/gui/configdocument.h b/utils/themeeditor/gui/configdocument.h new file mode 100644 index 0000000000..8493c7a138 --- /dev/null +++ b/utils/themeeditor/gui/configdocument.h | |||
@@ -0,0 +1,86 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2010 Robert Bieber | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | #ifndef CONFIGDOCUMENT_H | ||
23 | #define CONFIGDOCUMENT_H | ||
24 | |||
25 | #include <QHBoxLayout> | ||
26 | #include <QLineEdit> | ||
27 | #include <QComboBox> | ||
28 | #include <QPushButton> | ||
29 | #include <QWidget> | ||
30 | #include <QLabel> | ||
31 | #include <QMap> | ||
32 | |||
33 | #include "tabcontent.h" | ||
34 | |||
35 | namespace Ui { | ||
36 | class ConfigDocument; | ||
37 | } | ||
38 | |||
39 | class ConfigDocument : public TabContent { | ||
40 | Q_OBJECT | ||
41 | public: | ||
42 | ConfigDocument(QMap<QString, QString>& settings, QString file, | ||
43 | QWidget *parent = 0); | ||
44 | virtual ~ConfigDocument(); | ||
45 | |||
46 | TabType type() const{ return TabContent::Config; } | ||
47 | QString file() const{ return filePath; } | ||
48 | QString title() const; | ||
49 | |||
50 | QString toPlainText() const; | ||
51 | |||
52 | void save(); | ||
53 | void saveAs(); | ||
54 | |||
55 | bool requestClose(); | ||
56 | |||
57 | protected: | ||
58 | void changeEvent(QEvent *e); | ||
59 | |||
60 | signals: | ||
61 | void configFileChanged(QString); | ||
62 | |||
63 | private slots: | ||
64 | void deleteClicked(); | ||
65 | void addClicked(); | ||
66 | void textChanged(); | ||
67 | |||
68 | |||
69 | private: | ||
70 | Ui::ConfigDocument *ui; | ||
71 | QList<QHBoxLayout*> containers; | ||
72 | QList<QComboBox*> keys; | ||
73 | QList<QLineEdit*> values; | ||
74 | QList<QPushButton*> deleteButtons; | ||
75 | QList<QLabel*> labels; | ||
76 | |||
77 | QStringList primaryKeys; | ||
78 | QStringList secondaryKeys; | ||
79 | |||
80 | QString filePath; | ||
81 | QString saved; | ||
82 | |||
83 | void addRow(QString key, QString value); | ||
84 | }; | ||
85 | |||
86 | #endif // CONFIGDOCUMENT_H | ||