diff options
Diffstat (limited to 'utils')
-rw-r--r-- | utils/themeeditor/configdocument.cpp | 40 | ||||
-rw-r--r-- | utils/themeeditor/configdocument.h | 25 | ||||
-rw-r--r-- | utils/themeeditor/resources.qrc | 1 | ||||
-rw-r--r-- | utils/themeeditor/resources/configkeys | 173 |
4 files changed, 226 insertions, 13 deletions
diff --git a/utils/themeeditor/configdocument.cpp b/utils/themeeditor/configdocument.cpp index 5bc4b77504..a897d3b9e3 100644 --- a/utils/themeeditor/configdocument.cpp +++ b/utils/themeeditor/configdocument.cpp | |||
@@ -36,9 +36,24 @@ ConfigDocument::ConfigDocument(QMap<QString, QString>& settings, QString file, | |||
36 | { | 36 | { |
37 | ui->setupUi(this); | 37 | ui->setupUi(this); |
38 | 38 | ||
39 | /* Populating the known keys list */ | ||
40 | QFile fin(":/resources/configkeys"); | ||
41 | fin.open(QFile::ReadOnly); | ||
42 | |||
43 | QStringList* container = &primaryKeys; | ||
44 | while(!fin.atEnd()) | ||
45 | { | ||
46 | QString current = QString(fin.readLine()); | ||
47 | if(current == "-\n") | ||
48 | container = &secondaryKeys; | ||
49 | else if(current != "\n") | ||
50 | container->append(current.trimmed()); | ||
51 | } | ||
52 | |||
39 | QMap<QString, QString>::iterator i; | 53 | QMap<QString, QString>::iterator i; |
40 | for(i = settings.begin(); i != settings.end(); i++) | 54 | for(i = settings.begin(); i != settings.end(); i++) |
41 | addRow(i.key(), i.value()); | 55 | if(i.key() != "themebase") |
56 | addRow(i.key(), i.value()); | ||
42 | 57 | ||
43 | saved = toPlainText(); | 58 | saved = toPlainText(); |
44 | 59 | ||
@@ -160,7 +175,7 @@ QString ConfigDocument::toPlainText() const | |||
160 | 175 | ||
161 | for(int i = 0; i < keys.count(); i++) | 176 | for(int i = 0; i < keys.count(); i++) |
162 | { | 177 | { |
163 | buffer += keys[i]->text(); | 178 | buffer += keys[i]->currentText(); |
164 | buffer += ":"; | 179 | buffer += ":"; |
165 | buffer += values[i]->text(); | 180 | buffer += values[i]->text(); |
166 | buffer += "\n"; | 181 | buffer += "\n"; |
@@ -172,11 +187,24 @@ QString ConfigDocument::toPlainText() const | |||
172 | void ConfigDocument::addRow(QString key, QString value) | 187 | void ConfigDocument::addRow(QString key, QString value) |
173 | { | 188 | { |
174 | QHBoxLayout* layout = new QHBoxLayout(); | 189 | QHBoxLayout* layout = new QHBoxLayout(); |
175 | QLineEdit* keyEdit = new QLineEdit(key, this); | 190 | QComboBox* keyEdit = new QComboBox(this); |
176 | QLineEdit* valueEdit = new QLineEdit(value, this); | 191 | QLineEdit* valueEdit = new QLineEdit(value, this); |
177 | QPushButton* delButton = new QPushButton(tr("-"), this); | 192 | QPushButton* delButton = new QPushButton(tr("-"), this); |
193 | QLabel* label = new QLabel(":"); | ||
194 | |||
195 | /* Loading the combo box options */ | ||
196 | keyEdit->setInsertPolicy(QComboBox::InsertAlphabetically); | ||
197 | keyEdit->setEditable(true); | ||
198 | keyEdit->addItems(primaryKeys); | ||
199 | keyEdit->insertSeparator(keyEdit->count()); | ||
200 | keyEdit->addItems(secondaryKeys); | ||
201 | if(keyEdit->findText(key) != -1) | ||
202 | keyEdit->setCurrentIndex(keyEdit->findText(key)); | ||
203 | else | ||
204 | keyEdit->setEditText(key); | ||
178 | 205 | ||
179 | layout->addWidget(keyEdit); | 206 | layout->addWidget(keyEdit); |
207 | layout->addWidget(label); | ||
180 | layout->addWidget(valueEdit); | 208 | layout->addWidget(valueEdit); |
181 | layout->addWidget(delButton); | 209 | layout->addWidget(delButton); |
182 | 210 | ||
@@ -185,7 +213,8 @@ void ConfigDocument::addRow(QString key, QString value) | |||
185 | 213 | ||
186 | QObject::connect(delButton, SIGNAL(clicked()), | 214 | QObject::connect(delButton, SIGNAL(clicked()), |
187 | this, SLOT(deleteClicked())); | 215 | this, SLOT(deleteClicked())); |
188 | 216 | QObject::connect(keyEdit, SIGNAL(currentIndexChanged(QString)), | |
217 | this, SLOT(textChanged())); | ||
189 | QObject::connect(keyEdit, SIGNAL(textChanged(QString)), | 218 | QObject::connect(keyEdit, SIGNAL(textChanged(QString)), |
190 | this, SLOT(textChanged())); | 219 | this, SLOT(textChanged())); |
191 | QObject::connect(valueEdit, SIGNAL(textChanged(QString)), | 220 | QObject::connect(valueEdit, SIGNAL(textChanged(QString)), |
@@ -197,6 +226,7 @@ void ConfigDocument::addRow(QString key, QString value) | |||
197 | keys.append(keyEdit); | 226 | keys.append(keyEdit); |
198 | values.append(valueEdit); | 227 | values.append(valueEdit); |
199 | deleteButtons.append(delButton); | 228 | deleteButtons.append(delButton); |
229 | labels.append(label); | ||
200 | 230 | ||
201 | } | 231 | } |
202 | 232 | ||
@@ -209,11 +239,13 @@ void ConfigDocument::deleteClicked() | |||
209 | keys[row]->deleteLater(); | 239 | keys[row]->deleteLater(); |
210 | values[row]->deleteLater(); | 240 | values[row]->deleteLater(); |
211 | containers[row]->deleteLater(); | 241 | containers[row]->deleteLater(); |
242 | labels[row]->deleteLater(); | ||
212 | 243 | ||
213 | deleteButtons.removeAt(row); | 244 | deleteButtons.removeAt(row); |
214 | keys.removeAt(row); | 245 | keys.removeAt(row); |
215 | values.removeAt(row); | 246 | values.removeAt(row); |
216 | containers.removeAt(row); | 247 | containers.removeAt(row); |
248 | labels.removeAt(row); | ||
217 | 249 | ||
218 | if(saved != toPlainText()) | 250 | if(saved != toPlainText()) |
219 | emit titleChanged(title() + "*"); | 251 | emit titleChanged(title() + "*"); |
diff --git a/utils/themeeditor/configdocument.h b/utils/themeeditor/configdocument.h index 114cb5bbfc..8493c7a138 100644 --- a/utils/themeeditor/configdocument.h +++ b/utils/themeeditor/configdocument.h | |||
@@ -24,8 +24,10 @@ | |||
24 | 24 | ||
25 | #include <QHBoxLayout> | 25 | #include <QHBoxLayout> |
26 | #include <QLineEdit> | 26 | #include <QLineEdit> |
27 | #include <QComboBox> | ||
27 | #include <QPushButton> | 28 | #include <QPushButton> |
28 | #include <QWidget> | 29 | #include <QWidget> |
30 | #include <QLabel> | ||
29 | #include <QMap> | 31 | #include <QMap> |
30 | 32 | ||
31 | #include "tabcontent.h" | 33 | #include "tabcontent.h" |
@@ -55,25 +57,30 @@ public: | |||
55 | protected: | 57 | protected: |
56 | void changeEvent(QEvent *e); | 58 | void changeEvent(QEvent *e); |
57 | 59 | ||
60 | signals: | ||
61 | void configFileChanged(QString); | ||
62 | |||
63 | private slots: | ||
64 | void deleteClicked(); | ||
65 | void addClicked(); | ||
66 | void textChanged(); | ||
67 | |||
68 | |||
58 | private: | 69 | private: |
59 | Ui::ConfigDocument *ui; | 70 | Ui::ConfigDocument *ui; |
60 | QList<QHBoxLayout*> containers; | 71 | QList<QHBoxLayout*> containers; |
61 | QList<QLineEdit*> keys; | 72 | QList<QComboBox*> keys; |
62 | QList<QLineEdit*> values; | 73 | QList<QLineEdit*> values; |
63 | QList<QPushButton*> deleteButtons; | 74 | QList<QPushButton*> deleteButtons; |
75 | QList<QLabel*> labels; | ||
76 | |||
77 | QStringList primaryKeys; | ||
78 | QStringList secondaryKeys; | ||
64 | 79 | ||
65 | QString filePath; | 80 | QString filePath; |
66 | QString saved; | 81 | QString saved; |
67 | 82 | ||
68 | void addRow(QString key, QString value); | 83 | void addRow(QString key, QString value); |
69 | |||
70 | signals: | ||
71 | void configFileChanged(QString); | ||
72 | |||
73 | private slots: | ||
74 | void deleteClicked(); | ||
75 | void addClicked(); | ||
76 | void textChanged(); | ||
77 | }; | 84 | }; |
78 | 85 | ||
79 | #endif // CONFIGDOCUMENT_H | 86 | #endif // CONFIGDOCUMENT_H |
diff --git a/utils/themeeditor/resources.qrc b/utils/themeeditor/resources.qrc index b882e23a1d..bba483f210 100644 --- a/utils/themeeditor/resources.qrc +++ b/utils/themeeditor/resources.qrc | |||
@@ -4,5 +4,6 @@ | |||
4 | <file>resources/document-new.png</file> | 4 | <file>resources/document-new.png</file> |
5 | <file>resources/document-open.png</file> | 5 | <file>resources/document-open.png</file> |
6 | <file>resources/document-save.png</file> | 6 | <file>resources/document-save.png</file> |
7 | <file alias="configkeys">resources/configkeys</file> | ||
7 | </qresource> | 8 | </qresource> |
8 | </RCC> | 9 | </RCC> |
diff --git a/utils/themeeditor/resources/configkeys b/utils/themeeditor/resources/configkeys new file mode 100644 index 0000000000..67b84b8e68 --- /dev/null +++ b/utils/themeeditor/resources/configkeys | |||
@@ -0,0 +1,173 @@ | |||
1 | wps | ||
2 | rwps | ||
3 | sbs | ||
4 | rsbs | ||
5 | fms | ||
6 | rfms | ||
7 | volume | ||
8 | backdrop | ||
9 | foreground colour | ||
10 | background colour | ||
11 | foreground color | ||
12 | background color | ||
13 | font | ||
14 | iconset | ||
15 | - | ||
16 | bass | ||
17 | treble | ||
18 | balance | ||
19 | ui viewport | ||
20 | channels | ||
21 | stereo_width | ||
22 | shuffle | ||
23 | repeat | ||
24 | play selected | ||
25 | party mode | ||
26 | scan min step | ||
27 | seek acceleration | ||
28 | antiskip | ||
29 | volume fade | ||
30 | sort case | ||
31 | show files | ||
32 | show filename exts | ||
33 | follow playlist | ||
34 | playlist viewer icons | ||
35 | playlist viewer indices | ||
36 | playlist viewer track display | ||
37 | recursive directory insert | ||
38 | scroll speed | ||
39 | scroll delay | ||
40 | scroll step | ||
41 | screen scroll step | ||
42 | Screen Scrolls Out Of View | ||
43 | bidir limit | ||
44 | scroll paginated | ||
45 | hold_lr_for_scroll_in_list | ||
46 | show path in browser | ||
47 | contrast | ||
48 | backlight timeout | ||
49 | backlight timeout plugged | ||
50 | backlight filters first keypress | ||
51 | backlight on button hold | ||
52 | caption backlight | ||
53 | brightness | ||
54 | disk spindown | ||
55 | battery capacity | ||
56 | usb hid | ||
57 | usb keypad mode | ||
58 | idle poweroff | ||
59 | max files in playlist | ||
60 | max files in dir | ||
61 | lang | ||
62 | autocreate bookmarks | ||
63 | autoload bookmarks | ||
64 | use most-recent-bookmarks | ||
65 | pause on headphone unplug | ||
66 | rewind duration on pause | ||
67 | disable autoresume if phones not present | ||
68 | Last.fm Logging | ||
69 | talk dir | ||
70 | talk dir clip | ||
71 | talk file | ||
72 | talk file clip | ||
73 | talk filetype | ||
74 | talk menu | ||
75 | Announce Battery Level | ||
76 | hotkey wps | ||
77 | hotkey tree | ||
78 | sort files | ||
79 | sort dirs | ||
80 | sort interpret number | ||
81 | tagcache_autoupdate | ||
82 | warn when erasing dynamic playlist | ||
83 | cuesheet support | ||
84 | folder navigation | ||
85 | gather runtime data | ||
86 | skip length | ||
87 | prevent track skip | ||
88 | start in screen | ||
89 | playlist catalog directory | ||
90 | list_accel_start_delay | ||
91 | list_accel_wait | ||
92 | replaygain type | ||
93 | replaygain noclip | ||
94 | replaygain preamp | ||
95 | crossfade | ||
96 | crossfade fade in delay | ||
97 | crossfade fade out delay | ||
98 | crossfade fade in duration | ||
99 | crossfade fade out duration | ||
100 | crossfade fade out mode | ||
101 | crossfeed | ||
102 | crossfeed direct gain | ||
103 | crossfeed cross gain | ||
104 | crossfeed hf attenuation | ||
105 | crossfeed hf cutoff | ||
106 | eq enabled | ||
107 | eq precut | ||
108 | eq band 0 cutoff | ||
109 | eq band 1 cutoff | ||
110 | eq band 2 cutoff | ||
111 | eq band 3 cutoff | ||
112 | eq band 4 cutoff | ||
113 | eq band 0 q | ||
114 | eq band 1 q | ||
115 | eq band 2 q | ||
116 | eq band 3 q | ||
117 | eq band 4 q | ||
118 | eq band 0 gain | ||
119 | eq band 1 gain | ||
120 | eq band 2 gain | ||
121 | eq band 3 gain | ||
122 | eq band 4 gain | ||
123 | dithering enabled | ||
124 | timestretch enabled | ||
125 | compressor threshold | ||
126 | compressor makeup gain | ||
127 | compressor ratio | ||
128 | compressor knee | ||
129 | compressor release time | ||
130 | beep | ||
131 | keyclick | ||
132 | keyclick repeats | ||
133 | dircache | ||
134 | tagcache_ram | ||
135 | peak meter release | ||
136 | peak meter hold | ||
137 | peak meter clip hold | ||
138 | peak meter busy | ||
139 | peak meter dbfs | ||
140 | peak meter min | ||
141 | peak meter max | ||
142 | statusbar | ||
143 | scrollbar | ||
144 | scrollbar width | ||
145 | volume display | ||
146 | battery display | ||
147 | kbd | ||
148 | invert | ||
149 | flip display | ||
150 | selector type | ||
151 | show icons | ||
152 | viewers iconset | ||
153 | line selector start colour | ||
154 | line selector start color | ||
155 | line selector end colour | ||
156 | line selector end color | ||
157 | line selector text colour | ||
158 | line selector text color | ||
159 | filetype colours | ||
160 | filetype colors | ||
161 | time format | ||
162 | rec quality | ||
163 | rec frequency | ||
164 | rec source | ||
165 | rec channels | ||
166 | rec mic gain | ||
167 | rec left gain | ||
168 | rec right gain | ||
169 | editable recordings | ||
170 | rec timesplit | ||
171 | pre-recording time | ||
172 | rec directory | ||
173 | |||