summaryrefslogtreecommitdiff
path: root/rbutil/rbutilqt/installwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'rbutil/rbutilqt/installwindow.cpp')
-rw-r--r--rbutil/rbutilqt/installwindow.cpp45
1 files changed, 3 insertions, 42 deletions
diff --git a/rbutil/rbutilqt/installwindow.cpp b/rbutil/rbutilqt/installwindow.cpp
index 584b014ae8..8abc342690 100644
--- a/rbutil/rbutilqt/installwindow.cpp
+++ b/rbutil/rbutilqt/installwindow.cpp
@@ -32,7 +32,6 @@ InstallWindow::InstallWindow(QWidget *parent) : QDialog(parent)
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.radioCurrent, SIGNAL(toggled(bool)), this, SLOT(setDetailsCurrent(bool))); 34 connect(ui.radioCurrent, SIGNAL(toggled(bool)), this, SLOT(setDetailsCurrent(bool)));
35 connect(ui.radioArchived, SIGNAL(toggled(bool)), this, SLOT(setDetailsArchived(bool)));
36 connect(ui.changeBackup, SIGNAL(pressed()), this, SLOT(changeBackupPath())); 35 connect(ui.changeBackup, SIGNAL(pressed()), this, SLOT(changeBackupPath()));
37 connect(ui.backup, SIGNAL(stateChanged(int)), this, SLOT(backupCheckboxChanged(int))); 36 connect(ui.backup, SIGNAL(stateChanged(int)), this, SLOT(backupCheckboxChanged(int)));
38 37
@@ -56,10 +55,6 @@ InstallWindow::InstallWindow(QWidget *parent) : QDialog(parent)
56 backupCheckboxChanged(Qt::Unchecked); 55 backupCheckboxChanged(Qt::Unchecked);
57 56
58 57
59 if(ServerInfo::value(ServerInfo::DailyRevision).toString().isEmpty()) {
60 ui.radioArchived->setEnabled(false);
61 qDebug() << "[Install] no information about archived version available!";
62 }
63 if(ServerInfo::value(ServerInfo::CurReleaseVersion).toString().isEmpty()) { 58 if(ServerInfo::value(ServerInfo::CurReleaseVersion).toString().isEmpty()) {
64 ui.radioStable->setEnabled(false); 59 ui.radioStable->setEnabled(false);
65 } 60 }
@@ -69,24 +64,16 @@ InstallWindow::InstallWindow(QWidget *parent) : QDialog(parent)
69 if(RbSettings::value(RbSettings::Build).toString() == "stable" 64 if(RbSettings::value(RbSettings::Build).toString() == "stable"
70 && !ServerInfo::value(ServerInfo::CurReleaseVersion).toString().isEmpty()) 65 && !ServerInfo::value(ServerInfo::CurReleaseVersion).toString().isEmpty())
71 ui.radioStable->setChecked(true); 66 ui.radioStable->setChecked(true);
72 else if(RbSettings::value(RbSettings::Build).toString() == "archived")
73 ui.radioArchived->setChecked(true);
74 else if(RbSettings::value(RbSettings::Build).toString() == "current") 67 else if(RbSettings::value(RbSettings::Build).toString() == "current")
75 ui.radioCurrent->setChecked(true); 68 ui.radioCurrent->setChecked(true);
76 else if(!ServerInfo::value(ServerInfo::CurReleaseVersion).toString().isEmpty()) { 69 else if(!ServerInfo::value(ServerInfo::CurReleaseVersion).toString().isEmpty()) {
77 ui.radioStable->setChecked(true); 70 ui.radioStable->setChecked(true);
78 ui.radioStable->setEnabled(true); 71 ui.radioStable->setEnabled(true);
79 QFont font;
80 font.setBold(true);
81 ui.radioStable->setFont(font);
82 } 72 }
83 else { 73 else {
84 ui.radioCurrent->setChecked(true); 74 ui.radioCurrent->setChecked(true);
85 ui.radioStable->setEnabled(false); 75 ui.radioStable->setEnabled(false);
86 ui.radioStable->setChecked(false); 76 ui.radioStable->setChecked(false);
87 QFont font;
88 font.setBold(true);
89 ui.radioCurrent->setFont(font);
90 } 77 }
91 78
92} 79}
@@ -146,12 +133,6 @@ void InstallWindow::accept()
146 RbSettings::setValue(RbSettings::Build, "stable"); 133 RbSettings::setValue(RbSettings::Build, "stable");
147 myversion = ServerInfo::value(ServerInfo::CurReleaseVersion).toString(); 134 myversion = ServerInfo::value(ServerInfo::CurReleaseVersion).toString();
148 } 135 }
149 else if(ui.radioArchived->isChecked()) {
150 file = SystemInfo::value(SystemInfo::DailyUrl).toString();
151 RbSettings::setValue(RbSettings::Build, "archived");
152 myversion = "r" + ServerInfo::value(ServerInfo::DailyRevision).toString()
153 + "-" + ServerInfo::value(ServerInfo::DailyDate).toString();
154 }
155 else if(ui.radioCurrent->isChecked()) { 136 else if(ui.radioCurrent->isChecked()) {
156 file = SystemInfo::value(SystemInfo::BleedingUrl).toString(); 137 file = SystemInfo::value(SystemInfo::BleedingUrl).toString();
157 RbSettings::setValue(RbSettings::Build, "current"); 138 RbSettings::setValue(RbSettings::Build, "current");
@@ -163,7 +144,6 @@ void InstallWindow::accept()
163 } 144 }
164 file.replace("%MODEL%", buildname); 145 file.replace("%MODEL%", buildname);
165 file.replace("%RELVERSION%", ServerInfo::value(ServerInfo::CurReleaseVersion).toString()); 146 file.replace("%RELVERSION%", ServerInfo::value(ServerInfo::CurReleaseVersion).toString());
166 file.replace("%REVISION%", ServerInfo::value(ServerInfo::DailyRevision).toString());
167 file.replace("%DATE%", ServerInfo::value(ServerInfo::DailyDate).toString()); 147 file.replace("%DATE%", ServerInfo::value(ServerInfo::DailyDate).toString());
168 148
169 RbSettings::sync(); 149 RbSettings::sync();
@@ -274,14 +254,10 @@ void InstallWindow::setDetailsCurrent(bool show)
274{ 254{
275 if(show) { 255 if(show) {
276 ui.labelDetails->setText(tr("This is the absolute up to the minute " 256 ui.labelDetails->setText(tr("This is the absolute up to the minute "
277 "Rockbox built. A current build will get updated every time " 257 "Rockbox built. The development version will get updated every time "
278 "a change is made. Latest version is %1 (%2).") 258 "a change is made. Latest development version is %1 (%2).")
279 .arg(ServerInfo::value(ServerInfo::BleedingRevision).toString(), 259 .arg(ServerInfo::value(ServerInfo::BleedingRevision).toString(),
280 ServerInfo::value(ServerInfo::BleedingDate).toString())); 260 ServerInfo::value(ServerInfo::BleedingDate).toString()));
281 if(ServerInfo::value(ServerInfo::CurReleaseVersion).toString().isEmpty())
282 ui.labelNote->setText(tr("<b>This is the recommended version.</b>"));
283 else
284 ui.labelNote->setText("");
285 } 261 }
286} 262}
287 263
@@ -294,28 +270,13 @@ void InstallWindow::setDetailsStable(bool show)
294 270
295 if(!ServerInfo::value(ServerInfo::CurReleaseVersion).toString().isEmpty()) 271 if(!ServerInfo::value(ServerInfo::CurReleaseVersion).toString().isEmpty())
296 ui.labelNote->setText(tr("<b>Note:</b> " 272 ui.labelNote->setText(tr("<b>Note:</b> "
297 "The lastest released version is %1. " 273 "The lastest stable version is %1.")
298 "<b>This is the recommended version.</b>")
299 .arg(ServerInfo::value(ServerInfo::CurReleaseVersion).toString())); 274 .arg(ServerInfo::value(ServerInfo::CurReleaseVersion).toString()));
300 else ui.labelNote->setText(""); 275 else ui.labelNote->setText("");
301 } 276 }
302} 277}
303 278
304 279
305void InstallWindow::setDetailsArchived(bool show)
306{
307 if(show) {
308 ui.labelDetails->setText(tr("These are automatically built each day "
309 "from the current development source code. This generally has more "
310 "features than the last stable release but may be much less stable. "
311 "Features may change regularly."));
312 ui.labelNote->setText(tr("<b>Note:</b> archived version is %1 (%2).")
313 .arg(ServerInfo::value(ServerInfo::DailyRevision).toString(),
314 ServerInfo::value(ServerInfo::DailyDate).toString()));
315 }
316}
317
318
319void InstallWindow::changeEvent(QEvent *e) 280void InstallWindow::changeEvent(QEvent *e)
320{ 281{
321 if(e->type() == QEvent::LanguageChange) { 282 if(e->type() == QEvent::LanguageChange) {