summaryrefslogtreecommitdiff
path: root/rbutil/rbutilqt/rbutilqt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'rbutil/rbutilqt/rbutilqt.cpp')
-rw-r--r--rbutil/rbutilqt/rbutilqt.cpp36
1 files changed, 22 insertions, 14 deletions
diff --git a/rbutil/rbutilqt/rbutilqt.cpp b/rbutil/rbutilqt/rbutilqt.cpp
index c9efb5e81a..5ef43b6732 100644
--- a/rbutil/rbutilqt/rbutilqt.cpp
+++ b/rbutil/rbutilqt/rbutilqt.cpp
@@ -79,6 +79,9 @@ RbUtilQt::RbUtilQt(QWidget *parent) : QMainWindow(parent)
79 ui.treeInfo->setHeaderLabels(QStringList() << tr("File") << tr("Version")); 79 ui.treeInfo->setHeaderLabels(QStringList() << tr("File") << tr("Version"));
80 ui.treeInfo->expandAll(); 80 ui.treeInfo->expandAll();
81 ui.treeInfo->setColumnCount(2); 81 ui.treeInfo->setColumnCount(2);
82 // disable quick install until version info is available
83 ui.buttonSmall->setEnabled(false);
84 ui.buttonComplete->setEnabled(false);
82 85
83 connect(ui.tabWidget, SIGNAL(currentChanged(int)), this, SLOT(updateTabs(int))); 86 connect(ui.tabWidget, SIGNAL(currentChanged(int)), this, SLOT(updateTabs(int)));
84 connect(ui.actionAbout_Qt, SIGNAL(triggered()), qApp, SLOT(aboutQt())); 87 connect(ui.actionAbout_Qt, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
@@ -177,6 +180,19 @@ void RbUtilQt::downloadDone(bool error)
177 versmap.insert("arch_rev", info.value("dailies/rev").toString()); 180 versmap.insert("arch_rev", info.value("dailies/rev").toString());
178 versmap.insert("arch_date", info.value("dailies/date").toString()); 181 versmap.insert("arch_date", info.value("dailies/date").toString());
179 182
183 info.beginGroup("release");
184 versmap.insert("rel_rev", info.value(settings->curPlatform()).toString());
185 info.endGroup();
186
187 if(versmap.value("rel_rev").isEmpty()) {
188 ui.buttonSmall->setEnabled(false);
189 ui.buttonComplete->setEnabled(false);
190 }
191 else {
192 ui.buttonSmall->setEnabled(true);
193 ui.buttonComplete->setEnabled(true);
194 }
195
180 bleeding = new HttpGet(this); 196 bleeding = new HttpGet(this);
181 connect(bleeding, SIGNAL(done(bool)), this, SLOT(downloadBleedingDone(bool))); 197 connect(bleeding, SIGNAL(done(bool)), this, SLOT(downloadBleedingDone(bool)));
182 connect(bleeding, SIGNAL(requestFinished(int, bool)), this, SLOT(downloadDone(int, bool))); 198 connect(bleeding, SIGNAL(requestFinished(int, bool)), this, SLOT(downloadDone(int, bool)));
@@ -215,7 +231,7 @@ void RbUtilQt::downloadBleedingDone(bool error)
215 versmap.insert("bleed_rev", info.value("bleeding/rev").toString()); 231 versmap.insert("bleed_rev", info.value("bleeding/rev").toString());
216 versmap.insert("bleed_date", info.value("bleeding/timestamp").toString()); 232 versmap.insert("bleed_date", info.value("bleeding/timestamp").toString());
217 qDebug() << "versmap =" << versmap; 233 qDebug() << "versmap =" << versmap;
218 234
219 m_gotInfo = true; 235 m_gotInfo = true;
220} 236}
221 237
@@ -362,7 +378,7 @@ void RbUtilQt::completeInstall()
362 "This will install Rockbox %1. To install the most recent " 378 "This will install Rockbox %1. To install the most recent "
363 "development build available press \"Cancel\" and " 379 "development build available press \"Cancel\" and "
364 "use the \"Installation\" tab.") 380 "use the \"Installation\" tab.")
365 .arg(settings->lastRelease(settings->curPlatform())), 381 .arg(versmap.value("rel_rev")),
366 QMessageBox::Ok | QMessageBox::Cancel) != QMessageBox::Ok) 382 QMessageBox::Ok | QMessageBox::Cancel) != QMessageBox::Ok)
367 return; 383 return;
368 // create logger 384 // create logger
@@ -420,7 +436,7 @@ void RbUtilQt::smallInstall()
420 "This will install Rockbox %1. To install the most recent " 436 "This will install Rockbox %1. To install the most recent "
421 "development build available press \"Cancel\" and " 437 "development build available press \"Cancel\" and "
422 "use the \"Installation\" tab.") 438 "use the \"Installation\" tab.")
423 .arg(settings->lastRelease(settings->curPlatform())), 439 .arg(versmap.value("rel_rev")),
424 QMessageBox::Ok | QMessageBox::Cancel) != QMessageBox::Ok) 440 QMessageBox::Ok | QMessageBox::Cancel) != QMessageBox::Ok)
425 return; 441 return;
426 442
@@ -491,9 +507,8 @@ void RbUtilQt::installBtn()
491bool RbUtilQt::installAuto() 507bool RbUtilQt::installAuto()
492{ 508{
493 QString file = QString("%1/%2/rockbox-%3-%4.zip") 509 QString file = QString("%1/%2/rockbox-%3-%4.zip")
494 .arg(settings->releaseUrl(), settings->lastRelease(settings->curPlatform()), 510 .arg(settings->releaseUrl(), versmap.value(settings->curPlatform()),
495 settings->curPlatform(), settings->lastRelease(settings->curPlatform())); 511 settings->curPlatform(), versmap.value(settings->curPlatform()));
496
497 buildInfo.open(); 512 buildInfo.open();
498 QSettings info(buildInfo.fileName(), QSettings::IniFormat, this); 513 QSettings info(buildInfo.fileName(), QSettings::IniFormat, this);
499 buildInfo.close(); 514 buildInfo.close();
@@ -552,7 +567,7 @@ bool RbUtilQt::installAuto()
552 ZipInstaller* installer = new ZipInstaller(this); 567 ZipInstaller* installer = new ZipInstaller(this);
553 installer->setUrl(file); 568 installer->setUrl(file);
554 installer->setLogSection("Rockbox (Base)"); 569 installer->setLogSection("Rockbox (Base)");
555 installer->setLogVersion(settings->lastRelease(settings->curPlatform())); 570 installer->setLogVersion(versmap.value("rel_rev"));
556 if(!settings->cacheDisabled()) 571 if(!settings->cacheDisabled())
557 installer->setCache(true); 572 installer->setCache(true);
558 installer->setMountPoint(settings->mountpoint()); 573 installer->setMountPoint(settings->mountpoint());
@@ -571,13 +586,6 @@ void RbUtilQt::install()
571 buildInfo.open(); 586 buildInfo.open();
572 QSettings info(buildInfo.fileName(), QSettings::IniFormat, this); 587 QSettings info(buildInfo.fileName(), QSettings::IniFormat, this);
573 buildInfo.close(); 588 buildInfo.close();
574
575 if(settings->curReleased()) {
576 // only set the keys if needed -- querying will yield an empty string
577 // if not set.
578 versmap.insert("rel_rev", settings->lastRelease(settings->curPlatform()));
579 versmap.insert("rel_date", ""); // FIXME: provide the release timestamp
580 }
581 installWindow->setVersionStrings(versmap); 589 installWindow->setVersionStrings(versmap);
582 590
583 installWindow->show(); 591 installWindow->show();