diff options
author | Rainer Keller <rainer.keller@theqtcompany.com> | 2014-11-14 15:19:18 +0100 |
---|---|---|
committer | Rainer Keller <rainer.keller@theqtcompany.com> | 2014-11-14 16:19:21 +0200 |
commit | 9f77929a4306a759c9d4bfb8cadc810ed4c05219 (patch) | |
tree | 87f4db96b141b7eb0f0728ed3ffca28f0b091536 /src | |
parent | 6010e69aa3ac3e94c0fabf16a28e682e35a07a68 (diff) |
b2qt-flashing-wizard: Handle script errors
Change-Id: Ic470f3bdb4e2870279edcb3012160b9edea075ae
Reviewed-by: Rainer Keller <rainer.keller@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/b2qt-flashing-wizard/actor.h | 1 | ||||
-rw-r--r-- | src/b2qt-flashing-wizard/progress_page.cpp | 8 | ||||
-rw-r--r-- | src/b2qt-flashing-wizard/progress_page.h | 1 | ||||
-rw-r--r-- | src/b2qt-flashing-wizard/scriptwriter.cpp | 9 |
4 files changed, 12 insertions, 7 deletions
diff --git a/src/b2qt-flashing-wizard/actor.h b/src/b2qt-flashing-wizard/actor.h index f310f0b..51e856d 100644 --- a/src/b2qt-flashing-wizard/actor.h +++ b/src/b2qt-flashing-wizard/actor.h @@ -35,6 +35,7 @@ public: signals: void progress(const QString &step); void finished(); + void failed(const QString &message); void details(const QByteArray &); }; diff --git a/src/b2qt-flashing-wizard/progress_page.cpp b/src/b2qt-flashing-wizard/progress_page.cpp index 9c87d2d..01a8691 100644 --- a/src/b2qt-flashing-wizard/progress_page.cpp +++ b/src/b2qt-flashing-wizard/progress_page.cpp @@ -82,11 +82,19 @@ void ProgressPage::finished() wizard()->next(); // progress to next page automatically } +void ProgressPage::failed(const QString &message) +{ + mFinished = false; + emit completeChanged(); + mProgress->setText(message); +} + void ProgressPage::setActor(Actor *actor) { Q_ASSERT(actor); mActor = actor; connect(actor, &Actor::finished, this, &ProgressPage::finished); + connect(actor, &Actor::failed, this, &ProgressPage::failed); connect(actor, &Actor::details, this, &ProgressPage::addDetails); connect(actor, &Actor::progress, this, &ProgressPage::progress); } diff --git a/src/b2qt-flashing-wizard/progress_page.h b/src/b2qt-flashing-wizard/progress_page.h index 3169e3f..f99f11b 100644 --- a/src/b2qt-flashing-wizard/progress_page.h +++ b/src/b2qt-flashing-wizard/progress_page.h @@ -39,6 +39,7 @@ public: public slots: void progress(const QString &step); void finished(); + void failed(const QString &step); void addDetails(QByteArray newData); void toggleDetails(); void copyDetailsToClipboard(); diff --git a/src/b2qt-flashing-wizard/scriptwriter.cpp b/src/b2qt-flashing-wizard/scriptwriter.cpp index dfe554e..063c35a 100644 --- a/src/b2qt-flashing-wizard/scriptwriter.cpp +++ b/src/b2qt-flashing-wizard/scriptwriter.cpp @@ -118,13 +118,8 @@ void ScriptWriter::readOutput() void ScriptWriter::processFinished(int exitCode, QProcess::ExitStatus exitStatus) { - if (exitStatus != QProcess::NormalExit) { - qWarning("process crashed"); - return; - } - - if (exitCode != 0) { - qWarning("process failed"); + if (exitStatus != QProcess::NormalExit || exitCode != 0) { + emit failed("Image creation failed"); return; } emit finished(); |