Commit 94cf79f8 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh

VCS: Add accelerators to context menu entry in editors

Change-Id: I57b89670999d1f4857dcbdf94d8dc1f480e337c1
Reviewed-by: default avatarTobias Hunger <tobias.hunger@theqtcompany.com>
parent cf8d601b
...@@ -46,8 +46,8 @@ BazaarEditorWidget::BazaarEditorWidget() : ...@@ -46,8 +46,8 @@ BazaarEditorWidget::BazaarEditorWidget() :
m_changesetId(QLatin1String(Constants::CHANGESET_ID)), m_changesetId(QLatin1String(Constants::CHANGESET_ID)),
m_exactChangesetId(QLatin1String(Constants::CHANGESET_ID_EXACT)) m_exactChangesetId(QLatin1String(Constants::CHANGESET_ID_EXACT))
{ {
setAnnotateRevisionTextFormat(tr("Annotate %1")); setAnnotateRevisionTextFormat(tr("&Annotate %1"));
setAnnotatePreviousRevisionTextFormat(tr("Annotate parent revision %1")); setAnnotatePreviousRevisionTextFormat(tr("Annotate &parent revision %1"));
// Diff format: // Diff format:
// === <change> <file|dir> 'mainwindow.cpp' // === <change> <file|dir> 'mainwindow.cpp'
setDiffFilePattern(QRegExp(QLatin1String("^=== [a-z]+ [a-z]+ '(.+)'\\s*"))); setDiffFilePattern(QRegExp(QLatin1String("^=== [a-z]+ [a-z]+ '(.+)'\\s*")));
......
...@@ -75,8 +75,8 @@ GitEditorWidget::GitEditorWidget() : ...@@ -75,8 +75,8 @@ GitEditorWidget::GitEditorWidget() :
*/ */
setDiffFilePattern(QRegExp(QLatin1String("^(?:diff --git a/|index |[+-]{3} (?:/dev/null|[ab]/(.+$)))"))); setDiffFilePattern(QRegExp(QLatin1String("^(?:diff --git a/|index |[+-]{3} (?:/dev/null|[ab]/(.+$)))")));
setLogEntryPattern(QRegExp(QLatin1String("^commit ([0-9a-f]{8})[0-9a-f]{32}"))); setLogEntryPattern(QRegExp(QLatin1String("^commit ([0-9a-f]{8})[0-9a-f]{32}")));
setAnnotateRevisionTextFormat(tr("Blame %1")); setAnnotateRevisionTextFormat(tr("&Blame %1"));
setAnnotatePreviousRevisionTextFormat(tr("Blame Parent Revision %1")); setAnnotatePreviousRevisionTextFormat(tr("Blame &Parent Revision %1"));
} }
QSet<QString> GitEditorWidget::annotationChanges() const QSet<QString> GitEditorWidget::annotationChanges() const
...@@ -345,10 +345,10 @@ void GitEditorWidget::addChangeActions(QMenu *menu, const QString &change) ...@@ -345,10 +345,10 @@ void GitEditorWidget::addChangeActions(QMenu *menu, const QString &change)
{ {
m_currentChange = change; m_currentChange = change;
if (contentType() != OtherContent) { if (contentType() != OtherContent) {
menu->addAction(tr("Cherry-Pick Change %1").arg(change), this, SLOT(cherryPickChange())); menu->addAction(tr("Cherr&y-Pick Change %1").arg(change), this, SLOT(cherryPickChange()));
menu->addAction(tr("Revert Change %1").arg(change), this, SLOT(revertChange())); menu->addAction(tr("Re&vert Change %1").arg(change), this, SLOT(revertChange()));
menu->addAction(tr("Checkout Change %1").arg(change), this, SLOT(checkoutChange())); menu->addAction(tr("C&heckout Change %1").arg(change), this, SLOT(checkoutChange()));
menu->addAction(tr("Hard Reset to Change %1").arg(change), this, SLOT(resetChange())); menu->addAction(tr("Hard &Reset to Change %1").arg(change), this, SLOT(resetChange()));
} }
} }
......
...@@ -55,8 +55,8 @@ MercurialEditorWidget::MercurialEditorWidget() : ...@@ -55,8 +55,8 @@ MercurialEditorWidget::MercurialEditorWidget() :
{ {
setDiffFilePattern(QRegExp(QLatin1String(Constants::DIFFIDENTIFIER))); setDiffFilePattern(QRegExp(QLatin1String(Constants::DIFFIDENTIFIER)));
setLogEntryPattern(QRegExp(QLatin1String("^changeset:\\s+(\\S+)$"))); setLogEntryPattern(QRegExp(QLatin1String("^changeset:\\s+(\\S+)$")));
setAnnotateRevisionTextFormat(tr("Annotate %1")); setAnnotateRevisionTextFormat(tr("&Annotate %1"));
setAnnotatePreviousRevisionTextFormat(tr("Annotate parent revision %1")); setAnnotatePreviousRevisionTextFormat(tr("Annotate &parent revision %1"));
} }
QSet<QString> MercurialEditorWidget::annotationChanges() const QSet<QString> MercurialEditorWidget::annotationChanges() const
......
...@@ -345,7 +345,7 @@ void ChangeTextCursorHandler::slotCopyRevision() ...@@ -345,7 +345,7 @@ void ChangeTextCursorHandler::slotCopyRevision()
QAction *ChangeTextCursorHandler::createDescribeAction(const QString &change) const QAction *ChangeTextCursorHandler::createDescribeAction(const QString &change) const
{ {
auto a = new QAction(VcsBaseEditorWidget::tr("Describe Change %1").arg(change), 0); auto a = new QAction(VcsBaseEditorWidget::tr("&Describe Change %1").arg(change), 0);
connect(a, &QAction::triggered, this, &ChangeTextCursorHandler::slotDescribe); connect(a, &QAction::triggered, this, &ChangeTextCursorHandler::slotDescribe);
return a; return a;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment