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:
Dominik Riebeling 2012-06-17 16:54:55 +02:00
parent cd1b6a1183
commit 74af18ebf5
3 changed files with 52 additions and 12 deletions

View file

@ -31,6 +31,7 @@ InstallWindow::InstallWindow(QWidget *parent) : QDialog(parent)
ui.setupUi(this);
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.changeBackup, SIGNAL(pressed()), this, SLOT(changeBackupPath()));
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());
QString version = rbinfo.version();
if(version != "")
{
if(version != "") {
ui.Backupgroup->show();
m_backupName = RbSettings::value(RbSettings::Mountpoint).toString();
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.
// Delay filling ui.backupLocation until the checkbox is changed.
}
else
{
else {
ui.Backupgroup->hide();
}
backupCheckboxChanged(Qt::Unchecked);
if(ServerInfo::value(ServerInfo::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"
&& !ServerInfo::value(ServerInfo::CurReleaseVersion).toString().isEmpty())
QString lastinstalled = RbSettings::value(RbSettings::Build).toString();
if(lastinstalled == "stable"
&& !ServerInfo::value(ServerInfo::CurReleaseVersion).toString().isEmpty()) {
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);
}
else if(!ServerInfo::value(ServerInfo::CurReleaseVersion).toString().isEmpty()) {
ui.radioStable->setChecked(true);
ui.radioStable->setEnabled(true);
@ -75,6 +80,9 @@ InstallWindow::InstallWindow(QWidget *parent) : QDialog(parent)
ui.radioStable->setEnabled(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()
{
QString url;
logger = new ProgressLoggerGui(this);
logger->show();
QString mountPoint = RbSettings::value(RbSettings::Mountpoint).toString();
@ -128,15 +137,20 @@ void InstallWindow::accept()
QString myversion;
if(ui.radioStable->isChecked()) {
file = ServerInfo::value(ServerInfo::CurReleaseUrl).toString();
url = ServerInfo::value(ServerInfo::CurReleaseUrl).toString();
RbSettings::setValue(RbSettings::Build, "stable");
myversion = ServerInfo::value(ServerInfo::CurReleaseVersion).toString();
}
else if(ui.radioCurrent->isChecked()) {
file = ServerInfo::value(ServerInfo::CurDevelUrl).toString();
url = ServerInfo::value(ServerInfo::CurDevelUrl).toString();
RbSettings::setValue(RbSettings::Build, "current");
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 {
qDebug() << "[Install] no build selected -- this shouldn't happen";
return;
@ -192,7 +206,7 @@ void InstallWindow::accept()
//! install build
installer = new ZipInstaller(this);
installer->setUrl(file);
installer->setUrl(url);
installer->setLogSection("Rockbox (Base)");
if(!RbSettings::value(RbSettings::CacheDisabled).toBool()
&& !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)
{
if(e->type() == QEvent::LanguageChange) {

View file

@ -41,7 +41,6 @@ class InstallWindow : public QDialog
ProgressLoggerGui* logger;
QHttp *download;
QFile *target;
QString file;
ZipInstaller* installer;
QString m_backupName;
void resizeEvent(QResizeEvent*);
@ -53,6 +52,7 @@ class InstallWindow : public QDialog
private slots:
void setDetailsCurrent(bool);
void setDetailsStable(bool);
void setDetailsCandidate(bool);
void done(bool);
void changeBackupPath(void);
void backupCheckboxChanged(int state);

View file

@ -53,6 +53,13 @@
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioCandidate" >
<property name="text" >
<string>Release &amp;Candidate</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioCurrent" >
<property name="text" >