summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/rbutilqt.cpp
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2010-06-06 18:02:08 +0000
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2010-06-06 18:02:08 +0000
commit56fea4f74d815dea21486848227d59b08719afdb (patch)
treef52f35c39fb5ca0392eb82a19720f38fa7c2f340 /rbutil/rbutilqt/rbutilqt.cpp
parentb2998ef6c7627be0b9cec4acada381eb78779895 (diff)
downloadrockbox-56fea4f74d815dea21486848227d59b08719afdb.tar.gz
rockbox-56fea4f74d815dea21486848227d59b08719afdb.tar.bz2
rockbox-56fea4f74d815dea21486848227d59b08719afdb.zip
Distinguish between release and current build when installing voice files.
Check the installed Rockbox and install release voice file if a release is found. Fixes wrong voice file getting installed for releases, which especially showed up with the recent lang file cleanup. This is likely to be the cause for FS#11362. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26637 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/rbutilqt/rbutilqt.cpp')
-rw-r--r--rbutil/rbutilqt/rbutilqt.cpp47
1 files changed, 37 insertions, 10 deletions
diff --git a/rbutil/rbutilqt/rbutilqt.cpp b/rbutil/rbutilqt/rbutilqt.cpp
index 66e41944f1..0cf1cbab93 100644
--- a/rbutil/rbutilqt/rbutilqt.cpp
+++ b/rbutil/rbutilqt/rbutilqt.cpp
@@ -847,26 +847,53 @@ void RbUtilQt::installVoice()
return;
}
+ QString mountpoint = RbSettings::value(RbSettings::Mountpoint).toString();
+ RockboxInfo installInfo(mountpoint);
+
+ QString voiceurl;
+ QString logversion;
+ QString relversion = installInfo.release();
+ // if no version is found abort.
+ if(installInfo.revision().isEmpty() && relversion.isEmpty()) {
+ QMessageBox::critical(this, tr("No Rockbox installation found"),
+ tr("Could not determine the installed Rockbox version. "
+ "Please install a Rockbox build before installing "
+ "voice files."));
+ return;
+ }
+ if(relversion.isEmpty()) {
+ // release is empty for non-release versions (i.e. daily / current)
+ voiceurl = SystemInfo::value(SystemInfo::VoiceUrl).toString();
+ logversion = installInfo.revision();
+ }
+ else {
+ voiceurl = SystemInfo::value(SystemInfo::ReleaseVoiceUrl).toString();
+ logversion = installInfo.release();
+ }
if(QMessageBox::question(this, tr("Confirm Installation"),
tr("Do you really want to install the voice file?"),
- QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) return;
+ QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes)
+ return;
+
+ QDate date = QDate::fromString(ServerInfo::value(ServerInfo::DailyDate).toString(),Qt::ISODate);
+ QString model = SystemInfo::value(SystemInfo::CurBuildserverModel).toString();
+ // replace placeholder in voice url
+ voiceurl.replace("%DATE%", date.toString("yyyyMMdd"));
+ voiceurl.replace("%MODEL%", model);
+ voiceurl.replace("%RELVERSION%", relversion);
+
+ qDebug() << "[RbUtil] voicefile URL:" << voiceurl;
+
// create logger
logger = new ProgressLoggerGui(this);
logger->show();
-
// create zip installer
installer = new ZipInstaller(this);
- QString voiceurl = SystemInfo::value(SystemInfo::VoiceUrl).toString();
- QDate date = QDate::fromString(ServerInfo::value(ServerInfo::DailyDate).toString(),Qt::ISODate);
- voiceurl += SystemInfo::value(SystemInfo::CurBuildserverModel).toString() + "-" +
- date.toString("yyyyMMdd") + "-english.zip";
- qDebug() << "[RbUtil] voicefile URL:" << voiceurl;
-
installer->setUrl(voiceurl);
installer->setLogSection("Voice");
- installer->setLogVersion(ServerInfo::value(ServerInfo::DailyDate).toString());
- installer->setMountPoint(RbSettings::value(RbSettings::Mountpoint).toString());
+ installer->setLogVersion(logversion);
+ installer->setMountPoint(mountpoint);
if(!RbSettings::value(RbSettings::CacheDisabled).toBool())
installer->setCache(true);
connect(installer, SIGNAL(logItem(QString, int)), logger, SLOT(addItem(QString, int)));