Git: Add customizable repository browser command.

Change-Id: Iac297e3665b18d97ca80097c4dd33dd70e64b9a1
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
Francois Ferrand
2011-10-03 14:17:03 +02:00
committed by Tobias Hunger
parent 2ba3f6c929
commit 4d1bbebf2a
8 changed files with 73 additions and 0 deletions

View File

@@ -430,6 +430,11 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
tr("Launch gitk"), Core::Id("Git.LaunchGitK"),
globalcontext, true, &GitClient::launchGitK);
m_repositoryBrowserAction
= createRepositoryAction(actionManager, gitContainer,
tr("Launch repository browser"), Core::Id("Git.LaunchRepositoryBrowser"),
globalcontext, true, &GitClient::launchRepositoryBrowser).first;
createRepositoryAction(actionManager, gitContainer,
tr("Branches..."), Core::Id("Git.BranchList"),
globalcontext, true, SLOT(branchList()));
@@ -1031,11 +1036,19 @@ void GitPlugin::updateActions(VcsBase::VcsBasePlugin::ActionState as)
foreach (QAction *repositoryAction, m_repositoryActions)
repositoryAction->setEnabled(repositoryEnabled);
updateRepositoryBrowserAction();
// Prompts for repo.
m_showAction->setEnabled(true);
}
void GitPlugin::updateRepositoryBrowserAction()
{
const bool repositoryEnabled = currentState().hasTopLevel();
const bool hasRepositoryBrowserCmd = !settings().stringValue(GitSettings::repositoryBrowserCmd).isEmpty();
m_repositoryBrowserAction->setEnabled(repositoryEnabled && hasRepositoryBrowserCmd);
}
void GitPlugin::showCommit()
{
const VcsBase::VcsBasePluginState state = currentState();
@@ -1070,6 +1083,7 @@ void GitPlugin::setSettings(const GitSettings &s)
m_settings = s;
m_gitClient->saveSettings();
static_cast<GitVersionControl *>(versionControl())->emitConfigurationChanged();
updateRepositoryBrowserAction();
}
GitClient *GitPlugin::gitClient() const