2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2009-06-29 14:47:04 +02:00
|
|
|
**
|
2015-01-14 18:07:15 +01:00
|
|
|
** Copyright (C) 2015 The Qt Company Ltd.
|
|
|
|
|
** Contact: http://www.qt.io/licensing
|
2009-06-29 14:47:04 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2009-06-29 14:47:04 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2015-01-14 18:07:15 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms and
|
|
|
|
|
** conditions see http://www.qt.io/terms-conditions. For further information
|
2014-10-01 13:21:18 +02:00
|
|
|
** use the contact form at http://www.qt.io/contact-us.
|
2009-06-29 14:47:04 +02:00
|
|
|
**
|
|
|
|
|
** GNU Lesser General Public License Usage
|
2012-10-02 09:12:39 +02:00
|
|
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
2014-10-01 13:21:18 +02:00
|
|
|
** General Public License version 2.1 or version 3 as published by the Free
|
|
|
|
|
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
|
|
|
|
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
|
|
|
|
** following information to ensure the GNU Lesser General Public License
|
|
|
|
|
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
|
|
|
|
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
2012-10-02 09:12:39 +02:00
|
|
|
**
|
2015-01-14 18:07:15 +01:00
|
|
|
** In addition, as a special exception, The Qt Company gives you certain additional
|
|
|
|
|
** rights. These rights are described in The Qt Company LGPL Exception
|
2010-12-17 16:01:08 +01:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
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) :
|
2015-05-29 17:25:40 +02:00
|
|
|
BaseQmakeProjectWizardDialog(factory, false, 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());
|
2009-06-29 14:47:04 +02:00
|
|
|
connect(this, SIGNAL(currentIdChanged(int)), this, SLOT(slotCurrentIdChanged(int)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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
|