summaryrefslogtreecommitdiff
path: root/utils/themeeditor/gui/preferencesdialog.cpp
diff options
context:
space:
mode:
authorRobert Bieber <robby@bieberphoto.com>2010-07-06 20:23:27 +0000
committerRobert Bieber <robby@bieberphoto.com>2010-07-06 20:23:27 +0000
commiteccc2bd009e967e45d38a573080d13a1339eb0a6 (patch)
tree810341f795f88ab63147d3ed545c1eb812347ebc /utils/themeeditor/gui/preferencesdialog.cpp
parent120f3e1c10c36fd5d174741d0da81ba84fc79ae3 (diff)
downloadrockbox-eccc2bd009e967e45d38a573080d13a1339eb0a6.zip
rockbox-eccc2bd009e967e45d38a573080d13a1339eb0a6.tar.gz
rockbox-eccc2bd009e967e45d38a573080d13a1339eb0a6.tar.bz2
rockbox-eccc2bd009e967e45d38a573080d13a1339eb0a6.tar.xz
Theme Editor: Added font directory option in preferences dialog, renderer will now search that directory for fonts if they're not found in the project directory
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27322 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/themeeditor/gui/preferencesdialog.cpp')
-rw-r--r--utils/themeeditor/gui/preferencesdialog.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/utils/themeeditor/gui/preferencesdialog.cpp b/utils/themeeditor/gui/preferencesdialog.cpp
index 8cd9665..f8c71f4 100644
--- a/utils/themeeditor/gui/preferencesdialog.cpp
+++ b/utils/themeeditor/gui/preferencesdialog.cpp
@@ -24,6 +24,7 @@
#include <QSettings>
#include <QColorDialog>
+#include <QFileDialog>
PreferencesDialog::PreferencesDialog(QWidget *parent) :
QDialog(parent),
@@ -43,6 +44,7 @@ void PreferencesDialog::loadSettings()
{
loadColors();
loadFont();
+ loadFontDir();
}
void PreferencesDialog::loadColors()
@@ -105,10 +107,21 @@ void PreferencesDialog::loadFont()
}
+void PreferencesDialog::loadFontDir()
+{
+ QSettings settings;
+ settings.beginGroup("RBFont");
+
+ ui->fontBox->setText(settings.value("fontDir", "/").toString());
+
+ settings.endGroup();
+}
+
void PreferencesDialog::saveSettings()
{
saveColors();
saveFont();
+ saveFontDir();
}
void PreferencesDialog::saveColors()
@@ -146,6 +159,16 @@ void PreferencesDialog::saveFont()
settings.endGroup();
}
+void PreferencesDialog::saveFontDir()
+{
+ QSettings settings;
+ settings.beginGroup("RBFont");
+
+ settings.setValue("fontDir", ui->fontBox->text());
+
+ settings.endGroup();
+}
+
void PreferencesDialog::setupUI()
{
/* Connecting color buttons */
@@ -161,6 +184,9 @@ void PreferencesDialog::setupUI()
for(int i = 0; i < buttons.count(); i++)
QObject::connect(buttons[i], SIGNAL(pressed()),
this, SLOT(colorClicked()));
+
+ QObject::connect(ui->fontBrowseButton, SIGNAL(clicked()),
+ this, SLOT(browseFont()));
}
void PreferencesDialog::colorClicked()
@@ -193,6 +219,14 @@ void PreferencesDialog::colorClicked()
}
}
+void PreferencesDialog::browseFont()
+{
+ QString path = QFileDialog::
+ getExistingDirectory(this, "Font Directory",
+ ui->fontBox->text());
+ ui->fontBox->setText(path);
+}
+
void PreferencesDialog::accept()
{
saveSettings();