forked from qt-creator/qt-creator
JsonWizard: Report runtime errors from pages
Change-Id: Ia96ac950ec209fcbc82c7b49b72d0b6417b99906 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
@@ -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()
|
|||||||
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:
|
|||||||
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;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user