summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2012-06-17 16:54:55 +0200
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2012-06-17 16:56:49 +0200
commit74af18ebf5d155a53268ec4ef41be3c1bbd85bac (patch)
treeb9b9bddd85c3918897a981d1fc1c094bca36a2a2
parentcd1b6a11831274fd7f69bebd840db8dabc610c76 (diff)
downloadrockbox-74af18ebf5d155a53268ec4ef41be3c1bbd85bac.tar.gz
rockbox-74af18ebf5d155a53268ec4ef41be3c1bbd85bac.zip
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
-rw-r--r--rbutil/rbutilqt/installwindow.cpp55
-rw-r--r--rbutil/rbutilqt/installwindow.h2
-rw-r--r--rbutil/rbutilqt/installwindowfrm.ui7
3 files changed, 52 insertions, 12 deletions
diff --git a/rbutil/rbutilqt/installwindow.cpp b/rbutil/rbutilqt/installwindow.cpp
index 1306043027..17d0495bc4 100644
--- a/rbutil/rbutilqt/installwindow.cpp
+++ b/rbutil/rbutilqt/installwindow.cpp
@@ -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) {
diff --git a/rbutil/rbutilqt/installwindow.h b/rbutil/rbutilqt/installwindow.h
index 67c06c1f9a..140782088d 100644
--- a/rbutil/rbutilqt/installwindow.h
+++ b/rbutil/rbutilqt/installwindow.h
@@ -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);
diff --git a/rbutil/rbutilqt/installwindowfrm.ui b/rbutil/rbutilqt/installwindowfrm.ui
index 92fe65e7c2..a06908214f 100644
--- a/rbutil/rbutilqt/installwindowfrm.ui
+++ b/rbutil/rbutilqt/installwindowfrm.ui
@@ -54,6 +54,13 @@
</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" >
<string>&amp;Development build</string>