summaryrefslogtreecommitdiffstats
path: root/rbutil
diff options
context:
space:
mode:
Diffstat (limited to 'rbutil')
-rw-r--r--rbutil/rbutilqt/base/systeminfo.cpp1
-rw-r--r--rbutil/rbutilqt/base/systeminfo.h1
-rw-r--r--rbutil/rbutilqt/rbutil.ini6
-rw-r--r--rbutil/rbutilqt/rbutilqt.cpp47
4 files changed, 43 insertions, 12 deletions
diff --git a/rbutil/rbutilqt/base/systeminfo.cpp b/rbutil/rbutilqt/base/systeminfo.cpp
index 7c3114a591..98d865f814 100644
--- a/rbutil/rbutilqt/base/systeminfo.cpp
+++ b/rbutil/rbutilqt/base/systeminfo.cpp
@@ -39,6 +39,7 @@ const static struct {
{ SystemInfo::BootloaderInfoUrl, "bootloader_info_url", "" },
{ SystemInfo::FontUrl, "font_url", "" },
{ SystemInfo::VoiceUrl, "voice_url", "" },
+ { SystemInfo::ReleaseVoiceUrl, "release_voice_url", "" },
{ SystemInfo::DoomUrl, "doom_url", "" },
{ SystemInfo::ReleaseUrl, "release_url", "" },
{ SystemInfo::DailyUrl, "daily_url", "" },
diff --git a/rbutil/rbutilqt/base/systeminfo.h b/rbutil/rbutilqt/base/systeminfo.h
index f79f34d5be..78fd881d22 100644
--- a/rbutil/rbutilqt/base/systeminfo.h
+++ b/rbutil/rbutilqt/base/systeminfo.h
@@ -45,6 +45,7 @@ class SystemInfo : public QObject
VoiceUrl,
DoomUrl,
ReleaseUrl,
+ ReleaseVoiceUrl,
DailyUrl,
ServerConfUrl,
GenlangUrl,
diff --git a/rbutil/rbutilqt/rbutil.ini b/rbutil/rbutilqt/rbutil.ini
index 9e9c872fdd..1f0d97db5c 100644
--- a/rbutil/rbutilqt/rbutil.ini
+++ b/rbutil/rbutilqt/rbutil.ini
@@ -1,18 +1,20 @@
[general]
+; release downloads
release_url=http://download.rockbox.org/release/%RELVERSION%/rockbox-%MODEL%-%RELVERSION%.zip
+release_voice_url=http://download.rockbox.org/release/%RELVERSION%/%MODEL%-%RELVERSION%-english.zip
+
daily_url=http://download.rockbox.org/daily/%MODEL%/rockbox-%MODEL%.zip
bleeding_url=http://build.rockbox.org/data/rockbox-%MODEL%.zip
server_conf_url=http://download.rockbox.org/daily/build-info
bootloader_info_url=http://download.rockbox.org/bootloader/bootloaders-info
bleeding_info=http://build.rockbox.org/cvsmod/build-info
font_url=http://download.rockbox.org/daily/fonts/rockbox-fonts.zip
-prog_name=rockbox
bootloader_url=http://download.rockbox.org/bootloader
themes_url=http://themes.rockbox.org/
themes_info_url=http://themes.rockbox.org/rbutilqt.php?target=%TARGET%&release=%RELEASE%&revision=%REVISION%&rbutilver=%RBUTILVER%
manual_url=http://download.rockbox.org/daily/manual
doom_url=http://download.rockbox.org/useful/rockdoom.zip
-voice_url=http://download.rockbox.org/daily/voices/
+voice_url=http://download.rockbox.org/daily/voices/%MODEL%-%DATE%-english.zip
genlang_url=http://www.rockbox.org/genlang/
rbutil_url=http://download.rockbox.org/rbutil/
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)));