From 7c52284b294cb33bc2e5d747e2e3c14d8ab937ae Mon Sep 17 00:00:00 2001 From: Robert Bieber Date: Wed, 21 Jul 2010 07:45:29 +0000 Subject: 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 --- utils/themeeditor/gui/preferencesdialog.cpp | 32 +++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'utils/themeeditor/gui/preferencesdialog.cpp') 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 @@ #include "preferencesdialog.h" #include "ui_preferencesdialog.h" +#include "fontdownloader.h" #include #include @@ -124,6 +125,14 @@ void PreferencesDialog::loadRender() false).toBool()); settings.endGroup(); + + settings.beginGroup("TargetData"); + + ui->dbBox->setText(settings.value("targetDbPath", + QDir::homePath() + "/.targetdb") + .toString()); + + settings.endGroup(); } void PreferencesDialog::saveSettings() @@ -183,6 +192,10 @@ void PreferencesDialog::saveRender() settings.setValue("autoHighlightTree", ui->autoHighlightBox->isChecked()); settings.endGroup(); + + settings.beginGroup("TargetData"); + settings.setValue("targetDbPath", ui->dbBox->text()); + settings.endGroup(); } void PreferencesDialog::setupUI() @@ -203,6 +216,10 @@ void PreferencesDialog::setupUI() QObject::connect(ui->fontBrowseButton, SIGNAL(clicked()), this, SLOT(browseFont())); + QObject::connect(ui->browseDB, SIGNAL(clicked()), + this, SLOT(browseDB())); + QObject::connect(ui->dlFontsButton, SIGNAL(clicked()), + this, SLOT(dlFonts())); } void PreferencesDialog::colorClicked() @@ -243,6 +260,21 @@ void PreferencesDialog::browseFont() ui->fontBox->setText(path); } +void PreferencesDialog::browseDB() +{ + QString path = QFileDialog::getOpenFileName(this, tr("Target DB"), + QDir(ui->dbBox->text()). + absolutePath(), + "All Files (*)"); + ui->dbBox->setText(path); +} + +void PreferencesDialog::dlFonts() +{ + FontDownloader* dl = new FontDownloader(this, ui->fontBox->text()); + dl->show(); +} + void PreferencesDialog::accept() { saveSettings(); -- cgit v1.2.3