mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 13:15:18 -05:00
rbutil: Detect if Rockbox is already installed, and allow Backup bevor installing a new build.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17440 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
251db06294
commit
acccee479a
7 changed files with 49 additions and 11 deletions
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
#include "install.h"
|
||||
#include "ui_installfrm.h"
|
||||
#include "rbzip.h"
|
||||
|
||||
Install::Install(QWidget *parent) : QDialog(parent)
|
||||
{
|
||||
|
|
@ -83,6 +84,21 @@ void Install::accept()
|
|||
}
|
||||
settings->sync();
|
||||
|
||||
//! check if rockbox is already installed
|
||||
if(QDir(settings->mountpoint() + "/.rockbox").exists())
|
||||
{
|
||||
if(QMessageBox::question(this, tr("Installed Rockbox detected"),
|
||||
tr("Rockbox installation detected. Do you want to backup first?"),
|
||||
QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes)
|
||||
{
|
||||
QString backupName = QFileDialog::getSaveFileName(this,"Select Backup Filename",settings->mountpoint());
|
||||
logger->show();
|
||||
RbZip backup;
|
||||
backup.createZip(backupName,settings->mountpoint() + "/.rockbox",logger);
|
||||
}
|
||||
}
|
||||
|
||||
//! install build
|
||||
installer = new ZipInstaller(this);
|
||||
installer->setUrl(file);
|
||||
installer->setLogSection("Rockbox (Base)");
|
||||
|
|
|
|||
|
|
@ -19,9 +19,9 @@
|
|||
|
||||
#include "progressloggergui.h"
|
||||
|
||||
ProgressLoggerGui::ProgressLoggerGui(QObject* parent): ProgressloggerInterface(parent)
|
||||
ProgressLoggerGui::ProgressLoggerGui(QWidget* parent): ProgressloggerInterface(parent)
|
||||
{
|
||||
downloadProgress = new QDialog();
|
||||
downloadProgress = new QDialog(parent);
|
||||
downloadProgress->setModal(true);
|
||||
dp.setupUi(downloadProgress);
|
||||
dp.listProgress->setAlternatingRowColors(true);
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ class ProgressLoggerGui :public ProgressloggerInterface
|
|||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ProgressLoggerGui(QObject * parent);
|
||||
ProgressLoggerGui(QWidget * parent);
|
||||
|
||||
virtual void addItem(const QString &text); //adds a string to the list
|
||||
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@
|
|||
#include "uninstallwindow.h"
|
||||
#include "browseof.h"
|
||||
#include "utils.h"
|
||||
#include "rbzip.h"
|
||||
|
||||
#if defined(Q_OS_LINUX)
|
||||
#include <stdio.h>
|
||||
|
|
@ -463,6 +464,21 @@ bool RbUtilQt::installAuto()
|
|||
|
||||
QString myversion = "r" + versmap.value("bleed_rev");
|
||||
|
||||
//! check if rockbox is already installed
|
||||
if(QDir(settings->mountpoint() + "/.rockbox").exists())
|
||||
{
|
||||
if(QMessageBox::question(this, tr("Installed Rockbox detected"),
|
||||
tr("Rockbox installation detected. Do you want to backup first?"),
|
||||
QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes)
|
||||
{
|
||||
QString backupName = QFileDialog::getSaveFileName(this,"Select Backup Filename",settings->mountpoint());
|
||||
logger->show();
|
||||
RbZip backup;
|
||||
backup.createZip(backupName,settings->mountpoint() + "/.rockbox",logger);
|
||||
}
|
||||
}
|
||||
|
||||
//! install current build
|
||||
ZipInstaller* installer = new ZipInstaller(this);
|
||||
installer->setUrl(file);
|
||||
installer->setLogSection("Rockbox (Base)");
|
||||
|
|
|
|||
|
|
@ -56,7 +56,8 @@ SOURCES += rbutilqt.cpp \
|
|||
voicefile.cpp \
|
||||
createvoicewindow.cpp \
|
||||
rbsettings.cpp \
|
||||
rbunzip.cpp
|
||||
rbunzip.cpp \
|
||||
rbzip.cpp
|
||||
|
||||
HEADERS += rbutilqt.h \
|
||||
install.h \
|
||||
|
|
@ -102,7 +103,8 @@ HEADERS += rbutilqt.h \
|
|||
voicefile.h \
|
||||
createvoicewindow.h \
|
||||
rbsettings.h \
|
||||
rbunzip.h
|
||||
rbunzip.h \
|
||||
rbzip.h
|
||||
|
||||
# Needed by QT on Win
|
||||
INCLUDEPATH = . irivertools zip zlib ../ipodpatcher ../sansapatcher ../../tools/rbspeex ../../tools
|
||||
|
|
|
|||
|
|
@ -441,13 +441,15 @@ Zip::ErrorCode Zip::addDirectory(const QString& path, const QString& root, Compr
|
|||
if (info.isDir())
|
||||
{
|
||||
// Recursion :)
|
||||
progress();
|
||||
ec = addDirectory(info.absoluteFilePath(), actualRoot, recursionOptions, level);
|
||||
}
|
||||
else
|
||||
{
|
||||
progress();
|
||||
ec = d->createEntry(info, actualRoot, level);
|
||||
filesAdded = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -104,6 +104,8 @@ public:
|
|||
|
||||
QString formatError(ErrorCode c) const;
|
||||
|
||||
virtual void progress() {}
|
||||
|
||||
private:
|
||||
ZipPrivate* d;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue