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 <coreplugin/messagemanager.h>
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/wizardpage.h>
|
||||
|
||||
#include <QFileInfo>
|
||||
#include <QMessageBox>
|
||||
@@ -213,4 +216,18 @@ void JsonWizard::accept()
|
||||
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
|
||||
|
@@ -95,6 +95,10 @@ signals:
|
||||
public slots:
|
||||
void accept();
|
||||
|
||||
private slots:
|
||||
void handleNewPages(int pageId);
|
||||
void handleError(const QString &message);
|
||||
|
||||
private:
|
||||
QList<JsonWizardGenerator *> m_generators;
|
||||
|
||||
|
Reference in New Issue
Block a user