summaryrefslogtreecommitdiffstats
path: root/rbutil
diff options
context:
space:
mode:
authorAntoine Cellerier <dionoea@videolan.org>2007-09-15 23:00:02 +0000
committerAntoine Cellerier <dionoea@videolan.org>2007-09-15 23:00:02 +0000
commite6dab6d0ac379e91942ce94654b1186a88441e43 (patch)
tree4a2cd88c59ad7277fb6db33c7e63b0d4fce2755a /rbutil
parent1464c9b5d03c105d985320083fd36788036a0dd6 (diff)
downloadrockbox-e6dab6d0ac379e91942ce94654b1186a88441e43.tar.gz
rockbox-e6dab6d0ac379e91942ce94654b1186a88441e43.tar.bz2
rockbox-e6dab6d0ac379e91942ce94654b1186a88441e43.zip
Factorize smallInstall and completeInstall code.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14724 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil')
-rw-r--r--rbutil/rbutilqt/rbutilqt.cpp53
-rw-r--r--rbutil/rbutilqt/rbutilqt.h1
2 files changed, 13 insertions, 41 deletions
diff --git a/rbutil/rbutilqt/rbutilqt.cpp b/rbutil/rbutilqt/rbutilqt.cpp
index f06669d5c5..0f6a856bd2 100644
--- a/rbutil/rbutilqt/rbutilqt.cpp
+++ b/rbutil/rbutilqt/rbutilqt.cpp
@@ -319,44 +319,8 @@ void RbUtilQt::completeInstall()
logger = new ProgressLoggerGui(this);
logger->show();
- QString mountpoint = userSettings->value("mountpoint").toString();
- // show dialog with error if mount point is wrong
- if(!QFileInfo(mountpoint).isDir()) {
- logger->addItem(tr("Mount point is wrong!"),LOGERROR);
- logger->abort();
+ if(smallInstallInner())
return;
- }
- // Bootloader
- devices->beginGroup(userSettings->value("platform").toString());
- if(devices->value("needsbootloader", "") == "yes") {
- m_error = false;
- m_installed = false;
- if(!installBootloaderAuto())
- return;
- else
- {
- // wait for boot loader installation finished
- while(!m_installed)
- QApplication::processEvents();
- }
- if(m_error) return;
- logger->undoAbort();
- }
- devices->endGroup();
-
- // Rockbox
- m_error = false;
- m_installed = false;
- if(!installAuto())
- return;
- else
- {
- // wait for installation finished
- while(!m_installed)
- QApplication::processEvents();
- }
- if(m_error) return;
- logger->undoAbort();
// Fonts
m_error = false;
@@ -406,12 +370,17 @@ void RbUtilQt::smallInstall()
logger = new ProgressLoggerGui(this);
logger->show();
+ smallInstallInner();
+}
+
+bool RbUtilQt::smallInstallInner()
+{
QString mountpoint = userSettings->value("mountpoint").toString();
// show dialog with error if mount point is wrong
if(!QFileInfo(mountpoint).isDir()) {
logger->addItem(tr("Mount point is wrong!"),LOGERROR);
logger->abort();
- return;
+ return true;
}
// Bootloader
devices->beginGroup(userSettings->value("platform").toString());
@@ -419,14 +388,14 @@ void RbUtilQt::smallInstall()
m_error = false;
m_installed = false;
if(!installBootloaderAuto())
- return;
+ return true;
else
{
// wait for boot loader installation finished
while(!m_installed)
QApplication::processEvents();
}
- if(m_error) return;
+ if(m_error) return true;
logger->undoAbort();
}
devices->endGroup();
@@ -435,13 +404,15 @@ void RbUtilQt::smallInstall()
m_error = false;
m_installed = false;
if(!installAuto())
- return;
+ return true;
else
{
// wait for installation finished
while(!m_installed)
QApplication::processEvents();
}
+
+ return false;
}
void RbUtilQt::installdone(bool error)
diff --git a/rbutil/rbutilqt/rbutilqt.h b/rbutil/rbutilqt/rbutilqt.h
index 087152db3c..cdabd6c571 100644
--- a/rbutil/rbutilqt/rbutilqt.h
+++ b/rbutil/rbutilqt/rbutilqt.h
@@ -69,6 +69,7 @@ class RbUtilQt : public QMainWindow
void completeInstall(void);
void smallInstall(void);
+ bool smallInstallInner(void);
void installdone(bool error);
void installBtn(void);