rbutil: Rework player configuration.
- Split internal configuration into player specific and common parts. Always require passing the player for player specific data instead of implicitly assuming the currently selected one; only use the currently selected one if the player name is explicitly passed as empty. - Similarly adjust handling of server info data; prepare for splitting into build type specific values so the naming becomes cleaner. Change-Id: I894e694f83bd9fe2d22ad46b3f8f7df3e2c68033
This commit is contained in:
parent
440083af87
commit
2509def164
14 changed files with 107 additions and 114 deletions
|
@ -108,7 +108,7 @@ void Autodetection::detectUsb()
|
|||
LOG_WARNING() << "[USB] detected problem with player" << d.device;
|
||||
}
|
||||
QString idstring = QString("%1").arg(attached.at(i), 8, 16, QChar('0'));
|
||||
if(!SystemInfo::platformValue(idstring, SystemInfo::CurName).toString().isEmpty()) {
|
||||
if(!SystemInfo::platformValue(SystemInfo::CurName, idstring).toString().isEmpty()) {
|
||||
struct Detected d;
|
||||
d.status = PlayerIncompatible;
|
||||
d.device = idstring;
|
||||
|
|
|
@ -408,7 +408,7 @@ BootloaderInstallBase::BootloaderType BootloaderInstallS5l::installed(void)
|
|||
QString logfile = RbSettings::value(RbSettings::Mountpoint).toString()
|
||||
+ "/.rockbox/rbutil.log";
|
||||
QSettings s(logfile, QSettings::IniFormat, this);
|
||||
QString section = SystemInfo::value(
|
||||
QString section = SystemInfo::platformValue(
|
||||
SystemInfo::CurBootloaderName).toString().section('/', -1);
|
||||
rbblInstalled = s.contains("Bootloader/" + section);
|
||||
|
||||
|
|
|
@ -194,7 +194,7 @@ QString RbSettings::constructSettingPath(QString path, QString substitute)
|
|||
}
|
||||
else {
|
||||
path.replace(":tts:", userSettings->value("tts").toString());
|
||||
path.replace(":encoder:", SystemInfo::platformValue(platform,SystemInfo::CurEncoder).toString());
|
||||
path.replace(":encoder:", SystemInfo::platformValue(SystemInfo::CurEncoder, platform).toString());
|
||||
}
|
||||
path.replace(":platform:", platform);
|
||||
}
|
||||
|
|
|
@ -51,9 +51,9 @@ void ServerInfo::readBuildInfo(QString file)
|
|||
QSettings info(file, QSettings::IniFormat);
|
||||
|
||||
QString developmentRevision = info.value("bleeding/rev").toString();
|
||||
setValue(ServerInfo::BleedingRevision, developmentRevision);
|
||||
setPlatformValue(ServerInfo::BleedingRevision, "", developmentRevision);
|
||||
QDateTime date = QDateTime::fromString(info.value("bleeding/timestamp").toString(), "yyyyMMddThhmmssZ");
|
||||
setValue(ServerInfo::BleedingDate, date.toString(Qt::ISODate));
|
||||
setPlatformValue(ServerInfo::BleedingDate, "", date.toString(Qt::ISODate));
|
||||
|
||||
info.beginGroup("release");
|
||||
QStringList releasekeys = info.allKeys();
|
||||
|
@ -135,10 +135,10 @@ void ServerInfo::readBuildInfo(QString file)
|
|||
QString manualHtmlUrl = manualBaseUrl;
|
||||
QString manualZipUrl = manualBaseUrl;
|
||||
|
||||
QString buildservermodel = SystemInfo::platformValue(platforms.at(i),
|
||||
SystemInfo::CurBuildserverModel).toString();
|
||||
QString modelman = SystemInfo::platformValue(platforms.at(i),
|
||||
SystemInfo::CurManual).toString();
|
||||
QString buildservermodel = SystemInfo::platformValue(
|
||||
SystemInfo::CurBuildserverModel, platforms.at(i)).toString();
|
||||
QString modelman = SystemInfo::platformValue(
|
||||
SystemInfo::CurManual, platforms.at(i)).toString();
|
||||
QString manualBaseName = "rockbox-";
|
||||
|
||||
if(modelman.isEmpty()) manualBaseName += buildservermodel;
|
||||
|
@ -153,45 +153,26 @@ void ServerInfo::readBuildInfo(QString file)
|
|||
|
||||
// set variants (if any)
|
||||
for(int j = 0; j < variants.size(); ++j) {
|
||||
setPlatformValue(variants.at(j), ServerInfo::CurStatus, status);
|
||||
setPlatformValue(ServerInfo::CurStatus, variants.at(j), status);
|
||||
if(!releaseUrl.isEmpty()) {
|
||||
setPlatformValue(variants.at(j), ServerInfo::CurReleaseVersion, releaseVersion);
|
||||
setPlatformValue(variants.at(j), ServerInfo::CurReleaseUrl, releaseUrl);
|
||||
setPlatformValue(ServerInfo::CurReleaseVersion, variants.at(j), releaseVersion);
|
||||
setPlatformValue(ServerInfo::CurReleaseUrl, variants.at(j), releaseUrl);
|
||||
}
|
||||
if(!relCandidateUrl.isEmpty()) {
|
||||
setPlatformValue(variants.at(j), ServerInfo::RelCandidateVersion, relCandidateVersion);
|
||||
setPlatformValue(variants.at(j), ServerInfo::RelCandidateUrl, relCandidateUrl);
|
||||
setPlatformValue(ServerInfo::RelCandidateVersion, variants.at(j), relCandidateVersion);
|
||||
setPlatformValue(ServerInfo::RelCandidateUrl, variants.at(j), relCandidateUrl);
|
||||
}
|
||||
setPlatformValue(variants.at(j), ServerInfo::CurDevelUrl, develUrl);
|
||||
setPlatformValue(ServerInfo::CurDevelUrl, variants.at(j), develUrl);
|
||||
|
||||
setPlatformValue(variants.at(j), ServerInfo::ManualPdfUrl, manualPdfUrl);
|
||||
setPlatformValue(variants.at(j), ServerInfo::ManualHtmlUrl, manualHtmlUrl);
|
||||
setPlatformValue(variants.at(j), ServerInfo::ManualZipUrl, manualZipUrl);
|
||||
setPlatformValue(ServerInfo::ManualPdfUrl, variants.at(j), manualPdfUrl);
|
||||
setPlatformValue(ServerInfo::ManualHtmlUrl, variants.at(j), manualHtmlUrl);
|
||||
setPlatformValue(ServerInfo::ManualZipUrl, variants.at(j), manualZipUrl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
QVariant ServerInfo::value(enum ServerInfos info)
|
||||
{
|
||||
// locate info item
|
||||
int i = 0;
|
||||
while(ServerInfoList[i].info != info)
|
||||
i++;
|
||||
|
||||
QString s = ServerInfoList[i].name;
|
||||
s.replace(":platform:", RbSettings::value(RbSettings::CurrentPlatform).toString());
|
||||
LOG_INFO() << "GET:" << s << serverInfos.value(s, ServerInfoList[i].def).toString();
|
||||
return serverInfos.value(s, ServerInfoList[i].def);
|
||||
}
|
||||
|
||||
void ServerInfo::setValue(enum ServerInfos setting, QVariant value)
|
||||
{
|
||||
QString empty;
|
||||
return setPlatformValue(empty, setting, value);
|
||||
}
|
||||
|
||||
void ServerInfo::setPlatformValue(QString platform, enum ServerInfos info, QVariant value)
|
||||
void ServerInfo::setPlatformValue(enum ServerInfos info, QString platform, QVariant value)
|
||||
{
|
||||
// locate setting item
|
||||
int i = 0;
|
||||
|
@ -204,13 +185,16 @@ void ServerInfo::setPlatformValue(QString platform, enum ServerInfos info, QVari
|
|||
LOG_INFO() << "SET:" << s << serverInfos.value(s).toString();
|
||||
}
|
||||
|
||||
QVariant ServerInfo::platformValue(QString platform, enum ServerInfos info)
|
||||
QVariant ServerInfo::platformValue(enum ServerInfos info, QString platform)
|
||||
{
|
||||
// locate setting item
|
||||
int i = 0;
|
||||
while(ServerInfoList[i].info != info)
|
||||
i++;
|
||||
|
||||
if(platform.isEmpty())
|
||||
platform = RbSettings::value(RbSettings::CurrentPlatform).toString();
|
||||
|
||||
QString s = ServerInfoList[i].name;
|
||||
s.replace(":platform:", platform);
|
||||
QString d = ServerInfoList[i].def;
|
||||
|
|
|
@ -45,16 +45,14 @@ class ServerInfo : public QObject
|
|||
|
||||
//! read in buildinfo file
|
||||
static void readBuildInfo(QString file);
|
||||
//! get a value from server info
|
||||
static QVariant value(enum ServerInfos setting);
|
||||
//! get a value from server info for a named platform.
|
||||
static QVariant platformValue(QString platform, enum ServerInfos setting);
|
||||
static QVariant platformValue(enum ServerInfos setting, QString platform = "");
|
||||
|
||||
private:
|
||||
//! set a server info value
|
||||
static void setValue(enum ServerInfos setting, QVariant value);
|
||||
//! set a value for a server info for a named platform.
|
||||
static void setPlatformValue(QString platform, enum ServerInfos setting, QVariant value);
|
||||
static void setPlatformValue(enum ServerInfos setting, QString platform, QVariant value);
|
||||
//! you shouldnt call this, its a fully static class
|
||||
ServerInfo() {}
|
||||
|
||||
|
|
|
@ -49,6 +49,13 @@ const static struct {
|
|||
{ SystemInfo::ThemesUrl, "themes_url", "" },
|
||||
{ SystemInfo::ThemesInfoUrl, "themes_info_url", "" },
|
||||
{ SystemInfo::RbutilUrl, "rbutil_url", "" },
|
||||
};
|
||||
|
||||
const static struct {
|
||||
SystemInfo::PlatformInfo info;
|
||||
const char* name;
|
||||
const char* def;
|
||||
} PlatformInfosList[] = {
|
||||
{ SystemInfo::CurPlatformName, ":platform:/name", "" },
|
||||
{ SystemInfo::CurManual, ":platform:/manualname","rockbox-:platform:" },
|
||||
{ SystemInfo::CurBootloaderMethod, ":platform:/bootloadermethod", "none" },
|
||||
|
@ -85,27 +92,27 @@ QVariant SystemInfo::value(enum SystemInfos info)
|
|||
int i = 0;
|
||||
while(SystemInfosList[i].info != info)
|
||||
i++;
|
||||
QString platform = RbSettings::value(RbSettings::CurrentPlatform).toString();
|
||||
QString s = SystemInfosList[i].name;
|
||||
s.replace(":platform:", platform);
|
||||
QString d = SystemInfosList[i].def;
|
||||
d.replace(":platform:", platform);
|
||||
LOG_INFO() << "GET:" << s << systemInfos->value(s, d).toString();
|
||||
return systemInfos->value(s, d);
|
||||
}
|
||||
|
||||
QVariant SystemInfo::platformValue(QString platform, enum SystemInfos info)
|
||||
QVariant SystemInfo::platformValue(enum PlatformInfo info, QString platform)
|
||||
{
|
||||
ensureSystemInfoExists();
|
||||
|
||||
// locate setting item
|
||||
int i = 0;
|
||||
while(SystemInfosList[i].info != info)
|
||||
while(PlatformInfosList[i].info != info)
|
||||
i++;
|
||||
|
||||
QString s = SystemInfosList[i].name;
|
||||
if (platform.isEmpty())
|
||||
platform = RbSettings::value(RbSettings::CurrentPlatform).toString();
|
||||
|
||||
QString s = PlatformInfosList[i].name;
|
||||
s.replace(":platform:", platform);
|
||||
QString d = SystemInfosList[i].def;
|
||||
QString d = PlatformInfosList[i].def;
|
||||
d.replace(":platform:", platform);
|
||||
LOG_INFO() << "GET P:" << s << systemInfos->value(s, d).toString();
|
||||
return systemInfos->value(s, d);
|
||||
|
|
|
@ -57,6 +57,9 @@ class SystemInfo : public QObject
|
|||
ThemesUrl,
|
||||
ThemesInfoUrl,
|
||||
RbutilUrl,
|
||||
};
|
||||
|
||||
enum PlatformInfo {
|
||||
CurPlatformName,
|
||||
CurManual,
|
||||
CurBootloaderMethod,
|
||||
|
@ -90,7 +93,7 @@ class SystemInfo : public QObject
|
|||
//! get a value from system settings
|
||||
static QVariant value(enum SystemInfos info);
|
||||
//! get a value from system settings for a named platform.
|
||||
static QVariant platformValue(QString platform, enum SystemInfos info);
|
||||
static QVariant platformValue(enum PlatformInfo info, QString platform = "");
|
||||
|
||||
private:
|
||||
//! you shouldnt call this, its a fully static calls
|
||||
|
|
|
@ -56,7 +56,8 @@ TalkGenerator::Status TalkGenerator::process(QList<TalkEntry>* list,int wavtrimt
|
|||
|
||||
// Encoder
|
||||
emit logItem(tr("Starting Encoder Engine"),LOGINFO);
|
||||
m_enc = EncoderBase::getEncoder(this,SystemInfo::value(SystemInfo::CurEncoder).toString());
|
||||
m_enc = EncoderBase::getEncoder(
|
||||
this, SystemInfo::platformValue(SystemInfo::CurEncoder).toString());
|
||||
if(!m_enc->start())
|
||||
{
|
||||
emit logItem(tr("Init of Encoder engine failed"),LOGERROR);
|
||||
|
|
|
@ -381,12 +381,12 @@ QString Utils::checkEnvironment(bool permission)
|
|||
RockboxInfo rbinfo(RbSettings::value(RbSettings::Mountpoint).toString());
|
||||
QString installed = rbinfo.target();
|
||||
if(!installed.isEmpty() && installed !=
|
||||
SystemInfo::value(SystemInfo::CurConfigureModel).toString())
|
||||
SystemInfo::platformValue(SystemInfo::CurConfigureModel).toString())
|
||||
{
|
||||
text += tr("<li>Target mismatch detected.<br/>"
|
||||
"Installed target: %1<br/>Selected target: %2.</li>")
|
||||
.arg(SystemInfo::platformValue(installed, SystemInfo::CurPlatformName).toString(),
|
||||
SystemInfo::value(SystemInfo::CurPlatformName).toString());
|
||||
.arg(SystemInfo::platformValue(SystemInfo::CurPlatformName, installed).toString(),
|
||||
SystemInfo::platformValue(SystemInfo::CurPlatformName).toString());
|
||||
}
|
||||
|
||||
if(!text.isEmpty())
|
||||
|
|
|
@ -355,8 +355,8 @@ void Config::setDevices()
|
|||
QMultiMap <QString, QString> manuf;
|
||||
for(int it = 0; it < platformList.size(); it++)
|
||||
{
|
||||
QString curbrand = SystemInfo::platformValue(platformList.at(it),
|
||||
SystemInfo::CurBrand).toString();
|
||||
QString curbrand = SystemInfo::platformValue(
|
||||
SystemInfo::CurBrand, platformList.at(it)).toString();
|
||||
manuf.insert(curbrand, platformList.at(it));
|
||||
}
|
||||
|
||||
|
@ -384,10 +384,10 @@ void Config::setDevices()
|
|||
if(!manuf.values(brands.at(c)).contains(platformList.at(it)))
|
||||
continue;
|
||||
// construct display name
|
||||
QString curname = SystemInfo::platformValue(platformList.at(it),
|
||||
SystemInfo::CurName).toString() +
|
||||
" (" +ServerInfo::platformValue(platformList.at(it),
|
||||
ServerInfo::CurStatus).toString() +")";
|
||||
QString curname = SystemInfo::platformValue(
|
||||
SystemInfo::CurName, platformList.at(it)).toString() +
|
||||
" (" +ServerInfo::platformValue(
|
||||
ServerInfo::CurStatus, platformList.at(it)).toString() +")";
|
||||
LOG_INFO() << "add supported device:" << brands.at(c) << curname;
|
||||
w2 = new QTreeWidgetItem(w, QStringList(curname));
|
||||
w2->setData(0, Qt::UserRole, platformList.at(it));
|
||||
|
@ -471,10 +471,10 @@ void Config::updateEncState()
|
|||
return;
|
||||
|
||||
QString devname = ui.treeDevices->selectedItems().at(0)->data(0, Qt::UserRole).toString();
|
||||
QString encoder = SystemInfo::platformValue(devname,
|
||||
SystemInfo::CurEncoder).toString();
|
||||
ui.encoderName->setText(EncoderBase::getEncoderName(SystemInfo::platformValue(devname,
|
||||
SystemInfo::CurEncoder).toString()));
|
||||
QString encoder = SystemInfo::platformValue(
|
||||
SystemInfo::CurEncoder, devname).toString();
|
||||
ui.encoderName->setText(EncoderBase::getEncoderName(SystemInfo::platformValue(
|
||||
SystemInfo::CurEncoder, devname).toString()));
|
||||
|
||||
EncoderBase* enc = EncoderBase::getEncoder(this,encoder);
|
||||
|
||||
|
@ -742,8 +742,8 @@ void Config::autodetect()
|
|||
mp = tr("(unknown)");
|
||||
}
|
||||
msg += QString("<li>%1</li>").arg(tr("%1 at %2").arg(
|
||||
SystemInfo::platformValue(detected.at(i).device,
|
||||
SystemInfo::CurPlatformName).toString(),
|
||||
SystemInfo::platformValue(
|
||||
SystemInfo::CurPlatformName, detected.at(i).device).toString(),
|
||||
QDir::toNativeSeparators(mp)));
|
||||
}
|
||||
msg += "</ul>";
|
||||
|
@ -768,22 +768,22 @@ void Config::autodetect()
|
|||
case Autodetection::PlayerIncompatible:
|
||||
msg += tr("Detected an unsupported player:\n%1\n"
|
||||
"Sorry, Rockbox doesn't run on your player.")
|
||||
.arg(SystemInfo::platformValue(detected.at(0).device,
|
||||
SystemInfo::CurName).toString());
|
||||
.arg(SystemInfo::platformValue(
|
||||
SystemInfo::CurName, detected.at(0).device).toString());
|
||||
break;
|
||||
case Autodetection::PlayerMtpMode:
|
||||
msg = tr("%1 in MTP mode found!\n"
|
||||
"You need to change your player to MSC mode for installation. ")
|
||||
.arg(SystemInfo::platformValue(detected.at(0).device,
|
||||
SystemInfo::CurName).toString());
|
||||
.arg(SystemInfo::platformValue(
|
||||
SystemInfo::CurName, detected.at(0).device).toString());
|
||||
break;
|
||||
case Autodetection::PlayerWrongFilesystem:
|
||||
if(SystemInfo::platformValue(detected.at(0).device,
|
||||
SystemInfo::CurBootloaderMethod) == "ipod") {
|
||||
if(SystemInfo::platformValue(
|
||||
SystemInfo::CurBootloaderMethod, detected.at(0).device) == "ipod") {
|
||||
msg = tr("%1 \"MacPod\" found!\n"
|
||||
"Rockbox needs a FAT formatted Ipod (so-called \"WinPod\") "
|
||||
"to run. ").arg(SystemInfo::platformValue(
|
||||
detected.at(0).device, SystemInfo::CurName).toString());
|
||||
SystemInfo::CurName, detected.at(0).device).toString());
|
||||
}
|
||||
else {
|
||||
msg = tr("The player contains an incompatible filesystem.\n"
|
||||
|
@ -962,10 +962,10 @@ void Config::configEnc()
|
|||
return;
|
||||
|
||||
QString devname = ui.treeDevices->selectedItems().at(0)->data(0, Qt::UserRole).toString();
|
||||
QString encoder = SystemInfo::platformValue(devname,
|
||||
SystemInfo::CurEncoder).toString();
|
||||
ui.encoderName->setText(EncoderBase::getEncoderName(SystemInfo::platformValue(devname,
|
||||
SystemInfo::CurEncoder).toString()));
|
||||
QString encoder = SystemInfo::platformValue(
|
||||
SystemInfo::CurEncoder, devname).toString();
|
||||
ui.encoderName->setText(EncoderBase::getEncoderName(SystemInfo::platformValue(
|
||||
SystemInfo::CurEncoder, devname).toString()));
|
||||
|
||||
|
||||
EncoderBase* enc = EncoderBase::getEncoder(this,encoder);
|
||||
|
|
|
@ -42,9 +42,9 @@ void ManualWidget::updateManual()
|
|||
if(!m_platform.isEmpty())
|
||||
{
|
||||
ui.labelPdfManual->setText(tr("<a href='%1'>PDF Manual</a>")
|
||||
.arg(ServerInfo::platformValue(m_platform, ServerInfo::ManualPdfUrl).toString()));
|
||||
.arg(ServerInfo::platformValue(ServerInfo::ManualPdfUrl, m_platform).toString()));
|
||||
ui.labelHtmlManual->setText(tr("<a href='%1'>HTML Manual (opens in browser)</a>")
|
||||
.arg(ServerInfo::platformValue(m_platform, ServerInfo::ManualHtmlUrl).toString()));
|
||||
.arg(ServerInfo::platformValue(ServerInfo::ManualHtmlUrl, m_platform).toString()));
|
||||
}
|
||||
else {
|
||||
ui.labelPdfManual->setText(tr("Select a device for a link to the correct manual"));
|
||||
|
@ -65,9 +65,9 @@ void ManualWidget::downloadManual(void)
|
|||
QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) {
|
||||
return;
|
||||
}
|
||||
QString manual = SystemInfo::value(SystemInfo::CurManual).toString();
|
||||
QString manual = SystemInfo::platformValue(SystemInfo::CurManual).toString();
|
||||
if(manual.isEmpty()) {
|
||||
manual = "rockbox-" + SystemInfo::value(SystemInfo::CurBuildserverModel).toString();
|
||||
manual = "rockbox-" + SystemInfo::platformValue(SystemInfo::CurBuildserverModel).toString();
|
||||
}
|
||||
|
||||
ProgressLoggerGui* logger = new ProgressLoggerGui(this);
|
||||
|
@ -78,14 +78,14 @@ void ManualWidget::downloadManual(void)
|
|||
installer->setCache(true);
|
||||
|
||||
if(ui.radioPdf->isChecked()) {
|
||||
installer->setUrl(ServerInfo::platformValue(m_platform,
|
||||
ServerInfo::ManualPdfUrl).toString());
|
||||
installer->setUrl(ServerInfo::platformValue(
|
||||
ServerInfo::ManualPdfUrl, m_platform).toString());
|
||||
installer->setLogSection("Manual (PDF)");
|
||||
installer->setTarget("/" + manual + ".pdf");
|
||||
}
|
||||
else {
|
||||
installer->setUrl(ServerInfo::platformValue(m_platform,
|
||||
ServerInfo::ManualZipUrl).toString());
|
||||
installer->setUrl(ServerInfo::platformValue(
|
||||
ServerInfo::ManualZipUrl, m_platform).toString());
|
||||
installer->setLogSection("Manual (HTML)");
|
||||
installer->setTarget("/" + manual + "-" + "-html.zip");
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ void SelectiveInstallWidget::selectedVersionChanged(int index)
|
|||
if(current == "development")
|
||||
ui.selectedDescription->setText(tr("The development version is "
|
||||
"updated on every code change. Last update was on %1").arg(
|
||||
ServerInfo::value(ServerInfo::BleedingDate).toString()));
|
||||
ServerInfo::platformValue(ServerInfo::BleedingDate).toString()));
|
||||
if(current == "rc")
|
||||
ui.selectedDescription->setText(tr("This will eventually become the "
|
||||
"next Rockbox version. Install it to help testing."));
|
||||
|
@ -81,8 +81,8 @@ void SelectiveInstallWidget::updateVersion(void)
|
|||
// get some configuration values globally
|
||||
m_mountpoint = RbSettings::value(RbSettings::Mountpoint).toString();
|
||||
m_target = RbSettings::value(RbSettings::CurrentPlatform).toString();
|
||||
m_blmethod = SystemInfo::platformValue(m_target,
|
||||
SystemInfo::CurBootloaderMethod).toString();
|
||||
m_blmethod = SystemInfo::platformValue(
|
||||
SystemInfo::CurBootloaderMethod, m_target).toString();
|
||||
|
||||
if(m_logger != NULL) {
|
||||
delete m_logger;
|
||||
|
@ -91,11 +91,11 @@ void SelectiveInstallWidget::updateVersion(void)
|
|||
|
||||
// re-populate all version items
|
||||
m_versions.clear();
|
||||
m_versions.insert("release", ServerInfo::value(ServerInfo::CurReleaseVersion).toString());
|
||||
m_versions.insert("release", ServerInfo::platformValue(ServerInfo::CurReleaseVersion).toString());
|
||||
// Don't populate RC or development selections if target has been retired.
|
||||
if (ServerInfo::value(ServerInfo::CurStatus) != tr("Stable (Retired)")) {
|
||||
m_versions.insert("development", ServerInfo::value(ServerInfo::BleedingRevision).toString());
|
||||
m_versions.insert("rc", ServerInfo::value(ServerInfo::RelCandidateVersion).toString());
|
||||
if (ServerInfo::platformValue(ServerInfo::CurStatus) != tr("Stable (Retired)")) {
|
||||
m_versions.insert("development", ServerInfo::platformValue(ServerInfo::BleedingRevision).toString());
|
||||
m_versions.insert("rc", ServerInfo::platformValue(ServerInfo::RelCandidateVersion).toString());
|
||||
}
|
||||
|
||||
ui.selectedVersion->clear();
|
||||
|
@ -237,7 +237,7 @@ void SelectiveInstallWidget::installBootloader(void)
|
|||
// create installer
|
||||
BootloaderInstallBase *bl =
|
||||
BootloaderInstallHelper::createBootloaderInstaller(this,
|
||||
SystemInfo::value(SystemInfo::CurBootloaderMethod).toString());
|
||||
SystemInfo::platformValue(SystemInfo::CurBootloaderMethod).toString());
|
||||
if(bl == NULL) {
|
||||
m_logger->addItem(tr("No install method known."), LOGERROR);
|
||||
m_logger->setFinished();
|
||||
|
@ -254,7 +254,7 @@ void SelectiveInstallWidget::installBootloader(void)
|
|||
connect(m_logger, SIGNAL(aborted()), bl, SLOT(progressAborted()));
|
||||
|
||||
// set bootloader filename. Do this now as installed() needs it.
|
||||
QStringList blfile = SystemInfo::value(SystemInfo::CurBootloaderFile).toStringList();
|
||||
QStringList blfile = SystemInfo::platformValue(SystemInfo::CurBootloaderFile).toStringList();
|
||||
QStringList blfilepath;
|
||||
for(int a = 0; a < blfile.size(); a++) {
|
||||
blfilepath.append(RbSettings::value(RbSettings::Mountpoint).toString()
|
||||
|
@ -262,7 +262,7 @@ void SelectiveInstallWidget::installBootloader(void)
|
|||
}
|
||||
bl->setBlFile(blfilepath);
|
||||
QUrl url(SystemInfo::value(SystemInfo::BootloaderUrl).toString()
|
||||
+ SystemInfo::value(SystemInfo::CurBootloaderName).toString());
|
||||
+ SystemInfo::platformValue(SystemInfo::CurBootloaderName).toString());
|
||||
bl->setBlUrl(url);
|
||||
bl->setLogfile(RbSettings::value(RbSettings::Mountpoint).toString()
|
||||
+ "/.rockbox/rbutil.log");
|
||||
|
@ -282,7 +282,7 @@ void SelectiveInstallWidget::installBootloader(void)
|
|||
else if(bl->installed() == BootloaderInstallBase::BootloaderOther
|
||||
&& bl->capabilities() & BootloaderInstallBase::Backup)
|
||||
{
|
||||
QString targetFolder = SystemInfo::value(SystemInfo::CurPlatformName).toString()
|
||||
QString targetFolder = SystemInfo::platformValue(SystemInfo::CurPlatformName).toString()
|
||||
+ " Firmware Backup";
|
||||
// remove invalid character(s)
|
||||
targetFolder.remove(QRegExp("[:/]"));
|
||||
|
@ -319,7 +319,7 @@ void SelectiveInstallWidget::installBootloader(void)
|
|||
// open dialog to browse to of file
|
||||
QString offile;
|
||||
QString filter
|
||||
= SystemInfo::value(SystemInfo::CurBootloaderFilter).toString();
|
||||
= SystemInfo::platformValue(SystemInfo::CurBootloaderFilter).toString();
|
||||
if(!filter.isEmpty()) {
|
||||
filter = tr("Bootloader files (%1)").arg(filter) + ";;";
|
||||
}
|
||||
|
@ -385,12 +385,12 @@ void SelectiveInstallWidget::installRockbox(void)
|
|||
RbSettings::setValue(RbSettings::Build, selected);
|
||||
RbSettings::sync();
|
||||
|
||||
if(selected == "release") url = ServerInfo::platformValue(m_target,
|
||||
ServerInfo::CurReleaseUrl).toString();
|
||||
else if(selected == "development") url = ServerInfo::platformValue(m_target,
|
||||
ServerInfo::CurDevelUrl).toString();
|
||||
else if(selected == "rc") url = ServerInfo::platformValue(m_target,
|
||||
ServerInfo::RelCandidateUrl).toString();
|
||||
if(selected == "release") url = ServerInfo::platformValue(
|
||||
ServerInfo::CurReleaseUrl, m_target).toString();
|
||||
else if(selected == "development") url = ServerInfo::platformValue(
|
||||
ServerInfo::CurDevelUrl, m_target).toString();
|
||||
else if(selected == "rc") url = ServerInfo::platformValue(
|
||||
ServerInfo::RelCandidateUrl, m_target).toString();
|
||||
|
||||
//! install build
|
||||
if(m_zipinstaller != NULL) m_zipinstaller->deleteLater();
|
||||
|
|
|
@ -390,11 +390,11 @@ void RbUtilQt::updateDevice()
|
|||
|
||||
/* Enable bootloader installation, if possible */
|
||||
bool bootloaderInstallable =
|
||||
SystemInfo::value(SystemInfo::CurBootloaderMethod) != "none";
|
||||
SystemInfo::platformValue(SystemInfo::CurBootloaderMethod) != "none";
|
||||
|
||||
/* Enable bootloader uninstallation, if possible */
|
||||
bool bootloaderUninstallable = bootloaderInstallable &&
|
||||
SystemInfo::value(SystemInfo::CurBootloaderMethod) != "fwpatcher";
|
||||
SystemInfo::platformValue(SystemInfo::CurBootloaderMethod) != "fwpatcher";
|
||||
ui.labelRemoveBootloader->setEnabled(bootloaderUninstallable);
|
||||
ui.buttonRemoveBootloader->setEnabled(bootloaderUninstallable);
|
||||
ui.actionRemove_bootloader->setEnabled(bootloaderUninstallable);
|
||||
|
@ -405,10 +405,10 @@ void RbUtilQt::updateDevice()
|
|||
ui.menuA_ctions->setEnabled(configurationValid);
|
||||
|
||||
// displayed device info
|
||||
QString brand = SystemInfo::value(SystemInfo::CurBrand).toString();
|
||||
QString brand = SystemInfo::platformValue(SystemInfo::CurBrand).toString();
|
||||
QString name
|
||||
= QString("%1 (%2)").arg(SystemInfo::value(SystemInfo::CurName).toString(),
|
||||
ServerInfo::value(ServerInfo::CurStatus).toString());
|
||||
= QString("%1 (%2)").arg(SystemInfo::platformValue(SystemInfo::CurName).toString(),
|
||||
ServerInfo::platformValue(ServerInfo::CurStatus).toString());
|
||||
ui.labelDevice->setText(QString("<b>%1 %2</b>").arg(brand, name));
|
||||
|
||||
QString mountpoint = RbSettings::value(RbSettings::Mountpoint).toString();
|
||||
|
@ -423,7 +423,7 @@ void RbUtilQt::updateDevice()
|
|||
}
|
||||
|
||||
QPixmap pm;
|
||||
QString m = SystemInfo::value(SystemInfo::CurPlayerPicture).toString();
|
||||
QString m = SystemInfo::platformValue(SystemInfo::CurPlayerPicture).toString();
|
||||
pm.load(":/icons/players/" + m + "-small.png");
|
||||
pm = pm.scaledToHeight(QFontMetrics(QApplication::font()).height() * 3);
|
||||
ui.labelPlayerPic->setPixmap(pm);
|
||||
|
@ -491,7 +491,7 @@ void RbUtilQt::installVoice()
|
|||
QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes)
|
||||
return;
|
||||
|
||||
QString model = SystemInfo::value(SystemInfo::CurBuildserverModel).toString();
|
||||
QString model = SystemInfo::platformValue(SystemInfo::CurBuildserverModel).toString();
|
||||
// replace placeholder in voice url
|
||||
voiceurl.replace("%MODEL%", model);
|
||||
voiceurl.replace("%RELVERSION%", relversion);
|
||||
|
@ -560,14 +560,14 @@ void RbUtilQt::uninstallBootloader(void)
|
|||
// create installer
|
||||
BootloaderInstallBase *bl
|
||||
= BootloaderInstallHelper::createBootloaderInstaller(this,
|
||||
SystemInfo::value(SystemInfo::CurBootloaderMethod).toString());
|
||||
SystemInfo::platformValue(SystemInfo::CurBootloaderMethod).toString());
|
||||
|
||||
if(bl == NULL) {
|
||||
logger->addItem(tr("No uninstall method for this target known."), LOGERROR);
|
||||
logger->setFinished();
|
||||
return;
|
||||
}
|
||||
QStringList blfile = SystemInfo::value(SystemInfo::CurBootloaderFile).toStringList();
|
||||
QStringList blfile = SystemInfo::platformValue(SystemInfo::CurBootloaderFile).toStringList();
|
||||
QStringList blfilepath;
|
||||
for(int a = 0; a < blfile.size(); a++) {
|
||||
blfilepath.append(RbSettings::value(RbSettings::Mountpoint).toString()
|
||||
|
|
|
@ -86,7 +86,7 @@ void ThemesInstallWindow::downloadInfo()
|
|||
|
||||
QString infoUrl = SystemInfo::value(SystemInfo::ThemesInfoUrl).toString();
|
||||
infoUrl.replace("%TARGET%",
|
||||
SystemInfo::value(SystemInfo::CurConfigureModel).toString());
|
||||
SystemInfo::platformValue(SystemInfo::CurConfigureModel).toString());
|
||||
infoUrl.replace("%REVISION%", installInfo.revision());
|
||||
infoUrl.replace("%RELEASE%", installInfo.release());
|
||||
infoUrl.replace("%RBUTILVER%", VERSION);
|
||||
|
|
Loading…
Reference in a new issue