summaryrefslogtreecommitdiff
path: root/rbutil/rbutilqt/rbutilqt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'rbutil/rbutilqt/rbutilqt.cpp')
-rw-r--r--rbutil/rbutilqt/rbutilqt.cpp76
1 files changed, 0 insertions, 76 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
441void 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
516void RbUtilQt::createTalkFiles(void) 440void RbUtilQt::createTalkFiles(void)
517{ 441{