summaryrefslogtreecommitdiff
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
parent942d7c6bcc2ebcae343d477497ae728ada609a00 (diff)
downloadrockbox-0978b427eeb1a661fbbe49dd9c79a1fc270589aa.tar.gz
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
-rw-r--r--rbutil/rbutilqt/createvoicewindow.cpp33
-rw-r--r--rbutil/rbutilqt/createvoicewindow.h1
2 files changed, 21 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)
35 35
36void CreateVoiceWindow::change() 36void CreateVoiceWindow::change()
37{ 37{
38 // save window settings
39 saveSettings();
40
41 // call configuration dialog
38 Config *cw = new Config(this,4); 42 Config *cw = new Config(this,4);
39 connect(cw, SIGNAL(settingsUpdated()), this, SLOT(updateSettings())); 43 connect(cw, SIGNAL(settingsUpdated()), this, SLOT(updateSettings()));
40 cw->show(); 44 cw->show();
@@ -45,19 +49,13 @@ void CreateVoiceWindow::accept()
45 logger = new ProgressLoggerGui(this); 49 logger = new ProgressLoggerGui(this);
46 connect(logger,SIGNAL(closed()),this,SLOT(close())); 50 connect(logger,SIGNAL(closed()),this,SLOT(close()));
47 logger->show(); 51 logger->show();
48 52
49 QString lang = ui.comboLanguage->currentText(); 53 saveSettings();
50 int wvThreshold = ui.wavtrimthreshold->value();
51
52 //safe selected language
53 RbSettings::setValue(RbSettings::VoiceLanguage, lang);
54 RbSettings::setValue(RbSettings::WavtrimThreshold, wvThreshold);
55 RbSettings::sync();
56 54
57 //configure voicecreator 55 //configure voicecreator
58 voicecreator->setMountPoint(RbSettings::value(RbSettings::Mountpoint).toString()); 56 voicecreator->setMountPoint(RbSettings::value(RbSettings::Mountpoint).toString());
59 voicecreator->setLang(lang); 57 voicecreator->setLang(ui.comboLanguage->currentText());
60 voicecreator->setWavtrimThreshold(wvThreshold); 58 voicecreator->setWavtrimThreshold(ui.wavtrimthreshold->value());
61 59
62 //start creating 60 //start creating
63 connect(voicecreator, SIGNAL(done(bool)), logger, SLOT(setFinished())); 61 connect(voicecreator, SIGNAL(done(bool)), logger, SLOT(setFinished()));
@@ -119,6 +117,15 @@ void CreateVoiceWindow::updateSettings(void)
119} 117}
120 118
121 119
122 120/** @brief save options
123 121 */
124 122void CreateVoiceWindow::saveSettings(void)
123{
124 // save selected language
125 RbSettings::setValue(RbSettings::VoiceLanguage,
126 ui.comboLanguage->currentText());
127 // save wavtrim threshold value
128 RbSettings::setValue(RbSettings::WavtrimThreshold,
129 ui.wavtrimthreshold->value());
130 RbSettings::sync();
131}
diff --git a/rbutil/rbutilqt/createvoicewindow.h b/rbutil/rbutilqt/createvoicewindow.h
index 237f21975e..9294004676 100644
--- a/rbutil/rbutilqt/createvoicewindow.h
+++ b/rbutil/rbutilqt/createvoicewindow.h
@@ -40,6 +40,7 @@ class CreateVoiceWindow : public QDialog
40 void accept(void); 40 void accept(void);
41 void change(void); 41 void change(void);
42 void updateSettings(void); 42 void updateSettings(void);
43 void saveSettings(void);
43 44
44 signals: 45 signals:
45 void settingsUpdated(void); 46 void settingsUpdated(void);