summaryrefslogtreecommitdiffstats
path: root/rbutil
diff options
context:
space:
mode:
Diffstat (limited to 'rbutil')
-rw-r--r--rbutil/rbutilqt/base/rbsettings.cpp9
-rw-r--r--rbutil/rbutilqt/base/rbsettings.h13
-rw-r--r--rbutil/rbutilqt/installtalkfrm.ui12
-rw-r--r--rbutil/rbutilqt/installtalkwindow.cpp58
-rw-r--r--rbutil/rbutilqt/installtalkwindow.h1
5 files changed, 65 insertions, 28 deletions
diff --git a/rbutil/rbutilqt/base/rbsettings.cpp b/rbutil/rbutilqt/base/rbsettings.cpp
index a74b167e92..f584c6808c 100644
--- a/rbutil/rbutilqt/base/rbsettings.cpp
+++ b/rbutil/rbutilqt/base/rbsettings.cpp
@@ -48,7 +48,14 @@ const static struct {
{ RbSettings::Tts, "tts", "espeak" },
#endif
{ RbSettings::UseTtsCorrections, "use_tts_corrections", "true" },
- { RbSettings::LastTalkedFolder, "last_talked_folder", "" },
+ { RbSettings::TalkFolders, "talk_folders", "" },
+ { RbSettings::TalkProcessFiles, "talk_process_files", "true" },
+ { RbSettings::TalkProcessFolders, "talk_process_folders", "true" },
+ { RbSettings::TalkRecursive, "talk_recursive", "true" },
+ { RbSettings::TalkSkipExisting, "talk_skip_existing", "true" },
+ { RbSettings::TalkStripExtensions, "talk_strip_extensions","true" },
+ { RbSettings::TalkIgnoreFiles, "talk_ignore_files", "false" },
+ { RbSettings::TalkIgnoreWildcards, "talk_ignore_wildcards","" },
{ RbSettings::VoiceLanguage, "voicelanguage", "" },
{ RbSettings::TtsLanguage, ":tts:/language", "" },
{ RbSettings::TtsOptions, ":tts:/options", "" },
diff --git a/rbutil/rbutilqt/base/rbsettings.h b/rbutil/rbutilqt/base/rbsettings.h
index ba4a63cb3b..45ec7092e2 100644
--- a/rbutil/rbutilqt/base/rbsettings.h
+++ b/rbutil/rbutilqt/base/rbsettings.h
@@ -27,7 +27,7 @@ class RbSettings : public QObject
{
Q_OBJECT
public:
-
+
//! All user settings
enum UserSettings {
RbutilVersion,
@@ -42,7 +42,14 @@ class RbSettings : public QObject
Language,
Tts,
UseTtsCorrections,
- LastTalkedFolder,
+ TalkFolders,
+ TalkProcessFiles,
+ TalkProcessFolders,
+ TalkRecursive,
+ TalkSkipExisting,
+ TalkStripExtensions,
+ TalkIgnoreFiles,
+ TalkIgnoreWildcards,
VoiceLanguage,
TtsLanguage,
TtsOptions,
@@ -61,7 +68,7 @@ class RbSettings : public QObject
EncoderQuality,
EncoderVolume,
};
-
+
//! call this to flush the user Settings
static void sync();
//! returns the filename of the usersettings file
diff --git a/rbutil/rbutilqt/installtalkfrm.ui b/rbutil/rbutilqt/installtalkfrm.ui
index 216a473573..0ee723d442 100644
--- a/rbutil/rbutilqt/installtalkfrm.ui
+++ b/rbutil/rbutilqt/installtalkfrm.ui
@@ -113,7 +113,7 @@
</widget>
</item>
<item row="8" column="0">
- <widget class="QCheckBox" name="checkBox">
+ <widget class="QCheckBox" name="ignoreEnabled">
<property name="text">
<string>Ignore files</string>
</property>
@@ -199,7 +199,7 @@
<tabstop>recursive</tabstop>
<tabstop>GenerateOnlyNew</tabstop>
<tabstop>StripExtensions</tabstop>
- <tabstop>checkBox</tabstop>
+ <tabstop>ignoreEnabled</tabstop>
<tabstop>ignoreFiles</tabstop>
</tabstops>
<resources>
@@ -213,8 +213,8 @@
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
- <x>472</x>
- <y>418</y>
+ <x>624</x>
+ <y>437</y>
</hint>
<hint type="destinationlabel">
<x>382</x>
@@ -229,8 +229,8 @@
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
- <x>561</x>
- <y>428</y>
+ <x>711</x>
+ <y>437</y>
</hint>
<hint type="destinationlabel">
<x>522</x>
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();
}
diff --git a/rbutil/rbutilqt/installtalkwindow.h b/rbutil/rbutilqt/installtalkwindow.h
index ab233955d8..7bb338587c 100644
--- a/rbutil/rbutilqt/installtalkwindow.h
+++ b/rbutil/rbutilqt/installtalkwindow.h
@@ -39,6 +39,7 @@ class InstallTalkWindow : public QDialog
private slots:
void updateSettings(void);
+ void saveSettings(void);
signals:
void settingsUpdated(void);