mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-20 10:32:42 -05:00
Factorize smallInstall and completeInstall code.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14724 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
1464c9b5d0
commit
e6dab6d0ac
2 changed files with 13 additions and 41 deletions
|
|
@ -319,44 +319,8 @@ void RbUtilQt::completeInstall()
|
||||||
logger = new ProgressLoggerGui(this);
|
logger = new ProgressLoggerGui(this);
|
||||||
logger->show();
|
logger->show();
|
||||||
|
|
||||||
QString mountpoint = userSettings->value("mountpoint").toString();
|
if(smallInstallInner())
|
||||||
// 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;
|
||||||
}
|
|
||||||
// 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
|
// Fonts
|
||||||
m_error = false;
|
m_error = false;
|
||||||
|
|
@ -406,12 +370,17 @@ void RbUtilQt::smallInstall()
|
||||||
logger = new ProgressLoggerGui(this);
|
logger = new ProgressLoggerGui(this);
|
||||||
logger->show();
|
logger->show();
|
||||||
|
|
||||||
|
smallInstallInner();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RbUtilQt::smallInstallInner()
|
||||||
|
{
|
||||||
QString mountpoint = userSettings->value("mountpoint").toString();
|
QString mountpoint = userSettings->value("mountpoint").toString();
|
||||||
// show dialog with error if mount point is wrong
|
// show dialog with error if mount point is wrong
|
||||||
if(!QFileInfo(mountpoint).isDir()) {
|
if(!QFileInfo(mountpoint).isDir()) {
|
||||||
logger->addItem(tr("Mount point is wrong!"),LOGERROR);
|
logger->addItem(tr("Mount point is wrong!"),LOGERROR);
|
||||||
logger->abort();
|
logger->abort();
|
||||||
return;
|
return true;
|
||||||
}
|
}
|
||||||
// Bootloader
|
// Bootloader
|
||||||
devices->beginGroup(userSettings->value("platform").toString());
|
devices->beginGroup(userSettings->value("platform").toString());
|
||||||
|
|
@ -419,14 +388,14 @@ void RbUtilQt::smallInstall()
|
||||||
m_error = false;
|
m_error = false;
|
||||||
m_installed = false;
|
m_installed = false;
|
||||||
if(!installBootloaderAuto())
|
if(!installBootloaderAuto())
|
||||||
return;
|
return true;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// wait for boot loader installation finished
|
// wait for boot loader installation finished
|
||||||
while(!m_installed)
|
while(!m_installed)
|
||||||
QApplication::processEvents();
|
QApplication::processEvents();
|
||||||
}
|
}
|
||||||
if(m_error) return;
|
if(m_error) return true;
|
||||||
logger->undoAbort();
|
logger->undoAbort();
|
||||||
}
|
}
|
||||||
devices->endGroup();
|
devices->endGroup();
|
||||||
|
|
@ -435,13 +404,15 @@ void RbUtilQt::smallInstall()
|
||||||
m_error = false;
|
m_error = false;
|
||||||
m_installed = false;
|
m_installed = false;
|
||||||
if(!installAuto())
|
if(!installAuto())
|
||||||
return;
|
return true;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// wait for installation finished
|
// wait for installation finished
|
||||||
while(!m_installed)
|
while(!m_installed)
|
||||||
QApplication::processEvents();
|
QApplication::processEvents();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RbUtilQt::installdone(bool error)
|
void RbUtilQt::installdone(bool error)
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,7 @@ class RbUtilQt : public QMainWindow
|
||||||
|
|
||||||
void completeInstall(void);
|
void completeInstall(void);
|
||||||
void smallInstall(void);
|
void smallInstall(void);
|
||||||
|
bool smallInstallInner(void);
|
||||||
void installdone(bool error);
|
void installdone(bool error);
|
||||||
|
|
||||||
void installBtn(void);
|
void installBtn(void);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue