Commit 86d7a980 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

JsonWizard: Replace EmptyProjectWizard with a JsonWizard



Change-Id: Ia199a04b535535722a3b47a9651b16635b019cbf
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent b360e73f
{
"version": 1,
"kind": "project",
"id": "U.QtEmpty",
"category": "H.Project",
"trDescription": "Creates a qmake-based project without any files. This allows you to create an application without any default classes.",
"trDisplayName": "Empty qmake Project",
"trDisplayCategory": "Other Project",
"icon": "../../../global/guiapplication.png",
"featuresRequired": [ "Plugin.QmakeProjectManager", "QtSupport.Wizards.FeatureQt" ],
"options":
[
{ "key": "ProFileName", "value": "%{JS: Util.fileName('%{ProjectDirectory}/%{ProjectName}', 'pro')}" },
{ "key": "IsTopLevelProject", "value": "%{JS: ('%{Exists:ProjectExplorer.Profile.Ids}') ? '' : 'yes'}" }
],
"pages":
[
{
"trDisplayName": "Project Location",
"trShortTitle": "Location",
"typeId": "Project"
},
{
"trDisplayName": "Kits",
"trShortTitle": "Kits",
"typeId": "Kits",
"enabled": "%{IsTopLevelProject}",
"data": { "projectFilePath": "%{ProFileName}" }
},
{
"trDisplayName": "Project Management",
"trShortTitle": "Summary",
"typeId": "Summary"
}
],
"generators":
[
{
"typeId": "File",
"data":
[
{
"source": "file.pro",
"target": "%{ProFileName}",
"openAsProject": true
}
]
}
]
}
......@@ -25,8 +25,6 @@ HEADERS += \
wizards/librarywizard.h \
wizards/librarywizarddialog.h \
wizards/guiappwizarddialog.h \
wizards/emptyprojectwizard.h \
wizards/emptyprojectwizarddialog.h \
wizards/testwizard.h \
wizards/testwizarddialog.h \
wizards/testwizardpage.h \
......@@ -75,8 +73,6 @@ SOURCES += \
wizards/librarywizard.cpp \
wizards/librarywizarddialog.cpp \
wizards/guiappwizarddialog.cpp \
wizards/emptyprojectwizard.cpp \
wizards/emptyprojectwizarddialog.cpp \
wizards/testwizard.cpp \
wizards/testwizarddialog.cpp \
wizards/testwizardpage.cpp \
......
......@@ -91,8 +91,6 @@ QtcPlugin {
"abstractmobileappwizard.cpp", "abstractmobileappwizard.h",
"consoleappwizard.cpp", "consoleappwizard.h",
"consoleappwizarddialog.cpp", "consoleappwizarddialog.h",
"emptyprojectwizard.cpp", "emptyprojectwizard.h",
"emptyprojectwizarddialog.cpp", "emptyprojectwizarddialog.h",
"filespage.cpp", "filespage.h",
"guiappwizard.cpp", "guiappwizard.h",
"guiappwizarddialog.cpp", "guiappwizarddialog.h",
......
......@@ -41,7 +41,6 @@
#include "wizards/guiappwizard.h"
#include "wizards/librarywizard.h"
#include "wizards/testwizard.h"
#include "wizards/emptyprojectwizard.h"
#include "wizards/subdirsprojectwizard.h"
#include "wizards/qtquickappwizard.h"
#include "customwidgetwizard/customwidgetwizard.h"
......@@ -109,7 +108,6 @@ bool QmakeProjectManagerPlugin::initialize(const QStringList &arguments, QString
ProjectExplorer::KitManager::registerKitInformation(new QmakeKitInformation);
addAutoReleasedObject(new EmptyProjectWizard);
addAutoReleasedObject(new SubdirsProjectWizard);
addAutoReleasedObject(new GuiAppWizard);
addAutoReleasedObject(new ConsoleAppWizard);
......
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** 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
** a written agreement between you and Digia. For licensing terms and
** conditions see http://www.qt.io/licensing. For further information
** use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** 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.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#include "emptyprojectwizard.h"
#include "emptyprojectwizarddialog.h"
#include <projectexplorer/projectexplorerconstants.h>
#include <qtsupport/qtsupportconstants.h>
#include <QCoreApplication>
namespace QmakeProjectManager {
namespace Internal {
EmptyProjectWizard::EmptyProjectWizard()
{
setId(QLatin1String("U.Qt4Empty"));
setCategory(QLatin1String(ProjectExplorer::Constants::QT_PROJECT_WIZARD_CATEGORY));
setDisplayCategory(QCoreApplication::translate("ProjectExplorer",
ProjectExplorer::Constants::QT_PROJECT_WIZARD_CATEGORY_DISPLAY));
setDisplayName(tr("Empty Qt Project"));
setDescription(tr("Creates a qmake-based project without any files. This allows you to create "
"an application without any default classes."));
setIcon(QIcon(QLatin1String(":/wizards/images/gui.png")));
setRequiredFeatures(Core::Feature(QtSupport::Constants::FEATURE_QT));
}
Core::BaseFileWizard *EmptyProjectWizard::create(QWidget *parent, const Core::WizardDialogParameters &parameters) const
{
EmptyProjectWizardDialog *dialog = new EmptyProjectWizardDialog(displayName(), icon(), parent, parameters);
dialog->setProjectName(EmptyProjectWizardDialog::uniqueProjectName(parameters.defaultPath()));
return dialog;
}
Core::GeneratedFiles
EmptyProjectWizard::generateFiles(const QWizard *w,
QString * /*errorMessage*/) const
{
const EmptyProjectWizardDialog *wizard = qobject_cast< const EmptyProjectWizardDialog *>(w);
const QtProjectParameters params = wizard->parameters();
const QString projectPath = params.projectPath();
const QString profileName = Core::BaseFileWizardFactory::buildFileName(projectPath, params.fileName, profileSuffix());
Core::GeneratedFile profile(profileName);
profile.setAttributes(Core::GeneratedFile::OpenProjectAttribute | Core::GeneratedFile::OpenEditorAttribute);
return Core::GeneratedFiles() << profile;
}
} // namespace Internal
} // namespace QmakeProjectManager
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** 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
** a written agreement between you and Digia. For licensing terms and
** conditions see http://www.qt.io/licensing. For further information
** use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** 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.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef EMPTYPROJECTWIZARD_H
#define EMPTYPROJECTWIZARD_H
#include "qtwizard.h"
namespace QmakeProjectManager {
namespace Internal {
class EmptyProjectWizard : public QtWizard
{
Q_OBJECT
public:
EmptyProjectWizard();
private:
Core::BaseFileWizard *create(QWidget *parent, const Core::WizardDialogParameters &parameters) const;
Core::GeneratedFiles generateFiles(const QWizard *w, QString *errorMessage) const;
};
} // namespace Internal
} // namespace QmakeProjectManager
#endif // EMPTYPROJECTWIZARD_H
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** 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
** a written agreement between you and Digia. For licensing terms and
** conditions see http://www.qt.io/licensing. For further information
** use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** 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.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#include "emptyprojectwizarddialog.h"
#include <projectexplorer/projectexplorerconstants.h>
namespace QmakeProjectManager {
namespace Internal {
EmptyProjectWizardDialog::EmptyProjectWizardDialog(const QString &templateName,
const QIcon &icon,
QWidget *parent, const Core::WizardDialogParameters &parameters) :
BaseQmakeProjectWizardDialog(false, parent, parameters)
{
setWindowIcon(icon);
setWindowTitle(templateName);
setIntroDescription(tr("This wizard generates an empty Qt project. "
"Add files to it later on by using the other wizards."));
if (!parameters.extraValues().contains(QLatin1String(ProjectExplorer::Constants::PROJECT_KIT_IDS)))
addTargetSetupPage();
addExtensionPages(parameters.extensionPages());
}
QtProjectParameters EmptyProjectWizardDialog::parameters() const
{
QtProjectParameters rc;
rc.type = QtProjectParameters::EmptyProject;
rc.fileName = projectName();
rc.path = path();
return rc;
}
} // namespace Internal
} // namespace QmakeProjectManager
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** 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
** a written agreement between you and Digia. For licensing terms and
** conditions see http://www.qt.io/licensing. For further information
** use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** 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.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef EMPTYPROJECTWIZARDDIALOG_H
#define EMPTYPROJECTWIZARDDIALOG_H
#include "qtwizard.h"
namespace QmakeProjectManager {
namespace Internal {
struct QtProjectParameters;
class EmptyProjectWizardDialog : public BaseQmakeProjectWizardDialog
{
Q_OBJECT
public:
explicit EmptyProjectWizardDialog(const QString &templateName,
const QIcon &icon,
QWidget *parent,
const Core::WizardDialogParameters &parameters);
QtProjectParameters parameters() const;
};
} // namespace Internal
} // namespace QmakeProjectManager
#endif // EMPTYPROJECTWIZARDDIALOG_H
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment