diff options
author | Dominik Wenger <domonoky@googlemail.com> | 2007-08-26 19:06:40 +0000 |
---|---|---|
committer | Dominik Wenger <domonoky@googlemail.com> | 2007-08-26 19:06:40 +0000 |
commit | 388506ec780d9617be7f8f8eeb96d13e581e702b (patch) | |
tree | a1dbb0028ba766081f72ee282afa49e7b8349136 /rbutil/rbutilqt/rbutilqt.cpp | |
parent | 0aeea5d9a715f5076cab4e9eaaa2a41665203186 (diff) | |
download | rockbox-388506ec780d9617be7f8f8eeb96d13e581e702b.tar.gz rockbox-388506ec780d9617be7f8f8eeb96d13e581e702b.zip |
rbutilqt: first attempt to Small and Complete Installation, could be improved.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14463 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/rbutilqt/rbutilqt.cpp')
-rw-r--r-- | rbutil/rbutilqt/rbutilqt.cpp | 67 |
1 files changed, 63 insertions, 4 deletions
diff --git a/rbutil/rbutilqt/rbutilqt.cpp b/rbutil/rbutilqt/rbutilqt.cpp index a374737bd8..6ae5fbf5e8 100644 --- a/rbutil/rbutilqt/rbutilqt.cpp +++ b/rbutil/rbutilqt/rbutilqt.cpp @@ -31,6 +31,7 @@ #include "installthemes.h" #include "uninstallwindow.h" #include "browseof.h" +#include "multiinstaller.h" #ifdef __linux #include <stdio.h> @@ -93,10 +94,9 @@ RbUtilQt::RbUtilQt(QWidget *parent) : QMainWindow(parent) connect(ui.buttonRemoveRockbox, SIGNAL(clicked()), this, SLOT(uninstall())); connect(ui.buttonRemoveBootloader, SIGNAL(clicked()), this, SLOT(uninstallBootloader())); connect(ui.buttonDownloadManual, SIGNAL(clicked()), this, SLOT(downloadManual())); - - // disable unimplemented stuff - ui.buttonSmall->setEnabled(false); - ui.buttonComplete->setEnabled(false); + connect(ui.buttonSmall, SIGNAL(clicked()), this, SLOT(smallInstall())); + connect(ui.buttonComplete, SIGNAL(clicked()), this, SLOT(completeInstall())); + #if !defined(STATIC) ui.actionInstall_Rockbox_Utility_on_player->setEnabled(false); #else @@ -299,6 +299,65 @@ void RbUtilQt::updateManual() } } +void RbUtilQt::completeInstall() +{ + if(QMessageBox::question(this, tr("Confirm Installation"), + tr("Do you really want to make a complete Installation?"), + QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) return; + + MultiInstaller installer(this); + installer.setUserSettings(userSettings); + installer.setDeviceSettings(devices); + installer.setProxy(proxy()); + + buildInfo.open(); + QSettings info(buildInfo.fileName(), QSettings::IniFormat, this); + buildInfo.close(); + + devices->beginGroup(platform); + QString released = devices->value("released").toString(); + devices->endGroup(); + if(released == "yes") { + // only set the keys if needed -- querying will yield an empty string + // if not set. + versmap.insert("rel_rev", devices->value("last_release").toString()); + versmap.insert("rel_date", ""); // FIXME: provide the release timestamp + } + installer.setVersionStrings(versmap); + + installer.installComplete(); + +} + +void RbUtilQt::smallInstall() +{ + if(QMessageBox::question(this, tr("Confirm Installation"), + tr("Do you really want to make a small Installation?"), + QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) return; + + MultiInstaller installer(this); + installer.setUserSettings(userSettings); + installer.setDeviceSettings(devices); + installer.setProxy(proxy()); + + buildInfo.open(); + QSettings info(buildInfo.fileName(), QSettings::IniFormat, this); + buildInfo.close(); + + devices->beginGroup(platform); + QString released = devices->value("released").toString(); + devices->endGroup(); + if(released == "yes") { + // only set the keys if needed -- querying will yield an empty string + // if not set. + versmap.insert("rel_rev", devices->value("last_release").toString()); + versmap.insert("rel_date", ""); // FIXME: provide the release timestamp + } + installer.setVersionStrings(versmap); + + installer.installSmall(); + +} void RbUtilQt::install() { |