diff options
author | Mateusz Loskot <mateusz@loskot.net> | 2015-05-06 00:16:58 +0200 |
---|---|---|
committer | Orgad Shaneh <orgads@gmail.com> | 2015-07-01 10:43:09 +0000 |
commit | 7389250fcd1ada74514f90e8670d7af087e6a7c7 (patch) | |
tree | 11cacc00d934db20de04737058ebda99b17828fb /src/plugins/boostbuildprojectmanager/b2openprojectwizard.h | |
parent | 188d4bfdb24c938a0c60042418852f2a8bcb2a73 (diff) |
Add Boost.Build Project Manager plug-in
Preparing to contribute the plug-in, see the announcement at
http://lists.qt-project.org/pipermail/qt-creator/2015-February/004436.html
Change-Id: Ic3920c9b888af5bea1b7742b8ff49984c29a2909
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
Diffstat (limited to 'src/plugins/boostbuildprojectmanager/b2openprojectwizard.h')
-rw-r--r-- | src/plugins/boostbuildprojectmanager/b2openprojectwizard.h | 127 |
1 files changed, 127 insertions, 0 deletions
diff --git a/src/plugins/boostbuildprojectmanager/b2openprojectwizard.h b/src/plugins/boostbuildprojectmanager/b2openprojectwizard.h new file mode 100644 index 00000000000..d7d6a93f63c --- /dev/null +++ b/src/plugins/boostbuildprojectmanager/b2openprojectwizard.h @@ -0,0 +1,127 @@ +// +// Copyright (C) 2013 Mateusz Ĺoskot <mateusz@loskot.net> +// Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +// +// This file is part of Qt Creator Boost.Build plugin project. +// +// This is free software; you can redistribute and/or modify it under +// the terms of the GNU Lesser General Public License, Version 2.1 +// as published by the Free Software Foundation. +// See accompanying file LICENSE.txt or copy at +// http://www.gnu.org/licenses/lgpl-2.1-standalone.html. +// +#ifndef BBOPENPROJECTWIZARD_HPP +#define BBOPENPROJECTWIZARD_HPP + +// Qt Creator +#include <coreplugin/basefilewizard.h> +#include <coreplugin/basefilewizardfactory.h> +#include <coreplugin/generatedfile.h> +#include <utils/wizard.h> +// Qt +#include <QString> +#include <QStringList> +QT_BEGIN_NAMESPACE +class QVBoxLayout; +class QLabel; +class QTreeView; +class QLineEdit; +QT_END_NAMESPACE + +namespace Utils { +class PathChooser; +} + +namespace BoostBuildProjectManager { +namespace Internal { + +class Project; +class PathsSelectionWizardPage; +class FilesSelectionWizardPage; + +////////////////////////////////////////////////////////////////////////////////////////// +// NOTE: The Boost.Build wizard is based on Core::BaseFileWizard which seems to be +// dedicated to build "New Project" wizards. So, the plugin uses the base class in +// unconventional, matching its features to Boost.Build wizard needs, like: +// - no parent QWidget is used +// - platform name is set from default Kit display name, usually it's "Desktop" +// - extra values QVariantMap may carry custom data +// CAUTION: This wizard may stop building or start failing in run-time, +// if Qt Creator changes the base class significantly. +class OpenProjectWizard : public Core::BaseFileWizardFactory +{ + Q_OBJECT + +public: + OpenProjectWizard(Project const* const project); + + bool run(QString const& platform, QVariantMap const& extraValues); + + QVariantMap outputValues() const { return outputValues_; } + +protected: + + Core::BaseFileWizard* + create(QWidget* parent, Core::WizardDialogParameters const& parameters) const; + + Core::GeneratedFiles + generateFiles(QWizard const* baseWizard, QString* errorMessage) const; + + bool + postGenerateFiles(QWizard const* wizard + , Core::GeneratedFiles const& files, QString* errorMessage); + +private: + Project const* const project_; + QVariantMap outputValues_; + bool projectOpened_; +}; + +////////////////////////////////////////////////////////////////////////////////////////// +class OpenProjectWizardDialog : public Core::BaseFileWizard +{ + Q_OBJECT + +public: + OpenProjectWizardDialog(QWidget* parent, QString const& projectFile + , QVariantMap const& extraValues, QVariantMap& outputValues); + + QString path() const; + QString projectFile() const; + QString projectName() const; + QString defaultProjectName() const; + + QStringList selectedFiles() const; + QStringList selectedPaths() const; + +public slots: + void setProjectName(QString const& name); + +private: + QVariantMap& outputValues_; + QVariantMap extraValues_; + QString projectFile_; + PathsSelectionWizardPage* pathsPage_; + FilesSelectionWizardPage* filesPage_; +}; + +////////////////////////////////////////////////////////////////////////////////////////// +class PathsSelectionWizardPage : public QWizardPage +{ + Q_OBJECT + +public: + explicit PathsSelectionWizardPage(OpenProjectWizardDialog* wizard); + + QString projectName() const; + void setProjectName(QString const& name); + +private: + OpenProjectWizardDialog* wizard_; + QLineEdit* nameLineEdit_; +}; + +} // namespace Internal +} // namespace BoostBuildProjectManager + +#endif // BBOPENPROJECTWIZARD_HPP |