diff options
Diffstat (limited to 'rbutil/rbutilqt/install.cpp')
-rw-r--r-- | rbutil/rbutilqt/install.cpp | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/rbutil/rbutilqt/install.cpp b/rbutil/rbutilqt/install.cpp index ee0d2114da..dc861ec14d 100644 --- a/rbutil/rbutilqt/install.cpp +++ b/rbutil/rbutilqt/install.cpp | |||
@@ -33,10 +33,10 @@ Install::Install(RbSettings *sett,QWidget *parent) : QDialog(parent) | |||
33 | connect(ui.radioArchived, SIGNAL(toggled(bool)), this, SLOT(setDetailsArchived(bool))); | 33 | connect(ui.radioArchived, SIGNAL(toggled(bool)), this, SLOT(setDetailsArchived(bool))); |
34 | connect(ui.changeBackup,SIGNAL(pressed()),this,SLOT(changeBackupPath())); | 34 | connect(ui.changeBackup,SIGNAL(pressed()),this,SLOT(changeBackupPath())); |
35 | connect(ui.backup,SIGNAL(stateChanged(int)),this,SLOT(backupCheckboxChanged(int))); | 35 | connect(ui.backup,SIGNAL(stateChanged(int)),this,SLOT(backupCheckboxChanged(int))); |
36 | 36 | ||
37 | //! check if rockbox is already installed | 37 | //! check if rockbox is already installed |
38 | QString version = Detect::installedVersion(settings->mountpoint()); | 38 | QString version = Detect::installedVersion(settings->mountpoint()); |
39 | 39 | ||
40 | if(version != "") | 40 | if(version != "") |
41 | { | 41 | { |
42 | ui.Backupgroup->show(); | 42 | ui.Backupgroup->show(); |
@@ -48,7 +48,7 @@ Install::Install(RbSettings *sett,QWidget *parent) : QDialog(parent) | |||
48 | else | 48 | else |
49 | { | 49 | { |
50 | ui.Backupgroup->hide(); | 50 | ui.Backupgroup->hide(); |
51 | } | 51 | } |
52 | backupCheckboxChanged(Qt::Unchecked); | 52 | backupCheckboxChanged(Qt::Unchecked); |
53 | } | 53 | } |
54 | 54 | ||
@@ -167,16 +167,15 @@ void Install::accept() | |||
167 | installer->setUrl(file); | 167 | installer->setUrl(file); |
168 | installer->setLogSection("Rockbox (Base)"); | 168 | installer->setLogSection("Rockbox (Base)"); |
169 | if(!settings->cacheDisabled() | 169 | if(!settings->cacheDisabled() |
170 | && !ui.radioCurrent->isChecked() | ||
171 | && !ui.checkBoxCache->isChecked()) | 170 | && !ui.checkBoxCache->isChecked()) |
172 | { | 171 | { |
173 | installer->setCache(true); | 172 | installer->setCache(true); |
174 | } | 173 | } |
175 | installer->setLogVersion(myversion); | 174 | installer->setLogVersion(myversion); |
176 | installer->setMountPoint(mountPoint); | 175 | installer->setMountPoint(mountPoint); |
177 | 176 | ||
178 | connect(installer, SIGNAL(done(bool)), this, SLOT(done(bool))); | 177 | connect(installer, SIGNAL(done(bool)), this, SLOT(done(bool))); |
179 | 178 | ||
180 | installer->install(logger); | 179 | installer->install(logger); |
181 | 180 | ||
182 | } | 181 | } |
@@ -274,7 +273,15 @@ void Install::setVersionStrings(QMap<QString, QString> ver) | |||
274 | qDebug() << "no information about archived version available!"; | 273 | qDebug() << "no information about archived version available!"; |
275 | } | 274 | } |
276 | 275 | ||
277 | if(!version.value("rel_rev").isEmpty()) { | 276 | // try to use the old selection first. If no selection has been made |
277 | // in the past, use a preselection based on released status. | ||
278 | if(settings->build() == "stable") | ||
279 | ui.radioStable->setChecked(true); | ||
280 | else if(settings->build() == "archived") | ||
281 | ui.radioArchived->setChecked(true); | ||
282 | else if(settings->build() == "current") | ||
283 | ui.radioCurrent->setChecked(true); | ||
284 | else if(!version.value("rel_rev").isEmpty()) { | ||
278 | ui.radioStable->setChecked(true); | 285 | ui.radioStable->setChecked(true); |
279 | ui.radioStable->setEnabled(true); | 286 | ui.radioStable->setEnabled(true); |
280 | QFont font; | 287 | QFont font; |
@@ -289,6 +296,7 @@ void Install::setVersionStrings(QMap<QString, QString> ver) | |||
289 | font.setBold(true); | 296 | font.setBold(true); |
290 | ui.radioCurrent->setFont(font); | 297 | ui.radioCurrent->setFont(font); |
291 | } | 298 | } |
299 | |||
292 | qDebug() << "Install::setVersionStrings" << version; | 300 | qDebug() << "Install::setVersionStrings" << version; |
293 | } | 301 | } |
294 | 302 | ||