diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2012-06-17 16:54:55 +0200 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2012-06-17 16:56:49 +0200 |
commit | 74af18ebf5d155a53268ec4ef41be3c1bbd85bac (patch) | |
tree | b9b9bddd85c3918897a981d1fc1c094bca36a2a2 /rbutil/rbutilqt | |
parent | cd1b6a11831274fd7f69bebd840db8dabc610c76 (diff) | |
download | rockbox-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
Diffstat (limited to 'rbutil/rbutilqt')
-rw-r--r-- | rbutil/rbutilqt/installwindow.cpp | 55 | ||||
-rw-r--r-- | rbutil/rbutilqt/installwindow.h | 2 | ||||
-rw-r--r-- | rbutil/rbutilqt/installwindowfrm.ui | 7 |
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) | |||
31 | ui.setupUi(this); | 31 | ui.setupUi(this); |
32 | 32 | ||
33 | connect(ui.radioStable, SIGNAL(toggled(bool)), this, SLOT(setDetailsStable(bool))); | 33 | connect(ui.radioStable, SIGNAL(toggled(bool)), this, SLOT(setDetailsStable(bool))); |
34 | connect(ui.radioCandidate, SIGNAL(toggled(bool)), this, SLOT(setDetailsCandidate(bool))); | ||
34 | connect(ui.radioCurrent, SIGNAL(toggled(bool)), this, SLOT(setDetailsCurrent(bool))); | 35 | connect(ui.radioCurrent, SIGNAL(toggled(bool)), this, SLOT(setDetailsCurrent(bool))); |
35 | connect(ui.changeBackup, SIGNAL(pressed()), this, SLOT(changeBackupPath())); | 36 | connect(ui.changeBackup, SIGNAL(pressed()), this, SLOT(changeBackupPath())); |
36 | connect(ui.backup, SIGNAL(stateChanged(int)), this, SLOT(backupCheckboxChanged(int))); | 37 | connect(ui.backup, SIGNAL(stateChanged(int)), this, SLOT(backupCheckboxChanged(int))); |
@@ -39,8 +40,7 @@ InstallWindow::InstallWindow(QWidget *parent) : QDialog(parent) | |||
39 | RockboxInfo rbinfo(RbSettings::value(RbSettings::Mountpoint).toString()); | 40 | RockboxInfo rbinfo(RbSettings::value(RbSettings::Mountpoint).toString()); |
40 | QString version = rbinfo.version(); | 41 | QString version = rbinfo.version(); |
41 | 42 | ||
42 | if(version != "") | 43 | if(version != "") { |
43 | { | ||
44 | ui.Backupgroup->show(); | 44 | ui.Backupgroup->show(); |
45 | m_backupName = RbSettings::value(RbSettings::Mountpoint).toString(); | 45 | m_backupName = RbSettings::value(RbSettings::Mountpoint).toString(); |
46 | if(!m_backupName.endsWith("/")) m_backupName += "/"; | 46 | if(!m_backupName.endsWith("/")) m_backupName += "/"; |
@@ -48,24 +48,29 @@ InstallWindow::InstallWindow(QWidget *parent) : QDialog(parent) | |||
48 | // for some reason the label doesn't return its final size yet. | 48 | // for some reason the label doesn't return its final size yet. |
49 | // Delay filling ui.backupLocation until the checkbox is changed. | 49 | // Delay filling ui.backupLocation until the checkbox is changed. |
50 | } | 50 | } |
51 | else | 51 | else { |
52 | { | ||
53 | ui.Backupgroup->hide(); | 52 | ui.Backupgroup->hide(); |
54 | } | 53 | } |
55 | backupCheckboxChanged(Qt::Unchecked); | 54 | backupCheckboxChanged(Qt::Unchecked); |
56 | 55 | ||
57 | |||
58 | if(ServerInfo::value(ServerInfo::CurReleaseVersion).toString().isEmpty()) { | 56 | if(ServerInfo::value(ServerInfo::CurReleaseVersion).toString().isEmpty()) { |
59 | ui.radioStable->setEnabled(false); | 57 | ui.radioStable->setEnabled(false); |
60 | } | 58 | } |
61 | 59 | ||
62 | // try to use the old selection first. If no selection has been made | 60 | // try to use the old selection first. If no selection has been made |
63 | // in the past, use a preselection based on released status. | 61 | // in the past, use a preselection based on released status. |
64 | if(RbSettings::value(RbSettings::Build).toString() == "stable" | 62 | QString lastinstalled = RbSettings::value(RbSettings::Build).toString(); |
65 | && !ServerInfo::value(ServerInfo::CurReleaseVersion).toString().isEmpty()) | 63 | if(lastinstalled == "stable" |
64 | && !ServerInfo::value(ServerInfo::CurReleaseVersion).toString().isEmpty()) { | ||
66 | ui.radioStable->setChecked(true); | 65 | ui.radioStable->setChecked(true); |
67 | else if(RbSettings::value(RbSettings::Build).toString() == "current") | 66 | } |
67 | else if(lastinstalled == "rc" | ||
68 | && !ServerInfo::value(ServerInfo::RelCandidateVersion).toString().isEmpty()) { | ||
69 | ui.radioCandidate->setChecked(true); | ||
70 | } | ||
71 | else if(lastinstalled == "current") { | ||
68 | ui.radioCurrent->setChecked(true); | 72 | ui.radioCurrent->setChecked(true); |
73 | } | ||
69 | else if(!ServerInfo::value(ServerInfo::CurReleaseVersion).toString().isEmpty()) { | 74 | else if(!ServerInfo::value(ServerInfo::CurReleaseVersion).toString().isEmpty()) { |
70 | ui.radioStable->setChecked(true); | 75 | ui.radioStable->setChecked(true); |
71 | ui.radioStable->setEnabled(true); | 76 | ui.radioStable->setEnabled(true); |
@@ -75,6 +80,9 @@ InstallWindow::InstallWindow(QWidget *parent) : QDialog(parent) | |||
75 | ui.radioStable->setEnabled(false); | 80 | ui.radioStable->setEnabled(false); |
76 | ui.radioStable->setChecked(false); | 81 | ui.radioStable->setChecked(false); |
77 | } | 82 | } |
83 | if(ServerInfo::value(ServerInfo::RelCandidateVersion).toString().isEmpty()) { | ||
84 | ui.radioCandidate->setEnabled(false); | ||
85 | } | ||
78 | 86 | ||
79 | } | 87 | } |
80 | 88 | ||
@@ -115,6 +123,7 @@ void InstallWindow::backupCheckboxChanged(int state) | |||
115 | 123 | ||
116 | void InstallWindow::accept() | 124 | void InstallWindow::accept() |
117 | { | 125 | { |
126 | QString url; | ||
118 | logger = new ProgressLoggerGui(this); | 127 | logger = new ProgressLoggerGui(this); |
119 | logger->show(); | 128 | logger->show(); |
120 | QString mountPoint = RbSettings::value(RbSettings::Mountpoint).toString(); | 129 | QString mountPoint = RbSettings::value(RbSettings::Mountpoint).toString(); |
@@ -128,15 +137,20 @@ void InstallWindow::accept() | |||
128 | 137 | ||
129 | QString myversion; | 138 | QString myversion; |
130 | if(ui.radioStable->isChecked()) { | 139 | if(ui.radioStable->isChecked()) { |
131 | file = ServerInfo::value(ServerInfo::CurReleaseUrl).toString(); | 140 | url = ServerInfo::value(ServerInfo::CurReleaseUrl).toString(); |
132 | RbSettings::setValue(RbSettings::Build, "stable"); | 141 | RbSettings::setValue(RbSettings::Build, "stable"); |
133 | myversion = ServerInfo::value(ServerInfo::CurReleaseVersion).toString(); | 142 | myversion = ServerInfo::value(ServerInfo::CurReleaseVersion).toString(); |
134 | } | 143 | } |
135 | else if(ui.radioCurrent->isChecked()) { | 144 | else if(ui.radioCurrent->isChecked()) { |
136 | file = ServerInfo::value(ServerInfo::CurDevelUrl).toString(); | 145 | url = ServerInfo::value(ServerInfo::CurDevelUrl).toString(); |
137 | RbSettings::setValue(RbSettings::Build, "current"); | 146 | RbSettings::setValue(RbSettings::Build, "current"); |
138 | myversion = "r" + ServerInfo::value(ServerInfo::BleedingRevision).toString(); | 147 | myversion = "r" + ServerInfo::value(ServerInfo::BleedingRevision).toString(); |
139 | } | 148 | } |
149 | else if(ui.radioCandidate->isChecked()) { | ||
150 | url = ServerInfo::value(ServerInfo::RelCandidateUrl).toString(); | ||
151 | RbSettings::setValue(RbSettings::Build, "rc"); | ||
152 | myversion = ServerInfo::value(ServerInfo::RelCandidateVersion).toString(); | ||
153 | } | ||
140 | else { | 154 | else { |
141 | qDebug() << "[Install] no build selected -- this shouldn't happen"; | 155 | qDebug() << "[Install] no build selected -- this shouldn't happen"; |
142 | return; | 156 | return; |
@@ -192,7 +206,7 @@ void InstallWindow::accept() | |||
192 | 206 | ||
193 | //! install build | 207 | //! install build |
194 | installer = new ZipInstaller(this); | 208 | installer = new ZipInstaller(this); |
195 | installer->setUrl(file); | 209 | installer->setUrl(url); |
196 | installer->setLogSection("Rockbox (Base)"); | 210 | installer->setLogSection("Rockbox (Base)"); |
197 | if(!RbSettings::value(RbSettings::CacheDisabled).toBool() | 211 | if(!RbSettings::value(RbSettings::CacheDisabled).toBool() |
198 | && !ui.checkBoxCache->isChecked()) | 212 | && !ui.checkBoxCache->isChecked()) |
@@ -272,6 +286,25 @@ void InstallWindow::setDetailsStable(bool show) | |||
272 | } | 286 | } |
273 | 287 | ||
274 | 288 | ||
289 | void InstallWindow::setDetailsCandidate(bool show) | ||
290 | { | ||
291 | if(show) { | ||
292 | ui.labelDetails->setText( | ||
293 | tr("This is the release candidate for the next Rockbox version." | ||
294 | "<br/>A release candidate is intended for testing. It will " | ||
295 | "receive bugfixes and eventually become the next stable " | ||
296 | "release of Rockbox. If you want to help testing Rockbox and " | ||
297 | "improve the next release install the release candidate.")); | ||
298 | |||
299 | if(!ServerInfo::value(ServerInfo::CurReleaseVersion).toString().isEmpty()) | ||
300 | ui.labelNote->setText(tr("<b>Note:</b> " | ||
301 | "The lastest release candidate is %1.") | ||
302 | .arg(ServerInfo::value(ServerInfo::RelCandidateVersion).toString())); | ||
303 | else ui.labelNote->setText(""); | ||
304 | } | ||
305 | } | ||
306 | |||
307 | |||
275 | void InstallWindow::changeEvent(QEvent *e) | 308 | void InstallWindow::changeEvent(QEvent *e) |
276 | { | 309 | { |
277 | if(e->type() == QEvent::LanguageChange) { | 310 | 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 | |||
41 | ProgressLoggerGui* logger; | 41 | ProgressLoggerGui* logger; |
42 | QHttp *download; | 42 | QHttp *download; |
43 | QFile *target; | 43 | QFile *target; |
44 | QString file; | ||
45 | ZipInstaller* installer; | 44 | ZipInstaller* installer; |
46 | QString m_backupName; | 45 | QString m_backupName; |
47 | void resizeEvent(QResizeEvent*); | 46 | void resizeEvent(QResizeEvent*); |
@@ -53,6 +52,7 @@ class InstallWindow : public QDialog | |||
53 | private slots: | 52 | private slots: |
54 | void setDetailsCurrent(bool); | 53 | void setDetailsCurrent(bool); |
55 | void setDetailsStable(bool); | 54 | void setDetailsStable(bool); |
55 | void setDetailsCandidate(bool); | ||
56 | void done(bool); | 56 | void done(bool); |
57 | void changeBackupPath(void); | 57 | void changeBackupPath(void); |
58 | void backupCheckboxChanged(int state); | 58 | 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 @@ | |||
54 | </widget> | 54 | </widget> |
55 | </item> | 55 | </item> |
56 | <item> | 56 | <item> |
57 | <widget class="QRadioButton" name="radioCandidate" > | ||
58 | <property name="text" > | ||
59 | <string>Release &Candidate</string> | ||
60 | </property> | ||
61 | </widget> | ||
62 | </item> | ||
63 | <item> | ||
57 | <widget class="QRadioButton" name="radioCurrent" > | 64 | <widget class="QRadioButton" name="radioCurrent" > |
58 | <property name="text" > | 65 | <property name="text" > |
59 | <string>&Development build</string> | 66 | <string>&Development build</string> |