forked from qt-creator/qt-creator
Git: Add actions for changes in output window context menu
Change-Id: I5aa46f87b82670286ac225d71a3a045133976e86 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
committed by
Orgad Shaneh
parent
ab3e2ac0fc
commit
ba87fb2083
@@ -3598,6 +3598,7 @@ GitRemote::GitRemote(const QString &location) : Core::IVersionControl::RepoUrl(l
|
||||
|
||||
void GitClient::addChangeActions(QMenu *menu, const QString &workingDir, const QString &change)
|
||||
{
|
||||
QTC_ASSERT(!change.isEmpty(), return);
|
||||
menu->addAction(tr("Cherr&y-Pick Change %1").arg(change), [workingDir, change] {
|
||||
m_instance->synchronousCherryPick(workingDir, change);
|
||||
});
|
||||
@@ -3611,9 +3612,11 @@ void GitClient::addChangeActions(QMenu *menu, const QString &workingDir, const Q
|
||||
&QAction::triggered, [workingDir, change] {
|
||||
GitPlugin::startRebaseFromCommit(workingDir, change);
|
||||
});
|
||||
menu->addAction(tr("&Log for Change %1").arg(change), [workingDir, change] {
|
||||
QAction *logAction = menu->addAction(tr("&Log for Change %1").arg(change), [workingDir, change] {
|
||||
m_instance->log(workingDir, QString(), false, {change});
|
||||
});
|
||||
if (change.contains(".."))
|
||||
menu->setDefaultAction(logAction);
|
||||
menu->addAction(tr("Add &Tag for Change %1...").arg(change), [workingDir, change] {
|
||||
QString output;
|
||||
QString errorMessage;
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
|
||||
#include "annotationhighlighter.h"
|
||||
#include "branchadddialog.h"
|
||||
#include "gitplugin.h"
|
||||
#include "gitclient.h"
|
||||
#include "gitsettings.h"
|
||||
#include "gitsubmiteditorwidget.h"
|
||||
|
||||
@@ -83,6 +83,7 @@
|
||||
|
||||
#include <QAction>
|
||||
#include <QApplication>
|
||||
#include <QClipboard>
|
||||
#include <QFileDialog>
|
||||
#include <QMenu>
|
||||
#include <QVBoxLayout>
|
||||
@@ -256,6 +257,18 @@ public:
|
||||
const QString &localName,
|
||||
const QStringList &extraArgs) final;
|
||||
|
||||
void fillLinkContextMenu(QMenu *menu,
|
||||
const QString &workingDirectory,
|
||||
const QString &reference) final
|
||||
{
|
||||
menu->addAction(tr("&Copy \"%1\"").arg(reference),
|
||||
[reference] { QApplication::clipboard()->setText(reference); });
|
||||
QAction *action = menu->addAction(tr("&Describe Change %1").arg(reference),
|
||||
[=] { describe(workingDirectory, reference); });
|
||||
menu->setDefaultAction(action);
|
||||
GitClient::addChangeActions(menu, workingDirectory, reference);
|
||||
}
|
||||
|
||||
RepoUrl getRepoUrl(const QString &location) const override;
|
||||
|
||||
QStringList additionalToolsPath() const final;
|
||||
|
||||
Reference in New Issue
Block a user