forked from qt-creator/qt-creator
Cleanup IWizard interface and users
Added 639 lines, removed 1391. Change-Id: I15ec7dd056d4f7ad79c6dd6a4181007ad14f6a43 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
@@ -43,27 +43,13 @@
|
|||||||
|
|
||||||
using namespace Bazaar::Internal;
|
using namespace Bazaar::Internal;
|
||||||
|
|
||||||
CloneWizard::CloneWizard(QObject *parent)
|
CloneWizard::CloneWizard()
|
||||||
: VcsBase::BaseCheckoutWizard(parent),
|
|
||||||
m_icon(QIcon(QLatin1String(":/bazaar/images/bazaar.png")))
|
|
||||||
{
|
{
|
||||||
setId(QLatin1String(VcsBase::Constants::VCS_ID_BAZAAR));
|
setId(QLatin1String(VcsBase::Constants::VCS_ID_BAZAAR));
|
||||||
setCustomLabels(tr("Cloning"), tr("Cloning started..."));
|
setCustomLabels(tr("Cloning"), tr("Cloning started..."));
|
||||||
}
|
setIcon(QIcon(QLatin1String(":/bazaar/images/bazaar.png")));
|
||||||
|
setDescription(tr("Clones a Bazaar branch and tries to load the contained project."));
|
||||||
QIcon CloneWizard::icon() const
|
setDisplayName(tr("Bazaar Clone (Or Branch)"));
|
||||||
{
|
|
||||||
return m_icon;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString CloneWizard::description() const
|
|
||||||
{
|
|
||||||
return tr("Clones a Bazaar branch and tries to load the contained project.");
|
|
||||||
}
|
|
||||||
|
|
||||||
QString CloneWizard::displayName() const
|
|
||||||
{
|
|
||||||
return tr("Bazaar Clone (Or Branch)");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QWizardPage *> CloneWizard::createParameterPages(const QString &path)
|
QList<QWizardPage *> CloneWizard::createParameterPages(const QString &path)
|
||||||
|
|||||||
@@ -42,19 +42,12 @@ class CloneWizard : public VcsBase::BaseCheckoutWizard
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CloneWizard(QObject *parent = 0);
|
CloneWizard();
|
||||||
|
|
||||||
QIcon icon() const;
|
private:
|
||||||
QString description() const;
|
|
||||||
QString displayName() const;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
QList<QWizardPage *> createParameterPages(const QString &path);
|
QList<QWizardPage *> createParameterPages(const QString &path);
|
||||||
VcsBase::Command *createCommand(const QList<QWizardPage *> ¶meterPages,
|
VcsBase::Command *createCommand(const QList<QWizardPage *> ¶meterPages,
|
||||||
QString *checkoutPath);
|
QString *checkoutPath);
|
||||||
|
|
||||||
private:
|
|
||||||
const QIcon m_icon;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -63,189 +63,6 @@ static int indexOfFile(const GeneratedFiles &f, const QString &path)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------ BaseFileWizardParameterData
|
|
||||||
class BaseFileWizardParameterData : public QSharedData
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
explicit BaseFileWizardParameterData(IWizard::WizardKind kind = IWizard::FileWizard);
|
|
||||||
void clear();
|
|
||||||
|
|
||||||
IWizard::WizardKind kind;
|
|
||||||
QIcon icon;
|
|
||||||
QString description;
|
|
||||||
QString displayName;
|
|
||||||
QString id;
|
|
||||||
QString category;
|
|
||||||
QString displayCategory;
|
|
||||||
FeatureSet requiredFeatures;
|
|
||||||
IWizard::WizardFlags flags;
|
|
||||||
QString descriptionImage;
|
|
||||||
};
|
|
||||||
|
|
||||||
BaseFileWizardParameterData::BaseFileWizardParameterData(IWizard::WizardKind k) :
|
|
||||||
kind(k)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void BaseFileWizardParameterData::clear()
|
|
||||||
{
|
|
||||||
kind = IWizard::FileWizard;
|
|
||||||
icon = QIcon();
|
|
||||||
description.clear();
|
|
||||||
displayName.clear();
|
|
||||||
id.clear();
|
|
||||||
category.clear();
|
|
||||||
displayCategory.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\class Core::BaseFileWizardParameters
|
|
||||||
\brief The BaseFileWizardParameters class is a parameter class for
|
|
||||||
passing parameters to instances of the class Wizard containing name, icon,
|
|
||||||
and so on.
|
|
||||||
|
|
||||||
\sa Core::GeneratedFile, Core::BaseFileWizard, Core::StandardFileWizard
|
|
||||||
\sa Core::Internal::WizardEventLoop
|
|
||||||
*/
|
|
||||||
|
|
||||||
BaseFileWizardParameters::BaseFileWizardParameters(IWizard::WizardKind kind) :
|
|
||||||
m_d(new BaseFileWizardParameterData(kind))
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
BaseFileWizardParameters::BaseFileWizardParameters(const BaseFileWizardParameters &rhs) :
|
|
||||||
m_d(rhs.m_d)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
BaseFileWizardParameters &BaseFileWizardParameters::operator=(const BaseFileWizardParameters &rhs)
|
|
||||||
{
|
|
||||||
if (this != &rhs)
|
|
||||||
m_d.operator=(rhs.m_d);
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
BaseFileWizardParameters::~BaseFileWizardParameters()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void BaseFileWizardParameters::clear()
|
|
||||||
{
|
|
||||||
m_d->clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
CORE_EXPORT QDebug operator<<(QDebug d, const BaseFileWizardParameters &p)
|
|
||||||
{
|
|
||||||
d.nospace() << "Kind: " << p.kind() << " Id: " << p.id()
|
|
||||||
<< " Category: " << p.category()
|
|
||||||
<< " DisplayName: " << p.displayName()
|
|
||||||
<< " Description: " << p.description()
|
|
||||||
<< " DisplayCategory: " << p.displayCategory()
|
|
||||||
<< " Required Features: " << p.requiredFeatures().toStringList();
|
|
||||||
return d;
|
|
||||||
}
|
|
||||||
|
|
||||||
IWizard::WizardKind BaseFileWizardParameters::kind() const
|
|
||||||
{
|
|
||||||
return m_d->kind;
|
|
||||||
}
|
|
||||||
|
|
||||||
void BaseFileWizardParameters::setKind(IWizard::WizardKind k)
|
|
||||||
{
|
|
||||||
m_d->kind = k;
|
|
||||||
}
|
|
||||||
|
|
||||||
QIcon BaseFileWizardParameters::icon() const
|
|
||||||
{
|
|
||||||
return m_d->icon;
|
|
||||||
}
|
|
||||||
|
|
||||||
void BaseFileWizardParameters::setIcon(const QIcon &icon)
|
|
||||||
{
|
|
||||||
m_d->icon = icon;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString BaseFileWizardParameters::description() const
|
|
||||||
{
|
|
||||||
return m_d->description;
|
|
||||||
}
|
|
||||||
|
|
||||||
void BaseFileWizardParameters::setDescription(const QString &v)
|
|
||||||
{
|
|
||||||
m_d->description = v;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString BaseFileWizardParameters::displayName() const
|
|
||||||
{
|
|
||||||
return m_d->displayName;
|
|
||||||
}
|
|
||||||
|
|
||||||
void BaseFileWizardParameters::setDisplayName(const QString &v)
|
|
||||||
{
|
|
||||||
m_d->displayName = v;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString BaseFileWizardParameters::id() const
|
|
||||||
{
|
|
||||||
return m_d->id;
|
|
||||||
}
|
|
||||||
|
|
||||||
void BaseFileWizardParameters::setId(const QString &v)
|
|
||||||
{
|
|
||||||
m_d->id = v;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString BaseFileWizardParameters::category() const
|
|
||||||
{
|
|
||||||
return m_d->category;
|
|
||||||
}
|
|
||||||
|
|
||||||
void BaseFileWizardParameters::setCategory(const QString &v)
|
|
||||||
{
|
|
||||||
m_d->category = v;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString BaseFileWizardParameters::displayCategory() const
|
|
||||||
{
|
|
||||||
return m_d->displayCategory;
|
|
||||||
}
|
|
||||||
|
|
||||||
FeatureSet BaseFileWizardParameters::requiredFeatures() const
|
|
||||||
{
|
|
||||||
return m_d->requiredFeatures;
|
|
||||||
}
|
|
||||||
|
|
||||||
void BaseFileWizardParameters::setRequiredFeatures(FeatureSet features)
|
|
||||||
{
|
|
||||||
|
|
||||||
m_d->requiredFeatures = features;
|
|
||||||
}
|
|
||||||
|
|
||||||
void BaseFileWizardParameters::setDisplayCategory(const QString &v)
|
|
||||||
{
|
|
||||||
m_d->displayCategory = v;
|
|
||||||
}
|
|
||||||
|
|
||||||
IWizard::WizardFlags BaseFileWizardParameters::flags() const
|
|
||||||
{
|
|
||||||
return m_d->flags;
|
|
||||||
}
|
|
||||||
|
|
||||||
void BaseFileWizardParameters::setFlags(IWizard::WizardFlags flags)
|
|
||||||
{
|
|
||||||
m_d->flags = flags;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString BaseFileWizardParameters::descriptionImage() const
|
|
||||||
{
|
|
||||||
return m_d->descriptionImage;
|
|
||||||
}
|
|
||||||
|
|
||||||
void BaseFileWizardParameters::setDescriptionImage(const QString &path)
|
|
||||||
{
|
|
||||||
m_d->descriptionImage = path;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class Core::Internal::WizardEventLoop
|
\class Core::Internal::WizardEventLoop
|
||||||
\brief Special event loop that runs a QWizard and terminates if the page changes.
|
\brief Special event loop that runs a QWizard and terminates if the page changes.
|
||||||
@@ -359,72 +176,15 @@ void WizardEventLoop::rejected()
|
|||||||
\sa Core::Internal::WizardEventLoop
|
\sa Core::Internal::WizardEventLoop
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct BaseFileWizardPrivate
|
|
||||||
{
|
|
||||||
explicit BaseFileWizardPrivate(const Core::BaseFileWizardParameters ¶meters)
|
|
||||||
: m_parameters(parameters), m_wizardDialog(0)
|
|
||||||
{}
|
|
||||||
|
|
||||||
const Core::BaseFileWizardParameters m_parameters;
|
BaseFileWizard::BaseFileWizard(QObject *parent) :
|
||||||
QWizard *m_wizardDialog;
|
IWizard(parent)
|
||||||
};
|
|
||||||
|
|
||||||
// ---------------- Wizard
|
|
||||||
BaseFileWizard::BaseFileWizard(const BaseFileWizardParameters ¶meters,
|
|
||||||
QObject *parent) :
|
|
||||||
IWizard(parent),
|
|
||||||
d(new BaseFileWizardPrivate(parameters))
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
BaseFileWizardParameters BaseFileWizard::baseFileWizardParameters() const
|
|
||||||
{
|
|
||||||
return d->m_parameters;
|
|
||||||
}
|
|
||||||
|
|
||||||
BaseFileWizard::~BaseFileWizard()
|
BaseFileWizard::~BaseFileWizard()
|
||||||
{
|
{
|
||||||
delete d;
|
|
||||||
}
|
|
||||||
|
|
||||||
IWizard::WizardKind BaseFileWizard::kind() const
|
|
||||||
{
|
|
||||||
return d->m_parameters.kind();
|
|
||||||
}
|
|
||||||
|
|
||||||
QIcon BaseFileWizard::icon() const
|
|
||||||
{
|
|
||||||
return d->m_parameters.icon();
|
|
||||||
}
|
|
||||||
|
|
||||||
QString BaseFileWizard::description() const
|
|
||||||
{
|
|
||||||
return d->m_parameters.description();
|
|
||||||
}
|
|
||||||
|
|
||||||
QString BaseFileWizard::displayName() const
|
|
||||||
{
|
|
||||||
return d->m_parameters.displayName();
|
|
||||||
}
|
|
||||||
|
|
||||||
QString BaseFileWizard::id() const
|
|
||||||
{
|
|
||||||
return d->m_parameters.id();
|
|
||||||
}
|
|
||||||
|
|
||||||
QString BaseFileWizard::category() const
|
|
||||||
{
|
|
||||||
return d->m_parameters.category();
|
|
||||||
}
|
|
||||||
|
|
||||||
QString BaseFileWizard::displayCategory() const
|
|
||||||
{
|
|
||||||
return d->m_parameters.displayCategory();
|
|
||||||
}
|
|
||||||
|
|
||||||
QString BaseFileWizard::descriptionImage() const
|
|
||||||
{
|
|
||||||
return d->m_parameters.descriptionImage();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BaseFileWizard::runWizard(const QString &path, QWidget *parent, const QString &platform, const QVariantMap &extraValues)
|
void BaseFileWizard::runWizard(const QString &path, QWidget *parent, const QString &platform, const QVariantMap &extraValues)
|
||||||
@@ -548,17 +308,6 @@ void BaseFileWizard::runWizard(const QString &path, QWidget *parent, const QStri
|
|||||||
QMessageBox::critical(0, tr("File Generation Failure"), errorMessage);
|
QMessageBox::critical(0, tr("File Generation Failure"), errorMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FeatureSet BaseFileWizard::requiredFeatures() const
|
|
||||||
{
|
|
||||||
return d->m_parameters.requiredFeatures();
|
|
||||||
}
|
|
||||||
|
|
||||||
IWizard::WizardFlags BaseFileWizard::flags() const
|
|
||||||
{
|
|
||||||
return d->m_parameters.flags();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn virtual QWizard *Core::BaseFileWizard::createWizardDialog(QWidget *parent,
|
\fn virtual QWizard *Core::BaseFileWizard::createWizardDialog(QWidget *parent,
|
||||||
const WizardDialogParameters &wizardDialogParameters) const
|
const WizardDialogParameters &wizardDialogParameters) const
|
||||||
@@ -799,9 +548,8 @@ QString BaseFileWizard::preferredSuffix(const QString &mimeType)
|
|||||||
\brief Newly introduced virtual that creates the files under the path.
|
\brief Newly introduced virtual that creates the files under the path.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
StandardFileWizard::StandardFileWizard(const BaseFileWizardParameters ¶meters,
|
StandardFileWizard::StandardFileWizard(QObject *parent) :
|
||||||
QObject *parent) :
|
BaseFileWizard(parent)
|
||||||
BaseFileWizard(parameters, parent)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -48,64 +48,10 @@ class QWizardPage;
|
|||||||
class QDebug;
|
class QDebug;
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace Utils {
|
namespace Utils { class Wizard; }
|
||||||
class Wizard;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
|
|
||||||
class IEditor;
|
|
||||||
class IFileWizardExtension;
|
|
||||||
|
|
||||||
class BaseFileWizardParameterData;
|
|
||||||
struct BaseFileWizardPrivate;
|
|
||||||
|
|
||||||
class CORE_EXPORT BaseFileWizardParameters
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
explicit BaseFileWizardParameters(IWizard::WizardKind kind = IWizard::FileWizard);
|
|
||||||
BaseFileWizardParameters(const BaseFileWizardParameters &);
|
|
||||||
BaseFileWizardParameters &operator=(const BaseFileWizardParameters&);
|
|
||||||
~BaseFileWizardParameters();
|
|
||||||
|
|
||||||
void clear();
|
|
||||||
|
|
||||||
IWizard::WizardKind kind() const;
|
|
||||||
void setKind(IWizard::WizardKind k);
|
|
||||||
|
|
||||||
QIcon icon() const;
|
|
||||||
void setIcon(const QIcon &icon);
|
|
||||||
|
|
||||||
QString description() const;
|
|
||||||
void setDescription(const QString &description);
|
|
||||||
|
|
||||||
QString displayName() const;
|
|
||||||
void setDisplayName(const QString &name);
|
|
||||||
|
|
||||||
QString id() const;
|
|
||||||
void setId(const QString &id);
|
|
||||||
|
|
||||||
QString category() const;
|
|
||||||
void setCategory(const QString &category);
|
|
||||||
|
|
||||||
QString displayCategory() const;
|
|
||||||
void setDisplayCategory(const QString &trCategory);
|
|
||||||
|
|
||||||
Core::FeatureSet requiredFeatures() const;
|
|
||||||
void setRequiredFeatures(Core::FeatureSet features);
|
|
||||||
|
|
||||||
Core::IWizard::WizardFlags flags() const;
|
|
||||||
void setFlags(Core::IWizard::WizardFlags flags);
|
|
||||||
|
|
||||||
QString descriptionImage() const;
|
|
||||||
void setDescriptionImage(const QString &path);
|
|
||||||
|
|
||||||
private:
|
|
||||||
QSharedDataPointer<BaseFileWizardParameterData> m_d;
|
|
||||||
};
|
|
||||||
|
|
||||||
CORE_EXPORT QDebug operator<<(QDebug d, const BaseFileWizardParameters &);
|
|
||||||
|
|
||||||
class CORE_EXPORT WizardDialogParameters
|
class CORE_EXPORT WizardDialogParameters
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -163,20 +109,7 @@ public:
|
|||||||
virtual ~BaseFileWizard();
|
virtual ~BaseFileWizard();
|
||||||
|
|
||||||
// IWizard
|
// IWizard
|
||||||
virtual WizardKind kind() const;
|
|
||||||
virtual QIcon icon() const;
|
|
||||||
virtual QString description() const;
|
|
||||||
virtual QString displayName() const;
|
|
||||||
virtual QString id() const;
|
|
||||||
|
|
||||||
virtual QString category() const;
|
|
||||||
virtual QString displayCategory() const;
|
|
||||||
|
|
||||||
virtual QString descriptionImage() const;
|
|
||||||
|
|
||||||
virtual void runWizard(const QString &path, QWidget *parent, const QString &platform, const QVariantMap &extraValues);
|
virtual void runWizard(const QString &path, QWidget *parent, const QString &platform, const QVariantMap &extraValues);
|
||||||
virtual Core::FeatureSet requiredFeatures() const;
|
|
||||||
virtual WizardFlags flags() const;
|
|
||||||
|
|
||||||
static QString buildFileName(const QString &path, const QString &baseName, const QString &extension);
|
static QString buildFileName(const QString &path, const QString &baseName, const QString &extension);
|
||||||
static void setupWizard(QWizard *);
|
static void setupWizard(QWizard *);
|
||||||
@@ -185,9 +118,7 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
typedef QList<QWizardPage *> WizardPageList;
|
typedef QList<QWizardPage *> WizardPageList;
|
||||||
|
|
||||||
explicit BaseFileWizard(const BaseFileWizardParameters ¶meters, QObject *parent = 0);
|
explicit BaseFileWizard(QObject *parent = 0);
|
||||||
|
|
||||||
BaseFileWizardParameters baseFileWizardParameters() const;
|
|
||||||
|
|
||||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
virtual QWizard *createWizardDialog(QWidget *parent,
|
||||||
const WizardDialogParameters &wizardDialogParameters) const = 0;
|
const WizardDialogParameters &wizardDialogParameters) const = 0;
|
||||||
@@ -205,9 +136,6 @@ protected:
|
|||||||
OverwriteResult promptOverwrite(GeneratedFiles *files,
|
OverwriteResult promptOverwrite(GeneratedFiles *files,
|
||||||
QString *errorMessage) const;
|
QString *errorMessage) const;
|
||||||
static bool postGenerateOpenEditors(const GeneratedFiles &l, QString *errorMessage = 0);
|
static bool postGenerateOpenEditors(const GeneratedFiles &l, QString *errorMessage = 0);
|
||||||
|
|
||||||
private:
|
|
||||||
BaseFileWizardPrivate *d;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class CORE_EXPORT StandardFileWizard : public BaseFileWizard
|
class CORE_EXPORT StandardFileWizard : public BaseFileWizard
|
||||||
@@ -215,25 +143,13 @@ class CORE_EXPORT StandardFileWizard : public BaseFileWizard
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
explicit StandardFileWizard(const BaseFileWizardParameters ¶meters, QObject *parent = 0);
|
explicit StandardFileWizard(QObject *parent = 0);
|
||||||
virtual QWizard *createWizardDialog(QWidget *parent, const WizardDialogParameters &wizardDialogParameters) const;
|
virtual QWizard *createWizardDialog(QWidget *parent, const WizardDialogParameters &wizardDialogParameters) const;
|
||||||
virtual GeneratedFiles generateFiles(const QWizard *w, QString *errorMessage) const;
|
virtual GeneratedFiles generateFiles(const QWizard *w, QString *errorMessage) const;
|
||||||
virtual GeneratedFiles generateFilesFromPath(const QString &path, const QString &name,
|
virtual GeneratedFiles generateFilesFromPath(const QString &path, const QString &name,
|
||||||
QString *errorMessage) const = 0;
|
QString *errorMessage) const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class WizardClass>
|
|
||||||
QList<WizardClass*> createMultipleBaseFileWizardInstances(const QList<BaseFileWizardParameters> ¶metersList, ExtensionSystem::IPlugin *plugin)
|
|
||||||
{
|
|
||||||
QList<WizardClass*> list;
|
|
||||||
foreach (const BaseFileWizardParameters ¶meters, parametersList) {
|
|
||||||
WizardClass *wc = new WizardClass(parameters, 0);
|
|
||||||
plugin->addAutoReleasedObject(wc);
|
|
||||||
list << wc;
|
|
||||||
}
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace Core
|
} // namespace Core
|
||||||
|
|
||||||
Q_DECLARE_OPERATORS_FOR_FLAGS(Core::GeneratedFile::Attributes)
|
Q_DECLARE_OPERATORS_FOR_FLAGS(Core::GeneratedFile::Attributes)
|
||||||
|
|||||||
@@ -31,18 +31,15 @@
|
|||||||
#define IWIZARD_H
|
#define IWIZARD_H
|
||||||
|
|
||||||
#include <coreplugin/core_global.h>
|
#include <coreplugin/core_global.h>
|
||||||
|
#include <coreplugin/id.h>
|
||||||
|
#include <coreplugin/featureprovider.h>
|
||||||
|
|
||||||
|
#include <QIcon>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QVariantMap>
|
#include <QVariantMap>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
|
||||||
class QIcon;
|
|
||||||
QT_END_NAMESPACE
|
|
||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
|
|
||||||
class FeatureSet;
|
|
||||||
|
|
||||||
class CORE_EXPORT IWizard
|
class CORE_EXPORT IWizard
|
||||||
: public QObject
|
: public QObject
|
||||||
{
|
{
|
||||||
@@ -60,22 +57,49 @@ public:
|
|||||||
};
|
};
|
||||||
Q_DECLARE_FLAGS(WizardFlags, WizardFlag)
|
Q_DECLARE_FLAGS(WizardFlags, WizardFlag)
|
||||||
|
|
||||||
|
class CORE_EXPORT Data
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
Data() : kind(IWizard::FileWizard) {}
|
||||||
|
|
||||||
|
IWizard::WizardKind kind;
|
||||||
|
QIcon icon;
|
||||||
|
QString description;
|
||||||
|
QString displayName;
|
||||||
|
QString id;
|
||||||
|
QString category;
|
||||||
|
QString displayCategory;
|
||||||
|
FeatureSet requiredFeatures;
|
||||||
|
IWizard::WizardFlags flags;
|
||||||
|
QString descriptionImage;
|
||||||
|
};
|
||||||
|
|
||||||
IWizard(QObject *parent = 0) : QObject(parent) {}
|
IWizard(QObject *parent = 0) : QObject(parent) {}
|
||||||
virtual ~IWizard() {}
|
~IWizard() {}
|
||||||
|
|
||||||
virtual WizardKind kind() const = 0;
|
QString id() const { return m_data.id; }
|
||||||
virtual QIcon icon() const = 0;
|
WizardKind kind() const { return m_data.kind; }
|
||||||
virtual QString description() const = 0;
|
QIcon icon() const { return m_data.icon; }
|
||||||
virtual QString displayName() const = 0;
|
QString description() const { return m_data.description; }
|
||||||
virtual QString id() const = 0;
|
QString displayName() const { return m_data.displayName; }
|
||||||
|
QString category() const { return m_data.category; }
|
||||||
|
QString displayCategory() const { return m_data.displayCategory; }
|
||||||
|
QString descriptionImage() const { return m_data.descriptionImage; }
|
||||||
|
FeatureSet requiredFeatures() const { return m_data.requiredFeatures; }
|
||||||
|
WizardFlags flags() const { return m_data.flags; }
|
||||||
|
|
||||||
virtual QString category() const = 0;
|
void setData(const Data &data) { m_data = data; }
|
||||||
virtual QString displayCategory() const = 0;
|
void setId(const QString &id) { m_data.id = id; }
|
||||||
|
void setWizardKind(WizardKind kind) { m_data.kind = kind; }
|
||||||
virtual QString descriptionImage() const = 0;
|
void setIcon(const QIcon &icon) { m_data.icon = icon; }
|
||||||
|
void setDescription(const QString &description) { m_data.description = description; }
|
||||||
virtual FeatureSet requiredFeatures() const = 0;
|
void setDisplayName(const QString &displayName) { m_data.displayName = displayName; }
|
||||||
virtual WizardFlags flags() const = 0;
|
void setCategory(const QString &category) { m_data.category = category; }
|
||||||
|
void setDisplayCategory(const QString &displayCategory) { m_data.displayCategory = displayCategory; }
|
||||||
|
void setDescriptionImage(const QString &descriptionImage) { m_data.descriptionImage = descriptionImage; }
|
||||||
|
void setRequiredFeatures(const FeatureSet &featureSet) { m_data.requiredFeatures = featureSet; }
|
||||||
|
void addRequiredFeature(const Feature &feature) { m_data.requiredFeatures |= feature; }
|
||||||
|
void setFlags(WizardFlags flags) { m_data.flags = flags; }
|
||||||
|
|
||||||
virtual void runWizard(const QString &path, QWidget *parent, const QString &platform, const QVariantMap &variables) = 0;
|
virtual void runWizard(const QString &path, QWidget *parent, const QString &platform, const QVariantMap &variables) = 0;
|
||||||
|
|
||||||
@@ -88,6 +112,9 @@ public:
|
|||||||
static QList<IWizard*> wizardsOfKind(WizardKind kind);
|
static QList<IWizard*> wizardsOfKind(WizardKind kind);
|
||||||
static QStringList allAvailablePlatforms();
|
static QStringList allAvailablePlatforms();
|
||||||
static QString displayNameForPlatform(const QString &string);
|
static QString displayNameForPlatform(const QString &string);
|
||||||
|
|
||||||
|
private:
|
||||||
|
Data m_data;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Core
|
} // namespace Core
|
||||||
|
|||||||
@@ -140,17 +140,10 @@ CppClassWizardParameters CppClassWizardDialog::parameters() const
|
|||||||
|
|
||||||
// ========= CppClassWizard =========
|
// ========= CppClassWizard =========
|
||||||
|
|
||||||
CppClassWizard::CppClassWizard(const Core::BaseFileWizardParameters ¶meters,
|
CppClassWizard::CppClassWizard()
|
||||||
QObject *parent)
|
|
||||||
: Core::BaseFileWizard(parameters, parent)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::FeatureSet CppClassWizard::requiredFeatures() const
|
|
||||||
{
|
|
||||||
return Core::FeatureSet();
|
|
||||||
}
|
|
||||||
|
|
||||||
QString CppClassWizard::sourceSuffix() const
|
QString CppClassWizard::sourceSuffix() const
|
||||||
{
|
{
|
||||||
return preferredSuffix(QLatin1String(Constants::CPP_SOURCE_MIMETYPE));
|
return preferredSuffix(QLatin1String(Constants::CPP_SOURCE_MIMETYPE));
|
||||||
|
|||||||
@@ -96,25 +96,20 @@ class CppClassWizard : public Core::BaseFileWizard
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit CppClassWizard(const Core::BaseFileWizardParameters ¶meters,
|
CppClassWizard();
|
||||||
QObject *parent = 0);
|
|
||||||
|
|
||||||
virtual Core::FeatureSet requiredFeatures() const;
|
private:
|
||||||
|
QWizard *createWizardDialog(QWidget *parent,
|
||||||
protected:
|
|
||||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
|
||||||
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
||||||
|
|
||||||
|
|
||||||
virtual Core::GeneratedFiles generateFiles(const QWizard *w,
|
Core::GeneratedFiles generateFiles(const QWizard *w,
|
||||||
QString *errorMessage) const;
|
QString *errorMessage) const;
|
||||||
QString sourceSuffix() const;
|
QString sourceSuffix() const;
|
||||||
QString headerSuffix() const;
|
QString headerSuffix() const;
|
||||||
|
|
||||||
private:
|
|
||||||
static bool generateHeaderAndSource(const CppClassWizardParameters ¶ms,
|
static bool generateHeaderAndSource(const CppClassWizardParameters ¶ms,
|
||||||
QString *header, QString *source);
|
QString *header, QString *source);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -163,28 +163,35 @@ bool CppEditorPlugin::initialize(const QStringList & /*arguments*/, QString *err
|
|||||||
addAutoReleasedObject(m_quickFixProvider);
|
addAutoReleasedObject(m_quickFixProvider);
|
||||||
CppEditor::Internal::registerQuickFixes(this);
|
CppEditor::Internal::registerQuickFixes(this);
|
||||||
|
|
||||||
QObject *core = ICore::instance();
|
QString trCat = QCoreApplication::translate(Constants::WIZARD_CATEGORY, Constants::WIZARD_TR_CATEGORY);
|
||||||
CppFileWizard::BaseFileWizardParameters wizardParameters(IWizard::FileWizard);
|
|
||||||
|
|
||||||
wizardParameters.setCategory(QLatin1String(Constants::WIZARD_CATEGORY));
|
IWizard *wizard = new CppClassWizard;
|
||||||
wizardParameters.setDisplayCategory(QCoreApplication::translate(Constants::WIZARD_CATEGORY,
|
wizard->setWizardKind(IWizard::ClassWizard);
|
||||||
Constants::WIZARD_TR_CATEGORY));
|
wizard->setCategory(QLatin1String(Constants::WIZARD_CATEGORY));
|
||||||
wizardParameters.setDisplayName(tr("C++ Class"));
|
wizard->setDisplayCategory(trCat);
|
||||||
wizardParameters.setId(QLatin1String("A.Class"));
|
wizard->setDisplayName(tr("C++ Class"));
|
||||||
wizardParameters.setKind(IWizard::ClassWizard);
|
wizard->setId(QLatin1String("A.Class"));
|
||||||
wizardParameters.setDescription(tr("Creates a C++ header and a source file for a new class that you can add to a C++ project."));
|
wizard->setDescription(tr("Creates a C++ header and a source file for a new class that you can add to a C++ project."));
|
||||||
addAutoReleasedObject(new CppClassWizard(wizardParameters, core));
|
addAutoReleasedObject(wizard);
|
||||||
|
|
||||||
wizardParameters.setKind(IWizard::FileWizard);
|
wizard = new CppFileWizard(Source);
|
||||||
wizardParameters.setDescription(tr("Creates a C++ source file that you can add to a C++ project."));
|
wizard->setWizardKind(IWizard::FileWizard);
|
||||||
wizardParameters.setDisplayName(tr("C++ Source File"));
|
wizard->setCategory(QLatin1String(Constants::WIZARD_CATEGORY));
|
||||||
wizardParameters.setId(QLatin1String("B.Source"));
|
wizard->setDisplayCategory(trCat);
|
||||||
addAutoReleasedObject(new CppFileWizard(wizardParameters, Source, core));
|
wizard->setDisplayName(tr("C++ Class"));
|
||||||
|
wizard->setDescription(tr("Creates a C++ source file that you can add to a C++ project."));
|
||||||
|
wizard->setDisplayName(tr("C++ Source File"));
|
||||||
|
wizard->setId(QLatin1String("B.Source"));
|
||||||
|
addAutoReleasedObject(wizard);
|
||||||
|
|
||||||
wizardParameters.setDescription(tr("Creates a C++ header file that you can add to a C++ project."));
|
wizard = new CppFileWizard(Header);
|
||||||
wizardParameters.setDisplayName(tr("C++ Header File"));
|
wizard->setWizardKind(IWizard::FileWizard);
|
||||||
wizardParameters.setId(QLatin1String("C.Header"));
|
wizard->setCategory(QLatin1String(Constants::WIZARD_CATEGORY));
|
||||||
addAutoReleasedObject(new CppFileWizard(wizardParameters, Header, core));
|
wizard->setDisplayCategory(trCat);
|
||||||
|
wizard->setDescription(tr("Creates a C++ header file that you can add to a C++ project."));
|
||||||
|
wizard->setDisplayName(tr("C++ Header File"));
|
||||||
|
wizard->setId(QLatin1String("C.Header"));
|
||||||
|
addAutoReleasedObject(wizard);
|
||||||
|
|
||||||
Context context(CppEditor::Constants::C_CPPEDITOR);
|
Context context(CppEditor::Constants::C_CPPEDITOR);
|
||||||
|
|
||||||
|
|||||||
@@ -43,18 +43,14 @@ using namespace CppEditor::Internal;
|
|||||||
|
|
||||||
enum { debugWizard = 0 };
|
enum { debugWizard = 0 };
|
||||||
|
|
||||||
CppFileWizard::CppFileWizard(const BaseFileWizardParameters ¶meters,
|
CppFileWizard::CppFileWizard(FileType type)
|
||||||
FileType type,
|
: m_type(type)
|
||||||
QObject *parent) :
|
|
||||||
Core::StandardFileWizard(parameters, parent),
|
|
||||||
m_type(type)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::GeneratedFiles CppFileWizard::generateFilesFromPath(const QString &path,
|
Core::GeneratedFiles CppFileWizard::generateFilesFromPath(const QString &path,
|
||||||
const QString &name,
|
const QString &name,
|
||||||
QString * /*errorMessage*/) const
|
QString * /*errorMessage*/) const
|
||||||
|
|
||||||
{
|
{
|
||||||
const QString mimeType = m_type == Source ? QLatin1String(Constants::CPP_SOURCE_MIMETYPE) : QLatin1String(Constants::CPP_HEADER_MIMETYPE);
|
const QString mimeType = m_type == Source ? QLatin1String(Constants::CPP_SOURCE_MIMETYPE) : QLatin1String(Constants::CPP_HEADER_MIMETYPE);
|
||||||
const QString fileName = Core::BaseFileWizard::buildFileName(path, name, preferredSuffix(mimeType));
|
const QString fileName = Core::BaseFileWizard::buildFileName(path, name, preferredSuffix(mimeType));
|
||||||
|
|||||||
@@ -42,16 +42,11 @@ class CppFileWizard : public Core::StandardFileWizard
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef Core::BaseFileWizardParameters BaseFileWizardParameters;
|
CppFileWizard(FileType type);
|
||||||
|
|
||||||
CppFileWizard(const BaseFileWizardParameters ¶meters,
|
private:
|
||||||
FileType type,
|
|
||||||
QObject *parent = 0);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
QString fileContents(FileType type, const QString &baseName) const;
|
QString fileContents(FileType type, const QString &baseName) const;
|
||||||
|
|
||||||
protected:
|
|
||||||
Core::GeneratedFiles generateFilesFromPath(const QString &path,
|
Core::GeneratedFiles generateFilesFromPath(const QString &path,
|
||||||
const QString &fileName,
|
const QString &fileName,
|
||||||
QString *errorMessage) const;
|
QString *errorMessage) const;
|
||||||
|
|||||||
@@ -37,30 +37,15 @@
|
|||||||
#include <vcsbase/vcsconfigurationpage.h>
|
#include <vcsbase/vcsconfigurationpage.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QIcon>
|
|
||||||
|
|
||||||
namespace Cvs {
|
namespace Cvs {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
CheckoutWizard::CheckoutWizard(QObject *parent) :
|
CheckoutWizard::CheckoutWizard()
|
||||||
VcsBase::BaseCheckoutWizard(parent)
|
|
||||||
{
|
{
|
||||||
setId(QLatin1String(VcsBase::Constants::VCS_ID_CVS));
|
setId(QLatin1String(VcsBase::Constants::VCS_ID_CVS));
|
||||||
}
|
setIcon(QIcon(QLatin1String(":/cvs/images/cvs.png")));
|
||||||
|
setDescription(tr("Checks out a CVS repository and tries to load the contained project."));
|
||||||
QIcon CheckoutWizard::icon() const
|
setDisplayName(tr("CVS Checkout"));
|
||||||
{
|
|
||||||
return QIcon(QLatin1String(":/cvs/images/cvs.png"));
|
|
||||||
}
|
|
||||||
|
|
||||||
QString CheckoutWizard::description() const
|
|
||||||
{
|
|
||||||
return tr("Checks out a CVS repository and tries to load the contained project.");
|
|
||||||
}
|
|
||||||
|
|
||||||
QString CheckoutWizard::displayName() const
|
|
||||||
{
|
|
||||||
return tr("CVS Checkout");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QWizardPage*> CheckoutWizard::createParameterPages(const QString &path)
|
QList<QWizardPage*> CheckoutWizard::createParameterPages(const QString &path)
|
||||||
|
|||||||
@@ -38,15 +38,11 @@ namespace Internal {
|
|||||||
class CheckoutWizard : public VcsBase::BaseCheckoutWizard
|
class CheckoutWizard : public VcsBase::BaseCheckoutWizard
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit CheckoutWizard(QObject *parent = 0);
|
CheckoutWizard();
|
||||||
|
|
||||||
// IWizard
|
private:
|
||||||
QIcon icon() const;
|
|
||||||
QString description() const;
|
|
||||||
QString displayName() const;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
// BaseCheckoutWizard
|
// BaseCheckoutWizard
|
||||||
QList<QWizardPage*> createParameterPages(const QString &path);
|
QList<QWizardPage*> createParameterPages(const QString &path);
|
||||||
VcsBase::Command *createCommand(const QList<QWizardPage*> ¶meterPage,
|
VcsBase::Command *createCommand(const QList<QWizardPage*> ¶meterPage,
|
||||||
|
|||||||
@@ -40,9 +40,9 @@
|
|||||||
namespace Designer {
|
namespace Designer {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
FormClassWizard::FormClassWizard(const BaseFileWizardParameters ¶meters, QObject *parent)
|
FormClassWizard::FormClassWizard()
|
||||||
: Core::BaseFileWizard(parameters, parent)
|
|
||||||
{
|
{
|
||||||
|
setRequiredFeatures(Core::Feature(QtSupport::Constants::FEATURE_QWIDGETS));
|
||||||
}
|
}
|
||||||
|
|
||||||
QString FormClassWizard::headerSuffix() const
|
QString FormClassWizard::headerSuffix() const
|
||||||
@@ -60,11 +60,6 @@ QString FormClassWizard::formSuffix() const
|
|||||||
return preferredSuffix(QLatin1String(Constants::FORM_MIMETYPE));
|
return preferredSuffix(QLatin1String(Constants::FORM_MIMETYPE));
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::FeatureSet FormClassWizard::requiredFeatures() const
|
|
||||||
{
|
|
||||||
return Core::Feature(QtSupport::Constants::FEATURE_QWIDGETS);
|
|
||||||
}
|
|
||||||
|
|
||||||
QWizard *FormClassWizard::createWizardDialog(QWidget *parent,
|
QWizard *FormClassWizard::createWizardDialog(QWidget *parent,
|
||||||
const Core::WizardDialogParameters &wizardDialogParameters) const
|
const Core::WizardDialogParameters &wizardDialogParameters) const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -37,28 +37,22 @@
|
|||||||
namespace Designer {
|
namespace Designer {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class FormClassWizardParameters;
|
|
||||||
|
|
||||||
class FormClassWizard : public Core::BaseFileWizard
|
class FormClassWizard : public Core::BaseFileWizard
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef Core::BaseFileWizardParameters BaseFileWizardParameters;
|
FormClassWizard();
|
||||||
|
|
||||||
FormClassWizard(const BaseFileWizardParameters ¶meters, QObject *parent);
|
|
||||||
|
|
||||||
QString headerSuffix() const;
|
QString headerSuffix() const;
|
||||||
QString sourceSuffix() const;
|
QString sourceSuffix() const;
|
||||||
QString formSuffix() const;
|
QString formSuffix() const;
|
||||||
|
|
||||||
virtual Core::FeatureSet requiredFeatures() const;
|
private:
|
||||||
|
QWizard *createWizardDialog(QWidget *parent,
|
||||||
protected:
|
|
||||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
|
||||||
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
||||||
|
|
||||||
virtual Core::GeneratedFiles generateFiles(const QWizard *w,
|
Core::GeneratedFiles generateFiles(const QWizard *w,
|
||||||
QString *errorMessage) const;
|
QString *errorMessage) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -109,23 +109,27 @@ void FormEditorPlugin::extensionsInitialized()
|
|||||||
|
|
||||||
void FormEditorPlugin::initializeTemplates()
|
void FormEditorPlugin::initializeTemplates()
|
||||||
{
|
{
|
||||||
FormWizard::BaseFileWizardParameters wizardParameters(IWizard::FileWizard);
|
IWizard *wizard = new FormWizard;
|
||||||
wizardParameters.setCategory(QLatin1String(Core::Constants::WIZARD_CATEGORY_QT));
|
wizard->setWizardKind(IWizard::FileWizard);
|
||||||
wizardParameters.setDisplayCategory(QCoreApplication::translate("Core", Core::Constants::WIZARD_TR_CATEGORY_QT));
|
wizard->setCategory(QLatin1String(Core::Constants::WIZARD_CATEGORY_QT));
|
||||||
const QString formFileType = QLatin1String(Constants::FORM_FILE_TYPE);
|
wizard->setDisplayCategory(QCoreApplication::translate("Core", Core::Constants::WIZARD_TR_CATEGORY_QT));
|
||||||
wizardParameters.setDisplayName(tr("Qt Designer Form"));
|
wizard->setDisplayName(tr("Qt Designer Form"));
|
||||||
wizardParameters.setId(QLatin1String("D.Form"));
|
wizard->setId(QLatin1String("D.Form"));
|
||||||
wizardParameters.setDescription(tr("Creates a Qt Designer form that you can add to a Qt Widget Project. "
|
wizard->setDescription(tr("Creates a Qt Designer form that you can add to a Qt Widget Project. "
|
||||||
"This is useful if you already have an existing class for the UI business logic."));
|
"This is useful if you already have an existing class for the UI business logic."));
|
||||||
addAutoReleasedObject(new FormWizard(wizardParameters, this));
|
addAutoReleasedObject(wizard);
|
||||||
|
|
||||||
#ifdef CPP_ENABLED
|
#ifdef CPP_ENABLED
|
||||||
wizardParameters.setKind(IWizard::ClassWizard);
|
wizard = new FormClassWizard;
|
||||||
wizardParameters.setDisplayName(tr("Qt Designer Form Class"));
|
wizard->setWizardKind(IWizard::ClassWizard);
|
||||||
wizardParameters.setId(QLatin1String("C.FormClass"));
|
wizard->setCategory(QLatin1String(Core::Constants::WIZARD_CATEGORY_QT));
|
||||||
wizardParameters.setDescription(tr("Creates a Qt Designer form along with a matching class (C++ header and source file) "
|
wizard->setDisplayCategory(QCoreApplication::translate("Core", Core::Constants::WIZARD_TR_CATEGORY_QT));
|
||||||
|
wizard->setDisplayName(tr("Qt Designer Form Class"));
|
||||||
|
wizard->setId(QLatin1String("C.FormClass"));
|
||||||
|
wizard->setDescription(tr("Creates a Qt Designer form along with a matching class (C++ header and source file) "
|
||||||
"for implementation purposes. You can add the form and class to an existing Qt Widget Project."));
|
"for implementation purposes. You can add the form and class to an existing Qt Widget Project."));
|
||||||
addAutoReleasedObject(new FormClassWizard(wizardParameters, this));
|
addAutoReleasedObject(wizard);
|
||||||
|
|
||||||
addAutoReleasedObject(new CppSettingsPage);
|
addAutoReleasedObject(new CppSettingsPage);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,14 +37,9 @@
|
|||||||
using namespace Designer;
|
using namespace Designer;
|
||||||
using namespace Designer::Internal;
|
using namespace Designer::Internal;
|
||||||
|
|
||||||
FormWizard::FormWizard(const BaseFileWizardParameters ¶meters, QObject *parent)
|
FormWizard::FormWizard()
|
||||||
: Core::BaseFileWizard(parameters, parent)
|
|
||||||
{
|
{
|
||||||
}
|
addRequiredFeature(Core::Id(QtSupport::Constants::FEATURE_QWIDGETS));
|
||||||
|
|
||||||
Core::FeatureSet FormWizard::requiredFeatures() const
|
|
||||||
{
|
|
||||||
return Core::Feature(QtSupport::Constants::FEATURE_QWIDGETS);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QWizard *FormWizard::createWizardDialog(QWidget *parent,
|
QWizard *FormWizard::createWizardDialog(QWidget *parent,
|
||||||
|
|||||||
@@ -40,17 +40,13 @@ class FormWizard : public Core::BaseFileWizard
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef Core::BaseFileWizardParameters BaseFileWizardParameters;
|
FormWizard();
|
||||||
|
|
||||||
FormWizard(const BaseFileWizardParameters ¶meters, QObject *parent);
|
private:
|
||||||
|
QWizard *createWizardDialog(QWidget *parent,
|
||||||
virtual Core::FeatureSet requiredFeatures() const;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
|
||||||
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
||||||
|
|
||||||
virtual Core::GeneratedFiles generateFiles(const QWizard *w,
|
Core::GeneratedFiles generateFiles(const QWizard *w,
|
||||||
QString *errorMessage) const;
|
QString *errorMessage) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -108,33 +108,23 @@ QString GenericProjectWizardDialog::projectName() const
|
|||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
GenericProjectWizard::GenericProjectWizard()
|
GenericProjectWizard::GenericProjectWizard()
|
||||||
: Core::BaseFileWizard(parameters())
|
|
||||||
{ }
|
|
||||||
|
|
||||||
Core::FeatureSet GenericProjectWizard::requiredFeatures() const
|
|
||||||
{
|
{
|
||||||
return Core::FeatureSet();
|
setWizardKind(ProjectWizard);
|
||||||
}
|
|
||||||
|
|
||||||
Core::BaseFileWizardParameters GenericProjectWizard::parameters()
|
|
||||||
{
|
|
||||||
Core::BaseFileWizardParameters parameters(ProjectWizard);
|
|
||||||
// TODO do something about the ugliness of standard icons in sizes different than 16, 32, 64, 128
|
// TODO do something about the ugliness of standard icons in sizes different than 16, 32, 64, 128
|
||||||
{
|
{
|
||||||
QPixmap icon(22, 22);
|
QPixmap icon(22, 22);
|
||||||
icon.fill(Qt::transparent);
|
icon.fill(Qt::transparent);
|
||||||
QPainter p(&icon);
|
QPainter p(&icon);
|
||||||
p.drawPixmap(3, 3, 16, 16, qApp->style()->standardIcon(QStyle::SP_DirIcon).pixmap(16));
|
p.drawPixmap(3, 3, 16, 16, qApp->style()->standardIcon(QStyle::SP_DirIcon).pixmap(16));
|
||||||
parameters.setIcon(icon);
|
setIcon(icon);
|
||||||
}
|
}
|
||||||
parameters.setDisplayName(tr("Import Existing Project"));
|
setDisplayName(tr("Import Existing Project"));
|
||||||
parameters.setId(QLatin1String("Z.Makefile"));
|
setId(QLatin1String("Z.Makefile"));
|
||||||
parameters.setDescription(tr("Imports existing projects that do not use qmake, CMake or Autotools. "
|
setDescription(tr("Imports existing projects that do not use qmake, CMake or Autotools. "
|
||||||
"This allows you to use Qt Creator as a code editor."));
|
"This allows you to use Qt Creator as a code editor."));
|
||||||
parameters.setCategory(QLatin1String(ProjectExplorer::Constants::IMPORT_WIZARD_CATEGORY));
|
setCategory(QLatin1String(ProjectExplorer::Constants::IMPORT_WIZARD_CATEGORY));
|
||||||
parameters.setDisplayCategory(QLatin1String(ProjectExplorer::Constants::IMPORT_WIZARD_CATEGORY_DISPLAY));
|
setDisplayCategory(QLatin1String(ProjectExplorer::Constants::IMPORT_WIZARD_CATEGORY_DISPLAY));
|
||||||
parameters.setFlags(Core::IWizard::PlatformIndependent);
|
setFlags(Core::IWizard::PlatformIndependent);
|
||||||
return parameters;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QWizard *GenericProjectWizard::createWizardDialog(QWidget *parent,
|
QWizard *GenericProjectWizard::createWizardDialog(QWidget *parent,
|
||||||
|
|||||||
@@ -64,9 +64,6 @@ class GenericProjectWizard : public Core::BaseFileWizard
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
GenericProjectWizard();
|
GenericProjectWizard();
|
||||||
Core::FeatureSet requiredFeatures() const;
|
|
||||||
|
|
||||||
static Core::BaseFileWizardParameters parameters();
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QWizard *createWizardDialog(QWidget *parent,
|
QWizard *createWizardDialog(QWidget *parent,
|
||||||
|
|||||||
@@ -37,31 +37,16 @@
|
|||||||
#include <vcsbase/vcsconfigurationpage.h>
|
#include <vcsbase/vcsconfigurationpage.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QIcon>
|
|
||||||
|
|
||||||
namespace Git {
|
namespace Git {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
CloneWizard::CloneWizard(QObject *parent) :
|
CloneWizard::CloneWizard()
|
||||||
VcsBase::BaseCheckoutWizard(parent)
|
|
||||||
{
|
{
|
||||||
setId(QLatin1String(VcsBase::Constants::VCS_ID_GIT));
|
setId(QLatin1String(VcsBase::Constants::VCS_ID_GIT));
|
||||||
setCustomLabels(tr("Cloning"), tr("Cloning started..."));
|
setCustomLabels(tr("Cloning"), tr("Cloning started..."));
|
||||||
}
|
setIcon(QIcon(QLatin1String(":/git/images/git.png")));
|
||||||
|
setDescription(tr("Clones a Git repository and tries to load the contained project."));
|
||||||
QIcon CloneWizard::icon() const
|
setDisplayName(tr("Git Repository Clone"));
|
||||||
{
|
|
||||||
return QIcon(QLatin1String(":/git/images/git.png"));
|
|
||||||
}
|
|
||||||
|
|
||||||
QString CloneWizard::description() const
|
|
||||||
{
|
|
||||||
return tr("Clones a Git repository and tries to load the contained project.");
|
|
||||||
}
|
|
||||||
|
|
||||||
QString CloneWizard::displayName() const
|
|
||||||
{
|
|
||||||
return tr("Git Repository Clone");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QWizardPage*> CloneWizard::createParameterPages(const QString &path)
|
QList<QWizardPage*> CloneWizard::createParameterPages(const QString &path)
|
||||||
|
|||||||
@@ -38,15 +38,11 @@ namespace Internal {
|
|||||||
class CloneWizard : public VcsBase::BaseCheckoutWizard
|
class CloneWizard : public VcsBase::BaseCheckoutWizard
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit CloneWizard(QObject *parent = 0);
|
CloneWizard();
|
||||||
|
|
||||||
// IWizard
|
private:
|
||||||
QIcon icon() const;
|
|
||||||
QString description() const;
|
|
||||||
QString displayName() const;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
// BaseCheckoutWizard
|
// BaseCheckoutWizard
|
||||||
QList<QWizardPage*> createParameterPages(const QString &path);
|
QList<QWizardPage*> createParameterPages(const QString &path);
|
||||||
VcsBase::Command *createCommand(const QList<QWizardPage*> ¶meterPages,
|
VcsBase::Command *createCommand(const QList<QWizardPage*> ¶meterPages,
|
||||||
|
|||||||
@@ -41,7 +41,6 @@
|
|||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <QIcon>
|
|
||||||
|
|
||||||
namespace Gitorious {
|
namespace Gitorious {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
@@ -70,25 +69,12 @@ void GitoriousCloneWizardPage::initializePage()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// -------- GitoriousCloneWizard
|
// -------- GitoriousCloneWizard
|
||||||
GitoriousCloneWizard::GitoriousCloneWizard(QObject *parent) :
|
GitoriousCloneWizard::GitoriousCloneWizard()
|
||||||
VcsBase::BaseCheckoutWizard(parent)
|
|
||||||
{
|
{
|
||||||
setId(QLatin1String(VcsBase::Constants::VCS_ID_GIT));
|
setId(QLatin1String(VcsBase::Constants::VCS_ID_GIT));
|
||||||
}
|
setIcon(QIcon(QLatin1String(":/git/images/gitorious.png")));
|
||||||
|
setDescription(tr("Clones a Gitorious repository and tries to load the contained project."));
|
||||||
QIcon GitoriousCloneWizard::icon() const
|
setDisplayName(tr("Gitorious Repository Clone"));
|
||||||
{
|
|
||||||
return QIcon(QLatin1String(":/git/images/gitorious.png"));
|
|
||||||
}
|
|
||||||
|
|
||||||
QString GitoriousCloneWizard::description() const
|
|
||||||
{
|
|
||||||
return tr("Clones a Gitorious repository and tries to load the contained project.");
|
|
||||||
}
|
|
||||||
|
|
||||||
QString GitoriousCloneWizard::displayName() const
|
|
||||||
{
|
|
||||||
return tr("Gitorious Repository Clone");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QWizardPage*> GitoriousCloneWizard::createParameterPages(const QString &path)
|
QList<QWizardPage*> GitoriousCloneWizard::createParameterPages(const QString &path)
|
||||||
|
|||||||
@@ -40,15 +40,11 @@ namespace Internal {
|
|||||||
class GitoriousCloneWizard : public VcsBase::BaseCheckoutWizard
|
class GitoriousCloneWizard : public VcsBase::BaseCheckoutWizard
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit GitoriousCloneWizard(QObject *parent = 0);
|
GitoriousCloneWizard();
|
||||||
|
|
||||||
// IWizard
|
private:
|
||||||
QIcon icon() const;
|
|
||||||
QString description() const;
|
|
||||||
QString displayName() const;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
// BaseCheckoutWizard
|
// BaseCheckoutWizard
|
||||||
QList<QWizardPage*> createParameterPages(const QString &path);
|
QList<QWizardPage*> createParameterPages(const QString &path);
|
||||||
VcsBase::Command *createCommand(const QList<QWizardPage*> ¶meterPages,
|
VcsBase::Command *createCommand(const QList<QWizardPage*> ¶meterPages,
|
||||||
|
|||||||
@@ -178,48 +178,58 @@ bool GLSLEditorPlugin::initialize(const QStringList & /*arguments*/, QString *er
|
|||||||
FileIconProvider::registerIconOverlayForMimeType(":/glsleditor/images/glslfile.png", Constants::GLSL_MIMETYPE_VERT_ES);
|
FileIconProvider::registerIconOverlayForMimeType(":/glsleditor/images/glslfile.png", Constants::GLSL_MIMETYPE_VERT_ES);
|
||||||
FileIconProvider::registerIconOverlayForMimeType(":/glsleditor/images/glslfile.png", Constants::GLSL_MIMETYPE_FRAG_ES);
|
FileIconProvider::registerIconOverlayForMimeType(":/glsleditor/images/glslfile.png", Constants::GLSL_MIMETYPE_FRAG_ES);
|
||||||
|
|
||||||
QObject *core = ICore::instance();
|
IWizard *wizard = new GLSLFileWizard(GLSLFileWizard::FragmentShaderES);
|
||||||
BaseFileWizardParameters fragWizardParameters(IWizard::FileWizard);
|
wizard->setWizardKind(IWizard::FileWizard);
|
||||||
fragWizardParameters.setCategory(QLatin1String(Constants::WIZARD_CATEGORY_GLSL));
|
wizard->setCategory(QLatin1String(Constants::WIZARD_CATEGORY_GLSL));
|
||||||
fragWizardParameters.setDisplayCategory(QCoreApplication::translate("GLSLEditor", Constants::WIZARD_TR_CATEGORY_GLSL));
|
wizard->setDisplayCategory(QCoreApplication::translate("GLSLEditor", Constants::WIZARD_TR_CATEGORY_GLSL));
|
||||||
fragWizardParameters.setDescription
|
wizard->setDescription
|
||||||
(tr("Creates a fragment shader in the OpenGL/ES 2.0 Shading "
|
(tr("Creates a fragment shader in the OpenGL/ES 2.0 Shading "
|
||||||
"Language (GLSL/ES). Fragment shaders generate the final "
|
"Language (GLSL/ES). Fragment shaders generate the final "
|
||||||
"pixel colors for triangles, points and lines rendered "
|
"pixel colors for triangles, points and lines rendered "
|
||||||
"with OpenGL."));
|
"with OpenGL."));
|
||||||
fragWizardParameters.setDisplayName(tr("Fragment Shader (OpenGL/ES 2.0)"));
|
wizard->setDisplayName(tr("Fragment Shader (OpenGL/ES 2.0)"));
|
||||||
fragWizardParameters.setId(QLatin1String("F.GLSL"));
|
wizard->setId(QLatin1String("F.GLSL"));
|
||||||
addAutoReleasedObject(new GLSLFileWizard(fragWizardParameters, GLSLFileWizard::FragmentShaderES, core));
|
addAutoReleasedObject(wizard);
|
||||||
|
|
||||||
BaseFileWizardParameters vertWizardParameters(IWizard::FileWizard);
|
wizard = new GLSLFileWizard(GLSLFileWizard::VertexShaderES);
|
||||||
vertWizardParameters.setCategory(QLatin1String(Constants::WIZARD_CATEGORY_GLSL));
|
wizard->setWizardKind(IWizard::FileWizard);
|
||||||
vertWizardParameters.setDisplayCategory(QCoreApplication::translate("GLSLEditor", Constants::WIZARD_TR_CATEGORY_GLSL));
|
wizard->setCategory(QLatin1String(Constants::WIZARD_CATEGORY_GLSL));
|
||||||
vertWizardParameters.setDescription
|
wizard->setDisplayCategory(QCoreApplication::translate("GLSLEditor", Constants::WIZARD_TR_CATEGORY_GLSL));
|
||||||
|
wizard->setDescription
|
||||||
(tr("Creates a vertex shader in the OpenGL/ES 2.0 Shading "
|
(tr("Creates a vertex shader in the OpenGL/ES 2.0 Shading "
|
||||||
"Language (GLSL/ES). Vertex shaders transform the "
|
"Language (GLSL/ES). Vertex shaders transform the "
|
||||||
"positions, normals and texture co-ordinates of "
|
"positions, normals and texture co-ordinates of "
|
||||||
"triangles, points and lines rendered with OpenGL."));
|
"triangles, points and lines rendered with OpenGL."));
|
||||||
vertWizardParameters.setDisplayName(tr("Vertex Shader (OpenGL/ES 2.0)"));
|
wizard->setDisplayName(tr("Vertex Shader (OpenGL/ES 2.0)"));
|
||||||
vertWizardParameters.setId(QLatin1String("G.GLSL"));
|
wizard->setId(QLatin1String("G.GLSL"));
|
||||||
addAutoReleasedObject(new GLSLFileWizard(vertWizardParameters, GLSLFileWizard::VertexShaderES, core));
|
addAutoReleasedObject(wizard);
|
||||||
|
|
||||||
fragWizardParameters.setDescription
|
wizard = new GLSLFileWizard(GLSLFileWizard::FragmentShaderDesktop);
|
||||||
|
wizard->setWizardKind(IWizard::FileWizard);
|
||||||
|
wizard->setCategory(QLatin1String(Constants::WIZARD_CATEGORY_GLSL));
|
||||||
|
wizard->setDisplayCategory(QCoreApplication::translate("GLSLEditor", Constants::WIZARD_TR_CATEGORY_GLSL));
|
||||||
|
wizard->setDescription
|
||||||
(tr("Creates a fragment shader in the Desktop OpenGL Shading "
|
(tr("Creates a fragment shader in the Desktop OpenGL Shading "
|
||||||
"Language (GLSL). Fragment shaders generate the final "
|
"Language (GLSL). Fragment shaders generate the final "
|
||||||
"pixel colors for triangles, points and lines rendered "
|
"pixel colors for triangles, points and lines rendered "
|
||||||
"with OpenGL."));
|
"with OpenGL."));
|
||||||
fragWizardParameters.setDisplayName(tr("Fragment Shader (Desktop OpenGL)"));
|
wizard->setDisplayName(tr("Fragment Shader (Desktop OpenGL)"));
|
||||||
fragWizardParameters.setId(QLatin1String("J.GLSL"));
|
wizard->setId(QLatin1String("J.GLSL"));
|
||||||
addAutoReleasedObject(new GLSLFileWizard(fragWizardParameters, GLSLFileWizard::FragmentShaderDesktop, core));
|
addAutoReleasedObject(wizard);
|
||||||
|
|
||||||
vertWizardParameters.setDescription
|
wizard = new GLSLFileWizard(GLSLFileWizard::VertexShaderDesktop);
|
||||||
|
wizard->setWizardKind(IWizard::FileWizard);
|
||||||
|
wizard->setCategory(QLatin1String(Constants::WIZARD_CATEGORY_GLSL));
|
||||||
|
wizard->setDisplayCategory(QCoreApplication::translate("GLSLEditor", Constants::WIZARD_TR_CATEGORY_GLSL));
|
||||||
|
wizard->setDescription
|
||||||
(tr("Creates a vertex shader in the Desktop OpenGL Shading "
|
(tr("Creates a vertex shader in the Desktop OpenGL Shading "
|
||||||
"Language (GLSL). Vertex shaders transform the "
|
"Language (GLSL). Vertex shaders transform the "
|
||||||
"positions, normals and texture co-ordinates of "
|
"positions, normals and texture co-ordinates of "
|
||||||
"triangles, points and lines rendered with OpenGL."));
|
"triangles, points and lines rendered with OpenGL."));
|
||||||
vertWizardParameters.setDisplayName(tr("Vertex Shader (Desktop OpenGL)"));
|
wizard->setDisplayName(tr("Vertex Shader (Desktop OpenGL)"));
|
||||||
vertWizardParameters.setId(QLatin1String("K.GLSL"));
|
wizard->setId(QLatin1String("K.GLSL"));
|
||||||
addAutoReleasedObject(new GLSLFileWizard(vertWizardParameters, GLSLFileWizard::VertexShaderDesktop, core));
|
addAutoReleasedObject(wizard);
|
||||||
|
|
||||||
addAutoReleasedObject(new GLSLHighlighterFactory);
|
addAutoReleasedObject(new GLSLHighlighterFactory);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -52,21 +52,10 @@ public:
|
|||||||
|
|
||||||
using namespace GLSLEditor;
|
using namespace GLSLEditor;
|
||||||
|
|
||||||
GLSLFileWizard::GLSLFileWizard(const BaseFileWizardParameters ¶meters,
|
GLSLFileWizard::GLSLFileWizard(ShaderType shaderType)
|
||||||
ShaderType shaderType, QObject *parent):
|
: m_shaderType(shaderType)
|
||||||
Core::BaseFileWizard(parameters, parent),
|
|
||||||
m_shaderType(shaderType)
|
|
||||||
{
|
{
|
||||||
}
|
setFlags(Core::IWizard::PlatformIndependent);
|
||||||
|
|
||||||
Core::FeatureSet GLSLFileWizard::requiredFeatures() const
|
|
||||||
{
|
|
||||||
return Core::FeatureSet();
|
|
||||||
}
|
|
||||||
|
|
||||||
Core::IWizard::WizardFlags GLSLFileWizard::flags() const
|
|
||||||
{
|
|
||||||
return Core::IWizard::PlatformIndependent;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::GeneratedFiles GLSLFileWizard::generateFiles(const QWizard *w,
|
Core::GeneratedFiles GLSLFileWizard::generateFiles(const QWizard *w,
|
||||||
|
|||||||
@@ -39,8 +39,6 @@ class GLSLFileWizard: public Core::BaseFileWizard
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef Core::BaseFileWizardParameters BaseFileWizardParameters;
|
|
||||||
|
|
||||||
enum ShaderType
|
enum ShaderType
|
||||||
{
|
{
|
||||||
VertexShaderES,
|
VertexShaderES,
|
||||||
@@ -49,22 +47,18 @@ public:
|
|||||||
FragmentShaderDesktop
|
FragmentShaderDesktop
|
||||||
};
|
};
|
||||||
|
|
||||||
explicit GLSLFileWizard(const BaseFileWizardParameters ¶meters,
|
explicit GLSLFileWizard(ShaderType shaderType);
|
||||||
ShaderType shaderType, QObject *parent = 0);
|
|
||||||
|
|
||||||
virtual Core::FeatureSet requiredFeatures() const;
|
private:
|
||||||
virtual WizardFlags flags() const;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
QString fileContents(const QString &baseName, ShaderType shaderType) const;
|
QString fileContents(const QString &baseName, ShaderType shaderType) const;
|
||||||
|
|
||||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
QWizard *createWizardDialog(QWidget *parent,
|
||||||
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
||||||
|
|
||||||
virtual Core::GeneratedFiles generateFiles(const QWizard *w,
|
Core::GeneratedFiles generateFiles(const QWizard *w,
|
||||||
QString *errorMessage) const;
|
QString *errorMessage) const;
|
||||||
|
|
||||||
virtual QString preferredSuffix(ShaderType shaderType) const;
|
QString preferredSuffix(ShaderType shaderType) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ShaderType m_shaderType;
|
ShaderType m_shaderType;
|
||||||
|
|||||||
@@ -40,27 +40,13 @@
|
|||||||
using namespace Mercurial::Internal;
|
using namespace Mercurial::Internal;
|
||||||
using namespace VcsBase;
|
using namespace VcsBase;
|
||||||
|
|
||||||
CloneWizard::CloneWizard(QObject *parent)
|
CloneWizard::CloneWizard()
|
||||||
: BaseCheckoutWizard(parent),
|
|
||||||
m_icon(QIcon(QLatin1String(":/mercurial/images/hg.png")))
|
|
||||||
{
|
{
|
||||||
setId(QLatin1String(Constants::VCS_ID_MERCURIAL));
|
setId(QLatin1String(Constants::VCS_ID_MERCURIAL));
|
||||||
setCustomLabels(tr("Cloning"), tr("Cloning started..."));
|
setCustomLabels(tr("Cloning"), tr("Cloning started..."));
|
||||||
}
|
setIcon(QIcon(QLatin1String(":/mercurial/images/hg.png")));
|
||||||
|
setDescription(tr("Clones a Mercurial repository and tries to load the contained project."));
|
||||||
QIcon CloneWizard::icon() const
|
setDisplayName(tr("Mercurial Clone"));
|
||||||
{
|
|
||||||
return m_icon;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString CloneWizard::description() const
|
|
||||||
{
|
|
||||||
return tr("Clones a Mercurial repository and tries to load the contained project.");
|
|
||||||
}
|
|
||||||
|
|
||||||
QString CloneWizard::displayName() const
|
|
||||||
{
|
|
||||||
return tr("Mercurial Clone");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QWizardPage *> CloneWizard::createParameterPages(const QString &path)
|
QList<QWizardPage *> CloneWizard::createParameterPages(const QString &path)
|
||||||
|
|||||||
@@ -40,12 +40,9 @@ namespace Internal {
|
|||||||
class CloneWizard : public VcsBase::BaseCheckoutWizard
|
class CloneWizard : public VcsBase::BaseCheckoutWizard
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
|
||||||
CloneWizard(QObject *parent = 0);
|
|
||||||
|
|
||||||
QIcon icon() const;
|
public:
|
||||||
QString description() const;
|
CloneWizard();
|
||||||
QString displayName() const;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QList<QWizardPage *> createParameterPages(const QString &path);
|
QList<QWizardPage *> createParameterPages(const QString &path);
|
||||||
|
|||||||
@@ -88,10 +88,8 @@ int CustomWizardPrivate::verbose = 0;
|
|||||||
of type "class" or "file". Serves as base class for project wizards.
|
of type "class" or "file". Serves as base class for project wizards.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
CustomWizard::CustomWizard(const Core::BaseFileWizardParameters& baseFileParameters,
|
CustomWizard::CustomWizard()
|
||||||
QObject *parent) :
|
: d(new CustomWizardPrivate)
|
||||||
Core::BaseFileWizard(baseFileParameters, parent),
|
|
||||||
d(new CustomWizardPrivate)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -249,11 +247,6 @@ Core::GeneratedFiles CustomWizard::generateFiles(const QWizard *dialog, QString
|
|||||||
return generateWizardFiles(errorMessage);
|
return generateWizardFiles(errorMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::FeatureSet CustomWizard::requiredFeatures() const
|
|
||||||
{
|
|
||||||
return baseFileWizardParameters().requiredFeatures();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CustomWizard::writeFiles(const Core::GeneratedFiles &files, QString *errorMessage)
|
bool CustomWizard::writeFiles(const Core::GeneratedFiles &files, QString *errorMessage)
|
||||||
{
|
{
|
||||||
if (!Core::BaseFileWizard::writeFiles(files, errorMessage))
|
if (!Core::BaseFileWizard::writeFiles(files, errorMessage))
|
||||||
@@ -346,30 +339,31 @@ void CustomWizard::registerFactory(const QString &name, const ICustomWizardFacto
|
|||||||
customWizardFactoryMap()->insert(name, f);
|
customWizardFactoryMap()->insert(name, f);
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomWizard *CustomWizard::createWizard(const CustomWizardParametersPtr &p, const Core::BaseFileWizardParameters &b)
|
CustomWizard *CustomWizard::createWizard(const CustomProjectWizard::CustomWizardParametersPtr &p, const Core::IWizard::Data &b)
|
||||||
{
|
{
|
||||||
CustomWizard * rc = 0;
|
CustomWizard * rc = 0;
|
||||||
if (p->klass.isEmpty()) {
|
if (p->klass.isEmpty()) {
|
||||||
// Use defaults for empty class names
|
// Use defaults for empty class names
|
||||||
switch (b.kind()) {
|
switch (b.kind) {
|
||||||
case Core::IWizard::ProjectWizard:
|
case Core::IWizard::ProjectWizard:
|
||||||
rc = new CustomProjectWizard(b);
|
rc = new CustomProjectWizard;
|
||||||
break;
|
break;
|
||||||
case Core::IWizard::FileWizard:
|
case Core::IWizard::FileWizard:
|
||||||
case Core::IWizard::ClassWizard:
|
case Core::IWizard::ClassWizard:
|
||||||
rc = new CustomWizard(b);
|
rc = new CustomWizard;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Look up class name in map
|
// Look up class name in map
|
||||||
const CustomWizardFactoryMap::const_iterator it = customWizardFactoryMap()->constFind(p->klass);
|
const CustomWizardFactoryMap::const_iterator it = customWizardFactoryMap()->constFind(p->klass);
|
||||||
if (it != customWizardFactoryMap()->constEnd())
|
if (it != customWizardFactoryMap()->constEnd())
|
||||||
rc = it.value()->create(b);
|
rc = it.value()->create();
|
||||||
}
|
}
|
||||||
if (!rc) {
|
if (!rc) {
|
||||||
qWarning("Unable to create custom wizard for class %s.", qPrintable(p->klass));
|
qWarning("Unable to create custom wizard for class %s.", qPrintable(p->klass));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
rc->setData(b);
|
||||||
rc->setParameters(p);
|
rc->setParameters(p);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@@ -457,20 +451,20 @@ QList<CustomWizard*> CustomWizard::createWizards()
|
|||||||
verboseLog += QString::fromLatin1("CustomWizard: Scanning %1\n").arg(dirFi.absoluteFilePath());
|
verboseLog += QString::fromLatin1("CustomWizard: Scanning %1\n").arg(dirFi.absoluteFilePath());
|
||||||
if (dir.exists(configFile)) {
|
if (dir.exists(configFile)) {
|
||||||
CustomWizardParametersPtr parameters(new Internal::CustomWizardParameters);
|
CustomWizardParametersPtr parameters(new Internal::CustomWizardParameters);
|
||||||
Core::BaseFileWizardParameters baseFileParameters;
|
IWizard::Data data;
|
||||||
switch (parameters->parse(dir.absoluteFilePath(configFile), &baseFileParameters, &errorMessage)) {
|
switch (parameters->parse(dir.absoluteFilePath(configFile), &data, &errorMessage)) {
|
||||||
case Internal::CustomWizardParameters::ParseOk:
|
case Internal::CustomWizardParameters::ParseOk:
|
||||||
parameters->directory = dir.absolutePath();
|
parameters->directory = dir.absolutePath();
|
||||||
if (CustomWizardPrivate::verbose)
|
if (CustomWizardPrivate::verbose)
|
||||||
QTextStream(&verboseLog)
|
QTextStream(&verboseLog)
|
||||||
<< "\n### Adding: " << baseFileParameters.id() << " / " << baseFileParameters.displayName() << '\n'
|
<< "\n### Adding: " << data.id << " / " << data.displayName << '\n'
|
||||||
<< baseFileParameters.category() << " / " <<baseFileParameters.displayCategory() << '\n'
|
<< data.category << " / " << data.displayCategory << '\n'
|
||||||
<< " (" << baseFileParameters.description() << ")\n"
|
<< " (" << data.description << ")\n"
|
||||||
<< parameters->toString();
|
<< parameters->toString();
|
||||||
if (CustomWizard *w = createWizard(parameters, baseFileParameters))
|
if (CustomWizard *w = createWizard(parameters, data))
|
||||||
rc.push_back(w);
|
rc.push_back(w);
|
||||||
else
|
else
|
||||||
qWarning("Custom wizard factory function failed for %s", qPrintable(baseFileParameters.id()));
|
qWarning("Custom wizard factory function failed for %s", qPrintable(data.id));
|
||||||
break;
|
break;
|
||||||
case Internal::CustomWizardParameters::ParseDisabled:
|
case Internal::CustomWizardParameters::ParseDisabled:
|
||||||
if (CustomWizardPrivate::verbose)
|
if (CustomWizardPrivate::verbose)
|
||||||
@@ -512,9 +506,7 @@ QList<CustomWizard*> CustomWizard::createWizards()
|
|||||||
for QLineEdit-type fields' default text.
|
for QLineEdit-type fields' default text.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
CustomProjectWizard::CustomProjectWizard(const Core::BaseFileWizardParameters& baseFileParameters,
|
CustomProjectWizard::CustomProjectWizard()
|
||||||
QObject *parent) :
|
|
||||||
CustomWizard(baseFileParameters, parent)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -57,30 +57,29 @@ namespace Internal {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Documentation inside.
|
// Documentation inside.
|
||||||
class ICustomWizardFactory {
|
class ICustomWizardFactory
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
virtual CustomWizard *create(const Core::BaseFileWizardParameters& baseFileParameters,
|
virtual CustomWizard *create(QObject *parent = 0) const = 0;
|
||||||
QObject *parent = 0) const = 0;
|
|
||||||
virtual ~ICustomWizardFactory() {}
|
virtual ~ICustomWizardFactory() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Convenience template to create wizard factory classes.
|
// Convenience template to create wizard factory classes.
|
||||||
template <class Wizard> class CustomWizardFactory : public ICustomWizardFactory {
|
template <class Wizard> class CustomWizardFactory : public ICustomWizardFactory
|
||||||
virtual CustomWizard *create(const Core::BaseFileWizardParameters& baseFileParameters,
|
{
|
||||||
QObject *parent = 0) const
|
CustomWizard *create(QObject * = 0) const { return new Wizard; }
|
||||||
{ return new Wizard(baseFileParameters, parent); }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Documentation inside.
|
// Documentation inside.
|
||||||
class PROJECTEXPLORER_EXPORT CustomWizard : public Core::BaseFileWizard
|
class PROJECTEXPLORER_EXPORT CustomWizard : public Core::BaseFileWizard
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef QMap<QString, QString> FieldReplacementMap;
|
typedef QMap<QString, QString> FieldReplacementMap;
|
||||||
typedef QSharedPointer<ICustomWizardFactory> ICustomWizardFactoryPtr;
|
typedef QSharedPointer<ICustomWizardFactory> ICustomWizardFactoryPtr;
|
||||||
|
|
||||||
explicit CustomWizard(const Core::BaseFileWizardParameters& baseFileParameters,
|
CustomWizard();
|
||||||
QObject *parent = 0);
|
|
||||||
virtual ~CustomWizard();
|
virtual ~CustomWizard();
|
||||||
|
|
||||||
// Can be reimplemented to create custom wizards. initWizardDialog() needs to be
|
// Can be reimplemented to create custom wizards. initWizardDialog() needs to be
|
||||||
@@ -90,9 +89,6 @@ public:
|
|||||||
|
|
||||||
virtual Core::GeneratedFiles generateFiles(const QWizard *w, QString *errorMessage) const;
|
virtual Core::GeneratedFiles generateFiles(const QWizard *w, QString *errorMessage) const;
|
||||||
|
|
||||||
virtual Core::FeatureSet requiredFeatures() const;
|
|
||||||
|
|
||||||
|
|
||||||
// Register a factory for a derived custom widget
|
// Register a factory for a derived custom widget
|
||||||
static void registerFactory(const QString &name, const ICustomWizardFactoryPtr &f);
|
static void registerFactory(const QString &name, const ICustomWizardFactoryPtr &f);
|
||||||
template <class Wizard> static void registerFactory(const QString &name)
|
template <class Wizard> static void registerFactory(const QString &name)
|
||||||
@@ -121,11 +117,12 @@ protected:
|
|||||||
CustomWizardParametersPtr parameters() const;
|
CustomWizardParametersPtr parameters() const;
|
||||||
CustomWizardContextPtr context() const;
|
CustomWizardContextPtr context() const;
|
||||||
|
|
||||||
|
static CustomWizard *createWizard(const CustomWizardParametersPtr &p, const Core::IWizard::Data &b);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setParameters(const CustomWizardParametersPtr &p);
|
void setParameters(const CustomWizardParametersPtr &p);
|
||||||
|
|
||||||
static CustomWizard *createWizard(const CustomWizardParametersPtr &p,
|
static CustomWizard *createWizard(const CustomWizardParametersPtr &p);
|
||||||
const Core::BaseFileWizardParameters &b);
|
|
||||||
CustomWizardPrivate *d;
|
CustomWizardPrivate *d;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -133,17 +130,18 @@ private:
|
|||||||
class PROJECTEXPLORER_EXPORT CustomProjectWizard : public CustomWizard
|
class PROJECTEXPLORER_EXPORT CustomProjectWizard : public CustomWizard
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit CustomProjectWizard(const Core::BaseFileWizardParameters& baseFileParameters,
|
CustomProjectWizard();
|
||||||
QObject *parent = 0);
|
|
||||||
|
|
||||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
|
||||||
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
|
||||||
|
|
||||||
virtual Core::GeneratedFiles generateFiles(const QWizard *w, QString *errorMessage) const;
|
|
||||||
|
|
||||||
static bool postGenerateOpen(const Core::GeneratedFiles &l, QString *errorMessage = 0);
|
static bool postGenerateOpen(const Core::GeneratedFiles &l, QString *errorMessage = 0);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
QWizard *createWizardDialog(QWidget *parent,
|
||||||
|
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
||||||
|
|
||||||
|
Core::GeneratedFiles generateFiles(const QWizard *w, QString *errorMessage) const;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void projectLocationChanged(const QString &path);
|
void projectLocationChanged(const QString &path);
|
||||||
|
|
||||||
|
|||||||
@@ -267,36 +267,12 @@ static inline bool assignLanguageElementText(QXmlStreamReader &reader,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Copy&paste from above to call a setter of BaseFileParameters.
|
|
||||||
// Implementation of a sophisticated mem_fun pattern is left
|
|
||||||
// as an exercise to the reader.
|
|
||||||
static inline bool assignLanguageElementText(QXmlStreamReader &reader,
|
|
||||||
const QString &desiredLanguage,
|
|
||||||
BaseFileWizardParameters *bp,
|
|
||||||
void (BaseFileWizardParameters::*setter)(const QString &))
|
|
||||||
{
|
|
||||||
const QStringRef elementLanguage = reader.attributes().value(QLatin1String(langAttributeC));
|
|
||||||
if (elementLanguage.isEmpty()) {
|
|
||||||
// Try to find a translation for our built-in Wizards
|
|
||||||
const QString translated = QCoreApplication::translate("ProjectExplorer::CustomWizard", reader.readElementText().toLatin1().constData());
|
|
||||||
(bp->*setter)(translated);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (elementLanguage == desiredLanguage) {
|
|
||||||
(bp->*setter)(reader.readElementText());
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
// Language mismatch: forward to end element.
|
|
||||||
skipOverElementText(reader);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Read level sub-elements of "wizard"
|
// Read level sub-elements of "wizard"
|
||||||
static bool parseCustomProjectElement(QXmlStreamReader &reader,
|
static bool parseCustomProjectElement(QXmlStreamReader &reader,
|
||||||
const QString &configFileFullPath,
|
const QString &configFileFullPath,
|
||||||
const QString &language,
|
const QString &language,
|
||||||
CustomWizardParameters *p,
|
CustomWizardParameters *p,
|
||||||
BaseFileWizardParameters *bp)
|
IWizard::Data *bp)
|
||||||
{
|
{
|
||||||
const QStringRef elementName = reader.name();
|
const QStringRef elementName = reader.name();
|
||||||
if (elementName == QLatin1String(iconElementC)) {
|
if (elementName == QLatin1String(iconElementC)) {
|
||||||
@@ -306,23 +282,20 @@ static bool parseCustomProjectElement(QXmlStreamReader &reader,
|
|||||||
qWarning("Invalid icon path '%s' encountered in custom project template %s.",
|
qWarning("Invalid icon path '%s' encountered in custom project template %s.",
|
||||||
qPrintable(path), qPrintable(configFileFullPath));
|
qPrintable(path), qPrintable(configFileFullPath));
|
||||||
} else {
|
} else {
|
||||||
bp->setIcon(icon);
|
bp->icon = icon;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (elementName == QLatin1String(descriptionElementC)) {
|
if (elementName == QLatin1String(descriptionElementC)) {
|
||||||
assignLanguageElementText(reader, language, bp,
|
assignLanguageElementText(reader, language, &bp->description);
|
||||||
&BaseFileWizardParameters::setDescription);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (elementName == QLatin1String(displayNameElementC)) {
|
if (elementName == QLatin1String(displayNameElementC)) {
|
||||||
assignLanguageElementText(reader, language, bp,
|
assignLanguageElementText(reader, language, &bp->displayName);
|
||||||
&BaseFileWizardParameters::setDisplayName);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (elementName == QLatin1String(displayCategoryElementC)) {
|
if (elementName == QLatin1String(displayCategoryElementC)) {
|
||||||
assignLanguageElementText(reader, language, bp,
|
assignLanguageElementText(reader, language, &bp->displayCategory);
|
||||||
&BaseFileWizardParameters::setDisplayCategory);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (elementName == QLatin1String(fieldPageTitleElementC)) {
|
if (elementName == QLatin1String(fieldPageTitleElementC)) {
|
||||||
@@ -579,7 +552,7 @@ GeneratorScriptArgument::GeneratorScriptArgument(const QString &v) :
|
|||||||
CustomWizardParameters::ParseResult
|
CustomWizardParameters::ParseResult
|
||||||
CustomWizardParameters::parse(QIODevice &device,
|
CustomWizardParameters::parse(QIODevice &device,
|
||||||
const QString &configFileFullPath,
|
const QString &configFileFullPath,
|
||||||
BaseFileWizardParameters *bp,
|
IWizard::Data *bp,
|
||||||
QString *errorMessage)
|
QString *errorMessage)
|
||||||
{
|
{
|
||||||
int comboEntryCount = 0;
|
int comboEntryCount = 0;
|
||||||
@@ -587,8 +560,8 @@ CustomWizardParameters::ParseResult
|
|||||||
QXmlStreamReader::TokenType token = QXmlStreamReader::EndDocument;
|
QXmlStreamReader::TokenType token = QXmlStreamReader::EndDocument;
|
||||||
ParseState state = ParseBeginning;
|
ParseState state = ParseBeginning;
|
||||||
clear();
|
clear();
|
||||||
bp->clear();
|
*bp = IWizard::Data();
|
||||||
bp->setKind(IWizard::ProjectWizard);
|
bp->kind = IWizard::ProjectWizard;
|
||||||
const QString language = languageSetting();
|
const QString language = languageSetting();
|
||||||
CustomWizardField field;
|
CustomWizardField field;
|
||||||
do {
|
do {
|
||||||
@@ -613,11 +586,11 @@ CustomWizardParameters::ParseResult
|
|||||||
case ParseWithinWizard:
|
case ParseWithinWizard:
|
||||||
if (!booleanAttributeValue(reader, wizardEnabledAttributeC, true))
|
if (!booleanAttributeValue(reader, wizardEnabledAttributeC, true))
|
||||||
return ParseDisabled;
|
return ParseDisabled;
|
||||||
bp->setId(attributeValue(reader, idAttributeC));
|
bp->id = attributeValue(reader, idAttributeC);
|
||||||
bp->setCategory(attributeValue(reader, categoryAttributeC));
|
bp->category = attributeValue(reader, categoryAttributeC);
|
||||||
bp->setKind(kindAttribute(reader));
|
bp->kind = kindAttribute(reader);
|
||||||
bp->setRequiredFeatures(requiredFeatures(reader));
|
bp->requiredFeatures = requiredFeatures(reader);
|
||||||
bp->setFlags(wizardFlags(reader));
|
bp->flags = wizardFlags(reader);
|
||||||
klass = attributeValue(reader, klassAttributeC);
|
klass = attributeValue(reader, klassAttributeC);
|
||||||
firstPageId = integerAttributeValue(reader, firstPageAttributeC, -1);
|
firstPageId = integerAttributeValue(reader, firstPageAttributeC, -1);
|
||||||
break;
|
break;
|
||||||
@@ -731,7 +704,7 @@ CustomWizardParameters::ParseResult
|
|||||||
|
|
||||||
CustomWizardParameters::ParseResult
|
CustomWizardParameters::ParseResult
|
||||||
CustomWizardParameters::parse(const QString &configFileFullPath,
|
CustomWizardParameters::parse(const QString &configFileFullPath,
|
||||||
BaseFileWizardParameters *bp,
|
IWizard::Data *bp,
|
||||||
QString *errorMessage)
|
QString *errorMessage)
|
||||||
{
|
{
|
||||||
QFile configFile(configFileFullPath);
|
QFile configFile(configFileFullPath);
|
||||||
|
|||||||
@@ -106,9 +106,9 @@ public:
|
|||||||
CustomWizardParameters();
|
CustomWizardParameters();
|
||||||
void clear();
|
void clear();
|
||||||
ParseResult parse(QIODevice &device, const QString &configFileFullPath,
|
ParseResult parse(QIODevice &device, const QString &configFileFullPath,
|
||||||
Core::BaseFileWizardParameters *bp, QString *errorMessage);
|
Core::IWizard::Data *bp, QString *errorMessage);
|
||||||
ParseResult parse(const QString &configFileFullPath,
|
ParseResult parse(const QString &configFileFullPath,
|
||||||
Core::BaseFileWizardParameters *bp, QString *errorMessage);
|
Core::IWizard::Data *bp, QString *errorMessage);
|
||||||
QString toString() const;
|
QString toString() const;
|
||||||
|
|
||||||
QString directory;
|
QString directory;
|
||||||
|
|||||||
@@ -236,8 +236,8 @@ bool PythonEditorPlugin::initialize(const QStringList &arguments, QString *error
|
|||||||
Core::FileIconProvider::registerIconOverlayForMimeType(icon, C_PY_MIMETYPE);
|
Core::FileIconProvider::registerIconOverlayForMimeType(icon, C_PY_MIMETYPE);
|
||||||
|
|
||||||
// Add Python files and classes creation dialogs
|
// Add Python files and classes creation dialogs
|
||||||
addAutoReleasedObject(new FileWizard(Core::ICore::instance()));
|
addAutoReleasedObject(new FileWizard);
|
||||||
addAutoReleasedObject(new ClassWizard(Core::ICore::instance()));
|
addAutoReleasedObject(new ClassWizard);
|
||||||
addAutoReleasedObject(new Internal::PythonHighlighterFactory);
|
addAutoReleasedObject(new Internal::PythonHighlighterFactory);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -45,22 +45,14 @@ using namespace ProjectExplorer;
|
|||||||
namespace PythonEditor {
|
namespace PythonEditor {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
static Core::BaseFileWizardParameters getDefaultParams()
|
ClassWizard::ClassWizard()
|
||||||
{
|
|
||||||
Core::BaseFileWizardParameters p(Core::IWizard::FileWizard);
|
|
||||||
|
|
||||||
p.setId(QLatin1String(Constants::C_PY_CLASS_WIZARD_ID));
|
|
||||||
p.setCategory(QLatin1String(Constants::C_PY_WIZARD_CATEGORY));
|
|
||||||
p.setDisplayCategory(QLatin1String(Constants::C_PY_DISPLAY_CATEGORY));
|
|
||||||
p.setDisplayName(ClassWizard::tr(Constants::EN_PY_CLASS_DISPLAY_NAME));
|
|
||||||
p.setDescription(ClassWizard::tr(Constants::EN_PY_CLASS_DESCRIPTION));
|
|
||||||
|
|
||||||
return p;
|
|
||||||
}
|
|
||||||
|
|
||||||
ClassWizard::ClassWizard(QObject *parent) :
|
|
||||||
Core::BaseFileWizard(getDefaultParams(), parent)
|
|
||||||
{
|
{
|
||||||
|
setWizardKind(Core::IWizard::FileWizard);
|
||||||
|
setId(QLatin1String(Constants::C_PY_CLASS_WIZARD_ID));
|
||||||
|
setCategory(QLatin1String(Constants::C_PY_WIZARD_CATEGORY));
|
||||||
|
setDisplayCategory(QLatin1String(Constants::C_PY_DISPLAY_CATEGORY));
|
||||||
|
setDisplayName(ClassWizard::tr(Constants::EN_PY_CLASS_DISPLAY_NAME));
|
||||||
|
setDescription(ClassWizard::tr(Constants::EN_PY_CLASS_DESCRIPTION));
|
||||||
}
|
}
|
||||||
|
|
||||||
QWizard *ClassWizard::createWizardDialog(
|
QWizard *ClassWizard::createWizardDialog(
|
||||||
|
|||||||
@@ -46,9 +46,9 @@ class ClassWizard : public Core::BaseFileWizard
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ClassWizard(QObject *parent = 0);
|
ClassWizard();
|
||||||
|
|
||||||
protected:
|
private:
|
||||||
QWizard *createWizardDialog(QWidget *parent,
|
QWizard *createWizardDialog(QWidget *parent,
|
||||||
const Core::WizardDialogParameters ¶ms) const;
|
const Core::WizardDialogParameters ¶ms) const;
|
||||||
|
|
||||||
|
|||||||
@@ -41,32 +41,18 @@
|
|||||||
|
|
||||||
namespace PythonEditor {
|
namespace PythonEditor {
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief GetDefaultParams
|
|
||||||
* @return Default parameters for menu item "Files&Classes->Python->Python file"
|
|
||||||
*/
|
|
||||||
static const Core::BaseFileWizardParameters GetDefaultParams()
|
|
||||||
{
|
|
||||||
Core::BaseFileWizardParameters p(Core::IWizard::FileWizard);
|
|
||||||
|
|
||||||
p.setId(QLatin1String(Constants::C_PY_SOURCE_WIZARD_ID));
|
|
||||||
p.setCategory(QLatin1String(Constants::C_PY_WIZARD_CATEGORY));
|
|
||||||
p.setDisplayCategory(QLatin1String(Constants::C_PY_DISPLAY_CATEGORY));
|
|
||||||
p.setDisplayName(
|
|
||||||
FileWizard::tr(Constants::EN_PY_SOURCE_DISPLAY_NAME));
|
|
||||||
p.setDescription(
|
|
||||||
FileWizard::tr(Constants::EN_PY_SOURCE_DESCRIPTION));
|
|
||||||
|
|
||||||
return p;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initialize wizard and add new option to "New..." dialog.
|
* @brief Initialize wizard and add new option to "New..." dialog.
|
||||||
* @param parent
|
* @param parent
|
||||||
*/
|
*/
|
||||||
FileWizard::FileWizard(QObject *parent)
|
FileWizard::FileWizard()
|
||||||
:Core::BaseFileWizard(GetDefaultParams(), parent)
|
|
||||||
{
|
{
|
||||||
|
setWizardKind(Core::IWizard::FileWizard);
|
||||||
|
setId(QLatin1String(Constants::C_PY_SOURCE_WIZARD_ID));
|
||||||
|
setCategory(QLatin1String(Constants::C_PY_WIZARD_CATEGORY));
|
||||||
|
setDisplayCategory(QLatin1String(Constants::C_PY_DISPLAY_CATEGORY));
|
||||||
|
setDisplayName(FileWizard::tr(Constants::EN_PY_SOURCE_DISPLAY_NAME));
|
||||||
|
setDescription(FileWizard::tr(Constants::EN_PY_SOURCE_DESCRIPTION));
|
||||||
}
|
}
|
||||||
|
|
||||||
FileWizard::~FileWizard()
|
FileWizard::~FileWizard()
|
||||||
|
|||||||
@@ -39,16 +39,14 @@ class FileWizard : public Core::BaseFileWizard
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit FileWizard(QObject *parent = 0);
|
FileWizard();
|
||||||
virtual ~FileWizard();
|
~FileWizard();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual QWizard *createWizardDialog(
|
QWizard *createWizardDialog(QWidget *parent,
|
||||||
QWidget *parent,
|
|
||||||
const Core::WizardDialogParameters ¶ms) const;
|
const Core::WizardDialogParameters ¶ms) const;
|
||||||
|
|
||||||
virtual Core::GeneratedFiles generateFiles(
|
Core::GeneratedFiles generateFiles( const QWizard *dialog,
|
||||||
const QWizard *dialog,
|
|
||||||
QString *errorMessage) const;
|
QString *errorMessage) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -88,17 +88,10 @@ public:
|
|||||||
|
|
||||||
using namespace QmlJSEditor;
|
using namespace QmlJSEditor;
|
||||||
|
|
||||||
JsFileWizard::JsFileWizard(const BaseFileWizardParameters ¶meters,
|
JsFileWizard::JsFileWizard()
|
||||||
QObject *parent):
|
|
||||||
Core::BaseFileWizard(parameters, parent)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::FeatureSet JsFileWizard::requiredFeatures() const
|
|
||||||
{
|
|
||||||
return Core::FeatureSet();
|
|
||||||
}
|
|
||||||
|
|
||||||
Core::GeneratedFiles JsFileWizard::generateFiles(const QWizard *w,
|
Core::GeneratedFiles JsFileWizard::generateFiles(const QWizard *w,
|
||||||
QString * /*errorMessage*/) const
|
QString * /*errorMessage*/) const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -39,21 +39,15 @@ class JsFileWizard: public Core::BaseFileWizard
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef Core::BaseFileWizardParameters BaseFileWizardParameters;
|
JsFileWizard();
|
||||||
|
|
||||||
explicit JsFileWizard(const BaseFileWizardParameters ¶meters,
|
private:
|
||||||
QObject *parent = 0);
|
|
||||||
|
|
||||||
virtual Core::FeatureSet requiredFeatures() const;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
QString fileContents(const QString &baseName, bool statelessLibrary) const;
|
QString fileContents(const QString &baseName, bool statelessLibrary) const;
|
||||||
|
|
||||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
QWizard *createWizardDialog(QWidget *parent,
|
||||||
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
||||||
|
|
||||||
virtual Core::GeneratedFiles generateFiles(const QWizard *w,
|
Core::GeneratedFiles generateFiles(const QWizard *w, QString *errorMessage) const;
|
||||||
QString *errorMessage) const;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace QmlJSEditor
|
} // namespace QmlJSEditor
|
||||||
|
|||||||
@@ -37,9 +37,7 @@
|
|||||||
|
|
||||||
using namespace QmlJSEditor;
|
using namespace QmlJSEditor;
|
||||||
|
|
||||||
QmlFileWizard::QmlFileWizard(const BaseFileWizardParameters ¶meters,
|
QmlFileWizard::QmlFileWizard()
|
||||||
QObject *parent):
|
|
||||||
Core::StandardFileWizard(parameters, parent)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,7 +60,7 @@ QString QmlFileWizard::fileContents(const QString &) const
|
|||||||
QString contents;
|
QString contents;
|
||||||
QTextStream str(&contents);
|
QTextStream str(&contents);
|
||||||
|
|
||||||
if (baseFileWizardParameters().id() == QLatin1String(Constants::WIZARD_QML1FILE))
|
if (id() == QLatin1String(Constants::WIZARD_QML1FILE))
|
||||||
str << QLatin1String("import QtQuick 1.1\n");
|
str << QLatin1String("import QtQuick 1.1\n");
|
||||||
else
|
else
|
||||||
str << QLatin1String("import QtQuick 2.0\n");
|
str << QLatin1String("import QtQuick 2.0\n");
|
||||||
|
|||||||
@@ -39,15 +39,11 @@ class QmlFileWizard: public Core::StandardFileWizard
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef Core::BaseFileWizardParameters BaseFileWizardParameters;
|
QmlFileWizard();
|
||||||
|
|
||||||
explicit QmlFileWizard(const BaseFileWizardParameters ¶meters,
|
private:
|
||||||
QObject *parent = 0);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
QString fileContents(const QString &baseName) const;
|
QString fileContents(const QString &baseName) const;
|
||||||
|
|
||||||
protected:
|
|
||||||
Core::GeneratedFiles generateFilesFromPath(const QString &path,
|
Core::GeneratedFiles generateFilesFromPath(const QString &path,
|
||||||
const QString &fileName,
|
const QString &fileName,
|
||||||
QString *errorMessage) const;
|
QString *errorMessage) const;
|
||||||
|
|||||||
@@ -52,8 +52,8 @@
|
|||||||
|
|
||||||
#include <qmldesigner/qmldesignerconstants.h>
|
#include <qmldesigner/qmldesignerconstants.h>
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
|
||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/id.h>
|
#include <coreplugin/id.h>
|
||||||
#include <coreplugin/fileiconprovider.h>
|
#include <coreplugin/fileiconprovider.h>
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
@@ -79,6 +79,7 @@
|
|||||||
|
|
||||||
using namespace QmlJSEditor::Constants;
|
using namespace QmlJSEditor::Constants;
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
|
using namespace Core;
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
QUICKFIX_INTERVAL = 20
|
QUICKFIX_INTERVAL = 20
|
||||||
@@ -137,30 +138,32 @@ bool QmlJSEditorPlugin::initialize(const QStringList & /*arguments*/, QString *e
|
|||||||
m_editor = new QmlJSEditorFactory(this);
|
m_editor = new QmlJSEditorFactory(this);
|
||||||
addObject(m_editor);
|
addObject(m_editor);
|
||||||
|
|
||||||
QObject *core = Core::ICore::instance();
|
IWizard *wizard = new QmlFileWizard;
|
||||||
Core::BaseFileWizardParameters qml1WizardParameters(Core::IWizard::FileWizard);
|
wizard->setWizardKind(Core::IWizard::FileWizard);
|
||||||
qml1WizardParameters.setCategory(QLatin1String(Core::Constants::WIZARD_CATEGORY_QT));
|
wizard->setCategory(QLatin1String(Core::Constants::WIZARD_CATEGORY_QT));
|
||||||
qml1WizardParameters.setDisplayCategory(QCoreApplication::translate("QmlJsEditor", Core::Constants::WIZARD_TR_CATEGORY_QT));
|
wizard->setDisplayCategory(QCoreApplication::translate("QmlJsEditor", Core::Constants::WIZARD_TR_CATEGORY_QT));
|
||||||
qml1WizardParameters.setDescription(tr("Creates a QML file with boilerplate code, starting with \"import QtQuick 1.1\"."));
|
wizard->setDescription(tr("Creates a QML file with boilerplate code, starting with \"import QtQuick 1.1\"."));
|
||||||
qml1WizardParameters.setDisplayName(tr("QML File (Qt Quick 1)"));
|
wizard->setDisplayName(tr("QML File (Qt Quick 1)"));
|
||||||
qml1WizardParameters.setId(QLatin1String(Constants::WIZARD_QML1FILE));
|
wizard->setId(QLatin1String(Constants::WIZARD_QML1FILE));
|
||||||
addAutoReleasedObject(new QmlFileWizard(qml1WizardParameters, core));
|
addAutoReleasedObject(wizard);
|
||||||
|
|
||||||
Core::BaseFileWizardParameters qml2WizardParameters(Core::IWizard::FileWizard);
|
wizard = new QmlFileWizard;
|
||||||
qml2WizardParameters.setCategory(QLatin1String(Core::Constants::WIZARD_CATEGORY_QT));
|
wizard->setWizardKind(Core::IWizard::FileWizard);
|
||||||
qml2WizardParameters.setDisplayCategory(QCoreApplication::translate("QmlJsEditor", Core::Constants::WIZARD_TR_CATEGORY_QT));
|
wizard->setCategory(QLatin1String(Core::Constants::WIZARD_CATEGORY_QT));
|
||||||
qml2WizardParameters.setDescription(tr("Creates a QML file with boilerplate code, starting with \"import QtQuick 2.0\"."));
|
wizard->setDisplayCategory(QCoreApplication::translate("QmlJsEditor", Core::Constants::WIZARD_TR_CATEGORY_QT));
|
||||||
qml2WizardParameters.setDisplayName(tr("QML File (Qt Quick 2)"));
|
wizard->setDescription(tr("Creates a QML file with boilerplate code, starting with \"import QtQuick 2.0\"."));
|
||||||
qml2WizardParameters.setId(QLatin1String(Constants::WIZARD_QML2FILE));
|
wizard->setDisplayName(tr("QML File (Qt Quick 2)"));
|
||||||
addAutoReleasedObject(new QmlFileWizard(qml2WizardParameters, core));
|
wizard->setId(QLatin1String(Constants::WIZARD_QML2FILE));
|
||||||
|
addAutoReleasedObject(wizard);
|
||||||
|
|
||||||
Core::BaseFileWizardParameters jsWizardParameters(Core::IWizard::FileWizard);
|
wizard = new JsFileWizard;
|
||||||
jsWizardParameters.setCategory(QLatin1String(Core::Constants::WIZARD_CATEGORY_QT));
|
wizard->setWizardKind(Core::IWizard::FileWizard);
|
||||||
jsWizardParameters.setDisplayCategory(QCoreApplication::translate("QmlJsEditor", Core::Constants::WIZARD_TR_CATEGORY_QT));
|
wizard->setCategory(QLatin1String(Core::Constants::WIZARD_CATEGORY_QT));
|
||||||
jsWizardParameters.setDescription(tr("Creates a JavaScript file."));
|
wizard->setDisplayCategory(QCoreApplication::translate("QmlJsEditor", Core::Constants::WIZARD_TR_CATEGORY_QT));
|
||||||
jsWizardParameters.setDisplayName(tr("JS File"));
|
wizard->setDescription(tr("Creates a JavaScript file."));
|
||||||
jsWizardParameters.setId(QLatin1String("Z.Js"));
|
wizard->setDisplayName(tr("JS File"));
|
||||||
addAutoReleasedObject(new JsFileWizard(jsWizardParameters, core));
|
wizard->setId(QLatin1String("Z.Js"));
|
||||||
|
addAutoReleasedObject(wizard);
|
||||||
|
|
||||||
m_actionHandler = new TextEditor::TextEditorActionHandler(Constants::C_QMLJSEDITOR_ID,
|
m_actionHandler = new TextEditor::TextEditorActionHandler(Constants::C_QMLJSEDITOR_ID,
|
||||||
TextEditor::TextEditorActionHandler::Format
|
TextEditor::TextEditorActionHandler::Format
|
||||||
|
|||||||
@@ -65,29 +65,36 @@ QmlApp *QmlApplicationWizardDialog::qmlApp() const
|
|||||||
return m_qmlApp;
|
return m_qmlApp;
|
||||||
}
|
}
|
||||||
|
|
||||||
QmlApplicationWizard::QmlApplicationWizard(const BaseFileWizardParameters ¶meters,
|
QmlApplicationWizard::QmlApplicationWizard(const TemplateInfo &templateInfo)
|
||||||
const TemplateInfo &templateInfo, QObject *parent)
|
: m_qmlApp(new QmlApp(this))
|
||||||
: BaseFileWizard(parameters, parent),
|
|
||||||
m_qmlApp(new QmlApp(this))
|
|
||||||
{
|
{
|
||||||
|
setWizardKind(ProjectWizard);
|
||||||
|
setCategory(QLatin1String(ProjectExplorer::Constants::QT_APPLICATION_WIZARD_CATEGORY));
|
||||||
|
setId(QLatin1String("QA.QMLB Application"));
|
||||||
|
setIcon(QIcon(QLatin1String(Qt4ProjectManager::Constants::ICON_QTQUICK_APP)));
|
||||||
|
setDisplayCategory(
|
||||||
|
QLatin1String(ProjectExplorer::Constants::QT_APPLICATION_WIZARD_CATEGORY_DISPLAY));
|
||||||
|
setDisplayName(tr("Qt Quick Application"));
|
||||||
|
setDescription(tr("Creates a Qt Quick application project."));
|
||||||
|
|
||||||
m_qmlApp->setTemplateInfo(templateInfo);
|
m_qmlApp->setTemplateInfo(templateInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlApplicationWizard::createInstances(ExtensionSystem::IPlugin *plugin)
|
void QmlApplicationWizard::createInstances(ExtensionSystem::IPlugin *plugin)
|
||||||
{
|
{
|
||||||
foreach (const TemplateInfo &templateInfo, QmlApp::templateInfos()) {
|
foreach (const TemplateInfo &templateInfo, QmlApp::templateInfos()) {
|
||||||
BaseFileWizardParameters parameters;
|
QmlApplicationWizard *wizard = new QmlApplicationWizard(templateInfo);
|
||||||
parameters.setDisplayName(templateInfo.displayName);
|
wizard->setDisplayName(templateInfo.displayName);
|
||||||
parameters.setDescription(templateInfo.description);
|
wizard->setDescription(templateInfo.description);
|
||||||
const QString imagePath = templateInfo.templatePath + QLatin1String("/template.png");
|
const QString imagePath = templateInfo.templatePath + QLatin1String("/template.png");
|
||||||
if (QFileInfo(imagePath).exists())
|
if (QFileInfo(imagePath).exists())
|
||||||
parameters.setDescriptionImage(imagePath);
|
wizard->setDescriptionImage(imagePath);
|
||||||
parameters.setCategory(
|
wizard->setCategory(
|
||||||
QLatin1String(ProjectExplorer::Constants::QT_APPLICATION_WIZARD_CATEGORY));
|
QLatin1String(ProjectExplorer::Constants::QT_APPLICATION_WIZARD_CATEGORY));
|
||||||
parameters.setDisplayCategory(
|
wizard->setDisplayCategory(
|
||||||
QLatin1String(ProjectExplorer::Constants::QT_APPLICATION_WIZARD_CATEGORY_DISPLAY));
|
QLatin1String(ProjectExplorer::Constants::QT_APPLICATION_WIZARD_CATEGORY_DISPLAY));
|
||||||
parameters.setKind(IWizard::ProjectWizard);
|
wizard->setWizardKind(IWizard::ProjectWizard);
|
||||||
parameters.setId(templateInfo.wizardId);
|
wizard->setId(templateInfo.wizardId);
|
||||||
|
|
||||||
QStringList stringList =
|
QStringList stringList =
|
||||||
templateInfo.featuresRequired.split(QLatin1Char(','), QString::SkipEmptyParts);
|
templateInfo.featuresRequired.split(QLatin1Char(','), QString::SkipEmptyParts);
|
||||||
@@ -97,26 +104,12 @@ void QmlApplicationWizard::createInstances(ExtensionSystem::IPlugin *plugin)
|
|||||||
features |= feature;
|
features |= feature;
|
||||||
}
|
}
|
||||||
|
|
||||||
parameters.setRequiredFeatures(features);
|
wizard->setRequiredFeatures(features);
|
||||||
parameters.setIcon(QIcon(QLatin1String(Qt4ProjectManager::Constants::ICON_QTQUICK_APP)));
|
wizard->setIcon(QIcon(QLatin1String(Qt4ProjectManager::Constants::ICON_QTQUICK_APP)));
|
||||||
QmlApplicationWizard *wizard = new QmlApplicationWizard(parameters, templateInfo);
|
|
||||||
plugin->addAutoReleasedObject(wizard);
|
plugin->addAutoReleasedObject(wizard);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BaseFileWizardParameters QmlApplicationWizard::parameters()
|
|
||||||
{
|
|
||||||
BaseFileWizardParameters params(ProjectWizard);
|
|
||||||
params.setCategory(QLatin1String(ProjectExplorer::Constants::QT_APPLICATION_WIZARD_CATEGORY));
|
|
||||||
params.setId(QLatin1String("QA.QMLB Application"));
|
|
||||||
params.setIcon(QIcon(QLatin1String(Qt4ProjectManager::Constants::ICON_QTQUICK_APP)));
|
|
||||||
params.setDisplayCategory(
|
|
||||||
QLatin1String(ProjectExplorer::Constants::QT_APPLICATION_WIZARD_CATEGORY_DISPLAY));
|
|
||||||
params.setDisplayName(tr("Qt Quick Application"));
|
|
||||||
params.setDescription(tr("Creates a Qt Quick application project."));
|
|
||||||
return params;
|
|
||||||
}
|
|
||||||
|
|
||||||
QWizard *QmlApplicationWizard::createWizardDialog(QWidget *parent,
|
QWizard *QmlApplicationWizard::createWizardDialog(QWidget *parent,
|
||||||
const WizardDialogParameters &wizardDialogParameters) const
|
const WizardDialogParameters &wizardDialogParameters) const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -60,25 +60,21 @@ private:
|
|||||||
class QmlApplicationWizard : public Core::BaseFileWizard
|
class QmlApplicationWizard : public Core::BaseFileWizard
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_DISABLE_COPY(QmlApplicationWizard)
|
|
||||||
public:
|
public:
|
||||||
QmlApplicationWizard(const Core::BaseFileWizardParameters ¶meters,
|
explicit QmlApplicationWizard(const TemplateInfo &templateInfo);
|
||||||
const TemplateInfo &templateInfo, QObject *parent = 0);
|
|
||||||
|
|
||||||
static void createInstances(ExtensionSystem::IPlugin *plugin);
|
static void createInstances(ExtensionSystem::IPlugin *plugin);
|
||||||
|
|
||||||
|
private:
|
||||||
private: // functions
|
|
||||||
QWizard *createWizardDialog(QWidget *parent,
|
QWizard *createWizardDialog(QWidget *parent,
|
||||||
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
||||||
Core::GeneratedFiles generateFiles(const QWizard *w, QString *errorMessage) const;
|
Core::GeneratedFiles generateFiles(const QWizard *w, QString *errorMessage) const;
|
||||||
void writeUserFile(const QString &fileName) const;
|
void writeUserFile(const QString &fileName) const;
|
||||||
bool postGenerateFiles(const QWizard *w, const Core::GeneratedFiles &l, QString *errorMessage);
|
bool postGenerateFiles(const QWizard *w, const Core::GeneratedFiles &l, QString *errorMessage);
|
||||||
|
|
||||||
static Core::BaseFileWizardParameters parameters();
|
private:
|
||||||
|
// mutable QString m_id;
|
||||||
private: //variables
|
|
||||||
mutable QString m_id;
|
|
||||||
QmlApp *m_qmlApp;
|
QmlApp *m_qmlApp;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -37,24 +37,21 @@
|
|||||||
|
|
||||||
#include <qtsupport/qtsupportconstants.h>
|
#include <qtsupport/qtsupportconstants.h>
|
||||||
|
|
||||||
#include <QIcon>
|
#include <QCoreApplication>
|
||||||
|
|
||||||
namespace Qt4ProjectManager {
|
namespace Qt4ProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
CustomWidgetWizard::CustomWidgetWizard() :
|
CustomWidgetWizard::CustomWidgetWizard()
|
||||||
QtWizard(QLatin1String("P.Qt4CustomWidget"),
|
|
||||||
QLatin1String(ProjectExplorer::Constants::QT_PROJECT_WIZARD_CATEGORY),
|
|
||||||
QLatin1String(ProjectExplorer::Constants::QT_PROJECT_WIZARD_CATEGORY_DISPLAY),
|
|
||||||
tr("Qt Custom Designer Widget"),
|
|
||||||
tr("Creates a Qt Custom Designer Widget or a Custom Widget Collection."),
|
|
||||||
QIcon(QLatin1String(":/wizards/images/gui.png")))
|
|
||||||
{
|
{
|
||||||
}
|
setId(QLatin1String("P.Qt4CustomWidget"));
|
||||||
|
setCategory(QLatin1String(ProjectExplorer::Constants::QT_PROJECT_WIZARD_CATEGORY));
|
||||||
Core::FeatureSet CustomWidgetWizard::requiredFeatures() const
|
setDisplayCategory(QCoreApplication::translate("ProjectExplorer",
|
||||||
{
|
ProjectExplorer::Constants::QT_PROJECT_WIZARD_CATEGORY_DISPLAY));
|
||||||
return Core::Feature(QtSupport::Constants::FEATURE_QWIDGETS);
|
setDisplayName(tr("Qt Custom Designer Widget"));
|
||||||
|
setDescription(tr("Creates a Qt Custom Designer Widget or a Custom Widget Collection."));
|
||||||
|
setIcon(QIcon(QLatin1String(":/wizards/images/gui.png")));
|
||||||
|
setRequiredFeatures(Core::Feature(QtSupport::Constants::FEATURE_QWIDGETS));
|
||||||
}
|
}
|
||||||
|
|
||||||
QWizard *CustomWidgetWizard::createWizardDialog(QWidget *parent,
|
QWizard *CustomWidgetWizard::createWizardDialog(QWidget *parent,
|
||||||
|
|||||||
@@ -41,15 +41,12 @@ class CustomWidgetWizard : public QtWizard
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
CustomWidgetWizard();
|
CustomWidgetWizard();
|
||||||
virtual Core::FeatureSet requiredFeatures() const;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
QWizard *createWizardDialog(QWidget *parent,
|
||||||
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
||||||
|
|
||||||
virtual Core::GeneratedFiles generateFiles(const QWizard *w,
|
Core::GeneratedFiles generateFiles(const QWizard *w, QString *errorMessage) const;
|
||||||
QString *errorMessage) const;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -226,8 +226,8 @@ QList<Core::Id> AbstractMobileAppWizardDialog::selectedKits() const
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
AbstractMobileAppWizard::AbstractMobileAppWizard(const Core::BaseFileWizardParameters ¶ms,
|
AbstractMobileAppWizard::AbstractMobileAppWizard(QObject *parent)
|
||||||
QObject *parent) : Core::BaseFileWizard(params, parent)
|
: Core::BaseFileWizard(parent)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
QWizard *AbstractMobileAppWizard::createWizardDialog(QWidget *parent,
|
QWizard *AbstractMobileAppWizard::createWizardDialog(QWidget *parent,
|
||||||
|
|||||||
@@ -101,8 +101,7 @@ class QT4PROJECTMANAGER_EXPORT AbstractMobileAppWizard : public Core::BaseFileWi
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
protected:
|
protected:
|
||||||
explicit AbstractMobileAppWizard(const Core::BaseFileWizardParameters ¶ms,
|
explicit AbstractMobileAppWizard(QObject *parent = 0);
|
||||||
QObject *parent = 0);
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void useProjectPath(const QString &projectName, const QString &projectPath);
|
void useProjectPath(const QString &projectName, const QString &projectPath);
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
#include <cpptools/abstracteditorsupport.h>
|
#include <cpptools/abstracteditorsupport.h>
|
||||||
#include <qtsupport/qtsupportconstants.h>
|
#include <qtsupport/qtsupportconstants.h>
|
||||||
|
|
||||||
#include <QIcon>
|
#include <QCoreApplication>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
|
|
||||||
@@ -53,14 +53,16 @@ namespace Qt4ProjectManager {
|
|||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
ConsoleAppWizard::ConsoleAppWizard()
|
ConsoleAppWizard::ConsoleAppWizard()
|
||||||
: QtWizard(QLatin1String("E.Qt4Core"),
|
|
||||||
QLatin1String(ProjectExplorer::Constants::QT_APPLICATION_WIZARD_CATEGORY),
|
|
||||||
QLatin1String(ProjectExplorer::Constants::QT_APPLICATION_WIZARD_CATEGORY_DISPLAY),
|
|
||||||
tr("Qt Console Application"),
|
|
||||||
tr("Creates a project containing a single main.cpp file with a stub implementation.\n\n"
|
|
||||||
"Preselects a desktop Qt for building the application if available."),
|
|
||||||
QIcon(QLatin1String(":/wizards/images/console.png")))
|
|
||||||
{
|
{
|
||||||
|
setId(QLatin1String("E.Qt4Core"));
|
||||||
|
setCategory(QLatin1String(ProjectExplorer::Constants::QT_APPLICATION_WIZARD_CATEGORY));
|
||||||
|
setDisplayCategory(QCoreApplication::translate("ProjectExplorer",
|
||||||
|
ProjectExplorer::Constants::QT_APPLICATION_WIZARD_CATEGORY_DISPLAY));
|
||||||
|
setDisplayName(tr("Qt Console Application"));
|
||||||
|
setDescription(tr("Creates a project containing a single main.cpp file with a stub implementation.\n\n"
|
||||||
|
"Preselects a desktop Qt for building the application if available."));
|
||||||
|
setIcon(QIcon(QLatin1String(":/wizards/images/console.png")));
|
||||||
|
setRequiredFeatures(Core::Feature(QtSupport::Constants::FEATURE_QT_CONSOLE));
|
||||||
}
|
}
|
||||||
|
|
||||||
QWizard *ConsoleAppWizard::createWizardDialog(QWidget *parent,
|
QWizard *ConsoleAppWizard::createWizardDialog(QWidget *parent,
|
||||||
@@ -102,10 +104,5 @@ Core::GeneratedFiles
|
|||||||
return Core::GeneratedFiles() << source << profile;
|
return Core::GeneratedFiles() << source << profile;
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::FeatureSet ConsoleAppWizard::requiredFeatures() const
|
|
||||||
{
|
|
||||||
return Core::Feature(QtSupport::Constants::FEATURE_QT_CONSOLE);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace Qt4ProjectManager
|
} // namespace Qt4ProjectManager
|
||||||
|
|||||||
@@ -45,13 +45,11 @@ public:
|
|||||||
ConsoleAppWizard();
|
ConsoleAppWizard();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
QWizard *createWizardDialog(QWidget *parent,
|
||||||
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
||||||
|
|
||||||
virtual Core::GeneratedFiles generateFiles(const QWizard *w,
|
Core::GeneratedFiles generateFiles(const QWizard *w,
|
||||||
QString *errorMessage) const;
|
QString *errorMessage) const;
|
||||||
|
|
||||||
virtual Core::FeatureSet requiredFeatures() const;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -34,25 +34,22 @@
|
|||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <qtsupport/qtsupportconstants.h>
|
#include <qtsupport/qtsupportconstants.h>
|
||||||
|
|
||||||
#include <QIcon>
|
#include <QCoreApplication>
|
||||||
|
|
||||||
namespace Qt4ProjectManager {
|
namespace Qt4ProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
EmptyProjectWizard::EmptyProjectWizard()
|
EmptyProjectWizard::EmptyProjectWizard()
|
||||||
: QtWizard(QLatin1String("U.Qt4Empty"),
|
|
||||||
QLatin1String(ProjectExplorer::Constants::QT_PROJECT_WIZARD_CATEGORY),
|
|
||||||
QLatin1String(ProjectExplorer::Constants::QT_PROJECT_WIZARD_CATEGORY_DISPLAY),
|
|
||||||
tr("Empty Qt Project"),
|
|
||||||
tr("Creates a qmake-based project without any files. This allows you to create "
|
|
||||||
"an application without any default classes."),
|
|
||||||
QIcon(QLatin1String(":/wizards/images/gui.png")))
|
|
||||||
{
|
{
|
||||||
}
|
setId(QLatin1String("U.Qt4Empty"));
|
||||||
|
setCategory(QLatin1String(ProjectExplorer::Constants::QT_PROJECT_WIZARD_CATEGORY));
|
||||||
Core::FeatureSet EmptyProjectWizard::requiredFeatures() const
|
setDisplayCategory(QCoreApplication::translate("ProjectExplorer",
|
||||||
{
|
ProjectExplorer::Constants::QT_PROJECT_WIZARD_CATEGORY_DISPLAY));
|
||||||
return Core::Feature(QtSupport::Constants::FEATURE_QT);
|
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));
|
||||||
}
|
}
|
||||||
|
|
||||||
QWizard *EmptyProjectWizard::createWizardDialog(QWidget *parent,
|
QWizard *EmptyProjectWizard::createWizardDialog(QWidget *parent,
|
||||||
|
|||||||
@@ -41,14 +41,12 @@ class EmptyProjectWizard : public QtWizard
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
EmptyProjectWizard();
|
EmptyProjectWizard();
|
||||||
virtual Core::FeatureSet requiredFeatures() const;
|
|
||||||
|
|
||||||
protected:
|
private:
|
||||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
QWizard *createWizardDialog(QWidget *parent,
|
||||||
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
||||||
|
|
||||||
virtual Core::GeneratedFiles generateFiles(const QWizard *w,
|
Core::GeneratedFiles generateFiles(const QWizard *w, QString *errorMessage) const;
|
||||||
QString *errorMessage) const;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -40,13 +40,12 @@
|
|||||||
|
|
||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
|
|
||||||
|
#include <QCoreApplication>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QSharedPointer>
|
#include <QSharedPointer>
|
||||||
|
|
||||||
#include <QIcon>
|
|
||||||
|
|
||||||
static const char mainSourceFileC[] = "main";
|
static const char mainSourceFileC[] = "main";
|
||||||
static const char mainSourceShowC[] = " w.show();\n";
|
static const char mainSourceShowC[] = " w.show();\n";
|
||||||
static const char mainSourceMobilityShowC[] = " w.show();\n";
|
static const char mainSourceMobilityShowC[] = " w.show();\n";
|
||||||
@@ -73,34 +72,19 @@ static inline QStringList baseClasses()
|
|||||||
namespace Qt4ProjectManager {
|
namespace Qt4ProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
GuiAppWizard::GuiAppWizard()
|
GuiAppWizard::GuiAppWizard(bool isMobile)
|
||||||
: QtWizard(QLatin1String("C.Qt4Gui"),
|
{
|
||||||
QLatin1String(ProjectExplorer::Constants::QT_APPLICATION_WIZARD_CATEGORY),
|
setId(QLatin1String("C.Qt4Gui"));
|
||||||
QLatin1String(ProjectExplorer::Constants::QT_APPLICATION_WIZARD_CATEGORY_DISPLAY),
|
setCategory(QLatin1String(ProjectExplorer::Constants::QT_APPLICATION_WIZARD_CATEGORY));
|
||||||
tr("Qt Gui Application"),
|
setDisplayCategory(QCoreApplication::translate("ProjectExplorer",
|
||||||
tr("Creates a Qt application for the desktop. "
|
ProjectExplorer::Constants::QT_APPLICATION_WIZARD_CATEGORY_DISPLAY));
|
||||||
|
setDisplayName(tr("Qt Gui Application"));
|
||||||
|
setDescription(tr("Creates a Qt application for the desktop. "
|
||||||
"Includes a Qt Designer-based main window.\n\n"
|
"Includes a Qt Designer-based main window.\n\n"
|
||||||
"Preselects a desktop Qt for building the application if available."),
|
"Preselects a desktop Qt for building the application if available."));
|
||||||
QIcon(QLatin1String(":/wizards/images/gui.png"))),
|
setIcon(QIcon(QLatin1String(":/wizards/images/gui.png")));
|
||||||
m_createMobileProject(false)
|
setRequiredFeatures(Core::Feature(QtSupport::Constants::FEATURE_QWIDGETS));
|
||||||
{
|
m_createMobileProject = isMobile;
|
||||||
}
|
|
||||||
|
|
||||||
Core::FeatureSet GuiAppWizard::requiredFeatures() const
|
|
||||||
{
|
|
||||||
return Core::Feature(QtSupport::Constants::FEATURE_QWIDGETS);
|
|
||||||
}
|
|
||||||
|
|
||||||
GuiAppWizard::GuiAppWizard(const QString &id,
|
|
||||||
const QString &category,
|
|
||||||
const QString &displayCategory,
|
|
||||||
const QString &name,
|
|
||||||
const QString &description,
|
|
||||||
const QIcon &icon,
|
|
||||||
bool createMobile)
|
|
||||||
: QtWizard(id, category, displayCategory, name, description, icon),
|
|
||||||
m_createMobileProject(createMobile)
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QWizard *GuiAppWizard::createWizardDialog(QWidget *parent,
|
QWizard *GuiAppWizard::createWizardDialog(QWidget *parent,
|
||||||
|
|||||||
@@ -42,22 +42,13 @@ class GuiAppWizard : public QtWizard
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GuiAppWizard();
|
GuiAppWizard(bool isMobile = false);
|
||||||
virtual Core::FeatureSet requiredFeatures() const;
|
|
||||||
|
|
||||||
protected:
|
private:
|
||||||
GuiAppWizard(const QString &id,
|
QWizard *createWizardDialog(QWidget *parent,
|
||||||
const QString &category,
|
|
||||||
const QString &displayCategory,
|
|
||||||
const QString &name,
|
|
||||||
const QString &description,
|
|
||||||
const QIcon &icon,
|
|
||||||
bool createMobile);
|
|
||||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
|
||||||
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
||||||
|
|
||||||
virtual Core::GeneratedFiles generateFiles(const QWizard *w,
|
Core::GeneratedFiles generateFiles(const QWizard *w, QString *errorMessage) const;
|
||||||
QString *errorMessage) const;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static bool parametrizeTemplate(const QString &templatePath, const QString &templateName,
|
static bool parametrizeTemplate(const QString &templatePath, const QString &templateName,
|
||||||
|
|||||||
@@ -79,9 +79,20 @@ class Html5AppWizardPrivate
|
|||||||
};
|
};
|
||||||
|
|
||||||
Html5AppWizard::Html5AppWizard()
|
Html5AppWizard::Html5AppWizard()
|
||||||
: AbstractMobileAppWizard(parameters())
|
: d(new Html5AppWizardPrivate)
|
||||||
, d(new Html5AppWizardPrivate)
|
|
||||||
{
|
{
|
||||||
|
setWizardKind(ProjectWizard);
|
||||||
|
setIcon(QIcon(QLatin1String(Constants::ICON_HTML5_APP)));
|
||||||
|
setDisplayName(tr("HTML5 Application"));
|
||||||
|
setId(QLatin1String("QA.HTML5A Application"));
|
||||||
|
setDescription(tr("Creates an HTML5 application project that can contain "
|
||||||
|
"both HTML5 and C++ code and includes a WebKit view.\n\n"
|
||||||
|
"You can build the application and deploy it on desktop and "
|
||||||
|
"mobile target platforms."));
|
||||||
|
setCategory(QLatin1String(ProjectExplorer::Constants::QT_APPLICATION_WIZARD_CATEGORY));
|
||||||
|
setDisplayCategory(QLatin1String(ProjectExplorer::Constants::QT_APPLICATION_WIZARD_CATEGORY_DISPLAY));
|
||||||
|
setRequiredFeatures(Core::Feature(QtSupport::Constants::FEATURE_QT_WEBKIT));
|
||||||
|
|
||||||
d->app = new Html5App;
|
d->app = new Html5App;
|
||||||
d->wizardDialog = 0;
|
d->wizardDialog = 0;
|
||||||
}
|
}
|
||||||
@@ -92,26 +103,6 @@ Html5AppWizard::~Html5AppWizard()
|
|||||||
delete d;
|
delete d;
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::FeatureSet Html5AppWizard::requiredFeatures() const
|
|
||||||
{
|
|
||||||
return Core::Feature(QtSupport::Constants::FEATURE_QT_WEBKIT);
|
|
||||||
}
|
|
||||||
|
|
||||||
Core::BaseFileWizardParameters Html5AppWizard::parameters()
|
|
||||||
{
|
|
||||||
Core::BaseFileWizardParameters parameters(ProjectWizard);
|
|
||||||
parameters.setIcon(QIcon(QLatin1String(Constants::ICON_HTML5_APP)));
|
|
||||||
parameters.setDisplayName(tr("HTML5 Application"));
|
|
||||||
parameters.setId(QLatin1String("QA.HTML5A Application"));
|
|
||||||
parameters.setDescription(tr("Creates an HTML5 application project that can contain "
|
|
||||||
"both HTML5 and C++ code and includes a WebKit view.\n\n"
|
|
||||||
"You can build the application and deploy it on desktop and "
|
|
||||||
"mobile target platforms."));
|
|
||||||
parameters.setCategory(QLatin1String(ProjectExplorer::Constants::QT_APPLICATION_WIZARD_CATEGORY));
|
|
||||||
parameters.setDisplayCategory(QLatin1String(ProjectExplorer::Constants::QT_APPLICATION_WIZARD_CATEGORY_DISPLAY));
|
|
||||||
return parameters;
|
|
||||||
}
|
|
||||||
|
|
||||||
AbstractMobileAppWizardDialog *Html5AppWizard::createWizardDialogInternal(QWidget *parent,
|
AbstractMobileAppWizardDialog *Html5AppWizard::createWizardDialogInternal(QWidget *parent,
|
||||||
const Core::WizardDialogParameters ¶meters) const
|
const Core::WizardDialogParameters ¶meters) const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -41,15 +41,12 @@ class Html5AppWizard : public AbstractMobileAppWizard
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
Html5AppWizard();
|
Html5AppWizard();
|
||||||
virtual ~Html5AppWizard();
|
~Html5AppWizard();
|
||||||
virtual Core::FeatureSet requiredFeatures() const;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QString fileToOpenPostGeneration() const;
|
QString fileToOpenPostGeneration() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static Core::BaseFileWizardParameters parameters();
|
|
||||||
|
|
||||||
virtual AbstractMobileApp *app() const;
|
virtual AbstractMobileApp *app() const;
|
||||||
virtual AbstractMobileAppWizardDialog *wizardDialog() const;
|
virtual AbstractMobileAppWizardDialog *wizardDialog() const;
|
||||||
virtual AbstractMobileAppWizardDialog *createWizardDialogInternal(QWidget *parent,
|
virtual AbstractMobileAppWizardDialog *createWizardDialogInternal(QWidget *parent,
|
||||||
|
|||||||
@@ -37,24 +37,25 @@
|
|||||||
|
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
#include <QIcon>
|
#include <QCoreApplication>
|
||||||
|
|
||||||
static const char sharedHeaderPostfixC[] = "_global";
|
static const char sharedHeaderPostfixC[] = "_global";
|
||||||
|
|
||||||
namespace Qt4ProjectManager {
|
namespace Qt4ProjectManager {
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
LibraryWizard::LibraryWizard()
|
LibraryWizard::LibraryWizard()
|
||||||
: QtWizard(QLatin1String("H.Qt4Library"),
|
|
||||||
QLatin1String(ProjectExplorer::Constants::LIBRARIES_WIZARD_CATEGORY),
|
|
||||||
QLatin1String(ProjectExplorer::Constants::LIBRARIES_WIZARD_CATEGORY_DISPLAY),
|
|
||||||
tr("C++ Library"),
|
|
||||||
tr("Creates a C++ library based on qmake. This can be used to create:<ul>"
|
|
||||||
"<li>a shared C++ library for use with <tt>QPluginLoader</tt> and runtime (Plugins)</li>"
|
|
||||||
"<li>a shared or static C++ library for use with another project at linktime</li></ul>"),
|
|
||||||
QIcon(QLatin1String(":/wizards/images/lib.png")))
|
|
||||||
{
|
{
|
||||||
|
setId(QLatin1String("H.Qt4Library"));
|
||||||
|
setCategory(QLatin1String(ProjectExplorer::Constants::LIBRARIES_WIZARD_CATEGORY));
|
||||||
|
setDisplayCategory(QCoreApplication::translate("ProjectExplorer",
|
||||||
|
ProjectExplorer::Constants::LIBRARIES_WIZARD_CATEGORY_DISPLAY));
|
||||||
|
setDisplayName(tr("C++ Library"));
|
||||||
|
setDescription(tr("Creates a C++ library based on qmake. This can be used to create:<ul>"
|
||||||
|
"<li>a shared C++ library for use with <tt>QPluginLoader</tt> and runtime (Plugins)</li>"
|
||||||
|
"<li>a shared or static C++ library for use with another project at linktime</li></ul>"));
|
||||||
|
setIcon(QIcon(QLatin1String(":/wizards/images/lib.png")));
|
||||||
|
setRequiredFeatures(Core::Feature(QtSupport::Constants::FEATURE_QT));
|
||||||
}
|
}
|
||||||
|
|
||||||
QWizard *LibraryWizard::createWizardDialog(QWidget *parent, const Core::WizardDialogParameters &wizardDialogParameters) const
|
QWizard *LibraryWizard::createWizardDialog(QWidget *parent, const Core::WizardDialogParameters &wizardDialogParameters) const
|
||||||
@@ -152,10 +153,5 @@ Core::GeneratedFiles LibraryWizard::generateFiles(const QWizard *w,
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::FeatureSet LibraryWizard::requiredFeatures() const
|
|
||||||
{
|
|
||||||
return Core::Feature(QtSupport::Constants::FEATURE_QT);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace Qt4ProjectManager
|
} // namespace Qt4ProjectManager
|
||||||
|
|||||||
@@ -36,9 +36,6 @@
|
|||||||
namespace Qt4ProjectManager {
|
namespace Qt4ProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
struct LibraryParameters;
|
|
||||||
class ModulesPage;
|
|
||||||
|
|
||||||
class LibraryWizard : public QtWizard
|
class LibraryWizard : public QtWizard
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@@ -47,12 +44,10 @@ public:
|
|||||||
LibraryWizard();
|
LibraryWizard();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
QWizard *createWizardDialog(QWidget *parent,
|
||||||
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
||||||
|
|
||||||
virtual Core::GeneratedFiles generateFiles(const QWizard *w,
|
Core::GeneratedFiles generateFiles(const QWizard *w, QString *errorMessage) const;
|
||||||
QString *errorMessage) const;
|
|
||||||
virtual Core::FeatureSet requiredFeatures() const;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -105,17 +105,14 @@ class QtQuickAppWizardPrivate
|
|||||||
};
|
};
|
||||||
|
|
||||||
QtQuickAppWizard::QtQuickAppWizard()
|
QtQuickAppWizard::QtQuickAppWizard()
|
||||||
: AbstractMobileAppWizard(baseParameters())
|
: d(new QtQuickAppWizardPrivate)
|
||||||
, d(new QtQuickAppWizardPrivate)
|
|
||||||
{
|
{
|
||||||
d->app = new QtQuickApp;
|
setWizardKind(ProjectWizard);
|
||||||
d->wizardDialog = 0;
|
setIcon(QIcon(QLatin1String(Qt4ProjectManager::Constants::ICON_QTQUICK_APP)));
|
||||||
}
|
setId(QLatin1String("D.QMLA Application"));
|
||||||
|
setCategory(QLatin1String(ProjectExplorer::Constants::QT_APPLICATION_WIZARD_CATEGORY));
|
||||||
|
setDisplayCategory(QLatin1String(ProjectExplorer::Constants::QT_APPLICATION_WIZARD_CATEGORY_DISPLAY));
|
||||||
|
|
||||||
QtQuickAppWizard::QtQuickAppWizard(const Core::BaseFileWizardParameters ¶ms, QObject *parent)
|
|
||||||
: AbstractMobileAppWizard(params, parent)
|
|
||||||
, d(new QtQuickAppWizardPrivate)
|
|
||||||
{
|
|
||||||
d->app = new QtQuickApp;
|
d->app = new QtQuickApp;
|
||||||
d->wizardDialog = 0;
|
d->wizardDialog = 0;
|
||||||
}
|
}
|
||||||
@@ -128,83 +125,68 @@ QtQuickAppWizard::~QtQuickAppWizard()
|
|||||||
|
|
||||||
void QtQuickAppWizard::createInstances(ExtensionSystem::IPlugin *plugin)
|
void QtQuickAppWizard::createInstances(ExtensionSystem::IPlugin *plugin)
|
||||||
{
|
{
|
||||||
Core::BaseFileWizardParameters base = baseParameters();
|
|
||||||
QList<Core::BaseFileWizardParameters> list;
|
|
||||||
Core::BaseFileWizardParameters parameter;
|
|
||||||
|
|
||||||
const QString basicDescription = tr("Creates a Qt Quick 1 application project that can contain "
|
const QString basicDescription = tr("Creates a Qt Quick 1 application project that can contain "
|
||||||
"both QML and C++ code and includes a QDeclarativeView.\n\n");
|
"both QML and C++ code and includes a QDeclarativeView.\n\n");
|
||||||
const QString basicDescription2 = tr("Creates a Qt Quick 2 application project that can contain "
|
const QString basicDescription2 = tr("Creates a Qt Quick 2 application project that can contain "
|
||||||
"both QML and C++ code and includes a QQuickView.\n\n");
|
"both QML and C++ code and includes a QQuickView.\n\n");
|
||||||
|
|
||||||
Core::FeatureSet basicFeatures;
|
Core::FeatureSet basicFeatures = Core::Feature(QtSupport::Constants::FEATURE_QT_QUICK_1);
|
||||||
basicFeatures = Core::Feature(QtSupport::Constants::FEATURE_QT_QUICK_1);
|
|
||||||
|
|
||||||
parameter = base;
|
QtQuickAppWizard *wizard = new QtQuickAppWizard;
|
||||||
parameter.setDisplayName(tr("Qt Quick 1 Application (Built-in Types)"));
|
wizard->setQtQuickKind(QtQuick1_1);
|
||||||
parameter.setDescription(basicDescription + tr("The built-in QML types in the QtQuick 1 namespace allow "
|
wizard->setDisplayName(tr("Qt Quick 1 Application (Built-in Types)"));
|
||||||
|
wizard->setDescription(basicDescription + tr("The built-in QML types in the QtQuick 1 namespace allow "
|
||||||
"you to write cross-platform applications with "
|
"you to write cross-platform applications with "
|
||||||
"a custom look and feel.\n\nRequires <b>Qt 4.7.0</b> or newer."));
|
"a custom look and feel.\n\nRequires <b>Qt 4.7.0</b> or newer."));
|
||||||
parameter.setRequiredFeatures(basicFeatures);
|
wizard->setRequiredFeatures(basicFeatures);
|
||||||
list << parameter;
|
plugin->addAutoReleasedObject(wizard);
|
||||||
|
|
||||||
parameter = base;
|
|
||||||
parameter.setDisplayName(tr("Qt Quick 2 Application (Built-in Types)"));
|
wizard = new QtQuickAppWizard;
|
||||||
parameter.setDescription(basicDescription2 + tr("The built-in QML types in the QtQuick 2 namespace allow "
|
wizard->setQtQuickKind(QtQuick2_0);
|
||||||
|
wizard->setDisplayName(tr("Qt Quick 2 Application (Built-in Types)"));
|
||||||
|
wizard->setDescription(basicDescription2 + tr("The built-in QML types in the QtQuick 2 namespace allow "
|
||||||
"you to write cross-platform applications with "
|
"you to write cross-platform applications with "
|
||||||
"a custom look and feel.\n\nRequires <b>Qt 5.0</b> or newer."));
|
"a custom look and feel.\n\nRequires <b>Qt 5.0</b> or newer."));
|
||||||
parameter.setRequiredFeatures(Core::Feature(QtSupport::Constants::FEATURE_QT_QUICK_2));
|
wizard->setRequiredFeatures(Core::Feature(QtSupport::Constants::FEATURE_QT_QUICK_2));
|
||||||
list << parameter;
|
plugin->addAutoReleasedObject(wizard);
|
||||||
|
|
||||||
parameter = base;
|
|
||||||
parameter.setDisplayName(tr("Qt Quick 1 Application for MeeGo Harmattan"));
|
wizard = new QtQuickAppWizard;
|
||||||
parameter.setDescription(basicDescription + tr("The Qt Quick Components for MeeGo Harmattan are "
|
wizard->setQtQuickKind(MeegoComponents);
|
||||||
|
wizard->setDisplayName(tr("Qt Quick 1 Application for MeeGo Harmattan"));
|
||||||
|
wizard->setDescription(basicDescription + tr("The Qt Quick Components for MeeGo Harmattan are "
|
||||||
"a set of ready-made components that are designed "
|
"a set of ready-made components that are designed "
|
||||||
"with specific native appearance for the MeeGo Harmattan "
|
"with specific native appearance for the MeeGo Harmattan "
|
||||||
"platform.\n\nRequires <b>Qt 4.7.4</b> or newer, and the "
|
"platform.\n\nRequires <b>Qt 4.7.4</b> or newer, and the "
|
||||||
"component set installed for your Qt version."));
|
"component set installed for your Qt version."));
|
||||||
parameter.setRequiredFeatures(basicFeatures | Core::Feature(QtSupport::Constants::FEATURE_QTQUICK_COMPONENTS_MEEGO)
|
wizard->setRequiredFeatures(basicFeatures | Core::Feature(QtSupport::Constants::FEATURE_QTQUICK_COMPONENTS_MEEGO)
|
||||||
| Core::Feature(QtSupport::Constants::FEATURE_QT_QUICK_1_1));
|
| Core::Feature(QtSupport::Constants::FEATURE_QT_QUICK_1_1));
|
||||||
list << parameter;
|
plugin->addAutoReleasedObject(wizard);
|
||||||
|
|
||||||
parameter = base;
|
|
||||||
parameter.setDisplayName(tr("Qt Quick 1 Application (from Existing QML File)"));
|
wizard = new QtQuickAppWizard;
|
||||||
parameter.setDescription(basicDescription + tr("Creates a deployable Qt Quick application from "
|
wizard->setQtQuickKind(ImportQml);
|
||||||
|
wizard->setDisplayName(tr("Qt Quick 1 Application (from Existing QML File)"));
|
||||||
|
wizard->setDescription(basicDescription + tr("Creates a deployable Qt Quick application from "
|
||||||
"existing QML files. All files and directories that "
|
"existing QML files. All files and directories that "
|
||||||
"reside in the same directory as the main .qml file "
|
"reside in the same directory as the main .qml file "
|
||||||
"are deployed. You can modify the contents of the "
|
"are deployed. You can modify the contents of the "
|
||||||
"directory any time before deploying.\n\nRequires <b>Qt 4.7.0</b> or newer."));
|
"directory any time before deploying.\n\nRequires <b>Qt 4.7.0</b> or newer."));
|
||||||
parameter.setRequiredFeatures(basicFeatures);
|
wizard->setRequiredFeatures(basicFeatures);
|
||||||
list << parameter;
|
plugin->addAutoReleasedObject(wizard);
|
||||||
|
|
||||||
parameter = base;
|
|
||||||
parameter.setDisplayName(tr("Qt Quick 2 Application (from Existing QML File)"));
|
wizard = new QtQuickAppWizard;
|
||||||
parameter.setDescription(basicDescription2 + tr("Creates a deployable Qt Quick application from "
|
wizard->setQtQuickKind(ImportQml2);
|
||||||
|
wizard->setDisplayName(tr("Qt Quick 2 Application (from Existing QML File)"));
|
||||||
|
wizard->setDescription(basicDescription2 + tr("Creates a deployable Qt Quick application from "
|
||||||
"existing QML files. All files and directories that "
|
"existing QML files. All files and directories that "
|
||||||
"reside in the same directory as the main .qml file "
|
"reside in the same directory as the main .qml file "
|
||||||
"are deployed. You can modify the contents of the "
|
"are deployed. You can modify the contents of the "
|
||||||
"directory any time before deploying.\n\nRequires <b>Qt 5.0</b> or newer."));
|
"directory any time before deploying.\n\nRequires <b>Qt 5.0</b> or newer."));
|
||||||
parameter.setRequiredFeatures(Core::Feature(QtSupport::Constants::FEATURE_QT_QUICK_2));
|
wizard->setRequiredFeatures(Core::Feature(QtSupport::Constants::FEATURE_QT_QUICK_2));
|
||||||
list << parameter;
|
plugin->addAutoReleasedObject(wizard);
|
||||||
|
|
||||||
QList<QtQuickAppWizard*> wizardList = Core::createMultipleBaseFileWizardInstances<QtQuickAppWizard>(list, plugin);
|
|
||||||
|
|
||||||
Q_ASSERT(wizardList.count() == 5);
|
|
||||||
|
|
||||||
for (int i = 0; i < wizardList.count(); i++) {
|
|
||||||
wizardList.at(i)->setQtQuickKind(Kind(i));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Core::BaseFileWizardParameters QtQuickAppWizard::baseParameters()
|
|
||||||
{
|
|
||||||
Core::BaseFileWizardParameters parameters(ProjectWizard);
|
|
||||||
parameters.setIcon(QIcon(QLatin1String(Qt4ProjectManager::Constants::ICON_QTQUICK_APP)));
|
|
||||||
parameters.setId(QLatin1String("D.QMLA Application"));
|
|
||||||
parameters.setCategory(QLatin1String(ProjectExplorer::Constants::QT_APPLICATION_WIZARD_CATEGORY));
|
|
||||||
parameters.setDisplayCategory(QLatin1String(ProjectExplorer::Constants::QT_APPLICATION_WIZARD_CATEGORY_DISPLAY));
|
|
||||||
|
|
||||||
return parameters;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AbstractMobileAppWizardDialog *QtQuickAppWizard::createWizardDialogInternal(QWidget *parent,
|
AbstractMobileAppWizardDialog *QtQuickAppWizard::createWizardDialogInternal(QWidget *parent,
|
||||||
|
|||||||
@@ -38,8 +38,8 @@ namespace Internal {
|
|||||||
class QtQuickAppWizard : public AbstractMobileAppWizard
|
class QtQuickAppWizard : public AbstractMobileAppWizard
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
|
||||||
|
|
||||||
|
public:
|
||||||
enum Kind {
|
enum Kind {
|
||||||
QtQuick1_1 = 0,
|
QtQuick1_1 = 0,
|
||||||
QtQuick2_0 = 1,
|
QtQuick2_0 = 1,
|
||||||
@@ -49,16 +49,14 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
QtQuickAppWizard();
|
QtQuickAppWizard();
|
||||||
explicit QtQuickAppWizard(const Core::BaseFileWizardParameters ¶ms, QObject *parent = 0);
|
~QtQuickAppWizard();
|
||||||
virtual ~QtQuickAppWizard();
|
|
||||||
static void createInstances(ExtensionSystem::IPlugin *plugin);
|
static void createInstances(ExtensionSystem::IPlugin *plugin);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QString fileToOpenPostGeneration() const;
|
QString fileToOpenPostGeneration() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static Core::BaseFileWizardParameters baseParameters();
|
|
||||||
|
|
||||||
virtual AbstractMobileApp *app() const;
|
virtual AbstractMobileApp *app() const;
|
||||||
virtual AbstractMobileAppWizardDialog *wizardDialog() const;
|
virtual AbstractMobileAppWizardDialog *wizardDialog() const;
|
||||||
virtual AbstractMobileAppWizardDialog *createWizardDialogInternal(QWidget *parent,
|
virtual AbstractMobileAppWizardDialog *createWizardDialogInternal(QWidget *parent,
|
||||||
|
|||||||
@@ -53,38 +53,10 @@ using namespace ProjectExplorer;
|
|||||||
using namespace Qt4ProjectManager;
|
using namespace Qt4ProjectManager;
|
||||||
using namespace Qt4ProjectManager::Internal;
|
using namespace Qt4ProjectManager::Internal;
|
||||||
|
|
||||||
static Core::BaseFileWizardParameters
|
|
||||||
wizardParameters(const QString &id,
|
|
||||||
const QString &category,
|
|
||||||
const QString &displayCategory,
|
|
||||||
const QString &name,
|
|
||||||
const QString &description,
|
|
||||||
const QIcon &icon)
|
|
||||||
{
|
|
||||||
Core::BaseFileWizardParameters rc(Core::IWizard::ProjectWizard);
|
|
||||||
rc.setCategory(category);
|
|
||||||
rc.setDisplayCategory(QCoreApplication::translate("ProjectExplorer",
|
|
||||||
displayCategory.toLatin1()));
|
|
||||||
rc.setIcon(icon);
|
|
||||||
rc.setDisplayName(name);
|
|
||||||
rc.setId(id);
|
|
||||||
rc.setDescription(description);
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
// -------------------- QtWizard
|
// -------------------- QtWizard
|
||||||
QtWizard::QtWizard(const QString &id,
|
QtWizard::QtWizard()
|
||||||
const QString &category,
|
|
||||||
const QString &displayCategory,
|
|
||||||
const QString &name,
|
|
||||||
const QString &description, const QIcon &icon) :
|
|
||||||
Core::BaseFileWizard(wizardParameters(id,
|
|
||||||
category,
|
|
||||||
displayCategory,
|
|
||||||
name,
|
|
||||||
description,
|
|
||||||
icon))
|
|
||||||
{
|
{
|
||||||
|
setWizardKind(Core::IWizard::ProjectWizard);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QtWizard::sourceSuffix()
|
QString QtWizard::sourceSuffix()
|
||||||
@@ -156,14 +128,12 @@ bool QtWizard::showModulesPageForLibraries()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ------------ CustomQt4ProjectWizard
|
// ------------ CustomQt4ProjectWizard
|
||||||
CustomQt4ProjectWizard::CustomQt4ProjectWizard(const Core::BaseFileWizardParameters& baseFileParameters,
|
CustomQt4ProjectWizard::CustomQt4ProjectWizard()
|
||||||
QObject *parent) :
|
|
||||||
ProjectExplorer::CustomProjectWizard(baseFileParameters, parent)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
QWizard *CustomQt4ProjectWizard::createWizardDialog(QWidget *parent,
|
QWizard *CustomQt4ProjectWizard::createWizardDialog
|
||||||
const Core::WizardDialogParameters &wizardDialogParameters) const
|
(QWidget *parent, const Core::WizardDialogParameters &wizardDialogParameters) const
|
||||||
{
|
{
|
||||||
BaseQt4ProjectWizardDialog *wizard = new BaseQt4ProjectWizardDialog(false, parent, wizardDialogParameters);
|
BaseQt4ProjectWizardDialog *wizard = new BaseQt4ProjectWizardDialog(false, parent, wizardDialogParameters);
|
||||||
|
|
||||||
|
|||||||
@@ -58,15 +58,9 @@ class QtWizard : public Core::BaseFileWizard
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QtWizard(const QString &id,
|
QtWizard();
|
||||||
const QString &category,
|
|
||||||
const QString &displayCategory,
|
|
||||||
const QString &name,
|
|
||||||
const QString &description,
|
|
||||||
const QIcon &icon);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
static QString templateDir();
|
static QString templateDir();
|
||||||
|
|
||||||
static QString sourceSuffix();
|
static QString sourceSuffix();
|
||||||
@@ -88,17 +82,18 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
// A custom wizard with an additional Qt 4 target page
|
// A custom wizard with an additional Qt 4 target page
|
||||||
class CustomQt4ProjectWizard : public ProjectExplorer::CustomProjectWizard {
|
class CustomQt4ProjectWizard : public ProjectExplorer::CustomProjectWizard
|
||||||
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
|
||||||
explicit CustomQt4ProjectWizard(const Core::BaseFileWizardParameters& baseFileParameters,
|
|
||||||
QObject *parent = 0);
|
|
||||||
|
|
||||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
public:
|
||||||
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
CustomQt4ProjectWizard();
|
||||||
|
|
||||||
static void registerSelf();
|
static void registerSelf();
|
||||||
|
|
||||||
protected:
|
private:
|
||||||
|
QWizard *createWizardDialog(QWidget *parent,
|
||||||
|
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
||||||
virtual bool postGenerateFiles(const QWizard *, const Core::GeneratedFiles &l, QString *errorMessage);
|
virtual bool postGenerateFiles(const QWizard *, const Core::GeneratedFiles &l, QString *errorMessage);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -35,20 +35,22 @@
|
|||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <qtsupport/qtsupportconstants.h>
|
#include <qtsupport/qtsupportconstants.h>
|
||||||
|
|
||||||
#include <QIcon>
|
#include <QCoreApplication>
|
||||||
|
|
||||||
namespace Qt4ProjectManager {
|
namespace Qt4ProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
SubdirsProjectWizard::SubdirsProjectWizard()
|
SubdirsProjectWizard::SubdirsProjectWizard()
|
||||||
: QtWizard(QLatin1String("U.Qt4Subdirs"),
|
|
||||||
QLatin1String(ProjectExplorer::Constants::QT_PROJECT_WIZARD_CATEGORY),
|
|
||||||
QLatin1String(ProjectExplorer::Constants::QT_PROJECT_WIZARD_CATEGORY_DISPLAY),
|
|
||||||
tr("Subdirs Project"),
|
|
||||||
tr("Creates a qmake-based subdirs project. This allows you to group "
|
|
||||||
"your projects in a tree structure."),
|
|
||||||
QIcon(QLatin1String(":/wizards/images/gui.png")))
|
|
||||||
{
|
{
|
||||||
|
setId(QLatin1String("U.Qt4Subdirs"));
|
||||||
|
setCategory(QLatin1String(ProjectExplorer::Constants::QT_PROJECT_WIZARD_CATEGORY));
|
||||||
|
setDisplayCategory(QCoreApplication::translate("ProjectExplorer",
|
||||||
|
ProjectExplorer::Constants::QT_PROJECT_WIZARD_CATEGORY_DISPLAY));
|
||||||
|
setDisplayName(tr("Subdirs Project"));
|
||||||
|
setDescription(tr("Creates a qmake-based subdirs project. This allows you to group "
|
||||||
|
"your projects in a tree structure."));
|
||||||
|
setIcon(QIcon(QLatin1String(":/wizards/images/gui.png")));
|
||||||
|
setRequiredFeatures(Core::Feature(QtSupport::Constants::FEATURE_QT));
|
||||||
}
|
}
|
||||||
|
|
||||||
QWizard *SubdirsProjectWizard::createWizardDialog(QWidget *parent,
|
QWizard *SubdirsProjectWizard::createWizardDialog(QWidget *parent,
|
||||||
@@ -97,10 +99,5 @@ bool SubdirsProjectWizard::postGenerateFiles(const QWizard *w, const Core::Gener
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::FeatureSet SubdirsProjectWizard::requiredFeatures() const
|
|
||||||
{
|
|
||||||
return Core::Feature(QtSupport::Constants::FEATURE_QT);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace Qt4ProjectManager
|
} // namespace Qt4ProjectManager
|
||||||
|
|||||||
@@ -42,14 +42,12 @@ class SubdirsProjectWizard : public QtWizard
|
|||||||
public:
|
public:
|
||||||
SubdirsProjectWizard();
|
SubdirsProjectWizard();
|
||||||
|
|
||||||
protected:
|
private:
|
||||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
QWizard *createWizardDialog(QWidget *parent,
|
||||||
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
||||||
|
|
||||||
virtual Core::GeneratedFiles generateFiles(const QWizard *w,
|
Core::GeneratedFiles generateFiles(const QWizard *w, QString *errorMessage) const;
|
||||||
QString *errorMessage) const;
|
bool postGenerateFiles(const QWizard *, const Core::GeneratedFiles &l, QString *errorMessage);
|
||||||
virtual bool postGenerateFiles(const QWizard *, const Core::GeneratedFiles &l, QString *errorMessage);
|
|
||||||
virtual Core::FeatureSet requiredFeatures() const;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -36,24 +36,26 @@
|
|||||||
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
|
#include <QCoreApplication>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
|
||||||
#include <QIcon>
|
|
||||||
|
|
||||||
namespace Qt4ProjectManager {
|
namespace Qt4ProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
TestWizard::TestWizard() :
|
TestWizard::TestWizard()
|
||||||
QtWizard(QLatin1String("L.Qt4Test"),
|
|
||||||
QLatin1String(ProjectExplorer::Constants::QT_PROJECT_WIZARD_CATEGORY),
|
|
||||||
QLatin1String(ProjectExplorer::Constants::QT_PROJECT_WIZARD_CATEGORY_DISPLAY),
|
|
||||||
tr("Qt Unit Test"),
|
|
||||||
tr("Creates a QTestLib-based unit test for a feature or a class. "
|
|
||||||
"Unit tests allow you to verify that the code is fit for use "
|
|
||||||
"and that there are no regressions."),
|
|
||||||
QIcon(QLatin1String(":/wizards/images/console.png")))
|
|
||||||
{
|
{
|
||||||
|
setId(QLatin1String("L.Qt4Test"));
|
||||||
|
setCategory(QLatin1String(ProjectExplorer::Constants::QT_PROJECT_WIZARD_CATEGORY));
|
||||||
|
setDisplayCategory(QCoreApplication::translate("ProjectExplorer",
|
||||||
|
ProjectExplorer::Constants::QT_PROJECT_WIZARD_CATEGORY_DISPLAY));
|
||||||
|
setDisplayName(tr("Qt Unit Test"));
|
||||||
|
setDescription(tr("Creates a QTestLib-based unit test for a feature or a class. "
|
||||||
|
"Unit tests allow you to verify that the code is fit for use "
|
||||||
|
"and that there are no regressions."));
|
||||||
|
setIcon(QIcon(QLatin1String(":/wizards/images/console.png")));
|
||||||
|
setRequiredFeatures(Core::Feature(QtSupport::Constants::FEATURE_QT_CONSOLE) |
|
||||||
|
Core::Feature(QtSupport::Constants::FEATURE_QT));
|
||||||
}
|
}
|
||||||
|
|
||||||
QWizard *TestWizard::createWizardDialog(QWidget *parent,
|
QWizard *TestWizard::createWizardDialog(QWidget *parent,
|
||||||
@@ -181,11 +183,5 @@ Core::GeneratedFiles TestWizard::generateFiles(const QWizard *w, QString *errorM
|
|||||||
return Core::GeneratedFiles() << source << profile;
|
return Core::GeneratedFiles() << source << profile;
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::FeatureSet TestWizard::requiredFeatures() const
|
|
||||||
{
|
|
||||||
return Core::Feature(QtSupport::Constants::FEATURE_QT_CONSOLE) |
|
|
||||||
Core::Feature(QtSupport::Constants::FEATURE_QT);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace Qt4ProjectManager
|
} // namespace Qt4ProjectManager
|
||||||
|
|||||||
@@ -41,14 +41,12 @@ class TestWizard : public QtWizard
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
TestWizard();
|
TestWizard();
|
||||||
virtual Core::FeatureSet requiredFeatures() const;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
QWizard *createWizardDialog(QWidget *parent,
|
||||||
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
||||||
|
|
||||||
virtual Core::GeneratedFiles generateFiles(const QWizard *w,
|
Core::GeneratedFiles generateFiles(const QWizard *w, QString *errorMessage) const;
|
||||||
QString *errorMessage) const;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -73,14 +73,13 @@ bool ResourceEditorPlugin::initialize(const QStringList &arguments, QString *err
|
|||||||
m_editor = new ResourceEditorFactory(this);
|
m_editor = new ResourceEditorFactory(this);
|
||||||
addObject(m_editor);
|
addObject(m_editor);
|
||||||
|
|
||||||
Core::BaseFileWizardParameters wizardParameters(Core::IWizard::FileWizard);
|
m_wizard = new ResourceWizard(this);
|
||||||
wizardParameters.setDescription(tr("Creates a Qt Resource file (.qrc) that you can add to a Qt Widget Project."));
|
m_wizard->setDescription(tr("Creates a Qt Resource file (.qrc) that you can add to a Qt Widget Project."));
|
||||||
wizardParameters.setDisplayName(tr("Qt Resource file"));
|
m_wizard->setDisplayName(tr("Qt Resource file"));
|
||||||
wizardParameters.setId(QLatin1String("F.Resource"));
|
m_wizard->setId(QLatin1String("F.Resource"));
|
||||||
wizardParameters.setCategory(QLatin1String(Core::Constants::WIZARD_CATEGORY_QT));
|
m_wizard->setCategory(QLatin1String(Core::Constants::WIZARD_CATEGORY_QT));
|
||||||
wizardParameters.setDisplayCategory(QCoreApplication::translate("Core", Core::Constants::WIZARD_TR_CATEGORY_QT));
|
m_wizard->setDisplayCategory(QCoreApplication::translate("Core", Core::Constants::WIZARD_TR_CATEGORY_QT));
|
||||||
|
|
||||||
m_wizard = new ResourceWizard(wizardParameters, this);
|
|
||||||
addObject(m_wizard);
|
addObject(m_wizard);
|
||||||
|
|
||||||
errorMessage->clear();
|
errorMessage->clear();
|
||||||
|
|||||||
@@ -34,8 +34,8 @@
|
|||||||
using namespace ResourceEditor;
|
using namespace ResourceEditor;
|
||||||
using namespace ResourceEditor::Internal;
|
using namespace ResourceEditor::Internal;
|
||||||
|
|
||||||
ResourceWizard::ResourceWizard(const BaseFileWizardParameters ¶meters, QObject *parent)
|
ResourceWizard::ResourceWizard(QObject *parent)
|
||||||
: Core::StandardFileWizard(parameters, parent)
|
: Core::StandardFileWizard(parent)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -40,8 +40,7 @@ class ResourceWizard : public Core::StandardFileWizard
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef Core::BaseFileWizardParameters BaseFileWizardParameters;
|
explicit ResourceWizard(QObject *parent);
|
||||||
explicit ResourceWizard(const BaseFileWizardParameters ¶meters, QObject *parent);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual Core::GeneratedFiles
|
virtual Core::GeneratedFiles
|
||||||
|
|||||||
@@ -42,25 +42,12 @@
|
|||||||
namespace Subversion {
|
namespace Subversion {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
CheckoutWizard::CheckoutWizard(QObject *parent) :
|
CheckoutWizard::CheckoutWizard()
|
||||||
VcsBase::BaseCheckoutWizard(parent)
|
|
||||||
{
|
{
|
||||||
setId(QLatin1String(VcsBase::Constants::VCS_ID_SUBVERSION));
|
setId(QLatin1String(VcsBase::Constants::VCS_ID_SUBVERSION));
|
||||||
}
|
setIcon(QIcon(QLatin1String(":/subversion/images/subversion.png")));
|
||||||
|
setDescription(tr("Checks out a Subversion repository and tries to load the contained project."));
|
||||||
QIcon CheckoutWizard::icon() const
|
setDisplayName(tr("Subversion Checkout"));
|
||||||
{
|
|
||||||
return QIcon(QLatin1String(":/subversion/images/subversion.png"));
|
|
||||||
}
|
|
||||||
|
|
||||||
QString CheckoutWizard::description() const
|
|
||||||
{
|
|
||||||
return tr("Checks out a Subversion repository and tries to load the contained project.");
|
|
||||||
}
|
|
||||||
|
|
||||||
QString CheckoutWizard::displayName() const
|
|
||||||
{
|
|
||||||
return tr("Subversion Checkout");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QWizardPage*> CheckoutWizard::createParameterPages(const QString &path)
|
QList<QWizardPage*> CheckoutWizard::createParameterPages(const QString &path)
|
||||||
|
|||||||
@@ -38,15 +38,11 @@ namespace Internal {
|
|||||||
class CheckoutWizard : public VcsBase::BaseCheckoutWizard
|
class CheckoutWizard : public VcsBase::BaseCheckoutWizard
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit CheckoutWizard(QObject *parent = 0);
|
CheckoutWizard();
|
||||||
|
|
||||||
// IWizard
|
private:
|
||||||
QIcon icon() const;
|
|
||||||
QString description() const;
|
|
||||||
QString displayName() const;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
// BaseCheckoutWizard
|
// BaseCheckoutWizard
|
||||||
QList<QWizardPage*> createParameterPages(const QString &path);
|
QList<QWizardPage*> createParameterPages(const QString &path);
|
||||||
VcsBase::Command *createCommand(const QList<QWizardPage*> ¶meterPage,
|
VcsBase::Command *createCommand(const QList<QWizardPage*> ¶meterPage,
|
||||||
|
|||||||
@@ -102,25 +102,18 @@ class ScratchFileWizard : public Core::IWizard
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual WizardKind kind() const { return FileWizard; }
|
ScratchFileWizard()
|
||||||
virtual QIcon icon() const { return QIcon(); }
|
{
|
||||||
virtual QString description() const
|
setWizardKind(FileWizard);
|
||||||
{ return TextEditorPlugin::tr("Creates a scratch buffer using a temporary file."); }
|
setDescription(TextEditorPlugin::tr("Creates a scratch buffer using a temporary file."));
|
||||||
virtual QString displayName() const
|
setDisplayName(TextEditorPlugin::tr("Scratch Buffer"));
|
||||||
{ return TextEditorPlugin::tr("Scratch Buffer"); }
|
setId(QLatin1String("Z.ScratchFile"));
|
||||||
virtual QString id() const
|
setCategory(QLatin1String(wizardCategoryC));
|
||||||
{ return QLatin1String("Z.ScratchFile"); }
|
setDisplayCategory(wizardDisplayCategory());
|
||||||
virtual QString category() const
|
setFlags(Core::IWizard::PlatformIndependent);
|
||||||
{ return QLatin1String(wizardCategoryC); }
|
}
|
||||||
virtual QString displayCategory() const
|
|
||||||
{ return wizardDisplayCategory(); }
|
void runWizard(const QString &, QWidget *, const QString &, const QVariantMap &)
|
||||||
virtual QString descriptionImage() const
|
|
||||||
{ return QString(); }
|
|
||||||
virtual Core::FeatureSet requiredFeatures() const
|
|
||||||
{ return Core::FeatureSet(); }
|
|
||||||
virtual WizardFlags flags() const
|
|
||||||
{ return Core::IWizard::PlatformIndependent; }
|
|
||||||
virtual void runWizard(const QString &, QWidget *, const QString &, const QVariantMap &)
|
|
||||||
{ createFile(); }
|
{ createFile(); }
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
@@ -148,16 +141,16 @@ bool TextEditorPlugin::initialize(const QStringList &arguments, QString *errorMe
|
|||||||
if (!Core::MimeDatabase::addMimeTypes(QLatin1String(":/texteditor/TextEditor.mimetypes.xml"), errorMessage))
|
if (!Core::MimeDatabase::addMimeTypes(QLatin1String(":/texteditor/TextEditor.mimetypes.xml"), errorMessage))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
Core::BaseFileWizardParameters wizardParameters(Core::IWizard::FileWizard);
|
|
||||||
wizardParameters.setDescription(tr("Creates a text file. The default file extension is <tt>.txt</tt>. "
|
|
||||||
"You can specify a different extension as part of the filename."));
|
|
||||||
wizardParameters.setDisplayName(tr("Text File"));
|
|
||||||
wizardParameters.setCategory(QLatin1String(wizardCategoryC));
|
|
||||||
wizardParameters.setDisplayCategory(wizardDisplayCategory());
|
|
||||||
wizardParameters.setFlags(Core::IWizard::PlatformIndependent);
|
|
||||||
TextFileWizard *wizard = new TextFileWizard(QLatin1String(Constants::C_TEXTEDITOR_MIMETYPE_TEXT),
|
TextFileWizard *wizard = new TextFileWizard(QLatin1String(Constants::C_TEXTEDITOR_MIMETYPE_TEXT),
|
||||||
QLatin1String("text$"),
|
QLatin1String("text$"));
|
||||||
wizardParameters);
|
wizard->setWizardKind(Core::IWizard::FileWizard);
|
||||||
|
wizard->setDescription(tr("Creates a text file. The default file extension is <tt>.txt</tt>. "
|
||||||
|
"You can specify a different extension as part of the filename."));
|
||||||
|
wizard->setDisplayName(tr("Text File"));
|
||||||
|
wizard->setCategory(QLatin1String(wizardCategoryC));
|
||||||
|
wizard->setDisplayCategory(wizardDisplayCategory());
|
||||||
|
wizard->setFlags(Core::IWizard::PlatformIndependent);
|
||||||
|
|
||||||
// Add text file wizard
|
// Add text file wizard
|
||||||
addAutoReleasedObject(wizard);
|
addAutoReleasedObject(wizard);
|
||||||
ScratchFileWizard *scratchFile = new ScratchFileWizard;
|
ScratchFileWizard *scratchFile = new ScratchFileWizard;
|
||||||
|
|||||||
@@ -28,15 +28,11 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "textfilewizard.h"
|
#include "textfilewizard.h"
|
||||||
#include <QDebug>
|
|
||||||
|
|
||||||
using namespace TextEditor;
|
namespace TextEditor {
|
||||||
|
|
||||||
TextFileWizard::TextFileWizard(const QString &mimeType,
|
TextFileWizard::TextFileWizard(const QString &mimeType,
|
||||||
const QString &suggestedFileName,
|
const QString &suggestedFileName) :
|
||||||
const BaseFileWizardParameters ¶meters,
|
|
||||||
QObject *parent) :
|
|
||||||
Core::StandardFileWizard(parameters, parent),
|
|
||||||
m_mimeType(mimeType),
|
m_mimeType(mimeType),
|
||||||
m_suggestedFileName(suggestedFileName)
|
m_suggestedFileName(suggestedFileName)
|
||||||
{
|
{
|
||||||
@@ -52,3 +48,5 @@ Core::GeneratedFiles
|
|||||||
file.setAttributes(Core::GeneratedFile::OpenEditorAttribute);
|
file.setAttributes(Core::GeneratedFile::OpenEditorAttribute);
|
||||||
return Core::GeneratedFiles() << file;
|
return Core::GeneratedFiles() << file;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace TextEditor
|
||||||
|
|||||||
@@ -41,11 +41,8 @@ class TEXTEDITOR_EXPORT TextFileWizard : public Core::StandardFileWizard
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef Core::BaseFileWizardParameters BaseFileWizardParameters;
|
|
||||||
TextFileWizard(const QString &mimeType,
|
TextFileWizard(const QString &mimeType,
|
||||||
const QString &suggestedFileName,
|
const QString &suggestedFileName);
|
||||||
const BaseFileWizardParameters ¶meters,
|
|
||||||
QObject *parent = 0);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual Core::GeneratedFiles
|
virtual Core::GeneratedFiles
|
||||||
|
|||||||
@@ -71,7 +71,6 @@ public:
|
|||||||
Internal::CheckoutWizardDialog *dialog;
|
Internal::CheckoutWizardDialog *dialog;
|
||||||
QList<QWizardPage *> parameterPages;
|
QList<QWizardPage *> parameterPages;
|
||||||
QString checkoutPath;
|
QString checkoutPath;
|
||||||
QString id;
|
|
||||||
QString progressTitle;
|
QString progressTitle;
|
||||||
QString startedStatus;
|
QString startedStatus;
|
||||||
};
|
};
|
||||||
@@ -89,6 +88,11 @@ BaseCheckoutWizard::BaseCheckoutWizard(QObject *parent) :
|
|||||||
Core::IWizard(parent),
|
Core::IWizard(parent),
|
||||||
d(new Internal::BaseCheckoutWizardPrivate)
|
d(new Internal::BaseCheckoutWizardPrivate)
|
||||||
{
|
{
|
||||||
|
setWizardKind(IWizard::ProjectWizard);
|
||||||
|
setCategory(QLatin1String(ProjectExplorer::Constants::IMPORT_WIZARD_CATEGORY));
|
||||||
|
setDisplayCategory(QCoreApplication::translate("ProjectExplorer",
|
||||||
|
ProjectExplorer::Constants::IMPORT_WIZARD_CATEGORY_DISPLAY));
|
||||||
|
setFlags(Core::IWizard::PlatformIndependent);
|
||||||
}
|
}
|
||||||
|
|
||||||
BaseCheckoutWizard::~BaseCheckoutWizard()
|
BaseCheckoutWizard::~BaseCheckoutWizard()
|
||||||
@@ -96,36 +100,6 @@ BaseCheckoutWizard::~BaseCheckoutWizard()
|
|||||||
delete d;
|
delete d;
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::IWizard::WizardKind BaseCheckoutWizard::kind() const
|
|
||||||
{
|
|
||||||
return Core::IWizard::ProjectWizard;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString BaseCheckoutWizard::category() const
|
|
||||||
{
|
|
||||||
return QLatin1String(ProjectExplorer::Constants::IMPORT_WIZARD_CATEGORY);
|
|
||||||
}
|
|
||||||
|
|
||||||
QString BaseCheckoutWizard::displayCategory() const
|
|
||||||
{
|
|
||||||
return QCoreApplication::translate("ProjectExplorer", ProjectExplorer::Constants::IMPORT_WIZARD_CATEGORY_DISPLAY);
|
|
||||||
}
|
|
||||||
|
|
||||||
QString BaseCheckoutWizard::id() const
|
|
||||||
{
|
|
||||||
return d->id;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString BaseCheckoutWizard::descriptionImage() const
|
|
||||||
{
|
|
||||||
return QString();
|
|
||||||
}
|
|
||||||
|
|
||||||
void BaseCheckoutWizard::setId(const QString &id)
|
|
||||||
{
|
|
||||||
d->id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
void BaseCheckoutWizard::runWizard(const QString &path, QWidget *parent, const QString & /*platform*/, const QVariantMap &extraValues)
|
void BaseCheckoutWizard::runWizard(const QString &path, QWidget *parent, const QString & /*platform*/, const QVariantMap &extraValues)
|
||||||
{
|
{
|
||||||
Q_UNUSED(extraValues)
|
Q_UNUSED(extraValues)
|
||||||
@@ -154,16 +128,6 @@ void BaseCheckoutWizard::runWizard(const QString &path, QWidget *parent, const Q
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::FeatureSet BaseCheckoutWizard::requiredFeatures() const
|
|
||||||
{
|
|
||||||
return Core::FeatureSet();
|
|
||||||
}
|
|
||||||
|
|
||||||
Core::IWizard::WizardFlags BaseCheckoutWizard::flags() const
|
|
||||||
{
|
|
||||||
return Core::IWizard::PlatformIndependent;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline QString msgNoProjectFiles(const QDir &dir, const QStringList &patterns)
|
static inline QString msgNoProjectFiles(const QDir &dir, const QStringList &patterns)
|
||||||
{
|
{
|
||||||
return BaseCheckoutWizard::tr("Could not find any project files matching (%1) in the directory '%2'.").arg(patterns.join(QLatin1String(", ")), QDir::toNativeSeparators(dir.absolutePath()));
|
return BaseCheckoutWizard::tr("Could not find any project files matching (%1) in the directory '%2'.").arg(patterns.join(QLatin1String(", ")), QDir::toNativeSeparators(dir.absolutePath()));
|
||||||
|
|||||||
@@ -53,21 +53,9 @@ class VCSBASE_EXPORT BaseCheckoutWizard : public Core::IWizard
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
explicit BaseCheckoutWizard(QObject *parent = 0);
|
explicit BaseCheckoutWizard(QObject *parent = 0);
|
||||||
virtual ~BaseCheckoutWizard();
|
~BaseCheckoutWizard();
|
||||||
|
|
||||||
virtual WizardKind kind() const;
|
void runWizard(const QString &path, QWidget *parent, const QString &platform, const QVariantMap &extraValues);
|
||||||
|
|
||||||
virtual QString category() const;
|
|
||||||
virtual QString displayCategory() const;
|
|
||||||
virtual QString id() const;
|
|
||||||
|
|
||||||
virtual QString descriptionImage() const;
|
|
||||||
|
|
||||||
virtual void runWizard(const QString &path, QWidget *parent, const QString &platform, const QVariantMap &extraValues);
|
|
||||||
|
|
||||||
virtual Core::FeatureSet requiredFeatures() const;
|
|
||||||
|
|
||||||
virtual WizardFlags flags() const;
|
|
||||||
|
|
||||||
static QString openProject(const QString &path, QString *errorMessage);
|
static QString openProject(const QString &path, QString *errorMessage);
|
||||||
|
|
||||||
@@ -77,9 +65,6 @@ protected:
|
|||||||
virtual Command *createCommand(const QList<QWizardPage *> ¶meterPages,
|
virtual Command *createCommand(const QList<QWizardPage *> ¶meterPages,
|
||||||
QString *checkoutPath) = 0;
|
QString *checkoutPath) = 0;
|
||||||
|
|
||||||
public slots:
|
|
||||||
void setId(const QString &id);
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void slotProgressPageShown();
|
void slotProgressPageShown();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user