aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/git/gitplugin.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <[email protected]>2010-01-08 16:07:05 +0100
committerFriedemann Kleint <[email protected]>2010-01-08 16:07:05 +0100
commitb81c30df2b32d530848c07d4dc25fb40b0694a99 (patch)
treee0e51308f7efd990d658d3ea202486f659766d5e /src/plugins/git/gitplugin.cpp
parentdf2a2dc118216d1233dfdc162404e0448f6f6a7c (diff)
VCS[git]: Add log repository action.
Diffstat (limited to 'src/plugins/git/gitplugin.cpp')
-rw-r--r--src/plugins/git/gitplugin.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp
index 19880501e22..7227085a367 100644
--- a/src/plugins/git/gitplugin.cpp
+++ b/src/plugins/git/gitplugin.cpp
@@ -120,6 +120,7 @@ GitPlugin::GitPlugin() :
m_blameAction(0),
m_logProjectAction(0),
m_undoFileAction(0),
+ m_logRepositoryAction(0),
m_undoRepositoryAction(0),
m_showAction(0),
m_stageAction(0),
@@ -295,9 +296,13 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
connect(m_statusRepositoryAction, SIGNAL(triggered()), this, SLOT(statusRepository()));
gitContainer->addAction(command);
+ m_logRepositoryAction = new QAction(tr("Log Repository"), this);
+ command = actionManager->registerAction(m_logRepositoryAction, "Git.LogRepository", globalcontext);
+ connect(m_logRepositoryAction, SIGNAL(triggered()), this, SLOT(logRepository()));
+ gitContainer->addAction(command);
+
m_undoRepositoryAction = new QAction(tr("Undo Repository Changes"), this);
command = actionManager->registerAction(m_undoRepositoryAction, "Git.UndoRepository", globalcontext);
- command->setAttribute(Core::Command::CA_UpdateText);
connect(m_undoRepositoryAction, SIGNAL(triggered()), this, SLOT(undoRepositoryChanges()));
gitContainer->addAction(command);
@@ -448,6 +453,13 @@ void GitPlugin::undoFileChanges()
m_gitClient->revert(QStringList(state.currentFile()));
}
+void GitPlugin::logRepository()
+{
+ const VCSBase::VCSBasePluginState state = currentState();
+ QTC_ASSERT(state.hasTopLevel(), return)
+ m_gitClient->graphLog(state.topLevel());
+}
+
void GitPlugin::undoRepositoryChanges()
{
const VCSBase::VCSBasePluginState state = currentState();
@@ -690,7 +702,6 @@ void GitPlugin::updateActions(VCSBase::VCSBasePlugin::ActionState as)
m_diffProjectAction->setParameter(projectName);
m_logProjectAction->setEnabled(projectEnabled);
m_logProjectAction->setParameter(projectName);
- m_undoRepositoryAction->setEnabled(projectEnabled);
const bool repositoryEnabled = currentState().hasTopLevel();
m_diffRepositoryAction->setEnabled(repositoryEnabled);
@@ -698,6 +709,8 @@ void GitPlugin::updateActions(VCSBase::VCSBasePlugin::ActionState as)
m_branchListAction->setEnabled(repositoryEnabled);
m_stashListAction->setEnabled(repositoryEnabled);
m_stashPopAction->setEnabled(repositoryEnabled);
+ m_logRepositoryAction->setEnabled(repositoryEnabled);
+ m_undoRepositoryAction->setEnabled(repositoryEnabled);
// Prompts for repo.
m_showAction->setEnabled(true);