From b848ade48d6b927c9f8c04330f1def4a49cfaede Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 20 Jan 2015 14:45:03 +0100 Subject: [PATCH] JsonWizard: Report runtime errors from pages Change-Id: Ia96ac950ec209fcbc82c7b49b72d0b6417b99906 Reviewed-by: Orgad Shaneh Reviewed-by: Tobias Hunger --- .../projectexplorer/jsonwizard/jsonwizard.cpp | 17 +++++++++++++++++ .../projectexplorer/jsonwizard/jsonwizard.h | 4 ++++ 2 files changed, 21 insertions(+) diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizard.cpp b/src/plugins/projectexplorer/jsonwizard/jsonwizard.cpp index 0c0543c2b9..e5ffc79965 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonwizard.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonwizard.cpp @@ -32,8 +32,11 @@ #include "jsonwizardgeneratorfactory.h" +#include + #include #include +#include #include #include @@ -213,4 +216,18 @@ void JsonWizard::accept() emit allDone(m_files); } +void JsonWizard::handleNewPages(int pageId) +{ + Utils::WizardPage *wp = qobject_cast(page(pageId)); + if (!wp) + return; + + connect(wp, &Utils::WizardPage::reportError, this, &JsonWizard::handleError); +} + +void JsonWizard::handleError(const QString &message) +{ + Core::MessageManager::write(message, Core::MessageManager::ModeSwitch); +} + } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizard.h b/src/plugins/projectexplorer/jsonwizard/jsonwizard.h index b58876c0c3..e66b655a16 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonwizard.h +++ b/src/plugins/projectexplorer/jsonwizard/jsonwizard.h @@ -95,6 +95,10 @@ signals: public slots: void accept(); +private slots: + void handleNewPages(int pageId); + void handleError(const QString &message); + private: QList m_generators; -- GitLab