summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/installtalkwindow.cpp
diff options
context:
space:
mode:
authorDominik Wenger <domonoky@googlemail.com>2008-01-25 00:12:25 +0000
committerDominik Wenger <domonoky@googlemail.com>2008-01-25 00:12:25 +0000
commit3a54c9b58d05e29343eef2044cf3d3cbce47ca50 (patch)
tree66c0ba1f872af0af3e3c02ec8580ba697353cbf8 /rbutil/rbutilqt/installtalkwindow.cpp
parenta665d99d3a1e37c3fa7e1a5f79f9dbb82dd3686d (diff)
downloadrockbox-3a54c9b58d05e29343eef2044cf3d3cbce47ca50.tar.gz
rockbox-3a54c9b58d05e29343eef2044cf3d3cbce47ca50.tar.bz2
rockbox-3a54c9b58d05e29343eef2044cf3d3cbce47ca50.zip
rbtutil: introduce a RbSettings class help code reuse, and minimises duplicated code.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16159 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/rbutilqt/installtalkwindow.cpp')
-rw-r--r--rbutil/rbutilqt/installtalkwindow.cpp28
1 files changed, 13 insertions, 15 deletions
diff --git a/rbutil/rbutilqt/installtalkwindow.cpp b/rbutil/rbutilqt/installtalkwindow.cpp
index e1b0b69049..f7202aae40 100644
--- a/rbutil/rbutilqt/installtalkwindow.cpp
+++ b/rbutil/rbutilqt/installtalkwindow.cpp
@@ -66,7 +66,7 @@ void InstallTalkWindow::setTalkFolder(QString folder)
void InstallTalkWindow::change()
{
Config *cw = new Config(this,4);
- cw->setSettings(userSettings,devices);
+ cw->setSettings(settings);
cw->show();
connect(cw, SIGNAL(settingsUpdated()), this, SIGNAL(settingsUpdated()));
}
@@ -86,13 +86,13 @@ void InstallTalkWindow::accept()
return;
}
- userSettings->setValue("last_talked_folder", folderToTalk);
+ settings->setLastTalkedDir(folderToTalk);
- userSettings->sync();
+ settings->sync();
- talkcreator->setSettings(userSettings,devices);
+ talkcreator->setSettings(settings);
talkcreator->setDir(QDir(folderToTalk));
- talkcreator->setMountPoint(userSettings->value("mountpoint").toString());
+ talkcreator->setMountPoint(settings->mountpoint());
talkcreator->setOverwriteTalk(ui.OverwriteTalk->isChecked());
talkcreator->setOverwriteWav(ui.OverwriteWav->isChecked());
@@ -106,29 +106,27 @@ void InstallTalkWindow::accept()
}
-void InstallTalkWindow::setSettings(QSettings *user,QSettings *dev)
+void InstallTalkWindow::setSettings(RbSettings* sett)
{
- devices = dev;
- userSettings = user;
- qDebug() << "Install::setDeviceSettings:" << devices;
-
- QString ttsName = userSettings->value("tts", "none").toString();
+ settings = sett;
+
+ QString ttsName = settings->curTTS();
TTSBase* tts = getTTS(ttsName);
- tts->setCfg(userSettings,devices);
+ tts->setCfg(settings);
if(tts->configOk())
ui.labelTtsProfile->setText(tr("Selected TTS engine : <b>%1</b>").arg(ttsName));
else
ui.labelTtsProfile->setText(tr("Selected TTS Engine: <b>%1</b>").arg("Invalid TTS configuration!"));
- QString encoder = userSettings->value("encoder", "none").toString();
+ QString encoder = settings->curEncoder();
EncBase* enc = getEncoder(encoder);
- enc->setUserCfg(userSettings);
+ enc->setCfg(settings);
if(enc->configOk())
ui.labelEncProfile->setText(tr("Selected Encoder: <b>%1</b>").arg(encoder));
else
ui.labelEncProfile->setText(tr("Selected Encoder: <b>%1</b>").arg("Invalid encoder configuration!"));
- setTalkFolder(userSettings->value("last_talked_folder").toString());
+ setTalkFolder(settings->lastTalkedFolder());
}