2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2016-01-15 14:57:40 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2010-12-17 16:01:08 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2008-12-02 16:19:05 +01:00
|
|
|
|
2016-02-02 18:26:51 +01:00
|
|
|
#pragma once
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2014-07-14 15:56:21 +02:00
|
|
|
#include "projectnodes.h"
|
|
|
|
|
|
2014-07-11 14:42:23 +02:00
|
|
|
#include <coreplugin/generatedfile.h>
|
2014-07-14 15:56:21 +02:00
|
|
|
#include <coreplugin/iwizardfactory.h>
|
2014-07-11 14:42:23 +02:00
|
|
|
|
2014-09-18 15:20:06 +02:00
|
|
|
#include <utils/wizardpage.h>
|
2016-06-24 09:36:42 +02:00
|
|
|
#include <utils/treemodel.h>
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2014-05-13 13:06:30 +02:00
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
class QTreeView;
|
2014-05-14 07:34:36 +02:00
|
|
|
class QModelIndex;
|
2014-05-13 13:06:30 +02:00
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
2014-07-11 14:42:23 +02:00
|
|
|
namespace Core { class IVersionControl; }
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
namespace ProjectExplorer {
|
|
|
|
|
namespace Internal {
|
2015-01-07 23:59:29 +01:00
|
|
|
|
2014-05-13 13:06:30 +02:00
|
|
|
class AddNewTree;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2014-02-11 21:55:42 +02:00
|
|
|
namespace Ui { class WizardPage; }
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2011-04-14 12:58:14 +02:00
|
|
|
// Documentation inside.
|
2014-09-18 15:20:06 +02:00
|
|
|
class ProjectWizardPage : public Utils::WizardPage
|
2011-07-13 18:02:35 +02:00
|
|
|
{
|
2008-12-02 12:01:29 +01:00
|
|
|
Q_OBJECT
|
2011-07-13 18:02:35 +02:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
public:
|
2016-04-13 15:52:14 +02:00
|
|
|
explicit ProjectWizardPage(QWidget *parent = nullptr);
|
2016-02-02 18:26:51 +01:00
|
|
|
~ProjectWizardPage() override;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2014-05-13 13:06:30 +02:00
|
|
|
FolderNode *currentNode() const;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2010-08-24 17:17:11 +02:00
|
|
|
void setNoneLabel(const QString &label);
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2010-01-12 16:45:21 +01:00
|
|
|
int versionControlIndex() const;
|
|
|
|
|
void setVersionControlIndex(int);
|
2014-11-10 13:54:01 +01:00
|
|
|
Core::IVersionControl *currentVersionControl();
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2010-01-12 16:45:21 +01:00
|
|
|
// Returns the common path
|
2014-07-11 14:42:23 +02:00
|
|
|
void setFiles(const QStringList &files);
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2014-07-11 14:42:23 +02:00
|
|
|
bool runVersionControl(const QList<Core::GeneratedFile> &files, QString *errorMessage);
|
|
|
|
|
|
2014-10-13 22:37:28 +03:00
|
|
|
void initializeProjectTree(Node *context, const QStringList &paths,
|
2014-07-14 15:56:21 +02:00
|
|
|
Core::IWizardFactory::WizardKind kind,
|
2014-10-13 22:37:28 +03:00
|
|
|
ProjectAction action);
|
2014-07-14 15:56:21 +02:00
|
|
|
|
2016-06-01 23:03:46 +03:00
|
|
|
void initializeVersionControls();
|
|
|
|
|
void setProjectUiVisible(bool visible);
|
|
|
|
|
|
2014-09-29 16:06:24 +02:00
|
|
|
signals:
|
|
|
|
|
void projectNodeChanged();
|
2014-11-10 13:54:01 +01:00
|
|
|
void versionControlChanged(int);
|
2014-09-29 16:06:24 +02:00
|
|
|
|
2016-01-29 16:38:37 +02:00
|
|
|
private:
|
2014-11-10 13:54:01 +01:00
|
|
|
void projectChanged(int);
|
|
|
|
|
void manageVcs();
|
2015-06-30 14:14:16 +02:00
|
|
|
void hideVersionControlUiElements();
|
2010-03-15 15:37:08 +01:00
|
|
|
|
2014-07-14 15:56:21 +02:00
|
|
|
void setAdditionalInfo(const QString &text);
|
|
|
|
|
void setAddingSubProject(bool addingSubProject);
|
|
|
|
|
void setBestNode(ProjectExplorer::Internal::AddNewTree *tree);
|
2014-07-11 14:42:23 +02:00
|
|
|
void setVersionControls(const QStringList &);
|
2013-05-25 01:47:26 +02:00
|
|
|
void setProjectToolTip(const QString &);
|
2014-05-13 13:06:30 +02:00
|
|
|
bool expandTree(const QModelIndex &root);
|
2010-03-15 15:37:08 +01:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
Ui::WizardPage *m_ui;
|
2010-03-15 15:37:08 +01:00
|
|
|
QStringList m_projectToolTips;
|
2017-03-17 12:26:00 +01:00
|
|
|
Utils::TreeModel<> m_model;
|
2014-07-11 14:42:23 +02:00
|
|
|
|
|
|
|
|
QList<Core::IVersionControl*> m_activeVersionControls;
|
|
|
|
|
QString m_commonDirectory;
|
2016-04-13 15:52:14 +02:00
|
|
|
bool m_repositoryExists = false;
|
2008-12-02 12:01:29 +01:00
|
|
|
};
|
|
|
|
|
|
2008-12-02 16:19:05 +01:00
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace ProjectExplorer
|