summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomer Shalev <shalev.tomer@gmail.com>2009-11-01 17:16:02 +0000
committerTomer Shalev <shalev.tomer@gmail.com>2009-11-01 17:16:02 +0000
commit04f84cf1e81e6930bd3f84c1f4066da70ff6c467 (patch)
treea33faa9016bd99ea15d8af96bd66a6b5f695bc0d
parent3216d32a0538e4b75ae9e82dadc555011181633f (diff)
downloadrockbox-04f84cf1e81e6930bd3f84c1f4066da70ff6c467.tar.gz
rockbox-04f84cf1e81e6930bd3f84c1f4066da70ff6c467.zip
FS#10747 - Disable actions if rbutil is not configured properly
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23466 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--rbutil/rbutilqt/rbutilqt.cpp55
1 files changed, 29 insertions, 26 deletions
diff --git a/rbutil/rbutilqt/rbutilqt.cpp b/rbutil/rbutilqt/rbutilqt.cpp
index aa81513d88..18534029a5 100644
--- a/rbutil/rbutilqt/rbutilqt.cpp
+++ b/rbutil/rbutilqt/rbutilqt.cpp
@@ -93,6 +93,8 @@ RbUtilQt::RbUtilQt(QWidget *parent) : QMainWindow(parent)
93 // disable quick install until version info is available 93 // disable quick install until version info is available
94 ui.buttonSmall->setEnabled(false); 94 ui.buttonSmall->setEnabled(false);
95 ui.buttonComplete->setEnabled(false); 95 ui.buttonComplete->setEnabled(false);
96 ui.actionSmall_Installation->setEnabled(false);
97 ui.actionComplete_Installation->setEnabled(false);
96 98
97 connect(ui.tabWidget, SIGNAL(currentChanged(int)), this, SLOT(updateTabs(int))); 99 connect(ui.tabWidget, SIGNAL(currentChanged(int)), this, SLOT(updateTabs(int)));
98 connect(ui.actionAbout_Qt, SIGNAL(triggered()), qApp, SLOT(aboutQt())); 100 connect(ui.actionAbout_Qt, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
@@ -204,14 +206,12 @@ void RbUtilQt::downloadDone(bool error)
204 versmap.insert("rel_rev", info.value(RbSettings::value(RbSettings::CurBuildserverModel).toString()).toString()); 206 versmap.insert("rel_rev", info.value(RbSettings::value(RbSettings::CurBuildserverModel).toString()).toString());
205 info.endGroup(); 207 info.endGroup();
206 208
207 if(versmap.value("rel_rev").isEmpty()) { 209 bool installable = !versmap.value("rel_rev").isEmpty();
208 ui.buttonSmall->setEnabled(false); 210
209 ui.buttonComplete->setEnabled(false); 211 ui.buttonSmall->setEnabled(installable);
210 } 212 ui.buttonComplete->setEnabled(installable);
211 else { 213 ui.actionSmall_Installation->setEnabled(installable);
212 ui.buttonSmall->setEnabled(true); 214 ui.actionComplete_Installation->setEnabled(installable);
213 ui.buttonComplete->setEnabled(true);
214 }
215 215
216 bleeding = new HttpGet(this); 216 bleeding = new HttpGet(this);
217 connect(bleeding, SIGNAL(done(bool)), this, SLOT(downloadBleedingDone(bool))); 217 connect(bleeding, SIGNAL(done(bool)), this, SLOT(downloadBleedingDone(bool)));
@@ -343,24 +343,27 @@ void RbUtilQt::updateSettings()
343 343
344void RbUtilQt::updateDevice() 344void RbUtilQt::updateDevice()
345{ 345{
346 if(RbSettings::value(RbSettings::CurBootloaderMethod) == "none" ) { 346 /* TODO: We should check the flags of the bootloaderinstall classes, and not
347 ui.buttonBootloader->setEnabled(false); 347 * just check if its != none or != "fwpatcher" */
348 ui.buttonRemoveBootloader->setEnabled(false); 348
349 ui.labelBootloader->setEnabled(false); 349 /* Enable bootloader installation, if possible */
350 ui.labelRemoveBootloader->setEnabled(false); 350 bool bootloaderInstallable =
351 } 351 RbSettings::value(RbSettings::CurBootloaderMethod) != "none";
352 else { 352 ui.buttonBootloader->setEnabled(bootloaderInstallable);
353 ui.buttonBootloader->setEnabled(true); 353 ui.labelBootloader->setEnabled(bootloaderInstallable);
354 ui.labelBootloader->setEnabled(true); 354 ui.actionInstall_Bootloader->setEnabled(bootloaderInstallable);
355 if(RbSettings::value(RbSettings::CurBootloaderMethod) == "fwpatcher") { 355
356 ui.labelRemoveBootloader->setEnabled(false); 356 /* Enable bootloader uninstallation, if possible */
357 ui.buttonRemoveBootloader->setEnabled(false); 357 bool bootloaderUninstallable = bootloaderInstallable &&
358 } 358 RbSettings::value(RbSettings::CurBootloaderMethod) != "fwpatcher";
359 else { 359 ui.labelRemoveBootloader->setEnabled(bootloaderUninstallable);
360 ui.labelRemoveBootloader->setEnabled(true); 360 ui.buttonRemoveBootloader->setEnabled(bootloaderUninstallable);
361 ui.buttonRemoveBootloader->setEnabled(true); 361 ui.actionRemove_bootloader->setEnabled(bootloaderUninstallable);
362 } 362
363 } 363 /* Disable the whole tab widget if configuration is invalid */
364 bool configurationValid = !chkConfig(false);
365 ui.tabWidget->setEnabled(configurationValid);
366 ui.menuA_ctions->setEnabled(configurationValid);
364 367
365 // displayed device info 368 // displayed device info
366 QString mountpoint = RbSettings::value(RbSettings::Mountpoint).toString(); 369 QString mountpoint = RbSettings::value(RbSettings::Mountpoint).toString();