diff options
author | Eike Ziller <[email protected]> | 2022-07-08 16:34:37 +0200 |
---|---|---|
committer | Eike Ziller <[email protected]> | 2022-07-11 07:07:40 +0000 |
commit | f901478c6ae5710a030e529e015dbbf6d57b99f8 (patch) | |
tree | 873c86c41c34636830fa1dc2965a7835770939d4 /src/plugins | |
parent | 1e723327fe86935e7c6831b3a5403848a6b9fd84 (diff) |
Bookmarks: Convert to Tr::tr
Change-Id: I3fd7472b731264b4399412ed36b1b9aba9b7d1c3
Reviewed-by: <[email protected]>
Reviewed-by: hjk <[email protected]>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/bookmarks/bookmarkfilter.cpp | 5 | ||||
-rw-r--r-- | src/plugins/bookmarks/bookmarkmanager.cpp | 28 | ||||
-rw-r--r-- | src/plugins/bookmarks/bookmarksplugin.cpp | 35 |
3 files changed, 35 insertions, 33 deletions
diff --git a/src/plugins/bookmarks/bookmarkfilter.cpp b/src/plugins/bookmarks/bookmarkfilter.cpp index 594b18e11c9..44892ded2c4 100644 --- a/src/plugins/bookmarks/bookmarkfilter.cpp +++ b/src/plugins/bookmarks/bookmarkfilter.cpp @@ -27,6 +27,7 @@ #include "bookmark.h" #include "bookmarkmanager.h" +#include "bookmarkstr.h" #include <utils/algorithm.h> @@ -38,8 +39,8 @@ BookmarkFilter::BookmarkFilter(BookmarkManager *manager) : m_manager(manager) { setId("Bookmarks"); - setDisplayName(tr("Bookmarks")); - setDescription(tr("Matches all bookmarks. Filter by file name, by the text on the line of the " + setDisplayName(Tr::tr("Bookmarks")); + setDescription(Tr::tr("Matches all bookmarks. Filter by file name, by the text on the line of the " "bookmark, or by the bookmark's note text.")); setPriority(Medium); setDefaultShortcutString("b"); diff --git a/src/plugins/bookmarks/bookmarkmanager.cpp b/src/plugins/bookmarks/bookmarkmanager.cpp index 3ddb2ddf143..d242af53dc0 100644 --- a/src/plugins/bookmarks/bookmarkmanager.cpp +++ b/src/plugins/bookmarks/bookmarkmanager.cpp @@ -26,8 +26,8 @@ #include "bookmarkmanager.h" #include "bookmark.h" -#include "bookmarksplugin.h" #include "bookmarks_global.h" +#include "bookmarkstr.h" #include <coreplugin/editormanager/editormanager.h> #include <coreplugin/icore.h> @@ -188,7 +188,7 @@ BookmarkView::BookmarkView(BookmarkManager *manager) : m_bookmarkContext(new IContext(this)), m_manager(manager) { - setWindowTitle(tr("Bookmarks")); + setWindowTitle(Tr::tr("Bookmarks")); m_bookmarkContext->setWidget(this); m_bookmarkContext->setContext(Context(Constants::BOOKMARKS_CONTEXT)); @@ -228,13 +228,13 @@ QList<QToolButton *> BookmarkView::createToolBarWidgets() void BookmarkView::contextMenuEvent(QContextMenuEvent *event) { QMenu menu; - QAction *moveUp = menu.addAction(tr("Move Up")); - QAction *moveDown = menu.addAction(tr("Move Down")); - QAction *edit = menu.addAction(tr("&Edit")); + QAction *moveUp = menu.addAction(Tr::tr("Move Up")); + QAction *moveDown = menu.addAction(Tr::tr("Move Down")); + QAction *edit = menu.addAction(Tr::tr("&Edit")); menu.addSeparator(); - QAction *remove = menu.addAction(tr("&Remove")); + QAction *remove = menu.addAction(Tr::tr("&Remove")); menu.addSeparator(); - QAction *removeAll = menu.addAction(tr("Remove All")); + QAction *removeAll = menu.addAction(Tr::tr("Remove All")); m_contextMenuIndex = indexAt(event->pos()); if (!m_contextMenuIndex.isValid()) { @@ -280,8 +280,8 @@ void BookmarkView::keyPressEvent(QKeyEvent *event) void BookmarkView::removeAll() { if (CheckableMessageBox::doNotAskAgainQuestion(this, - tr("Remove All Bookmarks"), - tr("Are you sure you want to remove all bookmarks from all files in the current session?"), + Tr::tr("Remove All Bookmarks"), + Tr::tr("Are you sure you want to remove all bookmarks from all files in the current session?"), ICore::settings(), QLatin1String("RemoveAllBookmarks")) != QDialogButtonBox::Yes) return; @@ -676,7 +676,7 @@ void BookmarkManager::edit() Bookmark *b = m_bookmarksList.at(current.row()); QDialog dlg; - dlg.setWindowTitle(tr("Edit Bookmark")); + dlg.setWindowTitle(Tr::tr("Edit Bookmark")); auto layout = new QFormLayout(&dlg); auto noteEdit = new QLineEdit(b->note()); noteEdit->setMinimumWidth(300); @@ -687,8 +687,8 @@ void BookmarkManager::edit() auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); connect(buttonBox, &QDialogButtonBox::accepted, &dlg, &QDialog::accept); connect(buttonBox, &QDialogButtonBox::rejected, &dlg, &QDialog::reject); - layout->addRow(tr("Note text:"), noteEdit); - layout->addRow(tr("Line number:"), lineNumberSpinbox); + layout->addRow(Tr::tr("Note text:"), noteEdit); + layout->addRow(Tr::tr("Line number:"), lineNumberSpinbox); layout->addWidget(buttonBox); if (dlg.exec() == QDialog::Accepted) { b->move(lineNumberSpinbox->value()); @@ -804,10 +804,10 @@ bool BookmarkManager::isAtCurrentBookmark() const BookmarkViewFactory::BookmarkViewFactory(BookmarkManager *bm) : m_manager(bm) { - setDisplayName(BookmarkView::tr("Bookmarks")); + setDisplayName(Tr::tr("Bookmarks")); setPriority(300); setId("Bookmarks"); - setActivationSequence(QKeySequence(useMacShortcuts ? tr("Alt+Meta+M") : tr("Alt+M"))); + setActivationSequence(QKeySequence(useMacShortcuts ? Tr::tr("Alt+Meta+M") : Tr::tr("Alt+M"))); } NavigationView BookmarkViewFactory::createWidget() diff --git a/src/plugins/bookmarks/bookmarksplugin.cpp b/src/plugins/bookmarks/bookmarksplugin.cpp index db0bd49bebe..898c030b52c 100644 --- a/src/plugins/bookmarks/bookmarksplugin.cpp +++ b/src/plugins/bookmarks/bookmarksplugin.cpp @@ -28,6 +28,7 @@ #include "bookmarkfilter.h" #include "bookmarkmanager.h" #include "bookmarks_global.h" +#include "bookmarkstr.h" #include <coreplugin/icore.h> #include <coreplugin/editormanager/ieditor.h> @@ -71,14 +72,14 @@ public: BookmarkFilter m_bookmarkFilter; BookmarkViewFactory m_bookmarkViewFactory; - QAction m_toggleAction{BookmarksPlugin::tr("Toggle Bookmark"), nullptr}; - QAction m_editAction{BookmarksPlugin::tr("Edit Bookmark"), nullptr}; - QAction m_prevAction{BookmarksPlugin::tr("Previous Bookmark"), nullptr}; - QAction m_nextAction{BookmarksPlugin::tr("Next Bookmark"), nullptr}; - QAction m_docPrevAction{BookmarksPlugin::tr("Previous Bookmark in Document"), nullptr}; - QAction m_docNextAction{BookmarksPlugin::tr("Next Bookmark in Document"), nullptr}; - QAction m_editBookmarkAction{BookmarksPlugin::tr("Edit Bookmark"), nullptr}; - QAction m_bookmarkMarginAction{BookmarksPlugin::tr("Toggle Bookmark"), nullptr}; + QAction m_toggleAction{Tr::tr("Toggle Bookmark"), nullptr}; + QAction m_editAction{Tr::tr("Edit Bookmark"), nullptr}; + QAction m_prevAction{Tr::tr("Previous Bookmark"), nullptr}; + QAction m_nextAction{Tr::tr("Next Bookmark"), nullptr}; + QAction m_docPrevAction{Tr::tr("Previous Bookmark in Document"), nullptr}; + QAction m_docNextAction{Tr::tr("Next Bookmark in Document"), nullptr}; + QAction m_editBookmarkAction{Tr::tr("Edit Bookmark"), nullptr}; + QAction m_bookmarkMarginAction{Tr::tr("Toggle Bookmark"), nullptr}; int m_marginActionLineNumber = 0; Utils::FilePath m_marginActionFileName; @@ -102,7 +103,7 @@ BookmarksPluginPrivate::BookmarksPluginPrivate() ActionContainer *mtools = ActionManager::actionContainer(Core::Constants::M_TOOLS); ActionContainer *touchBar = ActionManager::actionContainer(Core::Constants::TOUCH_BAR); ActionContainer *mbm = ActionManager::createMenu(Id(BOOKMARKS_MENU)); - mbm->menu()->setTitle(BookmarksPlugin::tr("&Bookmarks")); + mbm->menu()->setTitle(Tr::tr("&Bookmarks")); mtools->addMenu(mbm); const Context editorManagerContext(Core::Constants::C_EDITORMANAGER); @@ -110,16 +111,16 @@ BookmarksPluginPrivate::BookmarksPluginPrivate() // Toggle Command *cmd = ActionManager::registerAction(&m_toggleAction, BOOKMARKS_TOGGLE_ACTION, editorManagerContext); - cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? BookmarksPlugin::tr("Meta+M") - : BookmarksPlugin::tr("Ctrl+M"))); + cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Meta+M") + : Tr::tr("Ctrl+M"))); cmd->setTouchBarIcon(Utils::Icons::MACOS_TOUCHBAR_BOOKMARK.icon()); mbm->addAction(cmd); cmd = ActionManager::registerAction(&m_editAction, BOOKMARKS_EDIT_ACTION, editorManagerContext); - cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? BookmarksPlugin::tr("Meta+Shift+M") - : BookmarksPlugin::tr("Ctrl+Shift+M"))); + cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Meta+Shift+M") + : Tr::tr("Ctrl+Shift+M"))); mbm->addAction(cmd); touchBar->addAction(cmd, Core::Constants::G_TOUCHBAR_EDITOR); @@ -130,16 +131,16 @@ BookmarksPluginPrivate::BookmarksPluginPrivate() m_prevAction.setIcon(Utils::Icons::PREV_TOOLBAR.icon()); m_prevAction.setIconVisibleInMenu(false); cmd = ActionManager::registerAction(&m_prevAction, BOOKMARKS_PREV_ACTION, editorManagerContext); - cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? BookmarksPlugin::tr("Meta+,") - : BookmarksPlugin::tr("Ctrl+,"))); + cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Meta+,") + : Tr::tr("Ctrl+,"))); mbm->addAction(cmd); // Next m_nextAction.setIcon(Utils::Icons::NEXT_TOOLBAR.icon()); m_nextAction.setIconVisibleInMenu(false); cmd = ActionManager::registerAction(&m_nextAction, BOOKMARKS_NEXT_ACTION, editorManagerContext); - cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? BookmarksPlugin::tr("Meta+.") - : BookmarksPlugin::tr("Ctrl+."))); + cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Meta+.") + : Tr::tr("Ctrl+."))); mbm->addAction(cmd); mbm->addSeparator(); |