Git: Provide a commit editor for files opened externally

Change-Id: I52fccf36cca032dda36102d4be2654eb7461de64
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
Orgad Shaneh
2013-05-22 21:31:46 +03:00
committed by Orgad Shaneh
parent a9d9d44494
commit 7bfaf7a946
9 changed files with 40 additions and 3 deletions

View File

@@ -58,6 +58,7 @@
#include <coreplugin/infobar.h>
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/editormanager/ieditor.h>
#include <coreplugin/mimedatabase.h>
#include <utils/qtcassert.h>
#include <utils/parameteraction.h>
@@ -81,6 +82,7 @@
#include <QScopedPointer>
static const unsigned minimumRequiredVersion = 0x010702;
static const char RC_GIT_MIME_XML[] = ":/git/Git.mimetypes.xml";
static const VcsBase::VcsBaseEditorParameters editorParameters[] = {
{
@@ -103,7 +105,12 @@ static const VcsBase::VcsBaseEditorParameters editorParameters[] = {
Git::Constants::GIT_DIFF_EDITOR_ID,
Git::Constants::GIT_DIFF_EDITOR_DISPLAY_NAME,
Git::Constants::C_GIT_DIFF_EDITOR,
"text/x-patch"}
"text/x-patch"},
{ VcsBase::DiffOutput,
Git::Constants::GIT_COMMIT_TEXT_EDITOR_ID,
Git::Constants::GIT_COMMIT_TEXT_EDITOR_DISPLAY_NAME,
Git::Constants::C_GIT_COMMIT_TEXT_EDITOR,
"text/vnd.qtcreator.git.commit"},
};
// Utility to find a parameter set by type
@@ -263,7 +270,6 @@ ActionCommandPair
bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
{
Q_UNUSED(arguments)
Q_UNUSED(errorMessage)
m_settings.readSettings(Core::ICore::settings());
@@ -656,6 +662,9 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
command = Core::ActionManager::registerAction(m_redoAction, Core::Constants::REDO, submitContext);
if (!Core::ICore::mimeDatabase()->addMimeTypes(QLatin1String(RC_GIT_MIME_XML), errorMessage))
return false;
/* "Gerrit" */
m_gerritPlugin = new Gerrit::Internal::GerritPlugin(this);
const bool ok = m_gerritPlugin->initialize(remoteRepositoryMenu);