forked from len0rd/rockbox
rbutilQt: Add Uninstallation for Rockbox and Bootloaders. Also add Talkfiles to the installlog
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14275 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
d71339bf44
commit
6bc9abcceb
8 changed files with 59 additions and 13 deletions
|
|
@ -200,6 +200,7 @@ void InstallTalkWindow::accept()
|
||||||
talkcreator->setStripExtensions(ui.StripExtensions->isChecked());
|
talkcreator->setStripExtensions(ui.StripExtensions->isChecked());
|
||||||
|
|
||||||
talkcreator->createTalkFiles(logger);
|
talkcreator->createTalkFiles(logger);
|
||||||
|
connect(logger,SIGNAL(closed()),this,SLOT(close()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -274,7 +275,7 @@ void InstallTalkWindow::setUserSettings(QSettings *user)
|
||||||
{
|
{
|
||||||
userSettings = user;
|
userSettings = user;
|
||||||
|
|
||||||
|
talkcreator->setMountPoint(userSettings->value("defaults/mountpoint").toString());
|
||||||
|
|
||||||
setTalkFolder(userSettings->value("defaults/folderToTalk").toString());
|
setTalkFolder(userSettings->value("defaults/folderToTalk").toString());
|
||||||
setEncoderExec(userSettings->value("defaults/pathEncoder").toString());
|
setEncoderExec(userSettings->value("defaults/pathEncoder").toString());
|
||||||
|
|
|
||||||
|
|
@ -137,7 +137,7 @@ void ZipInstaller::downloadDone(bool error)
|
||||||
}
|
}
|
||||||
|
|
||||||
// add file to log
|
// add file to log
|
||||||
zipContents.append(m_mountpoint + m_target);
|
zipContents.append( m_target);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_dp->addItem(tr("Creating installation log"),LOGINFO);
|
m_dp->addItem(tr("Creating installation log"),LOGINFO);
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,8 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
#ifndef INSTALLRB_H
|
#ifndef INSTALLZIP_H
|
||||||
#define INSTALLRB_H
|
#define INSTALLZIP_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@
|
||||||
#include "installtalkwindow.h"
|
#include "installtalkwindow.h"
|
||||||
#include "httpget.h"
|
#include "httpget.h"
|
||||||
#include "installbootloader.h"
|
#include "installbootloader.h"
|
||||||
|
#include "uninstallwindow.h"
|
||||||
|
|
||||||
#ifdef __linux
|
#ifdef __linux
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
@ -80,13 +81,12 @@ RbUtilQt::RbUtilQt(QWidget *parent) : QMainWindow(parent)
|
||||||
connect(ui.buttonGames, SIGNAL(clicked()), this, SLOT(installDoom()));
|
connect(ui.buttonGames, SIGNAL(clicked()), this, SLOT(installDoom()));
|
||||||
connect(ui.buttonTalk, SIGNAL(clicked()), this, SLOT(createTalkFiles()));
|
connect(ui.buttonTalk, SIGNAL(clicked()), this, SLOT(createTalkFiles()));
|
||||||
connect(ui.buttonVoice, SIGNAL(clicked()), this, SLOT(installVoice()));
|
connect(ui.buttonVoice, SIGNAL(clicked()), this, SLOT(installVoice()));
|
||||||
|
connect(ui.buttonRemoveRockbox, SIGNAL(clicked()), this, SLOT(uninstall()));
|
||||||
|
connect(ui.buttonRemoveBootloader, SIGNAL(clicked()), this, SLOT(uninstallBootloader()));
|
||||||
|
|
||||||
// disable unimplemented stuff
|
// disable unimplemented stuff
|
||||||
ui.buttonThemes->setEnabled(false);
|
ui.buttonThemes->setEnabled(false);
|
||||||
ui.buttonSmall->setEnabled(false);
|
ui.buttonSmall->setEnabled(false);
|
||||||
ui.buttonRemoveRockbox->setEnabled(false);
|
|
||||||
ui.buttonRemoveBootloader->setEnabled(false);
|
|
||||||
ui.buttonComplete->setEnabled(false);
|
ui.buttonComplete->setEnabled(false);
|
||||||
|
|
||||||
initIpodpatcher();
|
initIpodpatcher();
|
||||||
|
|
@ -96,6 +96,8 @@ RbUtilQt::RbUtilQt(QWidget *parent) : QMainWindow(parent)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void RbUtilQt::downloadInfo()
|
void RbUtilQt::downloadInfo()
|
||||||
{
|
{
|
||||||
// try to get the current build information
|
// try to get the current build information
|
||||||
|
|
@ -396,3 +398,31 @@ void RbUtilQt::createTalkFiles(void)
|
||||||
installWindow->show();
|
installWindow->show();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RbUtilQt::uninstall(void)
|
||||||
|
{
|
||||||
|
UninstallWindow *uninstallWindow = new UninstallWindow(this);
|
||||||
|
uninstallWindow->setUserSettings(userSettings);
|
||||||
|
uninstallWindow->setDeviceSettings(devices);
|
||||||
|
uninstallWindow->show();
|
||||||
|
}
|
||||||
|
|
||||||
|
void RbUtilQt::uninstallBootloader(void)
|
||||||
|
{
|
||||||
|
if(QMessageBox::question(this, tr("Confirm Uninstallation"),
|
||||||
|
tr("Do you really want to uninstall the Bootloader?"),
|
||||||
|
QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) return;
|
||||||
|
// create logger
|
||||||
|
ProgressLoggerGui* logger = new ProgressLoggerGui(this);
|
||||||
|
logger->show();
|
||||||
|
|
||||||
|
QString plattform = userSettings->value("defaults/platform").toString();
|
||||||
|
BootloaderInstaller blinstaller(this);
|
||||||
|
blinstaller.setMountPoint(userSettings->value("defaults/mountpoint").toString());
|
||||||
|
blinstaller.setDevice(userSettings->value("defaults/platform").toString());
|
||||||
|
blinstaller.setBootloaderMethod(devices->value(plattform + "/bootloadermethod").toString());
|
||||||
|
blinstaller.setBootloaderName(devices->value(plattform + "/bootloadername").toString());
|
||||||
|
blinstaller.setBootloaderBaseUrl(devices->value("bootloader_url").toString());
|
||||||
|
blinstaller.uninstall(logger);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,8 @@ class RbUtilQt : public QMainWindow
|
||||||
void downloadDone(int, bool);
|
void downloadDone(int, bool);
|
||||||
void downloadInfo(void);
|
void downloadInfo(void);
|
||||||
void installVoice(void);
|
void installVoice(void);
|
||||||
|
void uninstall(void);
|
||||||
|
void uninstallBootloader(void);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,9 @@ SOURCES += rbutilqt.cpp \
|
||||||
../sansapatcher/sansapatcher.c \
|
../sansapatcher/sansapatcher.c \
|
||||||
irivertools/irivertools.cpp \
|
irivertools/irivertools.cpp \
|
||||||
irivertools/md5sum.cpp \
|
irivertools/md5sum.cpp \
|
||||||
browsedirtree.cpp
|
browsedirtree.cpp \
|
||||||
|
uninstall.cpp \
|
||||||
|
uninstallwindow.cpp
|
||||||
|
|
||||||
HEADERS += rbutilqt.h \
|
HEADERS += rbutilqt.h \
|
||||||
settings.h \
|
settings.h \
|
||||||
|
|
@ -62,7 +64,9 @@ HEADERS += rbutilqt.h \
|
||||||
irivertools/h120sums.h \
|
irivertools/h120sums.h \
|
||||||
irivertools/h300sums.h \
|
irivertools/h300sums.h \
|
||||||
irivertools/checksums.h \
|
irivertools/checksums.h \
|
||||||
browsedirtree.h
|
browsedirtree.h \
|
||||||
|
uninstall.h \
|
||||||
|
uninstallwindow.h
|
||||||
|
|
||||||
# Needed by QT on Win
|
# Needed by QT on Win
|
||||||
INCLUDEPATH = . irivertools zip zlib ../ipodpatcher ../sansapatcher
|
INCLUDEPATH = . irivertools zip zlib ../ipodpatcher ../sansapatcher
|
||||||
|
|
@ -81,7 +85,8 @@ FORMS += rbutilqtfrm.ui \
|
||||||
configurefrm.ui \
|
configurefrm.ui \
|
||||||
installbootloaderfrm.ui \
|
installbootloaderfrm.ui \
|
||||||
browsedirtreefrm.ui \
|
browsedirtreefrm.ui \
|
||||||
installtalkfrm.ui
|
installtalkfrm.ui \
|
||||||
|
uninstallfrm.ui
|
||||||
|
|
||||||
RESOURCES += rbutilqt.qrc
|
RESOURCES += rbutilqt.qrc
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -85,6 +85,8 @@ bool TalkFileCreator::createTalkFiles(ProgressloggerInterface* logger)
|
||||||
connect(logger,SIGNAL(aborted()),this,SLOT(abort()));
|
connect(logger,SIGNAL(aborted()),this,SLOT(abort()));
|
||||||
m_logger->setProgressMax(0);
|
m_logger->setProgressMax(0);
|
||||||
QDirIterator it(m_dir,QDirIterator::Subdirectories);
|
QDirIterator it(m_dir,QDirIterator::Subdirectories);
|
||||||
|
QSettings installlog(m_mountpoint + "/.rockbox/rbutil.log", QSettings::IniFormat, 0);
|
||||||
|
installlog.beginGroup("talkfiles");
|
||||||
// iterate over all entrys
|
// iterate over all entrys
|
||||||
while (it.hasNext())
|
while (it.hasNext())
|
||||||
{
|
{
|
||||||
|
|
@ -148,11 +150,16 @@ bool TalkFileCreator::createTalkFiles(ProgressloggerInterface* logger)
|
||||||
{
|
{
|
||||||
QFile wavfile(wavfilename);
|
QFile wavfile(wavfilename);
|
||||||
wavfile.remove();
|
wavfile.remove();
|
||||||
}
|
installlog.remove(wavfilename);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
installlog.setValue(wavfilename.remove(m_mountpoint),installlog.value(wavfilename,0).toInt()+1);
|
||||||
|
|
||||||
|
installlog.setValue(filename.remove(m_mountpoint),installlog.value(filename,0).toInt()+1);
|
||||||
it.next();
|
it.next();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
installlog.endGroup();
|
||||||
m_logger->addItem("Finished creating Talkfiles",LOGOK);
|
m_logger->addItem("Finished creating Talkfiles",LOGOK);
|
||||||
m_logger->setProgressMax(1);
|
m_logger->setProgressMax(1);
|
||||||
m_logger->setProgressValue(1);
|
m_logger->setProgressValue(1);
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,7 @@ public:
|
||||||
void setEncOpts(QString opts) {m_EncOpts=opts;}
|
void setEncOpts(QString opts) {m_EncOpts=opts;}
|
||||||
|
|
||||||
void setDir(QString dir){m_dir = dir; }
|
void setDir(QString dir){m_dir = dir; }
|
||||||
|
void setMountPoint(QString mountpoint) {m_mountpoint =mountpoint; }
|
||||||
|
|
||||||
void setOverwriteTalk(bool ov) {m_overwriteTalk = ov;}
|
void setOverwriteTalk(bool ov) {m_overwriteTalk = ov;}
|
||||||
void setOverwriteWav(bool ov) {m_overwriteWav = ov;}
|
void setOverwriteWav(bool ov) {m_overwriteWav = ov;}
|
||||||
|
|
@ -74,7 +75,7 @@ private:
|
||||||
bool voice(QString text,QString wavfile);
|
bool voice(QString text,QString wavfile);
|
||||||
|
|
||||||
QString m_dir;
|
QString m_dir;
|
||||||
|
QString m_mountpoint;
|
||||||
QString m_curTTS;
|
QString m_curTTS;
|
||||||
QString m_TTSexec;
|
QString m_TTSexec;
|
||||||
QStringList m_supportedTTS;
|
QStringList m_supportedTTS;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue