diff options
author | Cástor Muñoz <cmvidal@gmail.com> | 2016-01-08 23:56:27 +0100 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2016-08-15 20:14:25 +0200 |
commit | 40ce2b41331888d6284fff6e709789e939cc6a1a (patch) | |
tree | 52eb3f721c026b4d2190be38ae9ab91f2df36356 /rbutil/rbutilqt | |
parent | e4af97300d5b08e48d9d282d5a7500cdfae4c251 (diff) | |
download | rockbox-40ce2b41331888d6284fff6e709789e939cc6a1a.tar.gz rockbox-40ce2b41331888d6284fff6e709789e939cc6a1a.zip |
rbutil: add abort signal for bootloader install/uninstall
During the bootloader install/uninstall process, a signal
is emitted when "Abort" button is pressed, the installers
can attach this signal and cancel the process.
Change-Id: I7f297b8031d7a2d93da0022081aaef03ef041baf
Diffstat (limited to 'rbutil/rbutilqt')
-rw-r--r-- | rbutil/rbutilqt/base/bootloaderinstallbase.cpp | 7 | ||||
-rw-r--r-- | rbutil/rbutilqt/base/bootloaderinstallbase.h | 2 | ||||
-rw-r--r-- | rbutil/rbutilqt/gui/selectiveinstallwidget.cpp | 2 | ||||
-rw-r--r-- | rbutil/rbutilqt/rbutilqt.cpp | 2 |
4 files changed, 13 insertions, 0 deletions
diff --git a/rbutil/rbutilqt/base/bootloaderinstallbase.cpp b/rbutil/rbutilqt/base/bootloaderinstallbase.cpp index 9a1c74c690..15ced2e435 100644 --- a/rbutil/rbutilqt/base/bootloaderinstallbase.cpp +++ b/rbutil/rbutilqt/base/bootloaderinstallbase.cpp | |||
@@ -103,6 +103,13 @@ void BootloaderInstallBase::installBlfile(void) | |||
103 | } | 103 | } |
104 | 104 | ||
105 | 105 | ||
106 | void BootloaderInstallBase::progressAborted(void) | ||
107 | { | ||
108 | LOG_INFO() << "progressAborted(void)"; | ||
109 | emit installAborted(); | ||
110 | } | ||
111 | |||
112 | |||
106 | //! @brief backup OF file. | 113 | //! @brief backup OF file. |
107 | //! @param to folder to write backup file to. Folder will get created. | 114 | //! @param to folder to write backup file to. Folder will get created. |
108 | //! @return true on success, false on error. | 115 | //! @return true on success, false on error. |
diff --git a/rbutil/rbutilqt/base/bootloaderinstallbase.h b/rbutil/rbutilqt/base/bootloaderinstallbase.h index 0e970c4af6..23aac4f92f 100644 --- a/rbutil/rbutilqt/base/bootloaderinstallbase.h +++ b/rbutil/rbutilqt/base/bootloaderinstallbase.h | |||
@@ -73,6 +73,7 @@ class BootloaderInstallBase : public QObject | |||
73 | void downloadReqFinished(int id, bool error); | 73 | void downloadReqFinished(int id, bool error); |
74 | void downloadBlFinish(bool error); | 74 | void downloadBlFinish(bool error); |
75 | void installBlfile(void); | 75 | void installBlfile(void); |
76 | void progressAborted(void); | ||
76 | 77 | ||
77 | // NOTE: we need to keep this slot even on targets that don't need it | 78 | // NOTE: we need to keep this slot even on targets that don't need it |
78 | // -- using the preprocessor here confused moc. | 79 | // -- using the preprocessor here confused moc. |
@@ -101,6 +102,7 @@ class BootloaderInstallBase : public QObject | |||
101 | 102 | ||
102 | signals: | 103 | signals: |
103 | void downloadDone(void); //! internal signal sent when download finished. | 104 | void downloadDone(void); //! internal signal sent when download finished. |
105 | void installAborted(void); //! internal signal sent on abort button click. | ||
104 | void done(bool); | 106 | void done(bool); |
105 | void logItem(QString, int); //! set logger item | 107 | void logItem(QString, int); //! set logger item |
106 | void logProgress(int, int); //! set progress bar. | 108 | void logProgress(int, int); //! set progress bar. |
diff --git a/rbutil/rbutilqt/gui/selectiveinstallwidget.cpp b/rbutil/rbutilqt/gui/selectiveinstallwidget.cpp index 35837ba41d..843fa63cad 100644 --- a/rbutil/rbutilqt/gui/selectiveinstallwidget.cpp +++ b/rbutil/rbutilqt/gui/selectiveinstallwidget.cpp | |||
@@ -247,6 +247,8 @@ void SelectiveInstallWidget::installBootloader(void) | |||
247 | connect(bl, SIGNAL(done(bool)), this, SLOT(continueInstall(bool))); | 247 | connect(bl, SIGNAL(done(bool)), this, SLOT(continueInstall(bool))); |
248 | connect(bl, SIGNAL(logItem(QString, int)), m_logger, SLOT(addItem(QString, int))); | 248 | connect(bl, SIGNAL(logItem(QString, int)), m_logger, SLOT(addItem(QString, int))); |
249 | connect(bl, SIGNAL(logProgress(int, int)), m_logger, SLOT(setProgress(int, int))); | 249 | connect(bl, SIGNAL(logProgress(int, int)), m_logger, SLOT(setProgress(int, int))); |
250 | // pass Abort button click signal to current installer | ||
251 | connect(m_logger, SIGNAL(aborted()), bl, SLOT(progressAborted())); | ||
250 | 252 | ||
251 | // set bootloader filename. Do this now as installed() needs it. | 253 | // set bootloader filename. Do this now as installed() needs it. |
252 | QStringList blfile = SystemInfo::value(SystemInfo::CurBootloaderFile).toStringList(); | 254 | QStringList blfile = SystemInfo::value(SystemInfo::CurBootloaderFile).toStringList(); |
diff --git a/rbutil/rbutilqt/rbutilqt.cpp b/rbutil/rbutilqt/rbutilqt.cpp index 1444f4509d..8f4ee582d5 100644 --- a/rbutil/rbutilqt/rbutilqt.cpp +++ b/rbutil/rbutilqt/rbutilqt.cpp | |||
@@ -569,6 +569,8 @@ void RbUtilQt::uninstallBootloader(void) | |||
569 | connect(bl, SIGNAL(logItem(QString, int)), logger, SLOT(addItem(QString, int))); | 569 | connect(bl, SIGNAL(logItem(QString, int)), logger, SLOT(addItem(QString, int))); |
570 | connect(bl, SIGNAL(logProgress(int, int)), logger, SLOT(setProgress(int, int))); | 570 | connect(bl, SIGNAL(logProgress(int, int)), logger, SLOT(setProgress(int, int))); |
571 | connect(bl, SIGNAL(done(bool)), logger, SLOT(setFinished())); | 571 | connect(bl, SIGNAL(done(bool)), logger, SLOT(setFinished())); |
572 | // pass Abort button click signal to current installer | ||
573 | connect(logger, SIGNAL(aborted()), bl, SLOT(progressAborted())); | ||
572 | 574 | ||
573 | bl->uninstall(); | 575 | bl->uninstall(); |
574 | 576 | ||