summaryrefslogtreecommitdiff
path: root/src/plugins/git/gitplugin.cpp
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2013-06-11 23:01:54 +0300
committerOrgad Shaneh <orgads@gmail.com>2013-06-17 11:21:19 +0200
commit3591c1df579c51d579c6c0cfc39073850af37e85 (patch)
treed4b502a088867d7c8bf395ab37c36a01ca590271 /src/plugins/git/gitplugin.cpp
parent1686e314bdf5d9583429d5a965bdc7c6373df3a2 (diff)
downloadqt-creator-3591c1df579c51d579c6c0cfc39073850af37e85.tar.gz
Git: Disable rebase and fixup when there's a command in progress
Change-Id: Ifa2f781cb1f31afaf7b0af4e4a0dd08fb58296d3 Reviewed-by: Petar Perisin <petar.perisin@gmail.com> Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Diffstat (limited to 'src/plugins/git/gitplugin.cpp')
-rw-r--r--src/plugins/git/gitplugin.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp
index 65a0f91f2b..80232b36b6 100644
--- a/src/plugins/git/gitplugin.cpp
+++ b/src/plugins/git/gitplugin.cpp
@@ -59,6 +59,7 @@
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/editormanager/ieditor.h>
#include <coreplugin/mimedatabase.h>
+#include <coreplugin/vcsmanager.h>
#include <utils/qtcassert.h>
#include <utils/parameteraction.h>
@@ -427,9 +428,10 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
tr("Amend Last Commit..."), Core::Id("Git.AmendCommit"),
globalcontext, true, SLOT(startAmendCommit()));
- createRepositoryAction(localRepositoryMenu,
- tr("Fixup Previous Commit..."), Core::Id("Git.FixupCommit"),
- globalcontext, true, SLOT(startFixupCommit()));
+ m_fixupCommitAction =
+ createRepositoryAction(localRepositoryMenu,
+ tr("Fixup Previous Commit..."), Core::Id("Git.FixupCommit"),
+ globalcontext, true, SLOT(startFixupCommit())).first;
// --------------
localRepositoryMenu->addSeparator(globalcontext);
@@ -437,9 +439,10 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
tr("Reset..."), Core::Id("Git.Reset"),
globalcontext, true, SLOT(resetRepository()));
- createRepositoryAction(localRepositoryMenu,
- tr("Interactive Rebase..."), Core::Id("Git.InteractiveRebase"),
- globalcontext, true, SLOT(startRebase()));
+ m_interactiveRebaseAction =
+ createRepositoryAction(localRepositoryMenu,
+ tr("Interactive Rebase..."), Core::Id("Git.InteractiveRebase"),
+ globalcontext, true, SLOT(startRebase())).first;
m_submoduleUpdateAction =
createRepositoryAction(localRepositoryMenu,
@@ -684,6 +687,8 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
m_redoAction = new QAction(tr("&Redo"), this);
command = Core::ActionManager::registerAction(m_redoAction, Core::Constants::REDO, submitContext);
+ connect(Core::ICore::vcsManager(), SIGNAL(repositoryChanged(QString)),
+ this, SLOT(updateContinueAndAbortCommands()));
if (!Core::ICore::mimeDatabase()->addMimeTypes(QLatin1String(RC_GIT_MIME_XML), errorMessage))
return false;
@@ -1408,6 +1413,8 @@ void GitPlugin::updateContinueAndAbortCommands()
m_continueRevertAction->setVisible(gitCommandInProgress == GitClient::Revert);
m_continueRebaseAction->setVisible(gitCommandInProgress == GitClient::Rebase
|| gitCommandInProgress == GitClient::RebaseMerge);
+ m_fixupCommitAction->setEnabled(gitCommandInProgress == GitClient::NoCommand);
+ m_interactiveRebaseAction->setEnabled(gitCommandInProgress == GitClient::NoCommand);
} else {
m_mergeToolAction->setVisible(false);
m_abortMergeAction->setVisible(false);