TupExportWizardPage *TupExportWizard::addPage(TupExportWizardPage *newPage) { QString tag = newPage->getTag(); newPage->setParent(k->history); newPage->show(); k->history->addWidget(newPage); if (k->history->count() == 1) { // First Page newPage->setFocus(); k->backButton->setEnabled(false); k->nextButton->setDefault(true); } // k->nextButton->setEnabled(newPage->isComplete()); connect(newPage, SIGNAL(completed()), this, SLOT(pageCompleted())); connect(newPage, SIGNAL(emptyField()), this, SLOT(disableButton())); if (tag.compare("PLUGIN") == 0) { // connect(newPage, SIGNAL(formatSelected(int, const QString &)), this, SLOT(setFormat(int, const QString &))); connect(newPage, SIGNAL(animatedImageFormatSelected(int, const QString &)), this, SLOT(setFormat(int, const QString &))); connect(newPage, SIGNAL(imagesArrayFormatSelected(int, const QString &)), this, SLOT(setFormat(int, const QString &))); connect(newPage, SIGNAL(animationFormatSelected(int, const QString &)), this, SLOT(setFormat(int, const QString &))); }
void TWizard::next() { TWizardPage *current = qobject_cast<TWizardPage *>(m_history.currentWidget()); if (current) current->aboutToNextPage(); m_history.setCurrentIndex(m_history.currentIndex()+1); if (m_history.currentIndex() == m_history.count()-1 && current->isComplete()) { m_nextButton->setEnabled(false); m_backButton->setEnabled(true); m_finishButton->setDefault(true); } else { m_finishButton->setEnabled(false); } pageCompleted(); }
TWizardPage *TWizard::addPage(TWizardPage *newPage) { newPage->setParent(&m_history); newPage->show(); m_history.addWidget(newPage); if (m_history.count() == 1) { // First Page newPage->setFocus(); m_backButton->setEnabled(false); m_nextButton->setDefault(true); } m_nextButton->setEnabled(newPage->isComplete()); connect(newPage, SIGNAL(completed()), this, SLOT(pageCompleted())); return newPage; }