diff options
Diffstat (limited to 'utils/themeeditor/gui/preferencesdialog.cpp')
-rw-r--r-- | utils/themeeditor/gui/preferencesdialog.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/utils/themeeditor/gui/preferencesdialog.cpp b/utils/themeeditor/gui/preferencesdialog.cpp index 8cd9665779..f8c71f4450 100644 --- a/utils/themeeditor/gui/preferencesdialog.cpp +++ b/utils/themeeditor/gui/preferencesdialog.cpp | |||
@@ -24,6 +24,7 @@ | |||
24 | 24 | ||
25 | #include <QSettings> | 25 | #include <QSettings> |
26 | #include <QColorDialog> | 26 | #include <QColorDialog> |
27 | #include <QFileDialog> | ||
27 | 28 | ||
28 | PreferencesDialog::PreferencesDialog(QWidget *parent) : | 29 | PreferencesDialog::PreferencesDialog(QWidget *parent) : |
29 | QDialog(parent), | 30 | QDialog(parent), |
@@ -43,6 +44,7 @@ void PreferencesDialog::loadSettings() | |||
43 | { | 44 | { |
44 | loadColors(); | 45 | loadColors(); |
45 | loadFont(); | 46 | loadFont(); |
47 | loadFontDir(); | ||
46 | } | 48 | } |
47 | 49 | ||
48 | void PreferencesDialog::loadColors() | 50 | void PreferencesDialog::loadColors() |
@@ -105,10 +107,21 @@ void PreferencesDialog::loadFont() | |||
105 | 107 | ||
106 | } | 108 | } |
107 | 109 | ||
110 | void PreferencesDialog::loadFontDir() | ||
111 | { | ||
112 | QSettings settings; | ||
113 | settings.beginGroup("RBFont"); | ||
114 | |||
115 | ui->fontBox->setText(settings.value("fontDir", "/").toString()); | ||
116 | |||
117 | settings.endGroup(); | ||
118 | } | ||
119 | |||
108 | void PreferencesDialog::saveSettings() | 120 | void PreferencesDialog::saveSettings() |
109 | { | 121 | { |
110 | saveColors(); | 122 | saveColors(); |
111 | saveFont(); | 123 | saveFont(); |
124 | saveFontDir(); | ||
112 | } | 125 | } |
113 | 126 | ||
114 | void PreferencesDialog::saveColors() | 127 | void PreferencesDialog::saveColors() |
@@ -146,6 +159,16 @@ void PreferencesDialog::saveFont() | |||
146 | settings.endGroup(); | 159 | settings.endGroup(); |
147 | } | 160 | } |
148 | 161 | ||
162 | void PreferencesDialog::saveFontDir() | ||
163 | { | ||
164 | QSettings settings; | ||
165 | settings.beginGroup("RBFont"); | ||
166 | |||
167 | settings.setValue("fontDir", ui->fontBox->text()); | ||
168 | |||
169 | settings.endGroup(); | ||
170 | } | ||
171 | |||
149 | void PreferencesDialog::setupUI() | 172 | void PreferencesDialog::setupUI() |
150 | { | 173 | { |
151 | /* Connecting color buttons */ | 174 | /* Connecting color buttons */ |
@@ -161,6 +184,9 @@ void PreferencesDialog::setupUI() | |||
161 | for(int i = 0; i < buttons.count(); i++) | 184 | for(int i = 0; i < buttons.count(); i++) |
162 | QObject::connect(buttons[i], SIGNAL(pressed()), | 185 | QObject::connect(buttons[i], SIGNAL(pressed()), |
163 | this, SLOT(colorClicked())); | 186 | this, SLOT(colorClicked())); |
187 | |||
188 | QObject::connect(ui->fontBrowseButton, SIGNAL(clicked()), | ||
189 | this, SLOT(browseFont())); | ||
164 | } | 190 | } |
165 | 191 | ||
166 | void PreferencesDialog::colorClicked() | 192 | void PreferencesDialog::colorClicked() |
@@ -193,6 +219,14 @@ void PreferencesDialog::colorClicked() | |||
193 | } | 219 | } |
194 | } | 220 | } |
195 | 221 | ||
222 | void PreferencesDialog::browseFont() | ||
223 | { | ||
224 | QString path = QFileDialog:: | ||
225 | getExistingDirectory(this, "Font Directory", | ||
226 | ui->fontBox->text()); | ||
227 | ui->fontBox->setText(path); | ||
228 | } | ||
229 | |||
196 | void PreferencesDialog::accept() | 230 | void PreferencesDialog::accept() |
197 | { | 231 | { |
198 | saveSettings(); | 232 | saveSettings(); |