diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2020-11-22 16:02:11 +0100 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2020-11-22 18:30:01 +0100 |
commit | 0ea8f074ed5bc615f5a7cc495582f525210b87d5 (patch) | |
tree | 3f16f0f7949de70bf46b428ebed9083f0852c2d0 /rbutil/rbutilqt | |
parent | 0b911b7500541097acaf70bfef023a069997d4c3 (diff) | |
download | rockbox-0ea8f074ed5bc615f5a7cc495582f525210b87d5.tar.gz rockbox-0ea8f074ed5bc615f5a7cc495582f525210b87d5.zip |
rbutil: Remove Install Voice button from Accessibility tab.
Installing the voice file is now done via the main installation.
Change-Id: I431744467faaf1720b3c82d339a424d67c84e6e6
Diffstat (limited to 'rbutil/rbutilqt')
-rw-r--r-- | rbutil/rbutilqt/rbutilqt.cpp | 76 | ||||
-rw-r--r-- | rbutil/rbutilqt/rbutilqt.h | 1 | ||||
-rw-r--r-- | rbutil/rbutilqt/rbutilqtfrm.ui | 41 |
3 files changed, 6 insertions, 112 deletions
diff --git a/rbutil/rbutilqt/rbutilqt.cpp b/rbutil/rbutilqt/rbutilqt.cpp index a250e4f252..4953db3470 100644 --- a/rbutil/rbutilqt/rbutilqt.cpp +++ b/rbutil/rbutilqt/rbutilqt.cpp | |||
@@ -158,13 +158,11 @@ RbUtilQt::RbUtilQt(QWidget *parent) : QMainWindow(parent) | |||
158 | connect(ui.buttonEject, SIGNAL(clicked()), this, SLOT(eject())); | 158 | connect(ui.buttonEject, SIGNAL(clicked()), this, SLOT(eject())); |
159 | connect(ui.buttonTalk, SIGNAL(clicked()), this, SLOT(createTalkFiles())); | 159 | connect(ui.buttonTalk, SIGNAL(clicked()), this, SLOT(createTalkFiles())); |
160 | connect(ui.buttonCreateVoice, SIGNAL(clicked()), this, SLOT(createVoiceFile())); | 160 | connect(ui.buttonCreateVoice, SIGNAL(clicked()), this, SLOT(createVoiceFile())); |
161 | connect(ui.buttonVoice, SIGNAL(clicked()), this, SLOT(installVoice())); | ||
162 | connect(ui.buttonRemoveRockbox, SIGNAL(clicked()), this, SLOT(uninstall())); | 161 | connect(ui.buttonRemoveRockbox, SIGNAL(clicked()), this, SLOT(uninstall())); |
163 | connect(ui.buttonRemoveBootloader, SIGNAL(clicked()), this, SLOT(uninstallBootloader())); | 162 | connect(ui.buttonRemoveBootloader, SIGNAL(clicked()), this, SLOT(uninstallBootloader())); |
164 | connect(ui.buttonBackup, SIGNAL(clicked()), this, SLOT(backup())); | 163 | connect(ui.buttonBackup, SIGNAL(clicked()), this, SLOT(backup())); |
165 | 164 | ||
166 | // actions accessible from the menu | 165 | // actions accessible from the menu |
167 | connect(ui.actionInstall_Voice_File, SIGNAL(triggered()), this, SLOT(installVoice())); | ||
168 | connect(ui.actionCreate_Voice_File, SIGNAL(triggered()), this, SLOT(createVoiceFile())); | 166 | connect(ui.actionCreate_Voice_File, SIGNAL(triggered()), this, SLOT(createVoiceFile())); |
169 | connect(ui.actionCreate_Talk_Files, SIGNAL(triggered()), this, SLOT(createTalkFiles())); | 167 | connect(ui.actionCreate_Talk_Files, SIGNAL(triggered()), this, SLOT(createTalkFiles())); |
170 | connect(ui.actionRemove_bootloader, SIGNAL(triggered()), this, SLOT(uninstallBootloader())); | 168 | connect(ui.actionRemove_bootloader, SIGNAL(triggered()), this, SLOT(uninstallBootloader())); |
@@ -438,80 +436,6 @@ void RbUtilQt::installdone(bool error) | |||
438 | m_error = error; | 436 | m_error = error; |
439 | } | 437 | } |
440 | 438 | ||
441 | void RbUtilQt::installVoice() | ||
442 | { | ||
443 | if(chkConfig(this)) return; | ||
444 | |||
445 | if(m_gotInfo == false) | ||
446 | { | ||
447 | QMessageBox::warning(this, tr("Warning"), | ||
448 | tr("The Application is still downloading Information about new Builds." | ||
449 | " Please try again shortly.")); | ||
450 | return; | ||
451 | } | ||
452 | |||
453 | QString mountpoint = RbSettings::value(RbSettings::Mountpoint).toString(); | ||
454 | RockboxInfo installInfo(mountpoint); | ||
455 | |||
456 | QString voiceurl; | ||
457 | QString logversion; | ||
458 | QString relversion = installInfo.release(); | ||
459 | // if no version is found abort. | ||
460 | if(installInfo.revision().isEmpty() && relversion.isEmpty()) { | ||
461 | QMessageBox::critical(this, tr("No Rockbox installation found"), | ||
462 | tr("Could not determine the installed Rockbox version. " | ||
463 | "Please install a Rockbox build before installing " | ||
464 | "voice files.")); | ||
465 | return; | ||
466 | } | ||
467 | if(relversion.isEmpty()) { | ||
468 | // release is empty for development builds. | ||
469 | // No voice files are available for development builds. | ||
470 | QMessageBox::critical(this, tr("No voice file available"), | ||
471 | tr("The installed version of Rockbox is a development version. " | ||
472 | "Pre-built voices are only available for release versions " | ||
473 | "of Rockbox. Please generate a voice yourself using the " | ||
474 | "\"Create voice file\" functionality.")); | ||
475 | return; | ||
476 | } | ||
477 | else { | ||
478 | voiceurl = SystemInfo::value(SystemInfo::VoiceUrl, | ||
479 | SystemInfo::BuildRelease).toString(); | ||
480 | logversion = installInfo.release(); | ||
481 | } | ||
482 | if(QMessageBox::question(this, tr("Confirm Installation"), | ||
483 | tr("Do you really want to install the voice file?"), | ||
484 | QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) | ||
485 | return; | ||
486 | |||
487 | QString model = SystemInfo::platformValue(SystemInfo::BuildserverModel).toString(); | ||
488 | // replace placeholder in voice url | ||
489 | voiceurl.replace("%MODEL%", model); | ||
490 | voiceurl.replace("%RELVERSION%", relversion); | ||
491 | voiceurl.replace("%LANGUAGE%", "english"); | ||
492 | |||
493 | LOG_INFO() << "voicefile URL:" << voiceurl; | ||
494 | |||
495 | // create logger | ||
496 | logger = new ProgressLoggerGui(this); | ||
497 | logger->show(); | ||
498 | // create zip installer | ||
499 | installer = new ZipInstaller(this); | ||
500 | |||
501 | installer->setUrl(voiceurl); | ||
502 | installer->setLogSection("Voice"); | ||
503 | installer->setLogVersion(logversion); | ||
504 | installer->setMountPoint(mountpoint); | ||
505 | if(!RbSettings::value(RbSettings::CacheDisabled).toBool()) | ||
506 | installer->setCache(true); | ||
507 | connect(installer, SIGNAL(logItem(QString, int)), logger, SLOT(addItem(QString, int))); | ||
508 | connect(installer, SIGNAL(logProgress(int, int)), logger, SLOT(setProgress(int, int))); | ||
509 | connect(installer, SIGNAL(done(bool)), logger, SLOT(setFinished())); | ||
510 | connect(logger, SIGNAL(aborted()), installer, SLOT(abort())); | ||
511 | installer->install(); | ||
512 | |||
513 | } | ||
514 | |||
515 | 439 | ||
516 | void RbUtilQt::createTalkFiles(void) | 440 | void RbUtilQt::createTalkFiles(void) |
517 | { | 441 | { |
diff --git a/rbutil/rbutilqt/rbutilqt.h b/rbutil/rbutilqt/rbutilqt.h index 41000b80f9..e20749d438 100644 --- a/rbutil/rbutilqt/rbutilqt.h +++ b/rbutil/rbutilqt/rbutilqt.h | |||
@@ -91,7 +91,6 @@ class RbUtilQt : public QMainWindow | |||
91 | void downloadInfo(void); | 91 | void downloadInfo(void); |
92 | void backup(void); | 92 | void backup(void); |
93 | 93 | ||
94 | void installVoice(void); | ||
95 | void uninstall(void); | 94 | void uninstall(void); |
96 | void uninstallBootloader(void); | 95 | void uninstallBootloader(void); |
97 | void installPortable(void); | 96 | void installPortable(void); |
diff --git a/rbutil/rbutilqt/rbutilqtfrm.ui b/rbutil/rbutilqt/rbutilqtfrm.ui index f0b18ea87a..4bdd929a93 100644 --- a/rbutil/rbutilqt/rbutilqtfrm.ui +++ b/rbutil/rbutilqt/rbutilqtfrm.ui | |||
@@ -171,34 +171,7 @@ | |||
171 | <string>Install accessibility add-ons</string> | 171 | <string>Install accessibility add-ons</string> |
172 | </attribute> | 172 | </attribute> |
173 | <layout class="QGridLayout"> | 173 | <layout class="QGridLayout"> |
174 | <item row="0" column="0"> | 174 | <item row="1" column="0"> |
175 | <widget class="QToolButton" name="buttonVoice"> | ||
176 | <property name="text"> | ||
177 | <string>Install Voice files</string> | ||
178 | </property> | ||
179 | <property name="icon"> | ||
180 | <iconset resource="rbutilqt.qrc"> | ||
181 | <normaloff>:/icons/audio-volume-high.svg</normaloff>:/icons/audio-volume-high.svg</iconset> | ||
182 | </property> | ||
183 | <property name="iconSize"> | ||
184 | <size> | ||
185 | <width>56</width> | ||
186 | <height>46</height> | ||
187 | </size> | ||
188 | </property> | ||
189 | </widget> | ||
190 | </item> | ||
191 | <item row="0" column="1"> | ||
192 | <widget class="QLabel" name="labelVoice"> | ||
193 | <property name="text"> | ||
194 | <string><b>Install Voice file</b><br/>Voice files are needed to make Rockbox speak the user interface. Speaking is enabled by default, so if you installed the voice file Rockbox will speak.</string> | ||
195 | </property> | ||
196 | <property name="wordWrap"> | ||
197 | <bool>true</bool> | ||
198 | </property> | ||
199 | </widget> | ||
200 | </item> | ||
201 | <item row="2" column="0"> | ||
202 | <widget class="QToolButton" name="buttonTalk"> | 175 | <widget class="QToolButton" name="buttonTalk"> |
203 | <property name="text"> | 176 | <property name="text"> |
204 | <string>Install Talk files</string> | 177 | <string>Install Talk files</string> |
@@ -215,14 +188,14 @@ | |||
215 | </property> | 188 | </property> |
216 | </widget> | 189 | </widget> |
217 | </item> | 190 | </item> |
218 | <item row="2" column="1"> | 191 | <item row="1" column="1"> |
219 | <widget class="QLabel" name="labelTalk"> | 192 | <widget class="QLabel" name="labelTalk"> |
220 | <property name="text"> | 193 | <property name="text"> |
221 | <string><b>Create Talk Files</b><br/>Talkfiles are needed to let Rockbox speak File and Foldernames</string> | 194 | <string><b>Create Talk Files</b><br/>Talkfiles are needed to let Rockbox speak File and Foldernames</string> |
222 | </property> | 195 | </property> |
223 | </widget> | 196 | </widget> |
224 | </item> | 197 | </item> |
225 | <item row="3" column="0"> | 198 | <item row="2" column="0"> |
226 | <spacer> | 199 | <spacer> |
227 | <property name="orientation"> | 200 | <property name="orientation"> |
228 | <enum>Qt::Vertical</enum> | 201 | <enum>Qt::Vertical</enum> |
@@ -235,7 +208,7 @@ | |||
235 | </property> | 208 | </property> |
236 | </spacer> | 209 | </spacer> |
237 | </item> | 210 | </item> |
238 | <item row="3" column="1"> | 211 | <item row="2" column="1"> |
239 | <spacer> | 212 | <spacer> |
240 | <property name="orientation"> | 213 | <property name="orientation"> |
241 | <enum>Qt::Vertical</enum> | 214 | <enum>Qt::Vertical</enum> |
@@ -248,7 +221,7 @@ | |||
248 | </property> | 221 | </property> |
249 | </spacer> | 222 | </spacer> |
250 | </item> | 223 | </item> |
251 | <item row="1" column="0"> | 224 | <item row="0" column="0"> |
252 | <widget class="QToolButton" name="buttonCreateVoice"> | 225 | <widget class="QToolButton" name="buttonCreateVoice"> |
253 | <property name="text"> | 226 | <property name="text"> |
254 | <string>Create Voice files</string> | 227 | <string>Create Voice files</string> |
@@ -265,7 +238,7 @@ | |||
265 | </property> | 238 | </property> |
266 | </widget> | 239 | </widget> |
267 | </item> | 240 | </item> |
268 | <item row="1" column="1"> | 241 | <item row="0" column="1"> |
269 | <widget class="QLabel" name="labelCreateVoice"> | 242 | <widget class="QLabel" name="labelCreateVoice"> |
270 | <property name="text"> | 243 | <property name="text"> |
271 | <string><b>Create Voice file</b><br/>Voice files are needed to make Rockbox speak the user interface. Speaking is enabled by default, so | 244 | <string><b>Create Voice file</b><br/>Voice files are needed to make Rockbox speak the user interface. Speaking is enabled by default, so |
@@ -436,7 +409,6 @@ | |||
436 | <property name="title"> | 409 | <property name="title"> |
437 | <string>&Accessibility</string> | 410 | <string>&Accessibility</string> |
438 | </property> | 411 | </property> |
439 | <addaction name="actionInstall_Voice_File"/> | ||
440 | <addaction name="actionCreate_Voice_File"/> | 412 | <addaction name="actionCreate_Voice_File"/> |
441 | <addaction name="actionCreate_Talk_Files"/> | 413 | <addaction name="actionCreate_Talk_Files"/> |
442 | </widget> | 414 | </widget> |
@@ -656,7 +628,6 @@ | |||
656 | <tabstop>buttonChangeDevice</tabstop> | 628 | <tabstop>buttonChangeDevice</tabstop> |
657 | <tabstop>buttonRemoveBootloader</tabstop> | 629 | <tabstop>buttonRemoveBootloader</tabstop> |
658 | <tabstop>buttonRemoveRockbox</tabstop> | 630 | <tabstop>buttonRemoveRockbox</tabstop> |
659 | <tabstop>buttonVoice</tabstop> | ||
660 | <tabstop>buttonCreateVoice</tabstop> | 631 | <tabstop>buttonCreateVoice</tabstop> |
661 | <tabstop>buttonTalk</tabstop> | 632 | <tabstop>buttonTalk</tabstop> |
662 | </tabstops> | 633 | </tabstops> |