int LibraryWizardDialog::nextId() const { if (m_targetPageId != -1) { if (currentId() == m_targetPageId) { int next = m_modulesPageId; const bool symbianTargetEnabled = isQtPlatformSelected(QtSupport::Constants::SYMBIAN_PLATFORM); // If there was no Symbian target defined we omit "Symbian specific" step // We also omit this step if the library type is not dll if (symbianTargetEnabled && (type() == QtProjectParameters::SharedLibrary || type() == QtProjectParameters::Qt4Plugin)) next = m_mobilePageId; if (next == m_modulesPageId) return skipModulesPageIfNeeded(); return next; } else if (currentId() == m_mobilePageId) { return skipModulesPageIfNeeded(); } } else if (currentId() == startId()) { if (isQtPlatformSelected(QtSupport::Constants::SYMBIAN_PLATFORM)) return m_mobilePageId; return skipModulesPageIfNeeded(); } else if (currentId() == m_mobilePageId) { return skipModulesPageIfNeeded(); } return BaseQt4ProjectWizardDialog::nextId(); }
GuiAppParameters GuiAppWizardDialog::parameters() const { GuiAppParameters rc; rc.className = m_filesPage->className(); rc.baseClassName = m_filesPage->baseClassName(); rc.sourceFileName = m_filesPage->sourceFileName(); rc.headerFileName = m_filesPage->headerFileName(); rc.formFileName = m_filesPage->formFileName(); rc.designerForm = m_filesPage->formInputChecked(); rc.isMobileApplication = true; if (isQtPlatformSelected(QLatin1String(QtSupport::Constants::MAEMO_FREMANTLE_PLATFORM)) || isQtPlatformSelected(QLatin1String(QtSupport::Constants::MEEGO_HARMATTAN_PLATFORM)) || isQtPlatformSelected(QLatin1String(QtSupport::Constants::ANDROID_PLATFORM))) { rc.widgetWidth = 800; rc.widgetHeight = 480; } else { rc.isMobileApplication = false; rc.widgetWidth = 400; rc.widgetHeight = 300; } return rc; }
// ------------------- LibraryWizardDialog LibraryWizardDialog::LibraryWizardDialog(const QString &templateName, const QIcon &icon, bool showModulesPage, QWidget *parent, const Core::WizardDialogParameters ¶meters) : BaseQt4ProjectWizardDialog(showModulesPage, new LibraryIntroPage, -1, parent, parameters), m_filesPage(new FilesPage), m_mobilePage(new MobileLibraryWizardOptionPage), m_pluginBaseClassesInitialized(false), m_filesPageId(-1), m_modulesPageId(-1), m_targetPageId(-1), m_mobilePageId(-1) { setWindowIcon(icon); setWindowTitle(templateName); setSelectedModules(QLatin1String("core")); // Note that QWizard::currentIdChanged() is emitted at strange times. // Use the intro page instead, set up initially setIntroDescription(tr("This wizard generates a C++ library project.")); if (!parameters.extraValues().contains(ProjectExplorer::Constants::PROJECT_PROFILE_IDS)) { m_targetPageId = addTargetSetupPage(); m_mobilePageId = addPage(m_mobilePage); } else if (isQtPlatformSelected(QtSupport::Constants::SYMBIAN_PLATFORM)) { m_mobilePageId = addPage(m_mobilePage); } m_modulesPageId = addModulesPage(); m_filesPage->setNamespacesEnabled(true); m_filesPage->setFormFileInputVisible(false); m_filesPage->setClassTypeComboVisible(false); m_filesPageId = addPage(m_filesPage); Utils::WizardProgressItem *introItem = wizardProgress()->item(startId()); Utils::WizardProgressItem *targetItem = 0; Utils::WizardProgressItem *mobileItem = 0; if (m_targetPageId != -1) { targetItem = wizardProgress()->item(m_targetPageId); } if (m_mobilePageId != -1) { mobileItem = wizardProgress()->item(m_mobilePageId); mobileItem->setTitle(QLatin1String(" ") + tr("Symbian Specific")); } Utils::WizardProgressItem *modulesItem = wizardProgress()->item(m_modulesPageId); Utils::WizardProgressItem *filesItem = wizardProgress()->item(m_filesPageId); filesItem->setTitle(tr("Details")); if (m_targetPageId != -1) { targetItem->setNextItems(QList<Utils::WizardProgressItem *>() << mobileItem << modulesItem << filesItem); targetItem->setNextShownItem(0); mobileItem->setNextItems(QList<Utils::WizardProgressItem *>() << modulesItem << filesItem); mobileItem->setNextShownItem(0); } else if (m_mobilePageId != -1) { introItem->setNextItems(QList<Utils::WizardProgressItem *>() << mobileItem); mobileItem->setNextItems(QList<Utils::WizardProgressItem *>() << modulesItem << filesItem); mobileItem->setNextShownItem(0); } else { introItem->setNextItems(QList<Utils::WizardProgressItem *>() << modulesItem << filesItem); introItem->setNextShownItem(0); } connect(this, SIGNAL(currentIdChanged(int)), this, SLOT(slotCurrentIdChanged(int))); addExtensionPages(parameters.extensionPages()); }