1
0
Fork 0
forked from len0rd/rockbox

Distinguish between release and current build when installing fonts.

As with the voice file installation changed in r26637 the same issue exists for
fonts.  While the fonts package rarely changes and therefore this shouldn't
have had a negative impact in the past use the correct font package anyway.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26667 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Dominik Riebeling 2010-06-07 17:04:02 +00:00
parent 3f5e61e094
commit 18b350c972
4 changed files with 37 additions and 8 deletions

View file

@ -37,7 +37,8 @@ const static struct {
{ SystemInfo::BleedingUrl, "bleeding_url", "" },
{ SystemInfo::BootloaderUrl, "bootloader_url", "" },
{ SystemInfo::BootloaderInfoUrl, "bootloader_info_url", "" },
{ SystemInfo::FontUrl, "font_url", "" },
{ SystemInfo::ReleaseFontUrl, "release_font_url", "" },
{ SystemInfo::DailyFontUrl, "daily_font_url", "" },
{ SystemInfo::DailyVoiceUrl, "daily_voice_url", "" },
{ SystemInfo::ReleaseVoiceUrl, "release_voice_url", "" },
{ SystemInfo::DoomUrl, "doom_url", "" },

View file

@ -41,12 +41,13 @@ class SystemInfo : public QObject
BleedingUrl,
BootloaderUrl,
BootloaderInfoUrl,
FontUrl,
DailyUrl,
DailyFontUrl,
DailyVoiceUrl,
DoomUrl,
ReleaseUrl,
ReleaseVoiceUrl,
DailyUrl,
ReleaseFontUrl,
ServerConfUrl,
GenlangUrl,
ThemesUrl,

View file

@ -20,7 +20,10 @@ themes_info_url=http://themes.rockbox.org/rbutilqt.php?target=%TARGET%&release=%
; server information
server_conf_url=http://download.rockbox.org/daily/build-info
bleeding_info=http://build.rockbox.org/cvsmod/build-info
font_url=http://download.rockbox.org/daily/fonts/rockbox-fonts.zip
; fonts
release_font_url=http://download.rockbox.org/release/%RELEASEVER%/rockbox-fonts-%RELEASEVER%.zip
daily_font_url=http://download.rockbox.org/daily/fonts/rockbox-fonts.zip
; other
manual_url=http://download.rockbox.org/daily/manual

View file

@ -798,6 +798,15 @@ void RbUtilQt::installBootloaderPost(bool error)
void RbUtilQt::installFontsBtn()
{
if(chkConfig(true)) return;
QString mountpoint = RbSettings::value(RbSettings::Mountpoint).toString();
RockboxInfo installInfo(mountpoint);
if(installInfo.revision().isEmpty() && installInfo.release().isEmpty()) {
QMessageBox::critical(this, tr("No Rockbox installation found"),
tr("Could not determine the installed Rockbox version. "
"Please install a Rockbox build before installing "
"fonts."));
return;
}
if(QMessageBox::question(this, tr("Confirm Installation"),
tr("Do you really want to install the fonts package?"),
QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) return;
@ -816,13 +825,28 @@ bool RbUtilQt::installFontsAuto()
void RbUtilQt::installFonts()
{
QString mountpoint = RbSettings::value(RbSettings::Mountpoint).toString();
RockboxInfo installInfo(mountpoint);
QString fontsurl;
QString logversion;
QString relversion = installInfo.release();
if(relversion.isEmpty()) {
// release is empty for non-release versions (i.e. daily / current)
fontsurl = SystemInfo::value(SystemInfo::DailyFontUrl).toString();
logversion = installInfo.revision();
}
else {
fontsurl = SystemInfo::value(SystemInfo::ReleaseFontUrl).toString();
logversion = installInfo.release();
}
fontsurl.replace("%RELEASEVER%", relversion);
// create zip installer
installer = new ZipInstaller(this);
installer->setUrl(SystemInfo::value(SystemInfo::FontUrl).toString());
installer->setUrl(fontsurl);
installer->setLogSection("Fonts");
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);