summaryrefslogtreecommitdiff
path: root/src/plugins/vcsbase/vcsbaseplugin.h
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@digia.com>2013-04-18 12:06:43 +0200
committerEike Ziller <eike.ziller@digia.com>2013-04-19 16:21:06 +0200
commite31575a493c70116c46eb09fd9d469a70ddd2298 (patch)
tree5c1a0032ba5ce11950dd30bea76026bdd0525cbe /src/plugins/vcsbase/vcsbaseplugin.h
parentd4f763edc696e9c6413f2f68b0fc9f7091dfe7de (diff)
downloadqt-creator-e31575a493c70116c46eb09fd9d469a70ddd2298.tar.gz
VCS: Clean up submit editor handling
It was not possible to simultaneously open two commit editors for different version control systems, also there was no reason to scan all open editors for the submit editor, since the plugins can just remember the editor that they opened. Change-Id: I1bea6ece3cd6faa1ecc0566bdd6f5fb10c816963 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/plugins/vcsbase/vcsbaseplugin.h')
-rw-r--r--src/plugins/vcsbase/vcsbaseplugin.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/plugins/vcsbase/vcsbaseplugin.h b/src/plugins/vcsbase/vcsbaseplugin.h
index ae018d9933..630f1d907a 100644
--- a/src/plugins/vcsbase/vcsbaseplugin.h
+++ b/src/plugins/vcsbase/vcsbaseplugin.h
@@ -127,7 +127,7 @@ class VCSBASE_EXPORT VcsBasePlugin : public ExtensionSystem::IPlugin
Q_OBJECT
protected:
- explicit VcsBasePlugin(const Core::Id submitEditorId);
+ explicit VcsBasePlugin();
void initializeVcs(Core::IVersionControl *vc);
virtual void extensionsInitialized();
@@ -207,10 +207,20 @@ public slots:
protected:
enum ActionState { NoVcsEnabled, OtherVcsEnabled, VcsEnabled };
+ // Sets the current submit editor for this specific version control plugin.
+ // The plugin automatically checks if the submit editor is closed and calls
+ // submitEditorAboutToClose().
+ // The method raiseSubmitEditor can be used to check for a running submit editor and raise it.
+ void setSubmitEditor(VcsBaseSubmitEditor *submitEditor);
+ // Current submit editor set through setSubmitEditor, if it wasn't closed inbetween
+ VcsBaseSubmitEditor *submitEditor() const;
+ // Tries to raise the submit editor set through setSubmitEditor. Returns true if that was found.
+ bool raiseSubmitEditor() const;
+
// Implement to enable the plugin menu actions according to state.
virtual void updateActions(ActionState as) = 0;
- // Implement to start the submit process.
- virtual bool submitEditorAboutToClose(VcsBaseSubmitEditor *submitEditor) = 0;
+ // Implement to start the submit process, use submitEditor() to get the submit editor instance.
+ virtual bool submitEditorAboutToClose() = 0;
// A helper to enable the VCS menu action according to state:
// NoVcsEnabled -> visible, enabled if repository creation is supported