diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2012-06-13 23:04:27 +0200 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2012-06-13 23:04:27 +0200 |
commit | b4dee8958f53f489b2a816685badd0a015c33719 (patch) | |
tree | eb9cd53eb16ec442ca47cfe12a79762f115bbf8b /rbutil | |
parent | da08e5059a50556d14315d6a5e850a218303992b (diff) | |
download | rockbox-b4dee8958f53f489b2a816685badd0a015c33719.tar.gz rockbox-b4dee8958f53f489b2a816685badd0a015c33719.zip |
Rework talkfile creation window.
Support selecting multiple folders by replacing the provided path with a tree
view that allows selecting multiple entries. The view is limited to the
selected mountpoint (i.e. the player) so this removes the possibility of
generating talk files for files that are not on the player. However, since
Rockbox Utility disables most functionality without an attached player this
isn't too much of a problem. Creating a standalone application for talkfile
creation that is not limited to the player is possible as well.
Change-Id: Ic68e7556f2e2e5b9c121aaba759a42a4d1d9d53a
Diffstat (limited to 'rbutil')
-rw-r--r-- | rbutil/rbutilqt/installtalkfrm.ui | 246 | ||||
-rw-r--r-- | rbutil/rbutilqt/installtalkwindow.cpp | 90 | ||||
-rw-r--r-- | rbutil/rbutilqt/installtalkwindow.h | 2 |
3 files changed, 156 insertions, 182 deletions
diff --git a/rbutil/rbutilqt/installtalkfrm.ui b/rbutil/rbutilqt/installtalkfrm.ui index de9a199ac7..216a473573 100644 --- a/rbutil/rbutilqt/installtalkfrm.ui +++ b/rbutil/rbutilqt/installtalkfrm.ui | |||
@@ -9,15 +9,15 @@ | |||
9 | <rect> | 9 | <rect> |
10 | <x>0</x> | 10 | <x>0</x> |
11 | <y>0</y> | 11 | <y>0</y> |
12 | <width>600</width> | 12 | <width>722</width> |
13 | <height>450</height> | 13 | <height>448</height> |
14 | </rect> | 14 | </rect> |
15 | </property> | 15 | </property> |
16 | <property name="windowTitle"> | 16 | <property name="windowTitle"> |
17 | <string>Install Talk Files</string> | 17 | <string>Install Talk Files</string> |
18 | </property> | 18 | </property> |
19 | <layout class="QGridLayout" name="gridLayout_2"> | 19 | <layout class="QGridLayout" name="gridLayout_2"> |
20 | <item row="0" column="0" rowspan="6"> | 20 | <item row="0" column="0" rowspan="4"> |
21 | <widget class="QLabel" name="label"> | 21 | <widget class="QLabel" name="label"> |
22 | <property name="text"> | 22 | <property name="text"> |
23 | <string/> | 23 | <string/> |
@@ -30,59 +30,37 @@ | |||
30 | </property> | 30 | </property> |
31 | </widget> | 31 | </widget> |
32 | </item> | 32 | </item> |
33 | <item row="0" column="1" colspan="3"> | ||
34 | <widget class="QLabel" name="label_2"> | ||
35 | <property name="text"> | ||
36 | <string>Select the Folder to generate Talkfiles for.</string> | ||
37 | </property> | ||
38 | </widget> | ||
39 | </item> | ||
40 | <item row="1" column="1" colspan="2"> | ||
41 | <widget class="QLineEdit" name="lineTalkFolder"> | ||
42 | <property name="accessibleName"> | ||
43 | <string>Talkfile Folder</string> | ||
44 | </property> | ||
45 | </widget> | ||
46 | </item> | ||
47 | <item row="1" column="3"> | ||
48 | <widget class="QPushButton" name="buttonBrowse"> | ||
49 | <property name="text"> | ||
50 | <string>&Browse</string> | ||
51 | </property> | ||
52 | <property name="icon"> | ||
53 | <iconset resource="rbutilqt.qrc"> | ||
54 | <normaloff>:/icons/system-search.png</normaloff>:/icons/system-search.png</iconset> | ||
55 | </property> | ||
56 | </widget> | ||
57 | </item> | ||
58 | <item row="2" column="1" colspan="3"> | 33 | <item row="2" column="1" colspan="3"> |
59 | <widget class="QGroupBox" name="groupBox_2"> | 34 | <widget class="QGroupBox" name="groupBox"> |
60 | <property name="title"> | 35 | <property name="title"> |
61 | <string>Generation settings</string> | 36 | <string>Generation options</string> |
62 | </property> | 37 | </property> |
63 | <layout class="QGridLayout" name="gridLayout_3"> | 38 | <layout class="QGridLayout" name="gridLayout"> |
64 | <item row="0" column="0"> | 39 | <item row="7" column="0"> |
65 | <widget class="QLabel" name="labelTtsProfile"> | 40 | <widget class="QCheckBox" name="StripExtensions"> |
66 | <property name="text"> | 41 | <property name="text"> |
67 | <string>TTS profile:</string> | 42 | <string>Strip Extensions</string> |
43 | </property> | ||
44 | <property name="checked"> | ||
45 | <bool>false</bool> | ||
68 | </property> | 46 | </property> |
69 | </widget> | 47 | </widget> |
70 | </item> | 48 | </item> |
71 | <item row="0" column="1"> | 49 | <item row="1" column="0"> |
72 | <widget class="QPushButton" name="change"> | 50 | <widget class="QCheckBox" name="talkFiles"> |
73 | <property name="sizePolicy"> | ||
74 | <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> | ||
75 | <horstretch>0</horstretch> | ||
76 | <verstretch>0</verstretch> | ||
77 | </sizepolicy> | ||
78 | </property> | ||
79 | <property name="text"> | 51 | <property name="text"> |
80 | <string>Change</string> | 52 | <string>Generate for files</string> |
53 | </property> | ||
54 | <property name="checked"> | ||
55 | <bool>true</bool> | ||
56 | </property> | ||
57 | <property name="tristate"> | ||
58 | <bool>false</bool> | ||
81 | </property> | 59 | </property> |
82 | </widget> | 60 | </widget> |
83 | </item> | 61 | </item> |
84 | <item row="1" column="1"> | 62 | <item row="0" column="1"> |
85 | <spacer> | 63 | <spacer name="horizontalSpacer"> |
86 | <property name="orientation"> | 64 | <property name="orientation"> |
87 | <enum>Qt::Horizontal</enum> | 65 | <enum>Qt::Horizontal</enum> |
88 | </property> | 66 | </property> |
@@ -94,124 +72,60 @@ | |||
94 | </property> | 72 | </property> |
95 | </spacer> | 73 | </spacer> |
96 | </item> | 74 | </item> |
97 | </layout> | 75 | <item row="0" column="0"> |
98 | </widget> | 76 | <widget class="QLabel" name="labelTtsProfile"> |
99 | </item> | ||
100 | <item row="4" column="2"> | ||
101 | <spacer> | ||
102 | <property name="orientation"> | ||
103 | <enum>Qt::Vertical</enum> | ||
104 | </property> | ||
105 | <property name="sizeHint" stdset="0"> | ||
106 | <size> | ||
107 | <width>20</width> | ||
108 | <height>40</height> | ||
109 | </size> | ||
110 | </property> | ||
111 | </spacer> | ||
112 | </item> | ||
113 | <item row="5" column="1"> | ||
114 | <spacer> | ||
115 | <property name="orientation"> | ||
116 | <enum>Qt::Horizontal</enum> | ||
117 | </property> | ||
118 | <property name="sizeHint" stdset="0"> | ||
119 | <size> | ||
120 | <width>40</width> | ||
121 | <height>20</height> | ||
122 | </size> | ||
123 | </property> | ||
124 | </spacer> | ||
125 | </item> | ||
126 | <item row="5" column="2" colspan="2"> | ||
127 | <layout class="QHBoxLayout"> | ||
128 | <item> | ||
129 | <widget class="QPushButton" name="buttonOk"> | ||
130 | <property name="text"> | ||
131 | <string>&Install</string> | ||
132 | </property> | ||
133 | <property name="icon"> | ||
134 | <iconset resource="rbutilqt.qrc"> | ||
135 | <normaloff>:/icons/go-next.png</normaloff>:/icons/go-next.png</iconset> | ||
136 | </property> | ||
137 | </widget> | ||
138 | </item> | ||
139 | <item> | ||
140 | <widget class="QPushButton" name="buttonCancel"> | ||
141 | <property name="text"> | ||
142 | <string>&Cancel</string> | ||
143 | </property> | ||
144 | <property name="icon"> | ||
145 | <iconset resource="rbutilqt.qrc"> | ||
146 | <normaloff>:/icons/process-stop.png</normaloff>:/icons/process-stop.png</iconset> | ||
147 | </property> | ||
148 | </widget> | ||
149 | </item> | ||
150 | </layout> | ||
151 | </item> | ||
152 | <item row="3" column="1" colspan="3"> | ||
153 | <widget class="QGroupBox" name="groupBox"> | ||
154 | <property name="title"> | ||
155 | <string>Generation options</string> | ||
156 | </property> | ||
157 | <layout class="QGridLayout" name="gridLayout"> | ||
158 | <item row="2" column="1"> | ||
159 | <widget class="QLineEdit" name="ignoreFiles"/> | ||
160 | </item> | ||
161 | <item row="2" column="0"> | ||
162 | <widget class="QLabel" name="label_3"> | ||
163 | <property name="text"> | 77 | <property name="text"> |
164 | <string>Ignore files (comma seperated Wildcards):</string> | 78 | <string>TTS profile:</string> |
165 | </property> | 79 | </property> |
166 | </widget> | 80 | </widget> |
167 | </item> | 81 | </item> |
168 | <item row="0" column="0"> | 82 | <item row="1" column="1" colspan="2"> |
169 | <widget class="QCheckBox" name="talkFiles"> | 83 | <widget class="QCheckBox" name="talkFolders"> |
170 | <property name="text"> | 84 | <property name="text"> |
171 | <string>Generate .talk files for Files</string> | 85 | <string>Generate for folders</string> |
172 | </property> | 86 | </property> |
173 | <property name="checked"> | 87 | <property name="checked"> |
174 | <bool>true</bool> | 88 | <bool>true</bool> |
175 | </property> | 89 | </property> |
176 | <property name="tristate"> | ||
177 | <bool>false</bool> | ||
178 | </property> | ||
179 | </widget> | 90 | </widget> |
180 | </item> | 91 | </item> |
181 | <item row="4" column="0"> | 92 | <item row="4" column="0"> |
182 | <widget class="QCheckBox" name="talkFolders"> | 93 | <widget class="QCheckBox" name="recursive"> |
183 | <property name="text"> | 94 | <property name="text"> |
184 | <string>Generate .talk files for Folders</string> | 95 | <string>Recurse into folders</string> |
185 | </property> | 96 | </property> |
186 | <property name="checked"> | 97 | <property name="checked"> |
187 | <bool>true</bool> | 98 | <bool>true</bool> |
188 | </property> | 99 | </property> |
189 | </widget> | 100 | </widget> |
190 | </item> | 101 | </item> |
191 | <item row="5" column="0"> | 102 | <item row="0" column="2"> |
192 | <widget class="QCheckBox" name="recursive"> | 103 | <widget class="QPushButton" name="change"> |
193 | <property name="text"> | 104 | <property name="sizePolicy"> |
194 | <string>Run recursive</string> | 105 | <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> |
106 | <horstretch>0</horstretch> | ||
107 | <verstretch>0</verstretch> | ||
108 | </sizepolicy> | ||
195 | </property> | 109 | </property> |
196 | <property name="checked"> | 110 | <property name="text"> |
197 | <bool>true</bool> | 111 | <string>Change</string> |
198 | </property> | 112 | </property> |
199 | </widget> | 113 | </widget> |
200 | </item> | 114 | </item> |
201 | <item row="6" column="0"> | 115 | <item row="8" column="0"> |
202 | <widget class="QCheckBox" name="StripExtensions"> | 116 | <widget class="QCheckBox" name="checkBox"> |
203 | <property name="text"> | 117 | <property name="text"> |
204 | <string>Strip Extensions</string> | 118 | <string>Ignore files</string> |
205 | </property> | ||
206 | <property name="checked"> | ||
207 | <bool>false</bool> | ||
208 | </property> | 119 | </property> |
209 | </widget> | 120 | </widget> |
210 | </item> | 121 | </item> |
211 | <item row="7" column="0"> | 122 | <item row="8" column="1" colspan="2"> |
123 | <widget class="QLineEdit" name="ignoreFiles"/> | ||
124 | </item> | ||
125 | <item row="4" column="1" colspan="2"> | ||
212 | <widget class="QCheckBox" name="GenerateOnlyNew"> | 126 | <widget class="QCheckBox" name="GenerateOnlyNew"> |
213 | <property name="text"> | 127 | <property name="text"> |
214 | <string>Create only new Talkfiles</string> | 128 | <string>Skip existing</string> |
215 | </property> | 129 | </property> |
216 | <property name="checked"> | 130 | <property name="checked"> |
217 | <bool>true</bool> | 131 | <bool>true</bool> |
@@ -221,14 +135,72 @@ | |||
221 | </layout> | 135 | </layout> |
222 | </widget> | 136 | </widget> |
223 | </item> | 137 | </item> |
138 | <item row="3" column="2" colspan="2"> | ||
139 | <layout class="QHBoxLayout"> | ||
140 | <item> | ||
141 | <widget class="QPushButton" name="buttonOk"> | ||
142 | <property name="text"> | ||
143 | <string>&Install</string> | ||
144 | </property> | ||
145 | <property name="icon"> | ||
146 | <iconset resource="rbutilqt.qrc"> | ||
147 | <normaloff>:/icons/go-next.png</normaloff>:/icons/go-next.png</iconset> | ||
148 | </property> | ||
149 | </widget> | ||
150 | </item> | ||
151 | <item> | ||
152 | <widget class="QPushButton" name="buttonCancel"> | ||
153 | <property name="text"> | ||
154 | <string>&Cancel</string> | ||
155 | </property> | ||
156 | <property name="icon"> | ||
157 | <iconset resource="rbutilqt.qrc"> | ||
158 | <normaloff>:/icons/process-stop.png</normaloff>:/icons/process-stop.png</iconset> | ||
159 | </property> | ||
160 | </widget> | ||
161 | </item> | ||
162 | </layout> | ||
163 | </item> | ||
164 | <item row="1" column="1" colspan="3"> | ||
165 | <widget class="QTreeView" name="treeView"/> | ||
166 | </item> | ||
167 | <item row="0" column="1" colspan="3"> | ||
168 | <widget class="QLabel" name="label_2"> | ||
169 | <property name="text"> | ||
170 | <string>Select folders for Talkfile generation (Ctrl for multiselect)</string> | ||
171 | </property> | ||
172 | </widget> | ||
173 | </item> | ||
174 | <item row="3" column="1"> | ||
175 | <spacer> | ||
176 | <property name="orientation"> | ||
177 | <enum>Qt::Horizontal</enum> | ||
178 | </property> | ||
179 | <property name="sizeType"> | ||
180 | <enum>QSizePolicy::Expanding</enum> | ||
181 | </property> | ||
182 | <property name="sizeHint" stdset="0"> | ||
183 | <size> | ||
184 | <width>20</width> | ||
185 | <height>20</height> | ||
186 | </size> | ||
187 | </property> | ||
188 | </spacer> | ||
189 | </item> | ||
224 | </layout> | 190 | </layout> |
225 | </widget> | 191 | </widget> |
226 | <tabstops> | 192 | <tabstops> |
227 | <tabstop>lineTalkFolder</tabstop> | ||
228 | <tabstop>buttonBrowse</tabstop> | ||
229 | <tabstop>change</tabstop> | ||
230 | <tabstop>buttonOk</tabstop> | 193 | <tabstop>buttonOk</tabstop> |
231 | <tabstop>buttonCancel</tabstop> | 194 | <tabstop>buttonCancel</tabstop> |
195 | <tabstop>treeView</tabstop> | ||
196 | <tabstop>change</tabstop> | ||
197 | <tabstop>talkFiles</tabstop> | ||
198 | <tabstop>talkFolders</tabstop> | ||
199 | <tabstop>recursive</tabstop> | ||
200 | <tabstop>GenerateOnlyNew</tabstop> | ||
201 | <tabstop>StripExtensions</tabstop> | ||
202 | <tabstop>checkBox</tabstop> | ||
203 | <tabstop>ignoreFiles</tabstop> | ||
232 | </tabstops> | 204 | </tabstops> |
233 | <resources> | 205 | <resources> |
234 | <include location="rbutilqt.qrc"/> | 206 | <include location="rbutilqt.qrc"/> |
diff --git a/rbutil/rbutilqt/installtalkwindow.cpp b/rbutil/rbutilqt/installtalkwindow.cpp index de723ae33e..f2e042e2a5 100644 --- a/rbutil/rbutilqt/installtalkwindow.cpp +++ b/rbutil/rbutilqt/installtalkwindow.cpp | |||
@@ -28,47 +28,42 @@ InstallTalkWindow::InstallTalkWindow(QWidget *parent) : QDialog(parent) | |||
28 | ui.setupUi(this); | 28 | ui.setupUi(this); |
29 | talkcreator = new TalkFileCreator(this); | 29 | talkcreator = new TalkFileCreator(this); |
30 | 30 | ||
31 | connect(ui.buttonBrowse, SIGNAL(clicked()), this, SLOT(browseFolder())); | ||
32 | connect(ui.change,SIGNAL(clicked()),this,SLOT(change())); | 31 | connect(ui.change,SIGNAL(clicked()),this,SLOT(change())); |
33 | 32 | ||
34 | ui.recursive->setChecked(true); | 33 | ui.recursive->setChecked(true); |
35 | ui.GenerateOnlyNew->setChecked(true); | 34 | ui.GenerateOnlyNew->setChecked(true); |
36 | ui.StripExtensions->setChecked(true); | 35 | ui.StripExtensions->setChecked(true); |
37 | 36 | ||
38 | updateSettings(); | 37 | fsm = new QFileSystemModel(this); |
39 | } | 38 | QString mp = RbSettings::value(RbSettings::Mountpoint).toString(); |
39 | fsm->setRootPath(mp); | ||
40 | ui.treeView->setModel(fsm); | ||
41 | ui.treeView->setSelectionMode(QAbstractItemView::ExtendedSelection); | ||
42 | ui.treeView->setRootIndex(fsm->index(mp)); | ||
43 | qDebug() << fsm->columnCount(); | ||
44 | fsm->setFilter(QDir::AllDirs | QDir::NoDotAndDotDot); | ||
45 | for(int i = 1; i < fsm->columnCount(); i++) | ||
46 | ui.treeView->setColumnHidden(i, true); | ||
47 | ui.treeView->setHeaderHidden(true); | ||
40 | 48 | ||
41 | void InstallTalkWindow::browseFolder() | 49 | updateSettings(); |
42 | { | ||
43 | QString selected; | ||
44 | QString startfolder; | ||
45 | if(QFileInfo(ui.lineTalkFolder->text()).isDir()) | ||
46 | { | ||
47 | startfolder = ui.lineTalkFolder->text(); | ||
48 | } | ||
49 | else | ||
50 | { | ||
51 | startfolder = RbSettings::value(RbSettings::Mountpoint).toString(); | ||
52 | } | ||
53 | selected = QFileDialog::getExistingDirectory(this, | ||
54 | tr("Select folder to create talk files"), startfolder); | ||
55 | if(!selected.isEmpty()) | ||
56 | { | ||
57 | ui.lineTalkFolder->setText(selected); | ||
58 | } | ||
59 | } | 50 | } |
60 | 51 | ||
61 | 52 | ||
62 | void InstallTalkWindow::change() | 53 | void InstallTalkWindow::change() |
63 | { | 54 | { |
64 | Config *cw = new Config(this,4); | 55 | Config *cw = new Config(this, 4); |
65 | 56 | ||
66 | // make sure the current selected folder doesn't get lost on settings | 57 | // make sure the current selected folder doesn't get lost on settings |
67 | // changes. If the current selection is invalid don't accept it so | 58 | // changes. |
68 | // it gets reset to the old value after closing the settings dialog. | 59 | QModelIndexList si = ui.treeView->selectionModel()->selectedIndexes(); |
69 | QString folderToTalk = ui.lineTalkFolder->text(); | 60 | QStringList foldersToTalk; |
70 | if(QFileInfo(folderToTalk).isDir()) | 61 | for(int i = 0; i < si.size(); i++) { |
71 | RbSettings::setValue(RbSettings::LastTalkedFolder, folderToTalk); | 62 | if(si.at(i).column() == 0) { |
63 | foldersToTalk.append(fsm->filePath(si.at(i))); | ||
64 | } | ||
65 | } | ||
66 | RbSettings::setValue(RbSettings::LastTalkedFolder, foldersToTalk); | ||
72 | connect(cw, SIGNAL(settingsUpdated()), this, SLOT(updateSettings())); | 67 | connect(cw, SIGNAL(settingsUpdated()), this, SLOT(updateSettings())); |
73 | 68 | ||
74 | cw->show(); | 69 | cw->show(); |
@@ -78,24 +73,20 @@ void InstallTalkWindow::accept() | |||
78 | { | 73 | { |
79 | logger = new ProgressLoggerGui(this); | 74 | logger = new ProgressLoggerGui(this); |
80 | 75 | ||
76 | QModelIndexList si = ui.treeView->selectionModel()->selectedIndexes(); | ||
77 | QStringList foldersToTalk; | ||
78 | for(int i = 0; i < si.size(); i++) { | ||
79 | if(si.at(i).column() == 0) { | ||
80 | foldersToTalk.append(fsm->filePath(si.at(i))); | ||
81 | } | ||
82 | } | ||
81 | connect(logger,SIGNAL(closed()),this,SLOT(close())); | 83 | connect(logger,SIGNAL(closed()),this,SLOT(close())); |
82 | logger->show(); | 84 | logger->show(); |
83 | 85 | ||
84 | 86 | RbSettings::setValue(RbSettings::LastTalkedFolder, foldersToTalk); | |
85 | QString folderToTalk = ui.lineTalkFolder->text(); | ||
86 | |||
87 | if(!QFileInfo(folderToTalk).isDir()) | ||
88 | { | ||
89 | logger->addItem(tr("The Folder to Talk is wrong!"),LOGERROR); | ||
90 | logger->setFinished(); | ||
91 | return; | ||
92 | } | ||
93 | |||
94 | RbSettings::setValue(RbSettings::LastTalkedFolder, folderToTalk); | ||
95 | 87 | ||
96 | RbSettings::sync(); | 88 | RbSettings::sync(); |
97 | 89 | ||
98 | talkcreator->setDir(QDir(folderToTalk)); | ||
99 | talkcreator->setMountPoint(RbSettings::value(RbSettings::Mountpoint).toString()); | 90 | talkcreator->setMountPoint(RbSettings::value(RbSettings::Mountpoint).toString()); |
100 | 91 | ||
101 | talkcreator->setGenerateOnlyNew(ui.GenerateOnlyNew->isChecked()); | 92 | talkcreator->setGenerateOnlyNew(ui.GenerateOnlyNew->isChecked()); |
@@ -110,7 +101,10 @@ void InstallTalkWindow::accept() | |||
110 | connect(talkcreator, SIGNAL(logProgress(int, int)), logger, SLOT(setProgress(int, int))); | 101 | connect(talkcreator, SIGNAL(logProgress(int, int)), logger, SLOT(setProgress(int, int))); |
111 | connect(logger,SIGNAL(aborted()),talkcreator,SLOT(abort())); | 102 | connect(logger,SIGNAL(aborted()),talkcreator,SLOT(abort())); |
112 | 103 | ||
113 | talkcreator->createTalkFiles(); | 104 | for(int i = 0; i < foldersToTalk.size(); i++) { |
105 | talkcreator->setDir(QDir(foldersToTalk.at(i))); | ||
106 | talkcreator->createTalkFiles(); | ||
107 | } | ||
114 | } | 108 | } |
115 | 109 | ||
116 | 110 | ||
@@ -119,14 +113,22 @@ void InstallTalkWindow::updateSettings(void) | |||
119 | QString ttsName = RbSettings::value(RbSettings::Tts).toString(); | 113 | QString ttsName = RbSettings::value(RbSettings::Tts).toString(); |
120 | TTSBase* tts = TTSBase::getTTS(this,ttsName); | 114 | TTSBase* tts = TTSBase::getTTS(this,ttsName); |
121 | if(tts->configOk()) | 115 | if(tts->configOk()) |
122 | ui.labelTtsProfile->setText(tr("Selected TTS engine: <b>%1</b>") | 116 | ui.labelTtsProfile->setText(tr("<b>%1</b>") |
123 | .arg(TTSBase::getTTSName(ttsName))); | 117 | .arg(TTSBase::getTTSName(ttsName))); |
124 | else | 118 | else |
125 | ui.labelTtsProfile->setText(tr("Selected TTS engine: <b>%1</b>") | 119 | ui.labelTtsProfile->setText(tr("<b>%1</b>") |
126 | .arg("Invalid TTS configuration!")); | 120 | .arg("Invalid TTS configuration!")); |
127 | 121 | ||
128 | ui.lineTalkFolder->setText( | 122 | QStringList folders = RbSettings::value(RbSettings::LastTalkedFolder).toStringList(); |
129 | RbSettings::value(RbSettings::LastTalkedFolder).toString()); | 123 | for(int i = 0; i < folders.size(); ++i) { |
124 | QModelIndex mi = fsm->index(folders.at(i)); | ||
125 | ui.treeView->selectionModel()->select(mi, QItemSelectionModel::Select); | ||
126 | // make sure all parent items are expanded. | ||
127 | while((mi = mi.parent()) != QModelIndex()) { | ||
128 | ui.treeView->setExpanded(mi, true); | ||
129 | } | ||
130 | } | ||
131 | |||
130 | emit settingsUpdated(); | 132 | emit settingsUpdated(); |
131 | } | 133 | } |
132 | 134 | ||
diff --git a/rbutil/rbutilqt/installtalkwindow.h b/rbutil/rbutilqt/installtalkwindow.h index acac221af9..ab233955d8 100644 --- a/rbutil/rbutilqt/installtalkwindow.h +++ b/rbutil/rbutilqt/installtalkwindow.h | |||
@@ -38,7 +38,6 @@ class InstallTalkWindow : public QDialog | |||
38 | void change(void); | 38 | void change(void); |
39 | 39 | ||
40 | private slots: | 40 | private slots: |
41 | void browseFolder(void); | ||
42 | void updateSettings(void); | 41 | void updateSettings(void); |
43 | 42 | ||
44 | signals: | 43 | signals: |
@@ -49,6 +48,7 @@ class InstallTalkWindow : public QDialog | |||
49 | TalkFileCreator* talkcreator; | 48 | TalkFileCreator* talkcreator; |
50 | Ui::InstallTalkFrm ui; | 49 | Ui::InstallTalkFrm ui; |
51 | ProgressLoggerGui* logger; | 50 | ProgressLoggerGui* logger; |
51 | QFileSystemModel *fsm; | ||
52 | }; | 52 | }; |
53 | 53 | ||
54 | #endif | 54 | #endif |