aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/vcsbase
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2020-02-28 10:03:11 +0200
committerOrgad Shaneh <orgads@gmail.com>2020-02-28 09:39:14 +0000
commita01035fefb6a9f877ac86c332c102e397bf93ba3 (patch)
tree6de00994daffcc0d5a1e3311bd1b71ee2b610dc0 /src/plugins/vcsbase
parenta8c9d394fd3cf76ef728390e7463c5241de680c5 (diff)
VcsBaseEditor: Highlight default actions on context menu
Change-Id: Idc493658dbc829394bd2898a59ba5686036bc3fe Reviewed-by: André Hartmann <aha_1980@gmx.de>
Diffstat (limited to 'src/plugins/vcsbase')
-rw-r--r--src/plugins/vcsbase/vcsbaseeditor.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/plugins/vcsbase/vcsbaseeditor.cpp b/src/plugins/vcsbase/vcsbaseeditor.cpp
index 5338580354..5dc03df32e 100644
--- a/src/plugins/vcsbase/vcsbaseeditor.cpp
+++ b/src/plugins/vcsbase/vcsbaseeditor.cpp
@@ -255,7 +255,7 @@ private slots:
void slotCopyRevision();
private:
- QAction *createDescribeAction(const QString &change) const;
+ void addDescribeAction(QMenu *menu, const QString &change) const;
QAction *createAnnotateAction(const QString &change, bool previous) const;
QAction *createCopyRevisionAction(const QString &change) const;
@@ -299,7 +299,7 @@ void ChangeTextCursorHandler::fillContextMenu(QMenu *menu, EditorContentType typ
menu->addSeparator();
menu->addAction(createCopyRevisionAction(m_currentChange));
if (currentValid)
- menu->addAction(createDescribeAction(m_currentChange));
+ addDescribeAction(menu, m_currentChange);
menu->addSeparator();
if (currentValid)
menu->addAction(createAnnotateAction(widget->decorateVersion(m_currentChange), false));
@@ -313,7 +313,7 @@ void ChangeTextCursorHandler::fillContextMenu(QMenu *menu, EditorContentType typ
default: // Describe current / Annotate file of current
menu->addSeparator();
menu->addAction(createCopyRevisionAction(m_currentChange));
- menu->addAction(createDescribeAction(m_currentChange));
+ addDescribeAction(menu, m_currentChange);
if (widget->isFileLogAnnotateEnabled())
menu->addAction(createAnnotateAction(m_currentChange, false));
break;
@@ -336,11 +336,12 @@ void ChangeTextCursorHandler::slotCopyRevision()
QApplication::clipboard()->setText(m_currentChange);
}
-QAction *ChangeTextCursorHandler::createDescribeAction(const QString &change) const
+void ChangeTextCursorHandler::addDescribeAction(QMenu *menu, const QString &change) const
{
auto a = new QAction(VcsBaseEditorWidget::tr("&Describe Change %1").arg(change), nullptr);
connect(a, &QAction::triggered, this, &ChangeTextCursorHandler::slotDescribe);
- return a;
+ menu->addAction(a);
+ menu->setDefaultAction(a);
}
QAction *ChangeTextCursorHandler::createAnnotateAction(const QString &change, bool previous) const