mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 05:05:20 -05:00
rbutil: store the info from the server centrally in RbSetttings. Dont download build-info multiple times. Rename install.cpp
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24301 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
b5d16e79e1
commit
8363619e66
7 changed files with 195 additions and 123 deletions
|
|
@ -94,9 +94,24 @@ const static struct {
|
|||
{ RbSettings::EncoderVolume, ":encoder:/volume", "1.0" },
|
||||
};
|
||||
|
||||
// server settings
|
||||
const static struct {
|
||||
RbSettings::ServerSettings setting;
|
||||
const char* name;
|
||||
const char* def;
|
||||
} ServerSettingsList[] = {
|
||||
{ RbSettings::CurReleaseVersion, ":platform:/releaseversion", "" },
|
||||
{ RbSettings::CurStatus, ":platform:/status", "" },
|
||||
{ RbSettings::DailyRevision, "dailyrev", "" },
|
||||
{ RbSettings::DailyDate, "dailydate", "" },
|
||||
{ RbSettings::BleedingRevision, "bleedingrev", "" },
|
||||
{ RbSettings::BleedingDate, "bleedingdate", "" },
|
||||
};
|
||||
|
||||
//! pointer to setting object to NULL
|
||||
QSettings* RbSettings::systemSettings = NULL;
|
||||
QSettings* RbSettings::userSettings = NULL;
|
||||
QSettings* RbSettings::serverSettings = NULL;
|
||||
|
||||
void RbSettings::ensureRbSettingsExists()
|
||||
{
|
||||
|
|
@ -107,6 +122,12 @@ void RbSettings::ensureRbSettingsExists()
|
|||
systemSettings = new QSettings(":/ini/rbutil.ini", QSettings::IniFormat, 0);
|
||||
}
|
||||
|
||||
if(serverSettings == NULL)
|
||||
{
|
||||
serverSettings = new QSettings(QSettings::IniFormat,
|
||||
QSettings::UserScope, "rockbox.org", "RockboxUtility",NULL);
|
||||
}
|
||||
|
||||
if(userSettings == NULL)
|
||||
{
|
||||
// portable installation:
|
||||
|
|
@ -200,6 +221,20 @@ QVariant RbSettings::subValue(QString sub, enum UserSettings setting)
|
|||
return userSettings->value(s, UserSettingsList[i].def);
|
||||
}
|
||||
|
||||
QVariant RbSettings::value(enum ServerSettings setting)
|
||||
{
|
||||
ensureRbSettingsExists();
|
||||
|
||||
// locate setting item
|
||||
int i = 0;
|
||||
while(ServerSettingsList[i].setting != setting)
|
||||
i++;
|
||||
|
||||
QString s = constructSettingPath(ServerSettingsList[i].name);
|
||||
qDebug() << "[Settings] GET SERV:" << s << serverSettings->value(s, ServerSettingsList[i].def).toString();
|
||||
return serverSettings->value(s, ServerSettingsList[i].def);
|
||||
}
|
||||
|
||||
void RbSettings::setValue(enum UserSettings setting , QVariant value)
|
||||
{
|
||||
QString empty;
|
||||
|
|
@ -216,8 +251,29 @@ void RbSettings::setSubValue(QString sub, enum UserSettings setting, QVariant va
|
|||
i++;
|
||||
|
||||
QString s = constructSettingPath(UserSettingsList[i].name, sub);
|
||||
qDebug() << "[Settings] SET U:" << s << userSettings->value(s).toString();
|
||||
userSettings->setValue(s, value);
|
||||
qDebug() << "[Settings] SET U:" << s << userSettings->value(s).toString();
|
||||
}
|
||||
|
||||
void RbSettings::setValue(enum ServerSettings setting, QVariant value)
|
||||
{
|
||||
QString empty;
|
||||
return setPlatformValue(empty, setting, value);
|
||||
}
|
||||
|
||||
void RbSettings::setPlatformValue(QString platform, enum ServerSettings setting, QVariant value)
|
||||
{
|
||||
ensureRbSettingsExists();
|
||||
|
||||
// locate setting item
|
||||
int i = 0;
|
||||
while(ServerSettingsList[i].setting != setting)
|
||||
i++;
|
||||
|
||||
QString s = ServerSettingsList[i].name;
|
||||
s.replace(":platform:", platform);
|
||||
serverSettings->setValue(s, value);
|
||||
qDebug() << "[Settings] SET SERV:" << s << serverSettings->value(s).toString();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -97,6 +97,16 @@ class RbSettings : public QObject
|
|||
CurConfigureModel,
|
||||
};
|
||||
|
||||
//! All Server settings
|
||||
enum ServerSettings {
|
||||
CurReleaseVersion,
|
||||
CurStatus,
|
||||
DailyRevision,
|
||||
DailyDate,
|
||||
BleedingRevision,
|
||||
BleedingDate,
|
||||
};
|
||||
|
||||
//! call this to flush the user Settings
|
||||
static void sync();
|
||||
//! returns the filename of the usersettings file
|
||||
|
|
@ -115,12 +125,18 @@ class RbSettings : public QObject
|
|||
static QVariant value(enum SystemSettings setting);
|
||||
//! get a value from user settings
|
||||
static QVariant value(enum UserSettings setting);
|
||||
//! get a value from server settings
|
||||
static QVariant value(enum ServerSettings setting);
|
||||
//! set a user setting value
|
||||
static void setValue(enum UserSettings setting , QVariant value);
|
||||
//! set a server setting value
|
||||
static void setValue(enum ServerSettings setting , QVariant value);
|
||||
//! get a user setting from a subvalue (ie for encoders and tts engines)
|
||||
static QVariant subValue(QString sub, enum UserSettings setting);
|
||||
//! set a user setting from a subvalue (ie for encoders and tts engines)
|
||||
static void setSubValue(QString sub, enum UserSettings setting, QVariant value);
|
||||
//! set a value for a server settings for a named platform.
|
||||
static void setPlatformValue(QString platform, enum ServerSettings setting, QVariant value);
|
||||
//! get a value from system settings for a named platform.
|
||||
static QVariant platformValue(QString platform, enum SystemSettings setting);
|
||||
|
||||
|
|
@ -135,6 +151,7 @@ class RbSettings : public QObject
|
|||
//! pointers to our setting objects
|
||||
static QSettings *systemSettings;
|
||||
static QSettings *userSettings;
|
||||
static QSettings *serverSettings;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -17,14 +17,14 @@
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
#include "install.h"
|
||||
#include "installwindow.h"
|
||||
#include "ui_installfrm.h"
|
||||
#include "rbzip.h"
|
||||
#include "system.h"
|
||||
#include "rbsettings.h"
|
||||
#include "utils.h"
|
||||
|
||||
Install::Install(QWidget *parent) : QDialog(parent)
|
||||
InstallWindow::InstallWindow(QWidget *parent) : QDialog(parent)
|
||||
{
|
||||
ui.setupUi(this);
|
||||
|
||||
|
|
@ -52,10 +52,45 @@ Install::Install(QWidget *parent) : QDialog(parent)
|
|||
ui.Backupgroup->hide();
|
||||
}
|
||||
backupCheckboxChanged(Qt::Unchecked);
|
||||
|
||||
|
||||
if(RbSettings::value(RbSettings::DailyRevision).toString().isEmpty()) {
|
||||
ui.radioArchived->setEnabled(false);
|
||||
qDebug() << "[Install] no information about archived version available!";
|
||||
}
|
||||
if(RbSettings::value(RbSettings::CurReleaseVersion).toString().isEmpty()) {
|
||||
ui.radioStable->setEnabled(false);
|
||||
}
|
||||
|
||||
// try to use the old selection first. If no selection has been made
|
||||
// in the past, use a preselection based on released status.
|
||||
if(RbSettings::value(RbSettings::Build).toString() == "stable"
|
||||
&& !RbSettings::value(RbSettings::CurReleaseVersion).toString().isEmpty())
|
||||
ui.radioStable->setChecked(true);
|
||||
else if(RbSettings::value(RbSettings::Build).toString() == "archived")
|
||||
ui.radioArchived->setChecked(true);
|
||||
else if(RbSettings::value(RbSettings::Build).toString() == "current")
|
||||
ui.radioCurrent->setChecked(true);
|
||||
else if(!RbSettings::value(RbSettings::CurReleaseVersion).toString().isEmpty()) {
|
||||
ui.radioStable->setChecked(true);
|
||||
ui.radioStable->setEnabled(true);
|
||||
QFont font;
|
||||
font.setBold(true);
|
||||
ui.radioStable->setFont(font);
|
||||
}
|
||||
else {
|
||||
ui.radioCurrent->setChecked(true);
|
||||
ui.radioStable->setEnabled(false);
|
||||
ui.radioStable->setChecked(false);
|
||||
QFont font;
|
||||
font.setBold(true);
|
||||
ui.radioCurrent->setFont(font);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void Install::resizeEvent(QResizeEvent *e)
|
||||
void InstallWindow::resizeEvent(QResizeEvent *e)
|
||||
{
|
||||
(void)e;
|
||||
|
||||
|
|
@ -64,7 +99,7 @@ void Install::resizeEvent(QResizeEvent *e)
|
|||
}
|
||||
|
||||
|
||||
void Install::updateBackupLocation(void)
|
||||
void InstallWindow::updateBackupLocation(void)
|
||||
{
|
||||
ui.backupLocation->setText(QDir::toNativeSeparators(
|
||||
fontMetrics().elidedText(tr("Backup to %1").arg(m_backupName),
|
||||
|
|
@ -72,7 +107,7 @@ void Install::updateBackupLocation(void)
|
|||
}
|
||||
|
||||
|
||||
void Install::backupCheckboxChanged(int state)
|
||||
void InstallWindow::backupCheckboxChanged(int state)
|
||||
{
|
||||
if(state == Qt::Checked)
|
||||
{
|
||||
|
|
@ -89,7 +124,7 @@ void Install::backupCheckboxChanged(int state)
|
|||
}
|
||||
|
||||
|
||||
void Install::accept()
|
||||
void InstallWindow::accept()
|
||||
{
|
||||
logger = new ProgressLoggerGui(this);
|
||||
logger->show();
|
||||
|
|
@ -107,26 +142,26 @@ void Install::accept()
|
|||
if(ui.radioStable->isChecked()) {
|
||||
file = RbSettings::value(RbSettings::ReleaseUrl).toString();
|
||||
RbSettings::setValue(RbSettings::Build, "stable");
|
||||
myversion = version.value("rel_rev");
|
||||
myversion = RbSettings::value(RbSettings::CurReleaseVersion).toString();
|
||||
}
|
||||
else if(ui.radioArchived->isChecked()) {
|
||||
file = RbSettings::value(RbSettings::DailyUrl).toString();
|
||||
RbSettings::setValue(RbSettings::Build, "archived");
|
||||
myversion = "r" + version.value("arch_rev") + "-" + version.value("arch_date");
|
||||
myversion = "r" + RbSettings::value(RbSettings::DailyRevision).toString() + "-" + RbSettings::value(RbSettings::DailyDate).toString();
|
||||
}
|
||||
else if(ui.radioCurrent->isChecked()) {
|
||||
file = RbSettings::value(RbSettings::BleedingUrl).toString();
|
||||
RbSettings::setValue(RbSettings::Build, "current");
|
||||
myversion = "r" + version.value("bleed_rev");
|
||||
myversion = "r" + RbSettings::value(RbSettings::BleedingRevision).toString();
|
||||
}
|
||||
else {
|
||||
qDebug() << "[Install] no build selected -- this shouldn't happen";
|
||||
return;
|
||||
}
|
||||
file.replace("%MODEL%", buildname);
|
||||
file.replace("%RELVERSION%", version.value("rel_rev"));
|
||||
file.replace("%REVISION%", version.value("arch_rev"));
|
||||
file.replace("%DATE%", version.value("arch_date"));
|
||||
file.replace("%RELVERSION%", RbSettings::value(RbSettings::CurReleaseVersion).toString());
|
||||
file.replace("%REVISION%", RbSettings::value(RbSettings::DailyRevision).toString());
|
||||
file.replace("%DATE%", RbSettings::value(RbSettings::DailyDate).toString());
|
||||
|
||||
RbSettings::sync();
|
||||
|
||||
|
|
@ -194,7 +229,7 @@ void Install::accept()
|
|||
|
||||
}
|
||||
|
||||
void Install::changeBackupPath()
|
||||
void InstallWindow::changeBackupPath()
|
||||
{
|
||||
QString backupString = QFileDialog::getSaveFileName(this,
|
||||
tr("Select Backup Filename"), m_backupName, "*.zip");
|
||||
|
|
@ -207,7 +242,7 @@ void Install::changeBackupPath()
|
|||
|
||||
|
||||
// Zip installer has finished
|
||||
void Install::done(bool error)
|
||||
void InstallWindow::done(bool error)
|
||||
{
|
||||
qDebug() << "[Install] done, error:" << error;
|
||||
|
||||
|
|
@ -227,14 +262,14 @@ void Install::done(bool error)
|
|||
}
|
||||
|
||||
|
||||
void Install::setDetailsCurrent(bool show)
|
||||
void InstallWindow::setDetailsCurrent(bool show)
|
||||
{
|
||||
if(show) {
|
||||
ui.labelDetails->setText(tr("This is the absolute up to the minute "
|
||||
"Rockbox built. A current build will get updated every time "
|
||||
"a change is made. Latest version is r%1 (%2).")
|
||||
.arg(version.value("bleed_rev"), version.value("bleed_date")));
|
||||
if(version.value("rel_rev").isEmpty())
|
||||
.arg(RbSettings::value(RbSettings::BleedingRevision).toString(),RbSettings::value(RbSettings::BleedingDate).toString()));
|
||||
if(RbSettings::value(RbSettings::CurReleaseVersion).toString().isEmpty())
|
||||
ui.labelNote->setText(tr("<b>This is the recommended version.</b>"));
|
||||
else
|
||||
ui.labelNote->setText("");
|
||||
|
|
@ -242,23 +277,23 @@ void Install::setDetailsCurrent(bool show)
|
|||
}
|
||||
|
||||
|
||||
void Install::setDetailsStable(bool show)
|
||||
void InstallWindow::setDetailsStable(bool show)
|
||||
{
|
||||
if(show) {
|
||||
ui.labelDetails->setText(
|
||||
tr("This is the last released version of Rockbox."));
|
||||
|
||||
if(!version.value("rel_rev").isEmpty())
|
||||
if(!RbSettings::value(RbSettings::CurReleaseVersion).toString().isEmpty())
|
||||
ui.labelNote->setText(tr("<b>Note:</b> "
|
||||
"The lastest released version is %1. "
|
||||
"<b>This is the recommended version.</b>")
|
||||
.arg(version.value("rel_rev")));
|
||||
.arg(RbSettings::value(RbSettings::CurReleaseVersion).toString()));
|
||||
else ui.labelNote->setText("");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Install::setDetailsArchived(bool show)
|
||||
void InstallWindow::setDetailsArchived(bool show)
|
||||
{
|
||||
if(show) {
|
||||
ui.labelDetails->setText(tr("These are automatically built each day "
|
||||
|
|
@ -266,54 +301,9 @@ void Install::setDetailsArchived(bool show)
|
|||
"features than the last stable release but may be much less stable. "
|
||||
"Features may change regularly."));
|
||||
ui.labelNote->setText(tr("<b>Note:</b> archived version is r%1 (%2).")
|
||||
.arg(version.value("arch_rev"), version.value("arch_date")));
|
||||
.arg(RbSettings::value(RbSettings::DailyRevision).toString(),RbSettings::value(RbSettings::DailyDate).toString()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Install::setVersionStrings(QMap<QString, QString>& ver)
|
||||
{
|
||||
version = ver;
|
||||
// version strings map is as following:
|
||||
// rel_rev release version revision id
|
||||
// rel_date release version release date
|
||||
// same for arch_* and bleed_*
|
||||
|
||||
if(version.value("arch_rev").isEmpty()) {
|
||||
ui.radioArchived->setEnabled(false);
|
||||
qDebug() << "[Install] no information about archived version available!";
|
||||
}
|
||||
if(version.value("rel_rev").isEmpty()) {
|
||||
ui.radioStable->setEnabled(false);
|
||||
}
|
||||
|
||||
// try to use the old selection first. If no selection has been made
|
||||
// in the past, use a preselection based on released status.
|
||||
if(RbSettings::value(RbSettings::Build).toString() == "stable"
|
||||
&& !version.value("rel_rev").isEmpty())
|
||||
ui.radioStable->setChecked(true);
|
||||
else if(RbSettings::value(RbSettings::Build).toString() == "archived")
|
||||
ui.radioArchived->setChecked(true);
|
||||
else if(RbSettings::value(RbSettings::Build).toString() == "current")
|
||||
ui.radioCurrent->setChecked(true);
|
||||
else if(!version.value("rel_rev").isEmpty()) {
|
||||
ui.radioStable->setChecked(true);
|
||||
ui.radioStable->setEnabled(true);
|
||||
QFont font;
|
||||
font.setBold(true);
|
||||
ui.radioStable->setFont(font);
|
||||
}
|
||||
else {
|
||||
ui.radioCurrent->setChecked(true);
|
||||
ui.radioStable->setEnabled(false);
|
||||
ui.radioStable->setChecked(false);
|
||||
QFont font;
|
||||
font.setBold(true);
|
||||
ui.radioCurrent->setFont(font);
|
||||
}
|
||||
|
||||
qDebug() << "[Install] setting version strings to:" << version;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -28,12 +28,11 @@
|
|||
#include "zipinstaller.h"
|
||||
#include "progressloggergui.h"
|
||||
|
||||
class Install : public QDialog
|
||||
class InstallWindow : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
Install(QWidget *parent);
|
||||
void setVersionStrings(QMap<QString, QString>&);
|
||||
InstallWindow(QWidget *parent);
|
||||
|
||||
public slots:
|
||||
void accept(void);
|
||||
|
|
@ -45,7 +44,6 @@ class Install : public QDialog
|
|||
QFile *target;
|
||||
QString file;
|
||||
ZipInstaller* installer;
|
||||
QMap<QString, QString> version;
|
||||
QString m_backupName;
|
||||
void resizeEvent(QResizeEvent*);
|
||||
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
#include "ui_rbutilqtfrm.h"
|
||||
#include "ui_aboutbox.h"
|
||||
#include "configure.h"
|
||||
#include "install.h"
|
||||
#include "installwindow.h"
|
||||
#include "installtalkwindow.h"
|
||||
#include "createvoicewindow.h"
|
||||
#include "httpget.h"
|
||||
|
|
@ -167,8 +167,6 @@ void RbUtilQt::updateTabs(int count)
|
|||
|
||||
void RbUtilQt::downloadInfo()
|
||||
{
|
||||
// make sure the version map is repopulated correctly later.
|
||||
versmap.clear();
|
||||
// try to get the current build information
|
||||
daily = new HttpGet(this);
|
||||
connect(daily, SIGNAL(done(bool)), this, SLOT(downloadDone(bool)));
|
||||
|
|
@ -196,23 +194,32 @@ void RbUtilQt::downloadDone(bool error)
|
|||
}
|
||||
qDebug() << "[RbUtil] network status:" << daily->error();
|
||||
|
||||
// read info into settings object
|
||||
buildInfo.open();
|
||||
QSettings info(buildInfo.fileName(), QSettings::IniFormat, this);
|
||||
buildInfo.close();
|
||||
versmap.insert("arch_rev", info.value("dailies/rev").toString());
|
||||
versmap.insert("arch_date", info.value("dailies/date").toString());
|
||||
RbSettings::setValue(RbSettings::DailyRevision,info.value("dailies/rev"));
|
||||
QDate date = QDate::fromString(info.value("dailies/date").toString(), "yyyyMMdd");
|
||||
RbSettings::setValue(RbSettings::DailyDate,date.toString());
|
||||
|
||||
info.beginGroup("release");
|
||||
versmap.insert("rel_rev", info.value(RbSettings::value(RbSettings::CurBuildserverModel).toString()).toString());
|
||||
QStringList keys = info.allKeys();
|
||||
for(int i=0; i < keys.size(); i++)
|
||||
{
|
||||
RbSettings::setPlatformValue(keys[i],RbSettings::CurReleaseVersion,info.value(keys[i]));
|
||||
}
|
||||
info.endGroup();
|
||||
|
||||
bool installable = !versmap.value("rel_rev").isEmpty();
|
||||
info.beginGroup("status");
|
||||
keys = info.allKeys();
|
||||
for(int i=0; i < keys.size(); i++)
|
||||
{
|
||||
RbSettings::setPlatformValue(keys[i],RbSettings::CurStatus,info.value(keys[i]));
|
||||
}
|
||||
info.endGroup();
|
||||
|
||||
ui.buttonSmall->setEnabled(installable);
|
||||
ui.buttonComplete->setEnabled(installable);
|
||||
ui.actionSmall_Installation->setEnabled(installable);
|
||||
ui.actionComplete_Installation->setEnabled(installable);
|
||||
|
||||
//start bleeding info download
|
||||
bleeding = new HttpGet(this);
|
||||
connect(bleeding, SIGNAL(done(bool)), this, SLOT(downloadBleedingDone(bool)));
|
||||
connect(bleeding, SIGNAL(requestFinished(int, bool)), this, SLOT(downloadDone(int, bool)));
|
||||
|
|
@ -223,22 +230,6 @@ void RbUtilQt::downloadDone(bool error)
|
|||
bleeding->getFile(QUrl(RbSettings::value(RbSettings::BleedingInfo).toString()));
|
||||
ui.statusbar->showMessage(tr("Downloading build information, please wait ..."));
|
||||
|
||||
if(RbSettings::value(RbSettings::RbutilVersion) != PUREVERSION) {
|
||||
QApplication::processEvents();
|
||||
QMessageBox::information(this, tr("New installation"),
|
||||
tr("This is a new installation of Rockbox Utility, or a new version. "
|
||||
"The configuration dialog will now open to allow you to setup the program, "
|
||||
" or review your settings."));
|
||||
configDialog();
|
||||
}
|
||||
else if(chkConfig(false)) {
|
||||
QApplication::processEvents();
|
||||
QMessageBox::critical(this, tr("Configuration error"),
|
||||
tr("Your configuration is invalid. This is most likely due "
|
||||
"to a changed device path. The configuration dialog will "
|
||||
"now open to allow you to correct the problem."));
|
||||
configDialog();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -251,11 +242,12 @@ void RbUtilQt::downloadBleedingDone(bool error)
|
|||
bleedingInfo.open();
|
||||
QSettings info(bleedingInfo.fileName(), QSettings::IniFormat, this);
|
||||
bleedingInfo.close();
|
||||
versmap.insert("bleed_rev", info.value("bleeding/rev").toString());
|
||||
versmap.insert("bleed_date", info.value("bleeding/timestamp").toString());
|
||||
qDebug() << "[RbUtil] version map:" << versmap;
|
||||
ui.statusbar->showMessage(tr("Download build information finished."), 5000);
|
||||
RbSettings::setValue(RbSettings::BleedingRevision,info.value("bleeding/rev"));
|
||||
QDateTime date = QDateTime::fromString(info.value("bleeding/timestamp").toString(), "yyyyMMddThhmmssZ");
|
||||
RbSettings::setValue(RbSettings::BleedingDate,date.toString());
|
||||
|
||||
ui.statusbar->showMessage(tr("Download build information finished."), 5000);
|
||||
updateSettings();
|
||||
m_gotInfo = true;
|
||||
|
||||
//start check for updates
|
||||
|
|
@ -317,7 +309,6 @@ void RbUtilQt::configDialog()
|
|||
{
|
||||
Config *cw = new Config(this);
|
||||
connect(cw, SIGNAL(settingsUpdated()), this, SLOT(updateSettings()));
|
||||
connect(cw, SIGNAL(settingsUpdated()), this, SLOT(downloadInfo()));
|
||||
cw->show();
|
||||
}
|
||||
|
||||
|
|
@ -338,6 +329,23 @@ void RbUtilQt::updateSettings()
|
|||
}
|
||||
HttpGet::setGlobalCache(RbSettings::value(RbSettings::CachePath).toString());
|
||||
HttpGet::setGlobalDumbCache(RbSettings::value(RbSettings::CacheOffline).toBool());
|
||||
|
||||
if(RbSettings::value(RbSettings::RbutilVersion) != PUREVERSION) {
|
||||
QApplication::processEvents();
|
||||
QMessageBox::information(this, tr("New installation"),
|
||||
tr("This is a new installation of Rockbox Utility, or a new version. "
|
||||
"The configuration dialog will now open to allow you to setup the program, "
|
||||
" or review your settings."));
|
||||
configDialog();
|
||||
}
|
||||
else if(chkConfig(false)) {
|
||||
QApplication::processEvents();
|
||||
QMessageBox::critical(this, tr("Configuration error"),
|
||||
tr("Your configuration is invalid. This is most likely due "
|
||||
"to a changed device path. The configuration dialog will "
|
||||
"now open to allow you to correct the problem."));
|
||||
configDialog();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -373,6 +381,13 @@ void RbUtilQt::updateDevice()
|
|||
if(mountpoint.isEmpty()) mountpoint = "<invalid>";
|
||||
ui.labelDevice->setText(tr("<b>%1 %2</b> at <b>%3</b>")
|
||||
.arg(brand, name, QDir::toNativeSeparators(mountpoint)));
|
||||
|
||||
// hide quickstart buttons if no release available
|
||||
bool installable = !RbSettings::value(RbSettings::CurReleaseVersion).toString().isEmpty();
|
||||
ui.buttonSmall->setEnabled(installable);
|
||||
ui.buttonComplete->setEnabled(installable);
|
||||
ui.actionSmall_Installation->setEnabled(installable);
|
||||
ui.actionComplete_Installation->setEnabled(installable);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -411,7 +426,7 @@ void RbUtilQt::completeInstall()
|
|||
"This will install Rockbox %1. To install the most recent "
|
||||
"development build available press \"Cancel\" and "
|
||||
"use the \"Installation\" tab.")
|
||||
.arg(versmap.value("rel_rev")),
|
||||
.arg(RbSettings::value(RbSettings::CurReleaseVersion).toString()),
|
||||
QMessageBox::Ok | QMessageBox::Cancel) != QMessageBox::Ok)
|
||||
return;
|
||||
// create logger
|
||||
|
|
@ -469,7 +484,7 @@ void RbUtilQt::smallInstall()
|
|||
"This will install Rockbox %1. To install the most recent "
|
||||
"development build available press \"Cancel\" and "
|
||||
"use the \"Installation\" tab.")
|
||||
.arg(versmap.value("rel_rev")),
|
||||
.arg(RbSettings::value(RbSettings::CurReleaseVersion).toString()),
|
||||
QMessageBox::Ok | QMessageBox::Cancel) != QMessageBox::Ok)
|
||||
return;
|
||||
|
||||
|
|
@ -543,7 +558,7 @@ bool RbUtilQt::installAuto()
|
|||
{
|
||||
QString file = RbSettings::value(RbSettings::ReleaseUrl).toString();
|
||||
file.replace("%MODEL%", RbSettings::value(RbSettings::CurBuildserverModel).toString());
|
||||
file.replace("%RELVERSION%", versmap.value("rel_rev"));
|
||||
file.replace("%RELVERSION%", RbSettings::value(RbSettings::CurReleaseVersion).toString());
|
||||
|
||||
// check installed Version and Target
|
||||
QString warning = check(false);
|
||||
|
|
@ -600,7 +615,7 @@ bool RbUtilQt::installAuto()
|
|||
ZipInstaller* installer = new ZipInstaller(this);
|
||||
installer->setUrl(file);
|
||||
installer->setLogSection("Rockbox (Base)");
|
||||
installer->setLogVersion(versmap.value("rel_rev"));
|
||||
installer->setLogVersion(RbSettings::value(RbSettings::CurReleaseVersion).toString());
|
||||
if(!RbSettings::value(RbSettings::CacheDisabled).toBool())
|
||||
installer->setCache(true);
|
||||
installer->setMountPoint(RbSettings::value(RbSettings::Mountpoint).toString());
|
||||
|
|
@ -617,10 +632,7 @@ bool RbUtilQt::installAuto()
|
|||
|
||||
void RbUtilQt::install()
|
||||
{
|
||||
Install *installWindow = new Install(this);
|
||||
|
||||
installWindow->setVersionStrings(versmap);
|
||||
|
||||
InstallWindow *installWindow = new InstallWindow(this);
|
||||
installWindow->show();
|
||||
}
|
||||
|
||||
|
|
@ -837,7 +849,7 @@ void RbUtilQt::installFonts()
|
|||
|
||||
installer->setUrl(RbSettings::value(RbSettings::FontUrl).toString());
|
||||
installer->setLogSection("Fonts");
|
||||
installer->setLogVersion(versmap.value("arch_date"));
|
||||
installer->setLogVersion(RbSettings::value(RbSettings::DailyDate).toString());
|
||||
installer->setMountPoint(RbSettings::value(RbSettings::Mountpoint).toString());
|
||||
if(!RbSettings::value(RbSettings::CacheDisabled).toBool())
|
||||
installer->setCache(true);
|
||||
|
|
@ -876,12 +888,12 @@ void RbUtilQt::installVoice()
|
|||
QString voiceurl = RbSettings::value(RbSettings::VoiceUrl).toString();
|
||||
|
||||
voiceurl += RbSettings::value(RbSettings::CurBuildserverModel).toString() + "-" +
|
||||
versmap.value("arch_date") + "-english.zip";
|
||||
RbSettings::value(RbSettings::DailyDate).toString() + "-english.zip";
|
||||
qDebug() << "[RbUtil] voicefile URL:" << voiceurl;
|
||||
|
||||
installer->setUrl(voiceurl);
|
||||
installer->setLogSection("Voice");
|
||||
installer->setLogVersion(versmap.value("arch_date"));
|
||||
installer->setLogVersion(RbSettings::value(RbSettings::DailyDate).toString());
|
||||
installer->setMountPoint(RbSettings::value(RbSettings::Mountpoint).toString());
|
||||
if(!RbSettings::value(RbSettings::CacheDisabled).toBool())
|
||||
installer->setCache(true);
|
||||
|
|
@ -931,7 +943,7 @@ void RbUtilQt::installDoom()
|
|||
|
||||
installer->setUrl(RbSettings::value(RbSettings::DoomUrl).toString());
|
||||
installer->setLogSection("Game Addons");
|
||||
installer->setLogVersion(versmap.value("arch_date"));
|
||||
installer->setLogVersion(RbSettings::value(RbSettings::DailyDate).toString());
|
||||
installer->setMountPoint(RbSettings::value(RbSettings::Mountpoint).toString());
|
||||
if(!RbSettings::value(RbSettings::CacheDisabled).toBool())
|
||||
installer->setCache(true);
|
||||
|
|
@ -1050,7 +1062,7 @@ void RbUtilQt::downloadManual(void)
|
|||
if(manual.isEmpty())
|
||||
manual = "rockbox-" + RbSettings::value(RbSettings::Platform).toString();
|
||||
|
||||
QString date = versmap.value("arch_date");
|
||||
QString date = RbSettings::value(RbSettings::DailyDate).toString();
|
||||
|
||||
QString manualurl;
|
||||
QString target;
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ class RbUtilQt : public QMainWindow
|
|||
ProgressLoggerGui *logger;
|
||||
ZipInstaller *installer;
|
||||
QUrl proxy(void);
|
||||
QMap<QString, QString> versmap;
|
||||
bool chkConfig(bool);
|
||||
|
||||
volatile bool m_installed;
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ QMAKE_EXTRA_TARGETS += lrelease
|
|||
|
||||
SOURCES += rbutilqt.cpp \
|
||||
main.cpp \
|
||||
install.cpp \
|
||||
installwindow.cpp \
|
||||
base/httpget.cpp \
|
||||
configure.cpp \
|
||||
zip/zip.cpp \
|
||||
|
|
@ -115,7 +115,7 @@ SOURCES += rbutilqt.cpp \
|
|||
../../tools/iriver.c \
|
||||
|
||||
HEADERS += rbutilqt.h \
|
||||
install.h \
|
||||
installwindow.h \
|
||||
base/httpget.h \
|
||||
configure.h \
|
||||
zip/zip.h \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue