1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Robert Bieber 2010-07-21 07:45:29 +00:00
parent b72f475d44
commit 7c52284b29
29 changed files with 7841 additions and 24 deletions

View file

@ -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();