Macros: Tr::tr

Change-Id: I16d875d238ea9ac14758148c867cbac74042c43c
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Alessandro Portale
2023-01-22 18:59:51 +01:00
parent 852a74c9c1
commit a0eb8493b9
18 changed files with 64 additions and 361 deletions

View File

@@ -3,10 +3,11 @@
#include "macrosplugin.h"
#include "macrosconstants.h"
#include "macrolocatorfilter.h"
#include "macromanager.h"
#include "macrooptionspage.h"
#include "macrolocatorfilter.h"
#include "macrosconstants.h"
#include "macrostr.h"
#include <texteditor/texteditorconstants.h>
@@ -48,30 +49,30 @@ void MacrosPlugin::initialize()
Core::ActionContainer *mtools = Core::ActionManager::actionContainer(Core::Constants::M_TOOLS);
Core::ActionContainer *mmacrotools = Core::ActionManager::createMenu(Constants::M_TOOLS_MACRO);
QMenu *menu = mmacrotools->menu();
menu->setTitle(tr("Text Editing &Macros"));
menu->setTitle(Tr::tr("Text Editing &Macros"));
menu->setEnabled(true);
mtools->addMenu(mmacrotools);
QAction *startMacro = new QAction(tr("Record Macro"), this);
QAction *startMacro = new QAction(Tr::tr("Record Macro"), this);
Core::Command *command = Core::ActionManager::registerAction(startMacro, Constants::START_MACRO, textContext);
command->setDefaultKeySequence(QKeySequence(Core::useMacShortcuts ? tr("Ctrl+[") : tr("Alt+[")));
command->setDefaultKeySequence(QKeySequence(Core::useMacShortcuts ? Tr::tr("Ctrl+[") : Tr::tr("Alt+[")));
mmacrotools->addAction(command);
connect(startMacro, &QAction::triggered, &d->macroManager, &MacroManager::startMacro);
QAction *endMacro = new QAction(tr("Stop Recording Macro"), this);
QAction *endMacro = new QAction(Tr::tr("Stop Recording Macro"), this);
endMacro->setEnabled(false);
command = Core::ActionManager::registerAction(endMacro, Constants::END_MACRO);
command->setDefaultKeySequence(QKeySequence(Core::useMacShortcuts ? tr("Ctrl+]") : tr("Alt+]")));
command->setDefaultKeySequence(QKeySequence(Core::useMacShortcuts ? Tr::tr("Ctrl+]") : Tr::tr("Alt+]")));
mmacrotools->addAction(command);
connect(endMacro, &QAction::triggered, &d->macroManager, &MacroManager::endMacro);
QAction *executeLastMacro = new QAction(tr("Play Last Macro"), this);
QAction *executeLastMacro = new QAction(Tr::tr("Play Last Macro"), this);
command = Core::ActionManager::registerAction(executeLastMacro, Constants::EXECUTE_LAST_MACRO, textContext);
command->setDefaultKeySequence(QKeySequence(Core::useMacShortcuts ? tr("Meta+R") : tr("Alt+R")));
command->setDefaultKeySequence(QKeySequence(Core::useMacShortcuts ? Tr::tr("Meta+R") : Tr::tr("Alt+R")));
mmacrotools->addAction(command);
connect(executeLastMacro, &QAction::triggered, &d->macroManager, &MacroManager::executeLastMacro);
QAction *saveLastMacro = new QAction(tr("Save Last Macro"), this);
QAction *saveLastMacro = new QAction(Tr::tr("Save Last Macro"), this);
saveLastMacro->setEnabled(false);
command = Core::ActionManager::registerAction(saveLastMacro, Constants::SAVE_LAST_MACRO, textContext);
mmacrotools->addAction(command);