diff options
Diffstat (limited to 'rbutil')
-rw-r--r-- | rbutil/rbutilqt/base/uninstall.cpp | 34 | ||||
-rw-r--r-- | rbutil/rbutilqt/base/uninstall.h | 10 | ||||
-rw-r--r-- | rbutil/rbutilqt/rbutilqt.cpp | 3 | ||||
-rw-r--r-- | rbutil/rbutilqt/uninstallwindow.cpp | 11 |
4 files changed, 30 insertions, 28 deletions
diff --git a/rbutil/rbutilqt/base/uninstall.cpp b/rbutil/rbutilqt/base/uninstall.cpp index 2f3b3c767f..14674837d9 100644 --- a/rbutil/rbutilqt/base/uninstall.cpp +++ b/rbutil/rbutilqt/base/uninstall.cpp | |||
@@ -26,30 +26,27 @@ Uninstaller::Uninstaller(QObject* parent,QString mountpoint): QObject(parent) | |||
26 | m_mountpoint = mountpoint; | 26 | m_mountpoint = mountpoint; |
27 | } | 27 | } |
28 | 28 | ||
29 | void Uninstaller::deleteAll(ProgressloggerInterface* dp) | 29 | void Uninstaller::deleteAll(void) |
30 | { | 30 | { |
31 | m_dp = dp; | ||
32 | QString rbdir(m_mountpoint + ".rockbox/"); | 31 | QString rbdir(m_mountpoint + ".rockbox/"); |
33 | m_dp->addItem(tr("Starting Uninstallation"),LOGINFO); | 32 | emit logItem(tr("Starting Uninstallation"), LOGINFO); |
34 | m_dp->setProgressMax(0); | 33 | emit logProgress(0, 0); |
35 | Utils::recursiveRmdir(rbdir); | 34 | Utils::recursiveRmdir(rbdir); |
36 | m_dp->setProgressMax(1); | 35 | emit logProgress(1, 1); |
37 | m_dp->setProgressValue(1); | 36 | emit logItem(tr("Finished Uninstallation"), LOGOK); |
38 | m_dp->addItem(tr("Finished Uninstallation"),LOGOK); | 37 | emit logFinished(); |
39 | m_dp->setFinished(); | ||
40 | } | 38 | } |
41 | 39 | ||
42 | void Uninstaller::uninstall(ProgressloggerInterface* dp) | 40 | void Uninstaller::uninstall(void) |
43 | { | 41 | { |
44 | m_dp = dp; | 42 | emit logProgress(0, 0); |
45 | m_dp->setProgressMax(0); | 43 | emit logItem(tr("Starting Uninstallation"), LOGINFO); |
46 | m_dp->addItem(tr("Starting Uninstallation"),LOGINFO); | ||
47 | 44 | ||
48 | QSettings installlog(m_mountpoint + "/.rockbox/rbutil.log", QSettings::IniFormat, this); | 45 | QSettings installlog(m_mountpoint + "/.rockbox/rbutil.log", QSettings::IniFormat, this); |
49 | 46 | ||
50 | for(int i=0; i< uninstallSections.size() ; i++) | 47 | for(int i=0; i< uninstallSections.size() ; i++) |
51 | { | 48 | { |
52 | m_dp->addItem(tr("Uninstalling %1...").arg(uninstallSections.at(i)), LOGINFO); | 49 | emit logItem(tr("Uninstalling %1...").arg(uninstallSections.at(i)), LOGINFO); |
53 | QCoreApplication::processEvents(); | 50 | QCoreApplication::processEvents(); |
54 | // create list of all other install sections | 51 | // create list of all other install sections |
55 | QStringList sections = installlog.childGroups(); | 52 | QStringList sections = installlog.childGroups(); |
@@ -80,8 +77,8 @@ void Uninstaller::uninstall(ProgressloggerInterface* dp) | |||
80 | if(toDelete.isFile()) // if it is a file remove it | 77 | if(toDelete.isFile()) // if it is a file remove it |
81 | { | 78 | { |
82 | if(deleteFile && !QFile::remove(toDelete.filePath())) | 79 | if(deleteFile && !QFile::remove(toDelete.filePath())) |
83 | m_dp->addItem(tr("Could not delete %1") | 80 | emit logItem(tr("Could not delete %1") |
84 | .arg(toDelete.filePath()),LOGWARNING); | 81 | .arg(toDelete.filePath()), LOGWARNING); |
85 | installlog.remove(toDeleteList.at(j)); | 82 | installlog.remove(toDeleteList.at(j)); |
86 | qDebug() << "deleted: " << toDelete.filePath() ; | 83 | qDebug() << "deleted: " << toDelete.filePath() ; |
87 | } | 84 | } |
@@ -108,10 +105,9 @@ void Uninstaller::uninstall(ProgressloggerInterface* dp) | |||
108 | } | 105 | } |
109 | uninstallSections.clear(); | 106 | uninstallSections.clear(); |
110 | installlog.sync(); | 107 | installlog.sync(); |
111 | m_dp->setProgressMax(1); | 108 | emit logProgress(1, 1); |
112 | m_dp->setProgressValue(1); | 109 | emit logItem(tr("Uninstallation finished"), LOGOK); |
113 | m_dp->addItem(tr("Uninstallation finished"),LOGOK); | 110 | emit logFinished(); |
114 | m_dp->setFinished(); | ||
115 | } | 111 | } |
116 | 112 | ||
117 | QStringList Uninstaller::getAllSections() | 113 | QStringList Uninstaller::getAllSections() |
diff --git a/rbutil/rbutilqt/base/uninstall.h b/rbutil/rbutilqt/base/uninstall.h index 34faf9a4d7..072ec651da 100644 --- a/rbutil/rbutilqt/base/uninstall.h +++ b/rbutil/rbutilqt/base/uninstall.h | |||
@@ -35,8 +35,8 @@ public: | |||
35 | Uninstaller(QObject* parent,QString mountpoint) ; | 35 | Uninstaller(QObject* parent,QString mountpoint) ; |
36 | ~Uninstaller(){} | 36 | ~Uninstaller(){} |
37 | 37 | ||
38 | void deleteAll(ProgressloggerInterface* dp); | 38 | void deleteAll(void); |
39 | void uninstall(ProgressloggerInterface* dp); | 39 | void uninstall(void); |
40 | 40 | ||
41 | bool uninstallPossible(); | 41 | bool uninstallPossible(); |
42 | 42 | ||
@@ -44,6 +44,10 @@ public: | |||
44 | 44 | ||
45 | void setSections(QStringList sections) {uninstallSections = sections;} | 45 | void setSections(QStringList sections) {uninstallSections = sections;} |
46 | 46 | ||
47 | signals: | ||
48 | void logItem(QString, int); //! set logger item | ||
49 | void logProgress(int, int); //! set progress bar. | ||
50 | void logFinished(void); | ||
47 | 51 | ||
48 | private slots: | 52 | private slots: |
49 | 53 | ||
@@ -52,8 +56,6 @@ private: | |||
52 | QString m_mountpoint; | 56 | QString m_mountpoint; |
53 | 57 | ||
54 | QStringList uninstallSections; | 58 | QStringList uninstallSections; |
55 | |||
56 | ProgressloggerInterface* m_dp; | ||
57 | }; | 59 | }; |
58 | 60 | ||
59 | 61 | ||
diff --git a/rbutil/rbutilqt/rbutilqt.cpp b/rbutil/rbutilqt/rbutilqt.cpp index 4485bacaec..274efb46af 100644 --- a/rbutil/rbutilqt/rbutilqt.cpp +++ b/rbutil/rbutilqt/rbutilqt.cpp | |||
@@ -899,7 +899,8 @@ void RbUtilQt::installVoice() | |||
899 | QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) | 899 | QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) |
900 | return; | 900 | return; |
901 | 901 | ||
902 | QDate date = QDate::fromString(ServerInfo::value(ServerInfo::DailyDate).toString(),Qt::ISODate); | 902 | QDate date = QDate::fromString( |
903 | ServerInfo::value(ServerInfo::DailyDate).toString(), Qt::ISODate); | ||
903 | QString model = SystemInfo::value(SystemInfo::CurBuildserverModel).toString(); | 904 | QString model = SystemInfo::value(SystemInfo::CurBuildserverModel).toString(); |
904 | // replace placeholder in voice url | 905 | // replace placeholder in voice url |
905 | voiceurl.replace("%DATE%", date.toString("yyyyMMdd")); | 906 | voiceurl.replace("%DATE%", date.toString("yyyyMMdd")); |
diff --git a/rbutil/rbutilqt/uninstallwindow.cpp b/rbutil/rbutilqt/uninstallwindow.cpp index 4abfe93b1e..fc47840b78 100644 --- a/rbutil/rbutilqt/uninstallwindow.cpp +++ b/rbutil/rbutilqt/uninstallwindow.cpp | |||
@@ -31,6 +31,11 @@ UninstallWindow::UninstallWindow(QWidget *parent) : QDialog(parent) | |||
31 | QString mountpoint = RbSettings::value(RbSettings::Mountpoint).toString(); | 31 | QString mountpoint = RbSettings::value(RbSettings::Mountpoint).toString(); |
32 | 32 | ||
33 | uninstaller = new Uninstaller(this,mountpoint); | 33 | uninstaller = new Uninstaller(this,mountpoint); |
34 | logger = new ProgressLoggerGui(this); | ||
35 | connect(uninstaller, SIGNAL(logItem(QString, int)), logger, SLOT(addItem(QString, int))); | ||
36 | connect(uninstaller, SIGNAL(logProgress(int, int)), logger, SLOT(setProgress(int, int))); | ||
37 | connect(uninstaller, SIGNAL(logFinished(void)), logger, SLOT(setFinished(void))); | ||
38 | connect(logger, SIGNAL(closed()), this, SLOT(close())); | ||
34 | 39 | ||
35 | // disable smart uninstall, if not possible | 40 | // disable smart uninstall, if not possible |
36 | if(!uninstaller->uninstallPossible()) | 41 | if(!uninstaller->uninstallPossible()) |
@@ -50,17 +55,15 @@ UninstallWindow::UninstallWindow(QWidget *parent) : QDialog(parent) | |||
50 | 55 | ||
51 | void UninstallWindow::accept() | 56 | void UninstallWindow::accept() |
52 | { | 57 | { |
53 | logger = new ProgressLoggerGui(this); | ||
54 | logger->show(); | 58 | logger->show(); |
55 | 59 | ||
56 | connect(logger,SIGNAL(closed()),this,SLOT(close())); | ||
57 | if(ui.CompleteRadioBtn->isChecked()) | 60 | if(ui.CompleteRadioBtn->isChecked()) |
58 | { | 61 | { |
59 | uninstaller->deleteAll(logger); | 62 | uninstaller->deleteAll(); |
60 | } | 63 | } |
61 | else | 64 | else |
62 | { | 65 | { |
63 | uninstaller->uninstall(logger); | 66 | uninstaller->uninstall(); |
64 | } | 67 | } |
65 | 68 | ||
66 | } | 69 | } |