summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2008-12-19 22:18:07 +0000
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2008-12-19 22:18:07 +0000
commit32a6262b5443f9bb50dd1563f755b675d690ebc6 (patch)
tree6d4a83def74efffab16afc3cb93b6b897d36f768
parent1aa881298e7479402e273e8146d60b2ffc6c1648 (diff)
downloadrockbox-32a6262b5443f9bb50dd1563f755b675d690ebc6.tar.gz
rockbox-32a6262b5443f9bb50dd1563f755b675d690ebc6.zip
- make installation dialog default to the last selection if existing.
- enable cache usage for current builds too -- the http class now checks the timestamp of the file on the server, so there's no more point in not using the cache for current builds too. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19492 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--rbutil/rbutilqt/install.cpp24
-rw-r--r--rbutil/rbutilqt/rbsettings.cpp5
-rw-r--r--rbutil/rbutilqt/rbsettings.h1
3 files changed, 22 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
diff --git a/rbutil/rbutilqt/rbsettings.cpp b/rbutil/rbutilqt/rbsettings.cpp
index 2b28ee4d9a..30552e6f3b 100644
--- a/rbutil/rbutilqt/rbsettings.cpp
+++ b/rbutil/rbutilqt/rbsettings.cpp
@@ -124,6 +124,11 @@ QString RbSettings::cachePath()
124 return userSettings->value("cachepath", QDir::tempPath()).toString(); 124 return userSettings->value("cachepath", QDir::tempPath()).toString();
125} 125}
126 126
127QString RbSettings::build()
128{
129 return userSettings->value("build").toString();
130}
131
127QString RbSettings::bootloaderUrl() 132QString RbSettings::bootloaderUrl()
128{ 133{
129 return devices->value("bootloader_url").toString(); 134 return devices->value("bootloader_url").toString();
diff --git a/rbutil/rbutilqt/rbsettings.h b/rbutil/rbutilqt/rbsettings.h
index 97a54fcf5d..f232a66c85 100644
--- a/rbutil/rbutilqt/rbsettings.h
+++ b/rbutil/rbutilqt/rbsettings.h
@@ -50,6 +50,7 @@ class RbSettings : public QObject
50 QString bleedingUrl(); 50 QString bleedingUrl();
51 QString lastRelease(QString platform); 51 QString lastRelease(QString platform);
52 QString cachePath(); 52 QString cachePath();
53 QString build(void);
53 QString bootloaderUrl(); 54 QString bootloaderUrl();
54 QString bootloaderInfoUrl(); 55 QString bootloaderInfoUrl();
55 QString fontUrl(); 56 QString fontUrl();