Macros: Fix shortcut display on macOS

Some "NativeText" parameters were missing.

Change-Id: Id08b8281d1458c05ff302011e32d8babbaf7b2bc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Eike Ziller
2022-05-16 14:51:24 +02:00
parent cf5588924c
commit 3967bbc22f
2 changed files with 13 additions and 6 deletions

View File

@@ -280,10 +280,15 @@ void MacroManager::startMacro()
foreach (IMacroHandler *handler, d->handlers)
handler->startRecording(d->currentMacro);
QString endShortcut = Core::ActionManager::command(Constants::END_MACRO)->keySequence().toString();
QString executeShortcut = Core::ActionManager::command(Constants::EXECUTE_LAST_MACRO)->keySequence().toString();
QString help = tr("Macro mode. Type \"%1\" to stop recording and \"%2\" to play the macro.")
.arg(endShortcut).arg(executeShortcut);
const QString endShortcut = Core::ActionManager::command(Constants::END_MACRO)
->keySequence()
.toString(QKeySequence::NativeText);
const QString executeShortcut = Core::ActionManager::command(Constants::EXECUTE_LAST_MACRO)
->keySequence()
.toString(QKeySequence::NativeText);
const QString help
= tr("Macro mode. Type \"%1\" to stop recording and \"%2\" to play the macro.")
.arg(endShortcut, executeShortcut);
Core::EditorManager::showEditorStatusBar(Constants::M_STATUS_BUFFER, help,
tr("Stop Recording Macro"),
this, [this] { endMacro(); });

View File

@@ -96,8 +96,10 @@ void MacroOptionsWidget::createTable()
Core::Command *command =
Core::ActionManager::command(base.withSuffix(macro->displayName()));
if (command && command->action())
macroItem->setText(2, command->action()->shortcut().toString());
if (command && command->action()) {
macroItem->setText(2,
command->action()->shortcut().toString(QKeySequence::NativeText));
}
}
}
}