2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
2009-06-29 14:47:04 +02:00
|
|
|
|
|
|
|
|
#include "customwidgetwizarddialog.h"
|
|
|
|
|
#include "customwidgetwidgetswizardpage.h"
|
|
|
|
|
#include "customwidgetpluginwizardpage.h"
|
2013-03-28 10:15:09 +01:00
|
|
|
#include "pluginoptions.h"
|
2012-05-14 18:55:30 +02:00
|
|
|
#include <projectexplorer/projectexplorerconstants.h>
|
2009-06-29 14:47:04 +02:00
|
|
|
|
2012-09-03 18:31:44 +02:00
|
|
|
#include <qtsupport/qtkitinformation.h>
|
2012-04-24 15:49:09 +02:00
|
|
|
#include <qtsupport/qtsupportconstants.h>
|
|
|
|
|
|
2013-10-16 11:02:37 +02:00
|
|
|
namespace QmakeProjectManager {
|
2009-06-29 14:47:04 +02:00
|
|
|
namespace Internal {
|
|
|
|
|
|
2010-03-05 11:24:31 +01:00
|
|
|
enum { IntroPageId = 0};
|
2009-06-29 14:47:04 +02:00
|
|
|
|
2015-05-29 17:25:40 +02:00
|
|
|
CustomWidgetWizardDialog::CustomWidgetWizardDialog(const Core::BaseFileWizardFactory *factory,
|
|
|
|
|
const QString &templateName,
|
|
|
|
|
const QIcon &icon, QWidget *parent,
|
2012-02-03 18:00:08 +01:00
|
|
|
const Core::WizardDialogParameters ¶meters) :
|
2019-08-13 10:33:23 +02:00
|
|
|
BaseQmakeProjectWizardDialog(factory, parent, parameters),
|
2009-06-29 14:47:04 +02:00
|
|
|
m_widgetsPage(new CustomWidgetWidgetsWizardPage),
|
2014-05-30 11:38:08 +02:00
|
|
|
m_pluginPage(new CustomWidgetPluginWizardPage)
|
2009-06-29 14:47:04 +02:00
|
|
|
{
|
|
|
|
|
setWindowIcon(icon);
|
|
|
|
|
setWindowTitle(templateName);
|
|
|
|
|
|
2012-11-06 13:45:14 +01:00
|
|
|
setIntroDescription(tr("This wizard generates a Qt Designer Custom Widget "
|
|
|
|
|
"or a Qt Designer Custom Widget Collection project."));
|
2012-05-14 18:55:30 +02:00
|
|
|
|
2012-11-26 15:09:56 +02:00
|
|
|
if (!parameters.extraValues().contains(QLatin1String(ProjectExplorer::Constants::PROJECT_KIT_IDS)))
|
2012-05-14 18:55:30 +02:00
|
|
|
addTargetSetupPage();
|
2014-05-30 11:38:08 +02:00
|
|
|
addPage(m_widgetsPage);
|
2010-03-05 11:24:31 +01:00
|
|
|
m_pluginPageId = addPage(m_pluginPage);
|
2009-06-29 14:47:04 +02:00
|
|
|
|
2015-05-29 17:25:40 +02:00
|
|
|
addExtensionPages(extensionPages());
|
2015-09-22 16:06:20 +02:00
|
|
|
connect(this, &QWizard::currentIdChanged, this, &CustomWidgetWizardDialog::slotCurrentIdChanged);
|
2009-06-29 14:47:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FileNamingParameters CustomWidgetWizardDialog::fileNamingParameters() const
|
|
|
|
|
{
|
|
|
|
|
return m_widgetsPage->fileNamingParameters();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CustomWidgetWizardDialog::setFileNamingParameters(const FileNamingParameters &fnp)
|
|
|
|
|
{
|
|
|
|
|
m_widgetsPage->setFileNamingParameters(fnp);
|
|
|
|
|
m_pluginPage->setFileNamingParameters(fnp);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CustomWidgetWizardDialog::slotCurrentIdChanged(int id)
|
|
|
|
|
{
|
2010-03-05 11:24:31 +01:00
|
|
|
if (id == m_pluginPageId)
|
2009-06-29 14:47:04 +02:00
|
|
|
m_pluginPage->init(m_widgetsPage);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QSharedPointer<PluginOptions> CustomWidgetWizardDialog::pluginOptions() const
|
|
|
|
|
{
|
|
|
|
|
QSharedPointer<PluginOptions> rc = m_pluginPage->basicPluginOptions();
|
|
|
|
|
rc->widgetOptions = m_widgetsPage->widgetOptions();
|
|
|
|
|
return rc;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
2013-10-16 11:02:37 +02:00
|
|
|
} // namespace QmakeProjectManager
|