summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/createvoicewindow.cpp
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2010-02-28 11:06:49 +0000
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2010-02-28 11:06:49 +0000
commit0978b427eeb1a661fbbe49dd9c79a1fc270589aa (patch)
tree2a96e7af157222612750913ae36a66fa4b4dc91b /rbutil/rbutilqt/createvoicewindow.cpp
parent942d7c6bcc2ebcae343d477497ae728ada609a00 (diff)
downloadrockbox-0978b427eeb1a661fbbe49dd9c79a1fc270589aa.tar.gz
rockbox-0978b427eeb1a661fbbe49dd9c79a1fc270589aa.tar.bz2
rockbox-0978b427eeb1a661fbbe49dd9c79a1fc270589aa.zip
Save values set in voice window before calling configuration dialog.
This fixes the values set in the voice window getting overwritten with the initial values when opening the configuration dialog from the window via the "Change" button. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24963 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/rbutilqt/createvoicewindow.cpp')
-rw-r--r--rbutil/rbutilqt/createvoicewindow.cpp33
1 files changed, 20 insertions, 13 deletions
diff --git a/rbutil/rbutilqt/createvoicewindow.cpp b/rbutil/rbutilqt/createvoicewindow.cpp
index 7fde1678a0..7c2ff732c4 100644
--- a/rbutil/rbutilqt/createvoicewindow.cpp
+++ b/rbutil/rbutilqt/createvoicewindow.cpp
@@ -35,6 +35,10 @@ CreateVoiceWindow::CreateVoiceWindow(QWidget *parent) : QDialog(parent)
void CreateVoiceWindow::change()
{
+ // save window settings
+ saveSettings();
+
+ // call configuration dialog
Config *cw = new Config(this,4);
connect(cw, SIGNAL(settingsUpdated()), this, SLOT(updateSettings()));
cw->show();
@@ -45,19 +49,13 @@ void CreateVoiceWindow::accept()
logger = new ProgressLoggerGui(this);
connect(logger,SIGNAL(closed()),this,SLOT(close()));
logger->show();
-
- QString lang = ui.comboLanguage->currentText();
- int wvThreshold = ui.wavtrimthreshold->value();
-
- //safe selected language
- RbSettings::setValue(RbSettings::VoiceLanguage, lang);
- RbSettings::setValue(RbSettings::WavtrimThreshold, wvThreshold);
- RbSettings::sync();
+
+ saveSettings();
//configure voicecreator
voicecreator->setMountPoint(RbSettings::value(RbSettings::Mountpoint).toString());
- voicecreator->setLang(lang);
- voicecreator->setWavtrimThreshold(wvThreshold);
+ voicecreator->setLang(ui.comboLanguage->currentText());
+ voicecreator->setWavtrimThreshold(ui.wavtrimthreshold->value());
//start creating
connect(voicecreator, SIGNAL(done(bool)), logger, SLOT(setFinished()));
@@ -119,6 +117,15 @@ void CreateVoiceWindow::updateSettings(void)
}
-
-
-
+/** @brief save options
+ */
+void CreateVoiceWindow::saveSettings(void)
+{
+ // save selected language
+ RbSettings::setValue(RbSettings::VoiceLanguage,
+ ui.comboLanguage->currentText());
+ // save wavtrim threshold value
+ RbSettings::setValue(RbSettings::WavtrimThreshold,
+ ui.wavtrimthreshold->value());
+ RbSettings::sync();
+}