1
0
Fork 0
forked from len0rd/rockbox

Install widget: fallback to development build.

If neither an old selected build nor a release is available fallback to
selecting the development build.

Remove some old code that was not supposed to be be kept.

Change-Id: I883535bd8e7981e68bc3fac3bcd5f375e1237242
This commit is contained in:
Dominik Riebeling 2012-07-01 12:21:20 +02:00
parent a455f5901a
commit d8f5a00fc1

View file

@ -111,10 +111,14 @@ void SelectiveInstallWidget::updateVersion(void)
if(index != -1) { if(index != -1) {
ui.selectedVersion->setCurrentIndex(index); ui.selectedVersion->setCurrentIndex(index);
} }
else { else if(!m_versions["release"].isEmpty()) {
index = ui.selectedVersion->findData("release"); index = ui.selectedVersion->findData("release");
ui.selectedVersion->setCurrentIndex(index); ui.selectedVersion->setCurrentIndex(index);
} }
else {
index = ui.selectedVersion->findData("current");
ui.selectedVersion->setCurrentIndex(index);
}
// check if Rockbox is installed. If it is untick the bootloader option, as // check if Rockbox is installed. If it is untick the bootloader option, as
// well as if the selected player doesn't need a bootloader. // well as if the selected player doesn't need a bootloader.
if(m_blmethod == "none") { if(m_blmethod == "none") {
@ -378,52 +382,6 @@ void SelectiveInstallWidget::installRockbox(void)
else if(selected == "rc") url = ServerInfo::platformValue(m_target, else if(selected == "rc") url = ServerInfo::platformValue(m_target,
ServerInfo::RelCandidateUrl).toString(); ServerInfo::RelCandidateUrl).toString();
#if 0
RockboxInfo info(m_mountpoint);
if(info.success()) {
// existing installation found. Ask for backup.
QMessageBox::information(this, tr("Backup existing installation?"),
tr("Existing installation detected. Create a backup before installing?"),
QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
}
#endif
#if 0
//! check if we should backup
if(ui.backup->isChecked())
{
m_logger->addItem(tr("Beginning Backup..."),LOGINFO);
QCoreApplication::processEvents();
//! create dir, if it doesnt exist
QFileInfo backupFile(m_backupName);
if(!QDir(backupFile.path()).exists())
{
QDir a;
a.mkpath(backupFile.path());
}
//! create backup
bool result = true;
ZipUtil zip(this);
connect(&zip, SIGNAL(logProgress(int, int)), m_logger, SLOT(setProgress(int, int)));
connect(&zip, SIGNAL(logItem(QString, int)), m_logger, SLOT(addItem(QString, int)));
zip.open(m_backupName, QuaZip::mdCreate);
QString mp = RbSettings::value(RbSettings::Mountpoint).toString();
QString folder = mp + "/.rockbox";
result = zip.appendDirToArchive(folder, mp);
zip.close();
if(result) {
m_logger->addItem(tr("Backup finished."), LOGINFO);
}
else {
m_logger->addItem(tr("Backup failed!"), LOGERROR);
m_logger->setFinished();
return;
}
}
#endif
//! install build //! install build
if(m_zipinstaller != NULL) delete m_zipinstaller; if(m_zipinstaller != NULL) delete m_zipinstaller;
m_zipinstaller = new ZipInstaller(this); m_zipinstaller = new ZipInstaller(this);