summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/createvoicewindow.cpp
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2009-04-29 20:58:47 +0000
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2009-04-29 20:58:47 +0000
commit3d2e42ab4cc6306db4036983badea0c92750210b (patch)
treedd4303f36be8df6c4f808878da00963cb7316415 /rbutil/rbutilqt/createvoicewindow.cpp
parent3c5e67516bfab95afc26f618840ca3db67998028 (diff)
downloadrockbox-3d2e42ab4cc6306db4036983badea0c92750210b.tar.gz
rockbox-3d2e42ab4cc6306db4036983badea0c92750210b.tar.bz2
rockbox-3d2e42ab4cc6306db4036983badea0c92750210b.zip
Completely rework RbSettings class.
- use a single member function for accessing a settings value. - use an enum to figure the correct value in the settings file instead of functions. - return the settings value as QVariant instead and leave converting to the caller. - accept QVariant as value when setting values. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20823 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/rbutilqt/createvoicewindow.cpp')
-rw-r--r--rbutil/rbutilqt/createvoicewindow.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/rbutil/rbutilqt/createvoicewindow.cpp b/rbutil/rbutilqt/createvoicewindow.cpp
index bb047cb196..2b45386589 100644
--- a/rbutil/rbutilqt/createvoicewindow.cpp
+++ b/rbutil/rbutilqt/createvoicewindow.cpp
@@ -49,14 +49,14 @@ void CreateVoiceWindow::accept()
int wvThreshold = ui.wavtrimthreshold->value();
//safe selected language
- settings->setVoiceLanguage(lang);
- settings->setWavtrimTh(wvThreshold);
+ settings->setValue(RbSettings::Language, lang);
+ settings->setValue(RbSettings::WavtrimThreshold, wvThreshold);
settings->sync();
//configure voicecreator
voicecreator->setSettings(settings);
- voicecreator->setMountPoint(settings->mountpoint());
- voicecreator->setTargetId(settings->curTargetId());
+ voicecreator->setMountPoint(settings->value(RbSettings::Mountpoint).toString());
+ voicecreator->setTargetId(settings->value(RbSettings::CurTargetId).toInt());
voicecreator->setLang(lang);
voicecreator->setWavtrimThreshold(wvThreshold);
@@ -79,14 +79,14 @@ void CreateVoiceWindow::setSettings(RbSettings* sett)
void CreateVoiceWindow::updateSettings(void)
{
// fill in language combobox
- QStringList languages = settings->allLanguages();
+ QStringList languages = settings->languages();
languages.sort();
ui.comboLanguage->addItems(languages);
// set saved lang
- int sel = ui.comboLanguage->findText(settings->voiceLanguage());
+ int sel = ui.comboLanguage->findText(settings->value(RbSettings::VoiceLanguage).toString());
// if no saved language is found try to figure the language from the UI lang
if(sel == -1) {
- QString f = settings->curLang();
+ QString f = settings->value(RbSettings::Language).toString();
// if no language is set default to english. Make sure not to check an empty string.
if(f.isEmpty()) f = "english";
sel = ui.comboLanguage->findText(f, Qt::MatchStartsWith);
@@ -97,7 +97,7 @@ void CreateVoiceWindow::updateSettings(void)
}
ui.comboLanguage->setCurrentIndex(sel);
- QString ttsName = settings->curTTS();
+ QString ttsName = settings->value(RbSettings::Tts).toString();
TTSBase* tts = TTSBase::getTTS(ttsName);
tts->setCfg(settings);
if(tts->configOk())
@@ -107,7 +107,7 @@ void CreateVoiceWindow::updateSettings(void)
ui.labelTtsProfile->setText(tr("Selected TTS engine: <b>%1</b>")
.arg("Invalid TTS configuration!"));
- QString encoder = settings->curEncoder();
+ QString encoder = settings->value(RbSettings::CurEncoder).toString();
// only proceed if encoder setting is set
EncBase* enc = EncBase::getEncoder(encoder);
if(enc != NULL) {
@@ -122,7 +122,7 @@ void CreateVoiceWindow::updateSettings(void)
else
ui.labelEncProfile->setText(tr("Selected encoder: <b>%1</b>")
.arg("Invalid encoder configuration!"));
- ui.wavtrimthreshold->setValue(settings->wavtrimTh());
+ ui.wavtrimthreshold->setValue(settings->value(RbSettings::WavtrimThreshold).toInt());
emit settingsUpdated();
}