forked from qt-creator/qt-creator
Macros: Tr::tr
Change-Id: I16d875d238ea9ac14758148c867cbac74042c43c Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
#include "macro.h"
|
||||
#include "macromanager.h"
|
||||
#include "macrostr.h"
|
||||
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <coreplugin/editormanager/ieditor.h>
|
||||
@@ -19,9 +20,9 @@ MacroLocatorFilter::MacroLocatorFilter()
|
||||
: m_icon(QPixmap(":/macros/images/macro.png"))
|
||||
{
|
||||
setId("Macros");
|
||||
setDisplayName(tr("Text Editing Macros"));
|
||||
setDescription(tr("Runs a text editing macro that was recorded with Tools > Text Editing "
|
||||
"Macros > Record Macro."));
|
||||
setDisplayName(Tr::tr("Text Editing Macros"));
|
||||
setDescription(Tr::tr("Runs a text editing macro that was recorded with Tools > Text Editing "
|
||||
"Macros > Record Macro."));
|
||||
setDefaultShortcutString("rm");
|
||||
}
|
||||
|
||||
|
||||
@@ -3,14 +3,15 @@
|
||||
|
||||
#include "macromanager.h"
|
||||
|
||||
#include "macrosconstants.h"
|
||||
#include "macroevent.h"
|
||||
#include "macro.h"
|
||||
#include "imacrohandler.h"
|
||||
#include "savedialog.h"
|
||||
#include "actionmacrohandler.h"
|
||||
#include "texteditormacrohandler.h"
|
||||
#include "findmacrohandler.h"
|
||||
#include "imacrohandler.h"
|
||||
#include "macro.h"
|
||||
#include "macroevent.h"
|
||||
#include "macrosconstants.h"
|
||||
#include "macrostr.h"
|
||||
#include "savedialog.h"
|
||||
#include "texteditormacrohandler.h"
|
||||
|
||||
#include <texteditor/texteditorconstants.h>
|
||||
|
||||
@@ -190,8 +191,8 @@ bool MacroManagerPrivate::executeMacro(Macro *macro)
|
||||
if (error) {
|
||||
QMessageBox::warning(
|
||||
Core::ICore::dialogParent(),
|
||||
MacroManager::tr("Playing Macro"),
|
||||
MacroManager::tr("An error occurred while replaying the macro, execution stopped."));
|
||||
Tr::tr("Playing Macro"),
|
||||
Tr::tr("An error occurred while replaying the macro, execution stopped."));
|
||||
}
|
||||
|
||||
// Set the focus back to the editor
|
||||
@@ -266,10 +267,10 @@ void MacroManager::startMacro()
|
||||
->keySequence()
|
||||
.toString(QKeySequence::NativeText);
|
||||
const QString help
|
||||
= tr("Macro mode. Type \"%1\" to stop recording and \"%2\" to play the macro.")
|
||||
= Tr::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"),
|
||||
Tr::tr("Stop Recording Macro"),
|
||||
this, [this] { endMacro(); });
|
||||
}
|
||||
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
#include "macrooptionspage.h"
|
||||
|
||||
#include "macromanager.h"
|
||||
#include "macrosconstants.h"
|
||||
#include "macrooptionswidget.h"
|
||||
#include "macrosconstants.h"
|
||||
#include "macrostr.h"
|
||||
|
||||
#include <texteditor/texteditorconstants.h>
|
||||
|
||||
@@ -15,7 +16,7 @@ namespace Internal {
|
||||
MacroOptionsPage::MacroOptionsPage()
|
||||
{
|
||||
setId(Constants::M_OPTIONS_PAGE);
|
||||
setDisplayName(MacroOptionsWidget::tr("Macros"));
|
||||
setDisplayName(Tr::tr("Macros"));
|
||||
setCategory(TextEditor::Constants::TEXT_EDITOR_SETTINGS_CATEGORY);
|
||||
setWidgetCreator([] { return new MacroOptionsWidget; });
|
||||
}
|
||||
|
||||
@@ -3,9 +3,10 @@
|
||||
|
||||
#include "macrooptionswidget.h"
|
||||
|
||||
#include "macrosconstants.h"
|
||||
#include "macromanager.h"
|
||||
#include "macro.h"
|
||||
#include "macromanager.h"
|
||||
#include "macrosconstants.h"
|
||||
#include "macrostr.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/coreconstants.h>
|
||||
@@ -40,23 +41,23 @@ MacroOptionsWidget::MacroOptionsWidget()
|
||||
m_treeWidget->header()->setSortIndicatorShown(true);
|
||||
m_treeWidget->header()->setStretchLastSection(true);
|
||||
m_treeWidget->header()->setSortIndicator(0, Qt::AscendingOrder);
|
||||
m_treeWidget->setHeaderLabels({tr("Name"), tr("Description)"), tr("Shortcut")});
|
||||
m_treeWidget->setHeaderLabels({Tr::tr("Name"), Tr::tr("Description)"), Tr::tr("Shortcut")});
|
||||
|
||||
m_description = new QLineEdit;
|
||||
|
||||
m_removeButton = new QPushButton(tr("Remove"));
|
||||
m_removeButton = new QPushButton(Tr::tr("Remove"));
|
||||
|
||||
m_macroGroup = new QGroupBox(tr("Macro"), this);
|
||||
m_macroGroup = new QGroupBox(Tr::tr("Macro"), this);
|
||||
|
||||
using namespace Utils::Layouting;
|
||||
|
||||
Row {
|
||||
tr("Description:"), m_description
|
||||
Tr::tr("Description:"), m_description
|
||||
}.attachTo(m_macroGroup);
|
||||
|
||||
Column {
|
||||
Group {
|
||||
title(tr("Preferences")),
|
||||
title(Tr::tr("Preferences")),
|
||||
Row {
|
||||
m_treeWidget,
|
||||
Column { m_removeButton, st },
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#include "savedialog.h"
|
||||
|
||||
#include "macrostr.h"
|
||||
|
||||
#include <utils/layoutbuilder.h>
|
||||
|
||||
#include <QCheckBox>
|
||||
@@ -18,7 +20,7 @@ SaveDialog::SaveDialog(QWidget *parent) :
|
||||
QDialog(parent)
|
||||
{
|
||||
resize(219, 91);
|
||||
setWindowTitle(tr("Save Macro"));
|
||||
setWindowTitle(Tr::tr("Save Macro"));
|
||||
|
||||
m_name = new QLineEdit;
|
||||
m_name->setValidator(new QRegularExpressionValidator(QRegularExpression(QLatin1String("\\w*")), this));
|
||||
@@ -31,8 +33,8 @@ SaveDialog::SaveDialog(QWidget *parent) :
|
||||
using namespace Layouting;
|
||||
|
||||
Form {
|
||||
tr("Name:"), m_name, br,
|
||||
tr("Description:"), m_description, br,
|
||||
Tr::tr("Name:"), m_name, br,
|
||||
Tr::tr("Description:"), m_description, br,
|
||||
buttonBox
|
||||
}.attachTo(this);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user