1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Dominik Riebeling 2010-06-06 18:02:08 +00:00
parent b2998ef6c7
commit 56fea4f74d
4 changed files with 43 additions and 12 deletions

View file

@ -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", "" },

View file

@ -45,6 +45,7 @@ class SystemInfo : public QObject
VoiceUrl,
DoomUrl,
ReleaseUrl,
ReleaseVoiceUrl,
DailyUrl,
ServerConfUrl,
GenlangUrl,

View file

@ -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/

View file

@ -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)));