forked from qt-creator/qt-creator
IWizard and derived classes: Code cleanups
There should be no functional changes, just removal of unnecessary code. This includes: * Removal of unused QObject *parent = 0 parameters to constructors * Removal of unnecessary explicits * Removal of unnecessary virtuals * Removal of unnecessary constructors/destructors Some explicits were added though where those were missing. Change-Id: Iab570349ea950dad0a2d01af17bc6175f70832f1 Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
@@ -175,17 +175,6 @@ void WizardEventLoop::rejected()
|
|||||||
\sa Core::Internal::WizardEventLoop
|
\sa Core::Internal::WizardEventLoop
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
BaseFileWizard::BaseFileWizard(QObject *parent) :
|
|
||||||
IWizard(parent)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
BaseFileWizard::~BaseFileWizard()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
BaseFileWizard::ExtensionList BaseFileWizard::selectExtensions()
|
BaseFileWizard::ExtensionList BaseFileWizard::selectExtensions()
|
||||||
{
|
{
|
||||||
return ExtensionSystem::PluginManager::getObjects<IFileWizardExtension>();
|
return ExtensionSystem::PluginManager::getObjects<IFileWizardExtension>();
|
||||||
@@ -532,11 +521,6 @@ QString BaseFileWizard::preferredSuffix(const QString &mimeType)
|
|||||||
Creates the files with the \a name under the \a path.
|
Creates the files with the \a name under the \a path.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
StandardFileWizard::StandardFileWizard(QObject *parent) :
|
|
||||||
BaseFileWizard(parent)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Creates a Utils::FileWizardDialog.
|
Creates a Utils::FileWizardDialog.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -108,10 +108,8 @@ class CORE_EXPORT BaseFileWizard : public IWizard
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual ~BaseFileWizard();
|
|
||||||
|
|
||||||
// IWizard
|
// IWizard
|
||||||
virtual void runWizard(const QString &path, QWidget *parent, const QString &platform, const QVariantMap &extraValues);
|
void runWizard(const QString &path, QWidget *parent, const QString &platform, const QVariantMap &extraValues);
|
||||||
|
|
||||||
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 applyExtensionPageShortTitle(Utils::Wizard *wizard, int pageId);
|
static void applyExtensionPageShortTitle(Utils::Wizard *wizard, int pageId);
|
||||||
@@ -120,8 +118,6 @@ protected:
|
|||||||
typedef QList<QWizardPage *> WizardPageList;
|
typedef QList<QWizardPage *> WizardPageList;
|
||||||
typedef QList<Core::IFileWizardExtension*> ExtensionList;
|
typedef QList<Core::IFileWizardExtension*> ExtensionList;
|
||||||
|
|
||||||
explicit BaseFileWizard(QObject *parent = 0);
|
|
||||||
|
|
||||||
virtual ExtensionList selectExtensions();
|
virtual ExtensionList selectExtensions();
|
||||||
|
|
||||||
virtual QWizard *createWizardDialog(QWidget *parent,
|
virtual QWizard *createWizardDialog(QWidget *parent,
|
||||||
@@ -147,9 +143,8 @@ class CORE_EXPORT StandardFileWizard : public BaseFileWizard
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
explicit StandardFileWizard(QObject *parent = 0);
|
QWizard *createWizardDialog(QWidget *parent, const WizardDialogParameters &wizardDialogParameters) const;
|
||||||
virtual QWizard *createWizardDialog(QWidget *parent, const WizardDialogParameters &wizardDialogParameters) const;
|
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;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -74,8 +74,7 @@ public:
|
|||||||
QString descriptionImage;
|
QString descriptionImage;
|
||||||
};
|
};
|
||||||
|
|
||||||
IWizard(QObject *parent = 0) : QObject(parent) {}
|
IWizard() { }
|
||||||
~IWizard() {}
|
|
||||||
|
|
||||||
QString id() const { return m_data.id; }
|
QString id() const { return m_data.id; }
|
||||||
WizardKind kind() const { return m_data.kind; }
|
WizardKind kind() const { return m_data.kind; }
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ class CppFileWizard : public Core::StandardFileWizard
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CppFileWizard(FileType type);
|
explicit CppFileWizard(FileType type);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString fileContents(FileType type, const QString &baseName) const;
|
QString fileContents(FileType type, const QString &baseName) const;
|
||||||
|
|||||||
@@ -52,8 +52,7 @@ private:
|
|||||||
QWizard *createWizardDialog(QWidget *parent,
|
QWizard *createWizardDialog(QWidget *parent,
|
||||||
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
||||||
|
|
||||||
Core::GeneratedFiles generateFiles(const QWizard *w,
|
Core::GeneratedFiles generateFiles(const QWizard *w, QString *errorMessage) const;
|
||||||
QString *errorMessage) const;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -46,8 +46,7 @@ private:
|
|||||||
QWizard *createWizardDialog(QWidget *parent,
|
QWizard *createWizardDialog(QWidget *parent,
|
||||||
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
||||||
|
|
||||||
Core::GeneratedFiles generateFiles(const QWizard *w,
|
Core::GeneratedFiles generateFiles(const QWizard *w, QString *errorMessage) const;
|
||||||
QString *errorMessage) const;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -78,14 +78,14 @@ public:
|
|||||||
typedef QSharedPointer<ICustomWizardFactory> ICustomWizardFactoryPtr;
|
typedef QSharedPointer<ICustomWizardFactory> ICustomWizardFactoryPtr;
|
||||||
|
|
||||||
CustomWizard();
|
CustomWizard();
|
||||||
virtual ~CustomWizard();
|
~CustomWizard();
|
||||||
|
|
||||||
// Can be reimplemented to create custom wizards. initWizardDialog() needs to be
|
// Can be reimplemented to create custom wizards. initWizardDialog() needs to be
|
||||||
// called.
|
// called.
|
||||||
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, QString *errorMessage) const;
|
Core::GeneratedFiles generateFiles(const QWizard *w, QString *errorMessage) 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);
|
||||||
@@ -110,7 +110,7 @@ protected:
|
|||||||
Core::GeneratedFiles generateWizardFiles(QString *errorMessage) const;
|
Core::GeneratedFiles generateWizardFiles(QString *errorMessage) const;
|
||||||
// Create replacement map as static base fields + QWizard fields
|
// Create replacement map as static base fields + QWizard fields
|
||||||
FieldReplacementMap replacementMap(const QWizard *w) const;
|
FieldReplacementMap replacementMap(const QWizard *w) const;
|
||||||
virtual bool writeFiles(const Core::GeneratedFiles &files, QString *errorMessage);
|
bool writeFiles(const Core::GeneratedFiles &files, QString *errorMessage);
|
||||||
|
|
||||||
CustomWizardParametersPtr parameters() const;
|
CustomWizardParametersPtr parameters() const;
|
||||||
CustomWizardContextPtr context() const;
|
CustomWizardContextPtr context() const;
|
||||||
@@ -144,7 +144,7 @@ signals:
|
|||||||
void projectLocationChanged(const QString &path);
|
void projectLocationChanged(const QString &path);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool postGenerateFiles(const QWizard *w, const Core::GeneratedFiles &l, QString *errorMessage);
|
bool postGenerateFiles(const QWizard *w, const Core::GeneratedFiles &l, QString *errorMessage);
|
||||||
|
|
||||||
void initProjectWizardDialog(BaseProjectWizardDialog *w, const QString &defaultPath,
|
void initProjectWizardDialog(BaseProjectWizardDialog *w, const QString &defaultPath,
|
||||||
const WizardPageList &extensionPages) const;
|
const WizardPageList &extensionPages) const;
|
||||||
|
|||||||
@@ -55,10 +55,6 @@ FileWizard::FileWizard()
|
|||||||
setDescription(FileWizard::tr(Constants::EN_PY_SOURCE_DESCRIPTION));
|
setDescription(FileWizard::tr(Constants::EN_PY_SOURCE_DESCRIPTION));
|
||||||
}
|
}
|
||||||
|
|
||||||
FileWizard::~FileWizard()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief FileWizard::createWizardDialog
|
* @brief FileWizard::createWizardDialog
|
||||||
* @param parent
|
* @param parent
|
||||||
|
|||||||
@@ -40,14 +40,12 @@ class FileWizard : public Core::BaseFileWizard
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
FileWizard();
|
FileWizard();
|
||||||
~FileWizard();
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QWizard *createWizardDialog(QWidget *parent,
|
QWizard *createWizardDialog(QWidget *parent,
|
||||||
const Core::WizardDialogParameters ¶ms) const;
|
const Core::WizardDialogParameters ¶ms) const;
|
||||||
|
|
||||||
Core::GeneratedFiles generateFiles( const QWizard *dialog,
|
Core::GeneratedFiles generateFiles( const QWizard *dialog, QString *errorMessage) const;
|
||||||
QString *errorMessage) const;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace PythonEditor
|
} // namespace PythonEditor
|
||||||
|
|||||||
@@ -97,11 +97,6 @@ int AbstractMobileAppWizardDialog::addPageWithTitle(QWizardPage *page, const QSt
|
|||||||
return pageId;
|
return pageId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
AbstractMobileAppWizard::AbstractMobileAppWizard(QObject *parent)
|
|
||||||
: Core::BaseFileWizard(parent)
|
|
||||||
{ }
|
|
||||||
|
|
||||||
QWizard *AbstractMobileAppWizard::createWizardDialog(QWidget *parent,
|
QWizard *AbstractMobileAppWizard::createWizardDialog(QWidget *parent,
|
||||||
const Core::WizardDialogParameters &wizardDialogParameters) const
|
const Core::WizardDialogParameters &wizardDialogParameters) const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -72,8 +72,6 @@ private:
|
|||||||
class QMAKEPROJECTMANAGER_EXPORT AbstractMobileAppWizard : public Core::BaseFileWizard
|
class QMAKEPROJECTMANAGER_EXPORT AbstractMobileAppWizard : public Core::BaseFileWizard
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
protected:
|
|
||||||
explicit AbstractMobileAppWizard(QObject *parent = 0);
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void useProjectPath(const QString &projectName, const QString &projectPath);
|
void useProjectPath(const QString &projectName, const QString &projectPath);
|
||||||
@@ -82,20 +80,17 @@ protected:
|
|||||||
virtual QString fileToOpenPostGeneration() const = 0;
|
virtual QString fileToOpenPostGeneration() const = 0;
|
||||||
|
|
||||||
private:
|
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 *wizard,
|
Core::GeneratedFiles generateFiles(const QWizard *wizard, QString *errorMessage) const;
|
||||||
QString *errorMessage) const;
|
bool postGenerateFiles(const QWizard *w, const Core::GeneratedFiles &l, QString *errorMessage);
|
||||||
virtual bool postGenerateFiles(const QWizard *w,
|
|
||||||
const Core::GeneratedFiles &l, QString *errorMessage);
|
|
||||||
|
|
||||||
virtual AbstractMobileApp *app() const = 0;
|
virtual AbstractMobileApp *app() const = 0;
|
||||||
virtual AbstractMobileAppWizardDialog *wizardDialog() const = 0;
|
virtual AbstractMobileAppWizardDialog *wizardDialog() const = 0;
|
||||||
virtual AbstractMobileAppWizardDialog *createWizardDialogInternal(QWidget *parent,
|
virtual AbstractMobileAppWizardDialog *createWizardDialogInternal(QWidget *parent,
|
||||||
const Core::WizardDialogParameters &wizardDialogParameters) const = 0;
|
const Core::WizardDialogParameters &wizardDialogParameters) const = 0;
|
||||||
virtual void projectPathChanged(const QString &path) const = 0;
|
virtual void projectPathChanged(const QString &path) const = 0;
|
||||||
virtual void prepareGenerateFiles(const QWizard *wizard,
|
virtual void prepareGenerateFiles(const QWizard *wizard, QString *errorMessage) const = 0;
|
||||||
QString *errorMessage) const = 0;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace QmakeProjectManager
|
} // namespace QmakeProjectManager
|
||||||
|
|||||||
@@ -48,8 +48,7 @@ protected:
|
|||||||
QWizard *createWizardDialog(QWidget *parent,
|
QWizard *createWizardDialog(QWidget *parent,
|
||||||
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
||||||
|
|
||||||
Core::GeneratedFiles generateFiles(const QWizard *w,
|
Core::GeneratedFiles generateFiles(const QWizard *w, QString *errorMessage) const;
|
||||||
QString *errorMessage) const;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -54,7 +54,6 @@ private:
|
|||||||
static bool parametrizeTemplate(const QString &templatePath, const QString &templateName,
|
static bool parametrizeTemplate(const QString &templatePath, const QString &templateName,
|
||||||
const GuiAppParameters ¶ms,
|
const GuiAppParameters ¶ms,
|
||||||
QString *target, QString *errorMessage);
|
QString *target, QString *errorMessage);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -47,13 +47,12 @@ protected:
|
|||||||
QString fileToOpenPostGeneration() const;
|
QString fileToOpenPostGeneration() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual AbstractMobileApp *app() const;
|
AbstractMobileApp *app() const;
|
||||||
virtual AbstractMobileAppWizardDialog *wizardDialog() const;
|
AbstractMobileAppWizardDialog *wizardDialog() const;
|
||||||
virtual AbstractMobileAppWizardDialog *createWizardDialogInternal(QWidget *parent,
|
AbstractMobileAppWizardDialog *createWizardDialogInternal(QWidget *parent,
|
||||||
const Core::WizardDialogParameters ¶meters) const;
|
const Core::WizardDialogParameters ¶meters) const;
|
||||||
virtual void projectPathChanged(const QString &path) const;
|
void projectPathChanged(const QString &path) const;
|
||||||
virtual void prepareGenerateFiles(const QWizard *wizard,
|
void prepareGenerateFiles(const QWizard *wizard, QString *errorMessage) const;
|
||||||
QString *errorMessage) const;
|
|
||||||
|
|
||||||
class Html5AppWizardPrivate *d;
|
class Html5AppWizardPrivate *d;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -47,13 +47,12 @@ protected:
|
|||||||
QString fileToOpenPostGeneration() const;
|
QString fileToOpenPostGeneration() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual AbstractMobileApp *app() const;
|
AbstractMobileApp *app() const;
|
||||||
virtual AbstractMobileAppWizardDialog *wizardDialog() const;
|
AbstractMobileAppWizardDialog *wizardDialog() const;
|
||||||
virtual AbstractMobileAppWizardDialog *createWizardDialogInternal(QWidget *parent,
|
AbstractMobileAppWizardDialog *createWizardDialogInternal(QWidget *parent,
|
||||||
const Core::WizardDialogParameters &baseParameters) const;
|
const Core::WizardDialogParameters &baseParameters) const;
|
||||||
virtual void projectPathChanged(const QString &path) const;
|
void projectPathChanged(const QString &path) const;
|
||||||
virtual void prepareGenerateFiles(const QWizard *wizard,
|
void prepareGenerateFiles(const QWizard *wizard, QString *errorMessage) const;
|
||||||
QString *errorMessage) const;
|
|
||||||
|
|
||||||
class QtQuickAppWizardPrivate *d;
|
class QtQuickAppWizardPrivate *d;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -95,8 +95,8 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
QWizard *createWizardDialog(QWidget *parent,
|
QWizard *createWizardDialog(QWidget *parent,
|
||||||
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
const Core::WizardDialogParameters &wizardDialogParameters) const;
|
||||||
virtual bool postGenerateFiles(const QWizard *, const Core::GeneratedFiles &l, QString *errorMessage);
|
bool postGenerateFiles(const QWizard *, const Core::GeneratedFiles &l, QString *errorMessage);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum { targetPageId = 1 };
|
enum { targetPageId = 1 };
|
||||||
@@ -120,7 +120,7 @@ protected:
|
|||||||
public:
|
public:
|
||||||
explicit BaseQmakeProjectWizardDialog(bool showModulesPage, QWidget *parent,
|
explicit BaseQmakeProjectWizardDialog(bool showModulesPage, QWidget *parent,
|
||||||
const Core::WizardDialogParameters ¶meters);
|
const Core::WizardDialogParameters ¶meters);
|
||||||
virtual ~BaseQmakeProjectWizardDialog();
|
~BaseQmakeProjectWizardDialog();
|
||||||
|
|
||||||
int addModulesPage(int id = -1);
|
int addModulesPage(int id = -1);
|
||||||
int addTargetSetupPage(int id = -1);
|
int addTargetSetupPage(int id = -1);
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ class QmlApplicationWizard : public Core::BaseFileWizard
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit QmlApplicationWizard();
|
QmlApplicationWizard();
|
||||||
|
|
||||||
static void createInstances(ExtensionSystem::IPlugin *plugin);
|
static void createInstances(ExtensionSystem::IPlugin *plugin);
|
||||||
|
|
||||||
|
|||||||
@@ -111,8 +111,7 @@ void CascadesImportWizardDialog::onSrcProjectPathChanged(const QString &path)
|
|||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
static const char IMPORT_LOG_FILE_NAME[] = "import.log";
|
static const char IMPORT_LOG_FILE_NAME[] = "import.log";
|
||||||
|
|
||||||
CascadesImportWizard::CascadesImportWizard(QObject *parent)
|
CascadesImportWizard::CascadesImportWizard()
|
||||||
: Core::BaseFileWizard(parent)
|
|
||||||
{
|
{
|
||||||
setWizardKind(ProjectWizard);
|
setWizardKind(ProjectWizard);
|
||||||
setIcon(QPixmap(QLatin1String(Qnx::Constants::QNX_BB_CATEGORY_ICON)));
|
setIcon(QPixmap(QLatin1String(Qnx::Constants::QNX_BB_CATEGORY_ICON)));
|
||||||
@@ -125,10 +124,6 @@ CascadesImportWizard::CascadesImportWizard(QObject *parent)
|
|||||||
setDisplayCategory(QLatin1String(ProjectExplorer::Constants::IMPORT_WIZARD_CATEGORY_DISPLAY));
|
setDisplayCategory(QLatin1String(ProjectExplorer::Constants::IMPORT_WIZARD_CATEGORY_DISPLAY));
|
||||||
}
|
}
|
||||||
|
|
||||||
CascadesImportWizard::~CascadesImportWizard()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
Core::BaseFileWizard::ExtensionList CascadesImportWizard::selectExtensions()
|
Core::BaseFileWizard::ExtensionList CascadesImportWizard::selectExtensions()
|
||||||
{
|
{
|
||||||
return Core::BaseFileWizard::ExtensionList();
|
return Core::BaseFileWizard::ExtensionList();
|
||||||
|
|||||||
@@ -63,8 +63,7 @@ class CascadesImportWizard : public Core::BaseFileWizard
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
CascadesImportWizard(QObject *parent = 0);
|
CascadesImportWizard();
|
||||||
virtual ~CascadesImportWizard();
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
ExtensionList selectExtensions();
|
ExtensionList selectExtensions();
|
||||||
|
|||||||
@@ -51,36 +51,28 @@
|
|||||||
using namespace ResourceEditor::Internal;
|
using namespace ResourceEditor::Internal;
|
||||||
|
|
||||||
ResourceEditorPlugin::ResourceEditorPlugin() :
|
ResourceEditorPlugin::ResourceEditorPlugin() :
|
||||||
m_wizard(0),
|
|
||||||
m_editor(0),
|
|
||||||
m_redoAction(0),
|
m_redoAction(0),
|
||||||
m_undoAction(0)
|
m_undoAction(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
ResourceEditorPlugin::~ResourceEditorPlugin()
|
|
||||||
{
|
|
||||||
removeObject(m_editor);
|
|
||||||
removeObject(m_wizard);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ResourceEditorPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
bool ResourceEditorPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||||
{
|
{
|
||||||
Q_UNUSED(arguments)
|
Q_UNUSED(arguments)
|
||||||
if (!Core::MimeDatabase::addMimeTypes(QLatin1String(":/resourceeditor/ResourceEditor.mimetypes.xml"), errorMessage))
|
if (!Core::MimeDatabase::addMimeTypes(QLatin1String(":/resourceeditor/ResourceEditor.mimetypes.xml"), errorMessage))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
m_editor = new ResourceEditorFactory(this);
|
ResourceEditorFactory *editor = new ResourceEditorFactory(this);
|
||||||
addObject(m_editor);
|
addAutoReleasedObject(editor);
|
||||||
|
|
||||||
m_wizard = new ResourceWizard(this);
|
ResourceWizard *wizard = new ResourceWizard;
|
||||||
m_wizard->setDescription(tr("Creates a Qt Resource file (.qrc) that you can add to a Qt Widget Project."));
|
wizard->setDescription(tr("Creates a Qt Resource file (.qrc) that you can add to a Qt Widget Project."));
|
||||||
m_wizard->setDisplayName(tr("Qt Resource file"));
|
wizard->setDisplayName(tr("Qt Resource file"));
|
||||||
m_wizard->setId(QLatin1String("F.Resource"));
|
wizard->setId(QLatin1String("F.Resource"));
|
||||||
m_wizard->setCategory(QLatin1String(Core::Constants::WIZARD_CATEGORY_QT));
|
wizard->setCategory(QLatin1String(Core::Constants::WIZARD_CATEGORY_QT));
|
||||||
m_wizard->setDisplayCategory(QCoreApplication::translate("Core", Core::Constants::WIZARD_TR_CATEGORY_QT));
|
wizard->setDisplayCategory(QCoreApplication::translate("Core", Core::Constants::WIZARD_TR_CATEGORY_QT));
|
||||||
|
|
||||||
addObject(m_wizard);
|
addAutoReleasedObject(wizard);
|
||||||
|
|
||||||
errorMessage->clear();
|
errorMessage->clear();
|
||||||
|
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ class ResourceEditorPlugin : public ExtensionSystem::IPlugin
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
ResourceEditorPlugin();
|
ResourceEditorPlugin();
|
||||||
virtual ~ResourceEditorPlugin();
|
|
||||||
|
|
||||||
// IPlugin
|
// IPlugin
|
||||||
bool initialize(const QStringList &arguments, QString *errorMessage = 0);
|
bool initialize(const QStringList &arguments, QString *errorMessage = 0);
|
||||||
@@ -68,8 +67,6 @@ private:
|
|||||||
ResourceEditorW * currentEditor() const;
|
ResourceEditorW * currentEditor() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ResourceWizard *m_wizard;
|
|
||||||
ResourceEditorFactory *m_editor;
|
|
||||||
QAction *m_redoAction;
|
QAction *m_redoAction;
|
||||||
QAction *m_undoAction;
|
QAction *m_undoAction;
|
||||||
QAction *m_refreshAction;
|
QAction *m_refreshAction;
|
||||||
|
|||||||
@@ -34,11 +34,6 @@
|
|||||||
using namespace ResourceEditor;
|
using namespace ResourceEditor;
|
||||||
using namespace ResourceEditor::Internal;
|
using namespace ResourceEditor::Internal;
|
||||||
|
|
||||||
ResourceWizard::ResourceWizard(QObject *parent)
|
|
||||||
: Core::StandardFileWizard(parent)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
Core::GeneratedFiles
|
Core::GeneratedFiles
|
||||||
ResourceWizard::generateFilesFromPath(const QString &path,
|
ResourceWizard::generateFilesFromPath(const QString &path,
|
||||||
const QString &name,
|
const QString &name,
|
||||||
|
|||||||
@@ -39,13 +39,9 @@ class ResourceWizard : public Core::StandardFileWizard
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
|
||||||
explicit ResourceWizard(QObject *parent);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual Core::GeneratedFiles
|
Core::GeneratedFiles generateFilesFromPath(const QString &path, const QString &name,
|
||||||
generateFilesFromPath(const QString &path, const QString &name,
|
QString *errorMessage) const;
|
||||||
QString *errorMessage) const;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -45,9 +45,8 @@ public:
|
|||||||
const QString &suggestedFileName);
|
const QString &suggestedFileName);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual Core::GeneratedFiles
|
Core::GeneratedFiles generateFilesFromPath(const QString &path, const QString &name,
|
||||||
generateFilesFromPath(const QString &path, const QString &name,
|
QString *errorMessage) const;
|
||||||
QString *errorMessage) const;
|
|
||||||
private:
|
private:
|
||||||
const QString m_mimeType;
|
const QString m_mimeType;
|
||||||
const QString m_suggestedFileName;
|
const QString m_suggestedFileName;
|
||||||
|
|||||||
@@ -84,8 +84,7 @@ void BaseCheckoutWizardPrivate::clear()
|
|||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|
||||||
BaseCheckoutWizard::BaseCheckoutWizard(QObject *parent) :
|
BaseCheckoutWizard::BaseCheckoutWizard() :
|
||||||
Core::IWizard(parent),
|
|
||||||
d(new Internal::BaseCheckoutWizardPrivate)
|
d(new Internal::BaseCheckoutWizardPrivate)
|
||||||
{
|
{
|
||||||
setWizardKind(IWizard::ProjectWizard);
|
setWizardKind(IWizard::ProjectWizard);
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ class VCSBASE_EXPORT BaseCheckoutWizard : public Core::IWizard
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit BaseCheckoutWizard(QObject *parent = 0);
|
BaseCheckoutWizard();
|
||||||
~BaseCheckoutWizard();
|
~BaseCheckoutWizard();
|
||||||
|
|
||||||
void runWizard(const QString &path, QWidget *parent, const QString &platform, const QVariantMap &extraValues);
|
void runWizard(const QString &path, QWidget *parent, const QString &platform, const QVariantMap &extraValues);
|
||||||
|
|||||||
Reference in New Issue
Block a user