summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--rbutil/rbutilqt/base/bootloaderinstallfile.cpp2
-rw-r--r--rbutil/rbutilqt/rbutilqt.cpp21
2 files changed, 13 insertions, 10 deletions
diff --git a/rbutil/rbutilqt/base/bootloaderinstallfile.cpp b/rbutil/rbutilqt/base/bootloaderinstallfile.cpp
index 7649f50e2a..58288d68de 100644
--- a/rbutil/rbutilqt/base/bootloaderinstallfile.cpp
+++ b/rbutil/rbutilqt/base/bootloaderinstallfile.cpp
@@ -141,6 +141,6 @@ BootloaderInstallBase::BootloaderType BootloaderInstallFile::installed(void)
BootloaderInstallBase::Capabilities BootloaderInstallFile::capabilities(void)
{
qDebug() << "[BootloaderInstallFile] getting capabilities";
- return Install | IsFile | CanCheckInstalled | Backup;
+ return Install | Uninstall | IsFile | CanCheckInstalled | Backup;
}
diff --git a/rbutil/rbutilqt/rbutilqt.cpp b/rbutil/rbutilqt/rbutilqt.cpp
index 56313f155e..59ba9e3c0e 100644
--- a/rbutil/rbutilqt/rbutilqt.cpp
+++ b/rbutil/rbutilqt/rbutilqt.cpp
@@ -1045,15 +1045,6 @@ void RbUtilQt::uninstallBootloader(void)
logger->setFinished();
return;
}
- if( (bl->capabilities() & BootloaderInstallBase::Uninstall) == 0)
- {
- logger->addItem(tr("Rockbox Utility can not uninstall the bootloader on this target. "
- "Try a normal firmware update to remove the booloader."), LOGERROR);
- logger->setFinished();
- delete bl;
- return;
- }
-
QStringList blfile = SystemInfo::value(SystemInfo::CurBootloaderFile).toStringList();
QStringList blfilepath;
for(int a = 0; a < blfile.size(); a++) {
@@ -1062,6 +1053,18 @@ void RbUtilQt::uninstallBootloader(void)
}
bl->setBlFile(blfilepath);
+ BootloaderInstallBase::BootloaderType currentbl = bl->installed();
+ if((bl->capabilities() & BootloaderInstallBase::Uninstall) == 0
+ || currentbl == BootloaderInstallBase::BootloaderUnknown
+ || currentbl == BootloaderInstallBase::BootloaderOther)
+ {
+ logger->addItem(tr("Rockbox Utility can not uninstall the bootloader on this target. "
+ "Try a normal firmware update to remove the booloader."), LOGERROR);
+ logger->setFinished();
+ delete bl;
+ return;
+ }
+
connect(bl, SIGNAL(logItem(QString, int)), logger, SLOT(addItem(QString, int)));
connect(bl, SIGNAL(logProgress(int, int)), logger, SLOT(setProgress(int, int)));