1
0
Fork 0
forked from len0rd/rockbox

Check environment before starting installation.

The environment needs to be correct for other installations than main Rockbox
as well.

Change-Id: Icf626de63b58ba40f600fd095a254b6e7e9e46ee
This commit is contained in:
Dominik Riebeling 2012-08-19 10:49:53 +02:00
parent 4908b8eb1c
commit ca1bbc08b3
2 changed files with 15 additions and 15 deletions

View file

@ -299,6 +299,7 @@ QString Utils::findExecutable(QString name)
*/ */
QString Utils::checkEnvironment(bool permission) QString Utils::checkEnvironment(bool permission)
{ {
qDebug() << "[Utils] checking environment";
QString text = ""; QString text = "";
// check permission // check permission

View file

@ -157,9 +157,23 @@ void SelectiveInstallWidget::startInstall(void)
{ {
qDebug() << "[SelectiveInstallWidget] starting installation"; qDebug() << "[SelectiveInstallWidget] starting installation";
saveSettings(); saveSettings();
m_installStage = 0; m_installStage = 0;
if(m_logger != NULL) delete m_logger; if(m_logger != NULL) delete m_logger;
m_logger = new ProgressLoggerGui(this); m_logger = new ProgressLoggerGui(this);
QString warning = Utils::checkEnvironment(false);
if(!warning.isEmpty())
{
warning += "<br/>" + tr("Continue with installation?");
if(QMessageBox::warning(this, tr("Really continue?"), warning,
QMessageBox::Ok | QMessageBox::Abort, QMessageBox::Abort)
== QMessageBox::Abort)
{
emit installSkipped(true);
return;
}
}
m_logger->show(); m_logger->show();
if(!QFileInfo(m_mountpoint).isDir()) { if(!QFileInfo(m_mountpoint).isDir()) {
m_logger->addItem(tr("Mountpoint is wrong"), LOGERROR); m_logger->addItem(tr("Mountpoint is wrong"), LOGERROR);
@ -360,21 +374,6 @@ void SelectiveInstallWidget::installRockbox(void)
RbSettings::setValue(RbSettings::Build, selected); RbSettings::setValue(RbSettings::Build, selected);
RbSettings::sync(); RbSettings::sync();
QString warning = Utils::checkEnvironment(false);
if(!warning.isEmpty())
{
warning += "<br/>" + tr("Continue with installation?");
if(QMessageBox::warning(this, tr("Really continue?"), warning,
QMessageBox::Ok | QMessageBox::Abort, QMessageBox::Abort)
== QMessageBox::Abort)
{
m_logger->addItem(tr("Aborted!"),LOGERROR);
m_logger->setFinished();
emit installSkipped(true);
return;
}
}
if(selected == "release") url = ServerInfo::platformValue(m_target, if(selected == "release") url = ServerInfo::platformValue(m_target,
ServerInfo::CurReleaseUrl).toString(); ServerInfo::CurReleaseUrl).toString();
else if(selected == "development") url = ServerInfo::platformValue(m_target, else if(selected == "development") url = ServerInfo::platformValue(m_target,