mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-08 20:55:17 -05:00
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
This commit is contained in:
parent
942d7c6bcc
commit
0978b427ee
2 changed files with 21 additions and 13 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ class CreateVoiceWindow : public QDialog
|
|||
void accept(void);
|
||||
void change(void);
|
||||
void updateSettings(void);
|
||||
void saveSettings(void);
|
||||
|
||||
signals:
|
||||
void settingsUpdated(void);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue