JsonWizard: Allow to delegate accept/reject to the current page

Change-Id: I1d2826159ce1cd4f531a576720b9ba6f204d15fb
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Tobias Hunger
2015-05-05 16:34:49 +02:00
committed by Tobias Hunger
parent bbf2d59981
commit 52d6c09183
4 changed files with 27 additions and 0 deletions

View File

@@ -176,6 +176,10 @@ void JsonWizard::removeAttributeFromAllFiles(Core::GeneratedFile::Attribute a)
void JsonWizard::accept()
{
auto page = qobject_cast<Utils::WizardPage *>(currentPage());
if (page && page->handleAccept())
return;
Utils::Wizard::accept();
QString errorMessage;
@@ -231,6 +235,15 @@ void JsonWizard::accept()
openFiles(m_files);
}
void JsonWizard::reject()
{
auto page = qobject_cast<Utils::WizardPage *>(currentPage());
if (page && page->handleReject())
return;
Utils::Wizard::reject();
}
void JsonWizard::handleNewPages(int pageId)
{
Utils::WizardPage *wp = qobject_cast<Utils::WizardPage *>(page(pageId));