summaryrefslogtreecommitdiff
path: root/utils/themeeditor/gui/preferencesdialog.cpp
diff options
context:
space:
mode:
authorRobert Bieber <robby@bieberphoto.com>2010-07-21 07:45:29 +0000
committerRobert Bieber <robby@bieberphoto.com>2010-07-21 07:45:29 +0000
commit7c52284b294cb33bc2e5d747e2e3c14d8ab937ae (patch)
treeba7bbf82a8ca0852deee158068330365f0f97e97 /utils/themeeditor/gui/preferencesdialog.cpp
parentb72f475d44cf83c10c99eaf765b1c55cfdc00bb0 (diff)
downloadrockbox-7c52284b294cb33bc2e5d747e2e3c14d8ab937ae.tar.gz
rockbox-7c52284b294cb33bc2e5d747e2e3c14d8ab937ae.zip
Theme Editor: Implemented download and decompression of font pack in the preferences dialog. Dialog will also allow the user to set a directory for a custom target database, but the update button doesn't work yet. Also fixed the file filters for open file/open project actions and resized the preferences dialog
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27509 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/themeeditor/gui/preferencesdialog.cpp')
-rw-r--r--utils/themeeditor/gui/preferencesdialog.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/utils/themeeditor/gui/preferencesdialog.cpp b/utils/themeeditor/gui/preferencesdialog.cpp
index dbb3249e9f..b8d0a0a6d6 100644
--- a/utils/themeeditor/gui/preferencesdialog.cpp
+++ b/utils/themeeditor/gui/preferencesdialog.cpp
@@ -21,6 +21,7 @@
21 21
22#include "preferencesdialog.h" 22#include "preferencesdialog.h"
23#include "ui_preferencesdialog.h" 23#include "ui_preferencesdialog.h"
24#include "fontdownloader.h"
24 25
25#include <QSettings> 26#include <QSettings>
26#include <QColorDialog> 27#include <QColorDialog>
@@ -124,6 +125,14 @@ void PreferencesDialog::loadRender()
124 false).toBool()); 125 false).toBool());
125 126
126 settings.endGroup(); 127 settings.endGroup();
128
129 settings.beginGroup("TargetData");
130
131 ui->dbBox->setText(settings.value("targetDbPath",
132 QDir::homePath() + "/.targetdb")
133 .toString());
134
135 settings.endGroup();
127} 136}
128 137
129void PreferencesDialog::saveSettings() 138void PreferencesDialog::saveSettings()
@@ -183,6 +192,10 @@ void PreferencesDialog::saveRender()
183 settings.setValue("autoHighlightTree", ui->autoHighlightBox->isChecked()); 192 settings.setValue("autoHighlightTree", ui->autoHighlightBox->isChecked());
184 193
185 settings.endGroup(); 194 settings.endGroup();
195
196 settings.beginGroup("TargetData");
197 settings.setValue("targetDbPath", ui->dbBox->text());
198 settings.endGroup();
186} 199}
187 200
188void PreferencesDialog::setupUI() 201void PreferencesDialog::setupUI()
@@ -203,6 +216,10 @@ void PreferencesDialog::setupUI()
203 216
204 QObject::connect(ui->fontBrowseButton, SIGNAL(clicked()), 217 QObject::connect(ui->fontBrowseButton, SIGNAL(clicked()),
205 this, SLOT(browseFont())); 218 this, SLOT(browseFont()));
219 QObject::connect(ui->browseDB, SIGNAL(clicked()),
220 this, SLOT(browseDB()));
221 QObject::connect(ui->dlFontsButton, SIGNAL(clicked()),
222 this, SLOT(dlFonts()));
206} 223}
207 224
208void PreferencesDialog::colorClicked() 225void PreferencesDialog::colorClicked()
@@ -243,6 +260,21 @@ void PreferencesDialog::browseFont()
243 ui->fontBox->setText(path); 260 ui->fontBox->setText(path);
244} 261}
245 262
263void PreferencesDialog::browseDB()
264{
265 QString path = QFileDialog::getOpenFileName(this, tr("Target DB"),
266 QDir(ui->dbBox->text()).
267 absolutePath(),
268 "All Files (*)");
269 ui->dbBox->setText(path);
270}
271
272void PreferencesDialog::dlFonts()
273{
274 FontDownloader* dl = new FontDownloader(this, ui->fontBox->text());
275 dl->show();
276}
277
246void PreferencesDialog::accept() 278void PreferencesDialog::accept()
247{ 279{
248 saveSettings(); 280 saveSettings();