mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-10 05:32:40 -05:00
Add support for installing release candidate builds.
Release candidates are now a third option in the installation window. Quick start will still install the latest release. Change-Id: I64e05160817263c5c4cb40cbdb4942149983e0ff
This commit is contained in:
parent
cd1b6a1183
commit
74af18ebf5
3 changed files with 52 additions and 12 deletions
|
|
@ -31,6 +31,7 @@ InstallWindow::InstallWindow(QWidget *parent) : QDialog(parent)
|
||||||
ui.setupUi(this);
|
ui.setupUi(this);
|
||||||
|
|
||||||
connect(ui.radioStable, SIGNAL(toggled(bool)), this, SLOT(setDetailsStable(bool)));
|
connect(ui.radioStable, SIGNAL(toggled(bool)), this, SLOT(setDetailsStable(bool)));
|
||||||
|
connect(ui.radioCandidate, SIGNAL(toggled(bool)), this, SLOT(setDetailsCandidate(bool)));
|
||||||
connect(ui.radioCurrent, SIGNAL(toggled(bool)), this, SLOT(setDetailsCurrent(bool)));
|
connect(ui.radioCurrent, SIGNAL(toggled(bool)), this, SLOT(setDetailsCurrent(bool)));
|
||||||
connect(ui.changeBackup, SIGNAL(pressed()), this, SLOT(changeBackupPath()));
|
connect(ui.changeBackup, SIGNAL(pressed()), this, SLOT(changeBackupPath()));
|
||||||
connect(ui.backup, SIGNAL(stateChanged(int)), this, SLOT(backupCheckboxChanged(int)));
|
connect(ui.backup, SIGNAL(stateChanged(int)), this, SLOT(backupCheckboxChanged(int)));
|
||||||
|
|
@ -39,8 +40,7 @@ InstallWindow::InstallWindow(QWidget *parent) : QDialog(parent)
|
||||||
RockboxInfo rbinfo(RbSettings::value(RbSettings::Mountpoint).toString());
|
RockboxInfo rbinfo(RbSettings::value(RbSettings::Mountpoint).toString());
|
||||||
QString version = rbinfo.version();
|
QString version = rbinfo.version();
|
||||||
|
|
||||||
if(version != "")
|
if(version != "") {
|
||||||
{
|
|
||||||
ui.Backupgroup->show();
|
ui.Backupgroup->show();
|
||||||
m_backupName = RbSettings::value(RbSettings::Mountpoint).toString();
|
m_backupName = RbSettings::value(RbSettings::Mountpoint).toString();
|
||||||
if(!m_backupName.endsWith("/")) m_backupName += "/";
|
if(!m_backupName.endsWith("/")) m_backupName += "/";
|
||||||
|
|
@ -48,24 +48,29 @@ InstallWindow::InstallWindow(QWidget *parent) : QDialog(parent)
|
||||||
// for some reason the label doesn't return its final size yet.
|
// for some reason the label doesn't return its final size yet.
|
||||||
// Delay filling ui.backupLocation until the checkbox is changed.
|
// Delay filling ui.backupLocation until the checkbox is changed.
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
ui.Backupgroup->hide();
|
ui.Backupgroup->hide();
|
||||||
}
|
}
|
||||||
backupCheckboxChanged(Qt::Unchecked);
|
backupCheckboxChanged(Qt::Unchecked);
|
||||||
|
|
||||||
|
|
||||||
if(ServerInfo::value(ServerInfo::CurReleaseVersion).toString().isEmpty()) {
|
if(ServerInfo::value(ServerInfo::CurReleaseVersion).toString().isEmpty()) {
|
||||||
ui.radioStable->setEnabled(false);
|
ui.radioStable->setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// try to use the old selection first. If no selection has been made
|
// try to use the old selection first. If no selection has been made
|
||||||
// in the past, use a preselection based on released status.
|
// in the past, use a preselection based on released status.
|
||||||
if(RbSettings::value(RbSettings::Build).toString() == "stable"
|
QString lastinstalled = RbSettings::value(RbSettings::Build).toString();
|
||||||
&& !ServerInfo::value(ServerInfo::CurReleaseVersion).toString().isEmpty())
|
if(lastinstalled == "stable"
|
||||||
|
&& !ServerInfo::value(ServerInfo::CurReleaseVersion).toString().isEmpty()) {
|
||||||
ui.radioStable->setChecked(true);
|
ui.radioStable->setChecked(true);
|
||||||
else if(RbSettings::value(RbSettings::Build).toString() == "current")
|
}
|
||||||
|
else if(lastinstalled == "rc"
|
||||||
|
&& !ServerInfo::value(ServerInfo::RelCandidateVersion).toString().isEmpty()) {
|
||||||
|
ui.radioCandidate->setChecked(true);
|
||||||
|
}
|
||||||
|
else if(lastinstalled == "current") {
|
||||||
ui.radioCurrent->setChecked(true);
|
ui.radioCurrent->setChecked(true);
|
||||||
|
}
|
||||||
else if(!ServerInfo::value(ServerInfo::CurReleaseVersion).toString().isEmpty()) {
|
else if(!ServerInfo::value(ServerInfo::CurReleaseVersion).toString().isEmpty()) {
|
||||||
ui.radioStable->setChecked(true);
|
ui.radioStable->setChecked(true);
|
||||||
ui.radioStable->setEnabled(true);
|
ui.radioStable->setEnabled(true);
|
||||||
|
|
@ -75,6 +80,9 @@ InstallWindow::InstallWindow(QWidget *parent) : QDialog(parent)
|
||||||
ui.radioStable->setEnabled(false);
|
ui.radioStable->setEnabled(false);
|
||||||
ui.radioStable->setChecked(false);
|
ui.radioStable->setChecked(false);
|
||||||
}
|
}
|
||||||
|
if(ServerInfo::value(ServerInfo::RelCandidateVersion).toString().isEmpty()) {
|
||||||
|
ui.radioCandidate->setEnabled(false);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -115,6 +123,7 @@ void InstallWindow::backupCheckboxChanged(int state)
|
||||||
|
|
||||||
void InstallWindow::accept()
|
void InstallWindow::accept()
|
||||||
{
|
{
|
||||||
|
QString url;
|
||||||
logger = new ProgressLoggerGui(this);
|
logger = new ProgressLoggerGui(this);
|
||||||
logger->show();
|
logger->show();
|
||||||
QString mountPoint = RbSettings::value(RbSettings::Mountpoint).toString();
|
QString mountPoint = RbSettings::value(RbSettings::Mountpoint).toString();
|
||||||
|
|
@ -128,15 +137,20 @@ void InstallWindow::accept()
|
||||||
|
|
||||||
QString myversion;
|
QString myversion;
|
||||||
if(ui.radioStable->isChecked()) {
|
if(ui.radioStable->isChecked()) {
|
||||||
file = ServerInfo::value(ServerInfo::CurReleaseUrl).toString();
|
url = ServerInfo::value(ServerInfo::CurReleaseUrl).toString();
|
||||||
RbSettings::setValue(RbSettings::Build, "stable");
|
RbSettings::setValue(RbSettings::Build, "stable");
|
||||||
myversion = ServerInfo::value(ServerInfo::CurReleaseVersion).toString();
|
myversion = ServerInfo::value(ServerInfo::CurReleaseVersion).toString();
|
||||||
}
|
}
|
||||||
else if(ui.radioCurrent->isChecked()) {
|
else if(ui.radioCurrent->isChecked()) {
|
||||||
file = ServerInfo::value(ServerInfo::CurDevelUrl).toString();
|
url = ServerInfo::value(ServerInfo::CurDevelUrl).toString();
|
||||||
RbSettings::setValue(RbSettings::Build, "current");
|
RbSettings::setValue(RbSettings::Build, "current");
|
||||||
myversion = "r" + ServerInfo::value(ServerInfo::BleedingRevision).toString();
|
myversion = "r" + ServerInfo::value(ServerInfo::BleedingRevision).toString();
|
||||||
}
|
}
|
||||||
|
else if(ui.radioCandidate->isChecked()) {
|
||||||
|
url = ServerInfo::value(ServerInfo::RelCandidateUrl).toString();
|
||||||
|
RbSettings::setValue(RbSettings::Build, "rc");
|
||||||
|
myversion = ServerInfo::value(ServerInfo::RelCandidateVersion).toString();
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
qDebug() << "[Install] no build selected -- this shouldn't happen";
|
qDebug() << "[Install] no build selected -- this shouldn't happen";
|
||||||
return;
|
return;
|
||||||
|
|
@ -192,7 +206,7 @@ void InstallWindow::accept()
|
||||||
|
|
||||||
//! install build
|
//! install build
|
||||||
installer = new ZipInstaller(this);
|
installer = new ZipInstaller(this);
|
||||||
installer->setUrl(file);
|
installer->setUrl(url);
|
||||||
installer->setLogSection("Rockbox (Base)");
|
installer->setLogSection("Rockbox (Base)");
|
||||||
if(!RbSettings::value(RbSettings::CacheDisabled).toBool()
|
if(!RbSettings::value(RbSettings::CacheDisabled).toBool()
|
||||||
&& !ui.checkBoxCache->isChecked())
|
&& !ui.checkBoxCache->isChecked())
|
||||||
|
|
@ -272,6 +286,25 @@ void InstallWindow::setDetailsStable(bool show)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void InstallWindow::setDetailsCandidate(bool show)
|
||||||
|
{
|
||||||
|
if(show) {
|
||||||
|
ui.labelDetails->setText(
|
||||||
|
tr("This is the release candidate for the next Rockbox version."
|
||||||
|
"<br/>A release candidate is intended for testing. It will "
|
||||||
|
"receive bugfixes and eventually become the next stable "
|
||||||
|
"release of Rockbox. If you want to help testing Rockbox and "
|
||||||
|
"improve the next release install the release candidate."));
|
||||||
|
|
||||||
|
if(!ServerInfo::value(ServerInfo::CurReleaseVersion).toString().isEmpty())
|
||||||
|
ui.labelNote->setText(tr("<b>Note:</b> "
|
||||||
|
"The lastest release candidate is %1.")
|
||||||
|
.arg(ServerInfo::value(ServerInfo::RelCandidateVersion).toString()));
|
||||||
|
else ui.labelNote->setText("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void InstallWindow::changeEvent(QEvent *e)
|
void InstallWindow::changeEvent(QEvent *e)
|
||||||
{
|
{
|
||||||
if(e->type() == QEvent::LanguageChange) {
|
if(e->type() == QEvent::LanguageChange) {
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,6 @@ class InstallWindow : public QDialog
|
||||||
ProgressLoggerGui* logger;
|
ProgressLoggerGui* logger;
|
||||||
QHttp *download;
|
QHttp *download;
|
||||||
QFile *target;
|
QFile *target;
|
||||||
QString file;
|
|
||||||
ZipInstaller* installer;
|
ZipInstaller* installer;
|
||||||
QString m_backupName;
|
QString m_backupName;
|
||||||
void resizeEvent(QResizeEvent*);
|
void resizeEvent(QResizeEvent*);
|
||||||
|
|
@ -53,6 +52,7 @@ class InstallWindow : public QDialog
|
||||||
private slots:
|
private slots:
|
||||||
void setDetailsCurrent(bool);
|
void setDetailsCurrent(bool);
|
||||||
void setDetailsStable(bool);
|
void setDetailsStable(bool);
|
||||||
|
void setDetailsCandidate(bool);
|
||||||
void done(bool);
|
void done(bool);
|
||||||
void changeBackupPath(void);
|
void changeBackupPath(void);
|
||||||
void backupCheckboxChanged(int state);
|
void backupCheckboxChanged(int state);
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,13 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QRadioButton" name="radioCandidate" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Release &Candidate</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QRadioButton" name="radioCurrent" >
|
<widget class="QRadioButton" name="radioCurrent" >
|
||||||
<property name="text" >
|
<property name="text" >
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue