summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/installtalkwindow.cpp
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2012-06-14 22:36:54 +0200
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2012-06-14 22:54:30 +0200
commit537dfe482fc0378151406ee37a98c99283b5a3f0 (patch)
treeecbc4c0915092ad4ca76bf03364562449695876a /rbutil/rbutilqt/installtalkwindow.cpp
parenta9217bde2749df65d2f59fb63bf1622096263e4f (diff)
downloadrockbox-537dfe482fc0378151406ee37a98c99283b5a3f0.tar.gz
rockbox-537dfe482fc0378151406ee37a98c99283b5a3f0.tar.bz2
rockbox-537dfe482fc0378151406ee37a98c99283b5a3f0.zip
Save all settings in talkfile dialog.
Save settings that haven't been and rename the configuration file value for the talked folder. Since the folder was replaced with a list we can't use the old value anymore so there's no need to keep a name that's not really suitable anymore. Solves FS#12634. Change-Id: I8db2a536409b94c45f28db9418a11f11f57dfacb
Diffstat (limited to 'rbutil/rbutilqt/installtalkwindow.cpp')
-rw-r--r--rbutil/rbutilqt/installtalkwindow.cpp58
1 files changed, 40 insertions, 18 deletions
diff --git a/rbutil/rbutilqt/installtalkwindow.cpp b/rbutil/rbutilqt/installtalkwindow.cpp
index f2e042e2a5..dedb19cb38 100644
--- a/rbutil/rbutilqt/installtalkwindow.cpp
+++ b/rbutil/rbutilqt/installtalkwindow.cpp
@@ -50,12 +50,8 @@ InstallTalkWindow::InstallTalkWindow(QWidget *parent) : QDialog(parent)
}
-void InstallTalkWindow::change()
+void InstallTalkWindow::saveSettings(void)
{
- Config *cw = new Config(this, 4);
-
- // make sure the current selected folder doesn't get lost on settings
- // changes.
QModelIndexList si = ui.treeView->selectionModel()->selectedIndexes();
QStringList foldersToTalk;
for(int i = 0; i < si.size(); i++) {
@@ -63,7 +59,26 @@ void InstallTalkWindow::change()
foldersToTalk.append(fsm->filePath(si.at(i)));
}
}
- RbSettings::setValue(RbSettings::LastTalkedFolder, foldersToTalk);
+ RbSettings::setValue(RbSettings::TalkFolders, foldersToTalk);
+
+ RbSettings::setValue(RbSettings::TalkSkipExisting, ui.GenerateOnlyNew->isChecked());
+ RbSettings::setValue(RbSettings::TalkRecursive, ui.recursive->isChecked());
+ RbSettings::setValue(RbSettings::TalkStripExtensions, ui.StripExtensions->isChecked());
+ RbSettings::setValue(RbSettings::TalkProcessFolders, ui.talkFolders->isChecked());
+ RbSettings::setValue(RbSettings::TalkProcessFiles, ui.talkFiles->isChecked());
+ RbSettings::setValue(RbSettings::TalkIgnoreWildcards, ui.ignoreFiles->text());
+ RbSettings::setValue(RbSettings::TalkIgnoreFiles, ui.ignoreEnabled->isChecked());
+
+ RbSettings::sync();
+}
+
+
+void InstallTalkWindow::change()
+{
+ Config *cw = new Config(this, 4);
+
+ // make sure the current selected folder doesn't get lost on settings
+ // changes.
connect(cw, SIGNAL(settingsUpdated()), this, SLOT(updateSettings()));
cw->show();
@@ -73,19 +88,10 @@ void InstallTalkWindow::accept()
{
logger = new ProgressLoggerGui(this);
- QModelIndexList si = ui.treeView->selectionModel()->selectedIndexes();
- QStringList foldersToTalk;
- for(int i = 0; i < si.size(); i++) {
- if(si.at(i).column() == 0) {
- foldersToTalk.append(fsm->filePath(si.at(i)));
- }
- }
+ saveSettings();
connect(logger,SIGNAL(closed()),this,SLOT(close()));
logger->show();
-
- RbSettings::setValue(RbSettings::LastTalkedFolder, foldersToTalk);
-
- RbSettings::sync();
+ saveSettings();
talkcreator->setMountPoint(RbSettings::value(RbSettings::Mountpoint).toString());
@@ -101,6 +107,8 @@ void InstallTalkWindow::accept()
connect(talkcreator, SIGNAL(logProgress(int, int)), logger, SLOT(setProgress(int, int)));
connect(logger,SIGNAL(aborted()),talkcreator,SLOT(abort()));
+ QStringList foldersToTalk
+ = RbSettings::value(RbSettings::TalkFolders).toStringList();
for(int i = 0; i < foldersToTalk.size(); i++) {
talkcreator->setDir(QDir(foldersToTalk.at(i)));
talkcreator->createTalkFiles();
@@ -119,7 +127,7 @@ void InstallTalkWindow::updateSettings(void)
ui.labelTtsProfile->setText(tr("<b>%1</b>")
.arg("Invalid TTS configuration!"));
- QStringList folders = RbSettings::value(RbSettings::LastTalkedFolder).toStringList();
+ QStringList folders = RbSettings::value(RbSettings::TalkFolders).toStringList();
for(int i = 0; i < folders.size(); ++i) {
QModelIndex mi = fsm->index(folders.at(i));
ui.treeView->selectionModel()->select(mi, QItemSelectionModel::Select);
@@ -128,6 +136,20 @@ void InstallTalkWindow::updateSettings(void)
ui.treeView->setExpanded(mi, true);
}
}
+ ui.GenerateOnlyNew->setChecked(
+ RbSettings::value(RbSettings::TalkSkipExisting).toBool());
+ ui.recursive->setChecked(
+ RbSettings::value(RbSettings::TalkRecursive).toBool());
+ ui.StripExtensions->setChecked(
+ RbSettings::value(RbSettings::TalkStripExtensions).toBool());
+ ui.talkFolders->setChecked(
+ RbSettings::value(RbSettings::TalkProcessFolders).toBool());
+ ui.talkFiles->setChecked(
+ RbSettings::value(RbSettings::TalkProcessFiles).toBool());
+ ui.ignoreFiles->setText(
+ RbSettings::value(RbSettings::TalkIgnoreWildcards).toString());
+ ui.ignoreEnabled->setChecked(
+ RbSettings::value(RbSettings::TalkIgnoreFiles).toBool());
emit settingsUpdated();
}