forked from qt-creator/qt-creator
VCS[hg, git]: Add support for repository creation.
Add repository creation operation to IVersionControl, implement for hg and git, add convenience slot with prompts to VCSBasePlugin. Add respective menu options and make menus are visible in case no VCS is active. Change project wizards extension page to list VCS that are capable of repository creation in a QComboBox in case the directory is not managed by another VCS (in which case it lists that one for operation 'add'). On that occasion, polish the Project selection to use a QComboBox as well and add some smartness to find the most suitable project to add via path matching.
This commit is contained in:
@@ -41,9 +41,10 @@ class CORE_EXPORT IVersionControl : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum Operation { AddOperation, DeleteOperation, OpenOperation };
|
||||
enum Operation { AddOperation, DeleteOperation, OpenOperation,
|
||||
CreateRepositoryOperation };
|
||||
|
||||
IVersionControl(QObject *parent = 0) : QObject(parent) {}
|
||||
explicit IVersionControl(QObject *parent = 0) : QObject(parent) {}
|
||||
virtual ~IVersionControl() {}
|
||||
|
||||
virtual QString displayName() const = 0;
|
||||
@@ -93,12 +94,14 @@ public:
|
||||
/*!
|
||||
* Called after a file has been removed from the project (if the user
|
||||
* wants), e.g. 'p4 delete', 'svn delete'.
|
||||
*
|
||||
* You probably want to call VcsManager::showDeleteDialog, which asks the
|
||||
* user to confirm the deletion.
|
||||
*/
|
||||
virtual bool vcsDelete(const QString &filename) = 0;
|
||||
|
||||
/*!
|
||||
* Called to initialize the version control systemin a directory.
|
||||
*/
|
||||
virtual bool vcsCreateRepository(const QString &directory) = 0;
|
||||
|
||||
signals:
|
||||
void repositoryChanged(const QString &repository);
|
||||
void filesChanged(const QStringList &files);
|
||||
|
||||
Reference in New Issue
Block a user