Commit b848ade4 authored by Tobias Hunger's avatar Tobias Hunger

JsonWizard: Report runtime errors from pages

Change-Id: Ia96ac950ec209fcbc82c7b49b72d0b6417b99906
Reviewed-by: Orgad Shaneh's avatarOrgad Shaneh <orgads@gmail.com>
Reviewed-by: default avatarTobias Hunger <tobias.hunger@theqtcompany.com>
parent 749c740a
...@@ -32,8 +32,11 @@ ...@@ -32,8 +32,11 @@
#include "jsonwizardgeneratorfactory.h" #include "jsonwizardgeneratorfactory.h"
#include <coreplugin/messagemanager.h>
#include <utils/algorithm.h> #include <utils/algorithm.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <utils/wizardpage.h>
#include <QFileInfo> #include <QFileInfo>
#include <QMessageBox> #include <QMessageBox>
...@@ -213,4 +216,18 @@ void JsonWizard::accept() ...@@ -213,4 +216,18 @@ void JsonWizard::accept()
emit allDone(m_files); emit allDone(m_files);
} }
void JsonWizard::handleNewPages(int pageId)
{
Utils::WizardPage *wp = qobject_cast<Utils::WizardPage *>(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 } // namespace ProjectExplorer
...@@ -95,6 +95,10 @@ signals: ...@@ -95,6 +95,10 @@ signals:
public slots: public slots:
void accept(); void accept();
private slots:
void handleNewPages(int pageId);
void handleError(const QString &message);
private: private:
QList<JsonWizardGenerator *> m_generators; QList<JsonWizardGenerator *> m_generators;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment