summaryrefslogtreecommitdiff
path: root/utils/themeeditor/gui/preferencesdialog.cpp
diff options
context:
space:
mode:
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 dbb3249..b8d0a0a 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 <QSettings>
#include <QColorDialog>
@@ -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();