ProjectWizardPage: Refactor code a little

Move functionality from the projectfilewizardextension into the
projectwizardpage itself and reduce the size of the context shared
between the extension and the page to a bare minimum.

Change-Id: I785fc103ea7d12e1da4bfdaf1d4664ed83a9989b
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
Tobias Hunger
2014-07-11 14:42:23 +02:00
parent 57a09d8cec
commit dd0032c83d
4 changed files with 121 additions and 112 deletions

View File

@@ -30,6 +30,8 @@
#ifndef PROJECTWIZARDPAGE_H
#define PROJECTWIZARDPAGE_H
#include <coreplugin/generatedfile.h>
#include <QWizardPage>
QT_BEGIN_NAMESPACE
@@ -37,6 +39,8 @@ class QTreeView;
class QModelIndex;
QT_END_NAMESPACE
namespace Core { class IVersionControl; }
namespace ProjectExplorer {
class FolderNode;
namespace Internal {
@@ -61,27 +65,36 @@ public:
void setNoneLabel(const QString &label);
void setAdditionalInfo(const QString &text);
void setVersionControls(const QStringList &);
int versionControlIndex() const;
void setVersionControlIndex(int);
// Returns the common path
void setFilesDisplay(const QString &commonPath, const QStringList &files);
void setFiles(const QStringList &files);
void setAddingSubProject(bool addingSubProject);
bool runVersionControl(const QList<Core::GeneratedFile> &files, QString *errorMessage);
public slots:
void initializeVersionControls();
private slots:
void slotProjectChanged(int);
void slotManageVcs();
private:
void setVersionControls(const QStringList &);
void setProjectToolTip(const QString &);
bool expandTree(const QModelIndex &root);
Ui::WizardPage *m_ui;
QStringList m_projectToolTips;
AddNewModel *m_model;
QList<Core::IVersionControl*> m_activeVersionControls;
QString m_commonDirectory;
bool m_repositoryExists;
};
} // namespace Internal