diff --git a/share/qtcreator/translations/qtcreator_da.ts b/share/qtcreator/translations/qtcreator_da.ts index 3c0da760506..4fffb2abfbf 100644 --- a/share/qtcreator/translations/qtcreator_da.ts +++ b/share/qtcreator/translations/qtcreator_da.ts @@ -19540,9 +19540,6 @@ Fejl: %5 Zoom: %1% Zoom: %1% - - - ModelEditor::Internal::ActionHandler &Remove &Fjern @@ -19603,16 +19600,10 @@ Fejl: %5 Return Vend tilbage - - - ModelEditor::Internal::ElementTasks Update Include Dependencies Opdater inkluder-afhængigheder - - - ModelEditor::Internal::ExtPropertiesMView Select Custom Configuration Folder Vælg brugerdefineret konfigurationsmappe @@ -19625,9 +19616,6 @@ Fejl: %5 <font color=red>Model file must be reloaded.</font> <font color=red>Modelfil skal genindlæses.</font> - - - ModelEditor::Internal::ModelDocument No model loaded. Cannot save. Ingen model indlæst. Kan ikke gemme. @@ -19640,9 +19628,6 @@ Fejl: %5 Could not open "%1" for reading: %2. Kunne ikke åbne "%1" til læsning: %2. - - - ModelEditor::Internal::ModelEditor <html><body style="color:#909090; font-size:14px"><div align='center'><div style="font-size:20px">Open a diagram</div><table><tr><td><hr/><div style="margin-top: 5px">&bull; Double-click on diagram in model tree</div><div style="margin-top: 5px">&bull; Select "Open Diagram" from package's context menu in model tree</div></td></tr></table></div></body></html> <html><body style="color:#909090; font-size:14px"><div align='center'><div style="font-size:20px">Åbn et diagram</div><table><tr><td><hr/><div style="margin-top: 5px">&bull; Dobbeltklik på diagram i model-træ</div><div style="margin-top: 5px">&bull; Vælg "Åbn diagram" fra pakkens genvejsmenu i model-træ</div></td></tr></table></div></body></html> @@ -19739,16 +19724,10 @@ Fejl: %5 Swimlane Svømmebane - - - ModelEditor::Internal::ModelsManager Open Diagram Åbn diagram - - - ModelEditor::Internal::PxNodeController Add Component %1 Tilføj komponenten %1 @@ -19809,7 +19788,7 @@ Fejl: %5 - Modeling + ::ModelEditor Modeling Modelering diff --git a/share/qtcreator/translations/qtcreator_de.ts b/share/qtcreator/translations/qtcreator_de.ts index 79211dada5a..b84b0a9aa1e 100644 --- a/share/qtcreator/translations/qtcreator_de.ts +++ b/share/qtcreator/translations/qtcreator_de.ts @@ -34614,7 +34614,7 @@ provided they were unmodified before the refactoring. - ModelEditor::Internal::ActionHandler + ::ModelEditor &Remove &Entfernen @@ -34675,9 +34675,6 @@ provided they were unmodified before the refactoring. Return Return - - - ModelEditor::Internal::ModelEditor <html><body style="color:#909090; font-size:14px"><div align='center'><div style="font-size:20px">Open a diagram</div><table><tr><td><hr/><div style="margin-top: 5px">&bull; Double-click on diagram in model tree</div><div style="margin-top: 5px">&bull; Select "Open Diagram" from package's context menu in model tree</div></td></tr></table></div></body></html> <html><body style="color:#909090; font-size:14px"><div align='center'><div style="font-size:20px">Diagramm öffnen</div><table><tr><td><hr/><div style="margin-top: 5px">&bull; Doppelklick auf ein Diagramm im Baum</div><div style="margin-top: 5px">&bull; Wählen Sie "Diagramm öffnen" aus dem Kontextmenü eines Pakets im Baum</div></td></tr></table></div></body></html> @@ -37492,7 +37489,7 @@ Siehe auch die Einstellungen für Google Test. - ModelEditor::Internal::ModelDocument + ::ModelEditor No model loaded. Cannot save. Kein Modell geladen, daher ist sichern nicht möglich. @@ -37501,23 +37498,14 @@ Siehe auch die Einstellungen für Google Test. Could not open "%1" for reading: %2. "%1" konnte nicht gelesen werden: %2. - - - Modeling Modeling Modellierung - - - ModelEditor::Internal::ModelsManager Open Diagram Diagramm öffnen - - - ModelEditor::Internal::PxNodeController Add Component %1 Komponente %1 hinzufügen @@ -37594,7 +37582,7 @@ Sie werden erhalten. - ModelEditor::Internal::ExtPropertiesMView + ::ModelEditor Select Custom Configuration Folder Konfigurationsverzeichnis auswählen @@ -39469,7 +39457,7 @@ Ablaufdatum: %3 - ModelEditor::Internal::ElementTasks + ::ModelEditor Update Include Dependencies Include-Abhängigkeiten aktualisieren diff --git a/share/qtcreator/translations/qtcreator_hr.ts b/share/qtcreator/translations/qtcreator_hr.ts index 7644a893f08..4278d56267f 100644 --- a/share/qtcreator/translations/qtcreator_hr.ts +++ b/share/qtcreator/translations/qtcreator_hr.ts @@ -25005,7 +25005,7 @@ Rok upotrebe: %3 - ModelEditor::Internal::ActionHandler + ::ModelEditor &Remove &Ukloni @@ -25066,16 +25066,10 @@ Rok upotrebe: %3 Return Return - - - ModelEditor::Internal::ElementTasks Update Include Dependencies Aktualiziraj dodavanje ovisnosti - - - ModelEditor::Internal::ExtPropertiesMView Select Custom Configuration Folder Odaberi mapu prilagođene konfiguracije @@ -25088,9 +25082,6 @@ Rok upotrebe: %3 <font color=red>Model file must be reloaded.</font> <font color=red>Datoteka modela se mora ponovo učitati.</font> - - - ModelEditor::Internal::ModelDocument No model loaded. Cannot save. Nijedan model nije učitan. Spremanje nije moguće. @@ -25099,9 +25090,6 @@ Rok upotrebe: %3 Could not open "%1" for reading: %2. Nije bilo moguće otvoriti "%1" za čitanje: %2. - - - ModelEditor::Internal::ModelEditor <html><body style="color:#909090; font-size:14px"><div align='center'><div style="font-size:20px">Open a diagram</div><table><tr><td><hr/><div style="margin-top: 5px">&bull; Double-click on diagram in model tree</div><div style="margin-top: 5px">&bull; Select "Open Diagram" from package's context menu in model tree</div></td></tr></table></div></body></html> <html><body style="color:#909090; font-size:14px"><div align='center'><div style="font-size:20px">Otvori dijagram</div><table><tr><td><hr/><div style="margin-top: 5px">&bull; Dvoklik na dijagram u stablastom modelu</div><div style="margin-top: 5px">&bull; Odabei "Otvori dijagram" iz kontekstnog izbornika u stablastom modelu</div></td></tr></table></div></body></html> @@ -25198,30 +25186,18 @@ Rok upotrebe: %3 Swimlane Dijagram toka - - - ::ModelEditor Zoom: %1% Zumiraj: %1% - - - Modeling Modeling Modeliranje - - - ModelEditor::Internal::ModelsManager Open Diagram Otvori dijagram - - - ModelEditor::Internal::PxNodeController Add Component %1 Dodaj komponentu %1 diff --git a/share/qtcreator/translations/qtcreator_ja.ts b/share/qtcreator/translations/qtcreator_ja.ts index 744ce194c7b..6f624b630a6 100644 --- a/share/qtcreator/translations/qtcreator_ja.ts +++ b/share/qtcreator/translations/qtcreator_ja.ts @@ -38772,7 +38772,7 @@ Would you like to overwrite it? - ModelEditor::Internal::ActionHandler + ::ModelEditor &Remove 図から削除(&R) @@ -38837,9 +38837,6 @@ Would you like to overwrite it? Return Return - - - ModelEditor::Internal::ExtPropertiesMView Select Custom Configuration Folder カスタム設定フォルダの選択 @@ -38852,9 +38849,6 @@ Would you like to overwrite it? <font color=red>Model file must be reloaded.</font> <font color="red">モデルファイルの再読込が必要です。</font> - - - ModelEditor::Internal::ModelDocument No model loaded. Cannot save. モデルが読み込まれていないため、保存できません。 @@ -38867,29 +38861,10 @@ Would you like to overwrite it? Could not open "%1" for reading: %2. 読み込み用に "%1" を開けません: %2. - - - ModelEditor::Internal::ModelEditor <html><body style="color:#909090; font-size:14px"><div align='center'><div style="font-size:20px">Open a diagram</div><table><tr><td><hr/><div style="margin-top: 5px">&bull; Double-click on diagram in model tree</div><div style="margin-top: 5px">&bull; Select "Open Diagram" from package's context menu in model tree</div></td></tr></table></div></body></html> <html><body style="color:#909090; font-size:14px"><div align='center'><div style="font-size:20px">図を開く</div><table><tr><td><hr/><div style="margin-top: 5px">&bull; モデルツリー内で図をダブルクリックする</div><div style="margin-top: 5px">&bull; モデルツリー内のパッケージのコンテキストメニューから"図を開く"を選択する</div></td></tr></table></div></body></html> - - Add Package - パッケージの追加 - - - Add Component - コンポーネントの追加 - - - Add Class - クラスの追加 - - - Add Canvas Diagram - キャンバス図の追加 - Images (*.png *.jpeg *.jpg *.tif *.tiff);;PDF (*.pdf) 画像 (*.png *.jpeg *.jpg *.tif *.tiff);;PDF (*.pdf) @@ -38950,23 +38925,14 @@ Would you like to overwrite it? Boundary 境界 - - - Modeling Modeling モデリング - - - ModelEditor::Internal::ModelsManager Open Diagram 図を開く - - - ModelEditor::Internal::PxNodeController Add Component %1 コンポーネント %1 の追加 diff --git a/share/qtcreator/translations/qtcreator_pl.ts b/share/qtcreator/translations/qtcreator_pl.ts index 6b8d1294816..c92c5b815c1 100644 --- a/share/qtcreator/translations/qtcreator_pl.ts +++ b/share/qtcreator/translations/qtcreator_pl.ts @@ -33620,7 +33620,7 @@ itself takes time. - ModelEditor::Internal::ActionHandler + ::ModelEditor &Remove &Usuń @@ -33689,9 +33689,6 @@ itself takes time. Return Powróć - - - ModelEditor::Internal::ModelDocument No model loaded. Cannot save. Brak załadowanego projektu. Nie można zachować. @@ -33704,29 +33701,10 @@ itself takes time. Could not open "%1" for reading: %2. Nie można otworzyć "%1" do odczytu: %2. - - - ModelEditor::Internal::ModelEditor <html><body style="color:#909090; font-size:14px"><div align='center'><div style="font-size:20px">Open a diagram</div><table><tr><td><hr/><div style="margin-top: 5px">&bull; Double-click on diagram in model tree</div><div style="margin-top: 5px">&bull; Select "Open Diagram" from package's context menu in model tree</div></td></tr></table></div></body></html> - - Add Package - Dodaj pakiet - - - Add Component - Dodaj komponent - - - Add Class - Dodaj klasę - - - Add Canvas Diagram - Dodaj diagram płótna - Images (*.png *.jpeg *.jpg *.tif *.tiff);;PDF (*.pdf) Pliki graficzne (*.png *.jpeg *.jpg *.tif *.tiff);;PDF (*.pdf) @@ -33771,23 +33749,14 @@ itself takes time. Boundary Granice - - - Modeling Modeling Modelowanie - - - ModelEditor::Internal::ModelsManager Open Diagram Otwórz diagram - - - ModelEditor::Internal::PxNodeController Add Component %1 Dodaj komponent %1 @@ -35433,7 +35402,7 @@ Czy nadpisać go? - ModelEditor::Internal::ExtPropertiesMView + ::ModelEditor Select Custom Configuration Folder Wybierz katalog z własną konfiguracją @@ -39640,7 +39609,7 @@ Błąd: %5 - ModelEditor::Internal::ElementTasks + ::ModelEditor Update Include Dependencies Uaktualnij zależności diff --git a/share/qtcreator/translations/qtcreator_ru.ts b/share/qtcreator/translations/qtcreator_ru.ts index 08bc9a383e9..9bd650d0b44 100644 --- a/share/qtcreator/translations/qtcreator_ru.ts +++ b/share/qtcreator/translations/qtcreator_ru.ts @@ -24941,9 +24941,6 @@ Useful if build directory is corrupted or when rebuilding with a newer version o Zoom: %1% Масштаб: %1% - - - ModelEditor::Internal::ActionHandler &Remove &Убрать @@ -25005,16 +25002,10 @@ Useful if build directory is corrupted or when rebuilding with a newer version o Return Ввод - - - ModelEditor::Internal::ElementTasks Update Include Dependencies Обновить зависимость от включаемых файлов - - - ModelEditor::Internal::ExtPropertiesMView Select Custom Configuration Folder Выбор особого каталога настроек @@ -25027,9 +25018,6 @@ Useful if build directory is corrupted or when rebuilding with a newer version o <font color=red>Model file must be reloaded.</font> <font color=red>Файл модели должен быть перезагружен.</font> - - - ModelEditor::Internal::ModelDocument No model loaded. Cannot save. Модель не загружена. Сохранить невозможно. @@ -25038,9 +25026,6 @@ Useful if build directory is corrupted or when rebuilding with a newer version o Could not open "%1" for reading: %2. Не удалось открыть файл «%1» для чтения: %2. - - - ModelEditor::Internal::ModelEditor <html><body style="color:#909090; font-size:14px"><div align='center'><div style="font-size:20px">Open a diagram</div><table><tr><td><hr/><div style="margin-top: 5px">&bull; Double-click on diagram in model tree</div><div style="margin-top: 5px">&bull; Select "Open Diagram" from package's context menu in model tree</div></td></tr></table></div></body></html> <html><body style="color:#909090; font-size:14px"><div align='center'><div style="font-size:20px">Открытие диаграммы</div><table><tr><td><hr/><div style="margin-top: 5px">&bull; Двойной щелчок на диаграмме в дереве модели</div><div style="margin-top: 5px">&bull; «Открыть диаграмму» в контекстном меню пакета дерева модели</div></td></tr></table></div></body></html> @@ -25137,16 +25122,10 @@ Useful if build directory is corrupted or when rebuilding with a newer version o Swimlane Swimlane - - - ModelEditor::Internal::ModelsManager Open Diagram Открыть диаграмму - - - ModelEditor::Internal::PxNodeController Add Component %1 Добавить компонент %1 @@ -25207,7 +25186,7 @@ Useful if build directory is corrupted or when rebuilding with a newer version o - Modeling + ::ModelEditor Modeling Моделирование diff --git a/share/qtcreator/translations/qtcreator_uk.ts b/share/qtcreator/translations/qtcreator_uk.ts index 545cfe05018..832ba384b66 100644 --- a/share/qtcreator/translations/qtcreator_uk.ts +++ b/share/qtcreator/translations/qtcreator_uk.ts @@ -42108,7 +42108,7 @@ the program. - ModelEditor::Internal::ActionHandler + ::ModelEditor &Remove &Прибрати @@ -42145,9 +42145,6 @@ the program. Return - - - ModelEditor::Internal::ModelDocument No model loaded. Cannot save. Модель на завантажено. Неможливо зберегти. @@ -42164,9 +42161,6 @@ the program. Could not open "%1" for reading: %2. Не вдалось відкрити файл '%1' для читання: %2. - - - ModelEditor::Internal::ModelEditor <html><body style="color:#909090; font-size:14px"><div align='center'><div style="font-size:20px">Open a diagram</div><table><tr><td><hr/><div style="margin-top: 5px">&bull; Double-click on diagram in model tree</div><div style="margin-top: 5px">&bull; Select "Open Diagram" from package's context menu in model tree</div></td></tr></table></div></body></html> <html><body style="color:#909090; font-size:14px"><div align='center'><div style="font-size:20px">Відкрити діаграму</div><table><tr><td><hr/><div style="margin-top: 5px">&bull; Подвійне клацання на діаграмі в дереві моделі</div><div style="margin-top: 5px">&bull; Виберіть "Відкрити діаграму" з контекстного меню пакунка в дереві моделі</div></td></tr></table></div></body></html> @@ -42231,16 +42225,10 @@ the program. Boundary Границя - - - Modeling Modeling Моделювання - - - ModelEditor::Internal::FileWizardFactory Model Модель @@ -42265,16 +42253,10 @@ the program. Location: Розташування: - - - ModelEditor::Internal::ModelsManager Open Diagram Відкрити діаграму - - - ModelEditor::Internal::PxNodeController Add Component %1 Додати компонент %1 @@ -43890,7 +43872,7 @@ Would you like to overwrite it? - ModelEditor::Internal::ExtPropertiesMView + ::ModelEditor Select Custom Configuration Folder Оберіть теку для налаштувань користувача diff --git a/share/qtcreator/translations/qtcreator_zh_CN.ts b/share/qtcreator/translations/qtcreator_zh_CN.ts index 3b3aec36653..b39f8ca8d27 100644 --- a/share/qtcreator/translations/qtcreator_zh_CN.ts +++ b/share/qtcreator/translations/qtcreator_zh_CN.ts @@ -24851,9 +24851,6 @@ Useful if build directory is corrupted or when rebuilding with a newer version o Zoom: %1% - - - ModelEditor::Internal::ActionHandler &Remove 删除(&R) @@ -24914,16 +24911,10 @@ Useful if build directory is corrupted or when rebuilding with a newer version o Return - - - ModelEditor::Internal::ElementTasks Update Include Dependencies - - - ModelEditor::Internal::ExtPropertiesMView Select Custom Configuration Folder @@ -24936,9 +24927,6 @@ Useful if build directory is corrupted or when rebuilding with a newer version o <font color=red>Model file must be reloaded.</font> - - - ModelEditor::Internal::ModelDocument No model loaded. Cannot save. @@ -24947,9 +24935,6 @@ Useful if build directory is corrupted or when rebuilding with a newer version o Could not open "%1" for reading: %2. - - - ModelEditor::Internal::ModelEditor <html><body style="color:#909090; font-size:14px"><div align='center'><div style="font-size:20px">Open a diagram</div><table><tr><td><hr/><div style="margin-top: 5px">&bull; Double-click on diagram in model tree</div><div style="margin-top: 5px">&bull; Select "Open Diagram" from package's context menu in model tree</div></td></tr></table></div></body></html> @@ -25046,16 +25031,10 @@ Useful if build directory is corrupted or when rebuilding with a newer version o Swimlane - - - ModelEditor::Internal::ModelsManager Open Diagram - - - ModelEditor::Internal::PxNodeController Add Component %1 @@ -25144,7 +25123,7 @@ Error: - Modeling + ::ModelEditor Modeling diff --git a/src/plugins/modeleditor/actionhandler.cpp b/src/plugins/modeleditor/actionhandler.cpp index 142dd3ad2ee..8dbca707de3 100644 --- a/src/plugins/modeleditor/actionhandler.cpp +++ b/src/plugins/modeleditor/actionhandler.cpp @@ -3,8 +3,9 @@ #include "actionhandler.h" -#include "modeleditor_constants.h" #include "modeleditor.h" +#include "modeleditor_constants.h" +#include "modeleditortr.h" #include #include @@ -120,26 +121,26 @@ void ActionHandler::createActions() d->pasteAction = registerCommand(Core::Constants::PASTE, &ModelEditor::paste, d->context)->action(); Core::Command *removeCommand = registerCommand( Constants::REMOVE_SELECTED_ELEMENTS, &ModelEditor::removeSelectedElements, d->context, - tr("&Remove"), QKeySequence::Delete); + Tr::tr("&Remove"), QKeySequence::Delete); medit->addAction(removeCommand, Core::Constants::G_EDIT_COPYPASTE); d->removeAction = removeCommand->action(); Core::Command *deleteCommand = registerCommand( Constants::DELETE_SELECTED_ELEMENTS, &ModelEditor::deleteSelectedElements, d->context, - tr("&Delete"), QKeySequence("Ctrl+D")); + Tr::tr("&Delete"), QKeySequence("Ctrl+D")); medit->addAction(deleteCommand, Core::Constants::G_EDIT_COPYPASTE); d->deleteAction = deleteCommand->action(); d->selectAllAction = registerCommand(Core::Constants::SELECTALL, &ModelEditor::selectAll, d->context)->action(); Core::Command *exportDiagramCommand = registerCommand( Constants::EXPORT_DIAGRAM, &ModelEditor::exportDiagram, d->context, - tr("Export Diagram...")); + Tr::tr("Export Diagram...")); exportDiagramCommand->setAttribute(Core::Command::CA_Hide); mfile->addAction(exportDiagramCommand, Core::Constants::G_FILE_EXPORT); d->exportDiagramAction = exportDiagramCommand->action(); Core::Command *exportSelectedElementsCommand = registerCommand( Constants::EXPORT_SELECTED_ELEMENTS, &ModelEditor::exportSelectedElements, d->context, - tr("Export Selected Elements...")); + Tr::tr("Export Selected Elements...")); exportSelectedElementsCommand->setAttribute(Core::Command::CA_Hide); mfile->addAction(exportSelectedElementsCommand, Core::Constants::G_FILE_EXPORT); d->exportSelectedElementsAction = exportSelectedElementsCommand->action(); @@ -150,34 +151,34 @@ void ActionHandler::createActions() d->openParentDiagramAction = registerCommand( Constants::OPEN_PARENT_DIAGRAM, &ModelEditor::openParentDiagram, Core::Context(), - tr("Open Parent Diagram"), QKeySequence("Ctrl+Shift+P"), + Tr::tr("Open Parent Diagram"), QKeySequence("Ctrl+Shift+P"), QIcon(":/modeleditor/up.png"))->action(); - registerCommand(Constants::ACTION_ADD_PACKAGE, nullptr, Core::Context(), tr("Add Package"), + registerCommand(Constants::ACTION_ADD_PACKAGE, nullptr, Core::Context(), Tr::tr("Add Package"), QKeySequence(), QIcon(":/modelinglib/48x48/package.png")); - registerCommand(Constants::ACTION_ADD_COMPONENT, nullptr, Core::Context(), tr("Add Component"), + registerCommand(Constants::ACTION_ADD_COMPONENT, nullptr, Core::Context(), Tr::tr("Add Component"), QKeySequence(), QIcon(":/modelinglib/48x48/component.png")); - registerCommand(Constants::ACTION_ADD_CLASS, nullptr, Core::Context(), tr("Add Class"), + registerCommand(Constants::ACTION_ADD_CLASS, nullptr, Core::Context(), Tr::tr("Add Class"), QKeySequence(), QIcon(":/modelinglib/48x48/class.png")); - registerCommand(Constants::ACTION_ADD_CANVAS_DIAGRAM, nullptr, Core::Context(), tr("Add Canvas Diagram"), + registerCommand(Constants::ACTION_ADD_CANVAS_DIAGRAM, nullptr, Core::Context(), Tr::tr("Add Canvas Diagram"), QKeySequence(), QIcon(":/modelinglib/48x48/canvas-diagram.png")); d->synchronizeBrowserAction = registerCommand( Constants::ACTION_SYNC_BROWSER, nullptr, Core::Context(), - tr("Synchronize Browser and Diagram") + "
" - + tr("Press && Hold for Options") + "", QKeySequence(), + Tr::tr("Synchronize Browser and Diagram") + "
" + + Tr::tr("Press && Hold for Options") + "", QKeySequence(), Utils::Icons::LINK_TOOLBAR.icon())->action(); d->synchronizeBrowserAction->setCheckable(true); - auto editPropertiesAction = new QAction(tr("Edit Element Properties"), + auto editPropertiesAction = new QAction(Tr::tr("Edit Element Properties"), Core::ICore::dialogParent()); Core::Command *editPropertiesCommand = Core::ActionManager::registerAction( editPropertiesAction, Constants::SHORTCUT_MODEL_EDITOR_EDIT_PROPERTIES, d->context); - editPropertiesCommand->setDefaultKeySequence(QKeySequence(tr("Shift+Return"))); + editPropertiesCommand->setDefaultKeySequence(QKeySequence(Tr::tr("Shift+Return"))); connect(editPropertiesAction, &QAction::triggered, this, &ActionHandler::onEditProperties); - auto editItemAction = new QAction(tr("Edit Item on Diagram"), Core::ICore::dialogParent()); + auto editItemAction = new QAction(Tr::tr("Edit Item on Diagram"), Core::ICore::dialogParent()); Core::Command *editItemCommand = Core::ActionManager::registerAction( editItemAction, Constants::SHORTCUT_MODEL_EDITOR_EDIT_ITEM, d->context); - editItemCommand->setDefaultKeySequence(QKeySequence(tr("Return"))); + editItemCommand->setDefaultKeySequence(QKeySequence(Tr::tr("Return"))); connect(editItemAction, &QAction::triggered, this, &ActionHandler::onEditItem); } diff --git a/src/plugins/modeleditor/elementtasks.cpp b/src/plugins/modeleditor/elementtasks.cpp index 819a41259a8..e0efd6914a6 100644 --- a/src/plugins/modeleditor/elementtasks.cpp +++ b/src/plugins/modeleditor/elementtasks.cpp @@ -3,10 +3,11 @@ #include "elementtasks.h" +#include "componentviewcontroller.h" +#include "modeleditor_plugin.h" +#include "modeleditortr.h" #include "modelsmanager.h" #include "openelementvisitor.h" -#include "modeleditor_plugin.h" -#include "componentviewcontroller.h" #include "qmt/diagram/delement.h" #include "qmt/diagram/dpackage.h" @@ -407,7 +408,7 @@ bool ElementTasks::extendContextMenu(const qmt::DElement *delement, const qmt::M { bool extended = false; if (dynamic_cast(delement)) { - menu->addAction(new qmt::ContextMenuAction(tr("Update Include Dependencies"), "updateIncludeDependencies", menu)); + menu->addAction(new qmt::ContextMenuAction(Tr::tr("Update Include Dependencies"), "updateIncludeDependencies", menu)); extended = true; } return extended; diff --git a/src/plugins/modeleditor/extpropertiesmview.cpp b/src/plugins/modeleditor/extpropertiesmview.cpp index 9b52d9fb634..4977d816b18 100644 --- a/src/plugins/modeleditor/extpropertiesmview.cpp +++ b/src/plugins/modeleditor/extpropertiesmview.cpp @@ -3,6 +3,8 @@ #include "extpropertiesmview.h" +#include "modeleditortr.h" + #include "qmt/model/mpackage.h" #include "qmt/project/project.h" #include "qmt/project_controller/projectcontroller.h" @@ -37,14 +39,14 @@ void ExtPropertiesMView::visitMPackage(const qmt::MPackage *package) qmt::Project *project = m_projectController->project(); if (!m_configPath) { m_configPath = new Utils::PathChooser(m_topWidget); - m_configPath->setPromptDialogTitle(tr("Select Custom Configuration Folder")); + m_configPath->setPromptDialogTitle(Tr::tr("Select Custom Configuration Folder")); m_configPath->setExpectedKind(Utils::PathChooser::ExistingDirectory); m_configPath->setValidationFunction([=](Utils::FancyLineEdit *edit, QString *errorMessage) { return edit->text().isEmpty() || m_configPath->defaultValidationFunction()(edit, errorMessage); }); m_configPath->setInitialBrowsePathBackup( Utils::FilePath::fromString(project->fileName()).absolutePath()); - addRow(tr("Config path:"), m_configPath, "configpath"); + addRow(Tr::tr("Config path:"), m_configPath, "configpath"); connect(m_configPath, &Utils::PathChooser::textChanged, this, &ExtPropertiesMView::onConfigPathChanged); } @@ -88,7 +90,7 @@ void ExtPropertiesMView::onConfigPathChanged() } } if (modified && m_configPathInfo) - m_configPathInfo->setText(tr("Model file must be reloaded.")); + m_configPathInfo->setText(Tr::tr("Model file must be reloaded.")); } } // namespace Interal diff --git a/src/plugins/modeleditor/modeldocument.cpp b/src/plugins/modeleditor/modeldocument.cpp index b389c2dc898..341b9144bd3 100644 --- a/src/plugins/modeleditor/modeldocument.cpp +++ b/src/plugins/modeleditor/modeldocument.cpp @@ -3,10 +3,11 @@ #include "modeldocument.h" +#include "extdocumentcontroller.h" #include "modeleditor_constants.h" #include "modeleditor_plugin.h" +#include "modeleditortr.h" #include "modelsmanager.h" -#include "extdocumentcontroller.h" #include "qmt/config/configcontroller.h" #include "qmt/infrastructure/ioexceptions.h" @@ -57,7 +58,7 @@ Core::IDocument::OpenResult ModelDocument::open(QString *errorString, bool ModelDocument::save(QString *errorString, const Utils::FilePath &filePath, bool autoSave) { if (!d->documentController) { - *errorString = tr("No model loaded. Cannot save."); + *errorString = Tr::tr("No model loaded. Cannot save."); return false; } @@ -107,7 +108,7 @@ bool ModelDocument::reload(QString *errorString, Core::IDocument::ReloadFlag fla *errorString = ex.errorMessage(); return false; } catch (const qmt::Exception &ex) { - *errorString = tr("Could not open \"%1\" for reading: %2.").arg(filePath().toString()).arg(ex.errorMessage()); + *errorString = Tr::tr("Could not open \"%1\" for reading: %2.").arg(filePath().toString()).arg(ex.errorMessage()); return false; } emit contentSet(); @@ -131,7 +132,7 @@ Core::IDocument::OpenResult ModelDocument::load(QString *errorString, const QStr *errorString = ex.errorMessage(); return OpenResult::ReadError; } catch (const qmt::Exception &ex) { - *errorString = tr("Could not open \"%1\" for reading: %2.").arg(fileName).arg(ex.errorMessage()); + *errorString = Tr::tr("Could not open \"%1\" for reading: %2.").arg(fileName).arg(ex.errorMessage()); return OpenResult::CannotHandle; } diff --git a/src/plugins/modeleditor/modeleditor.cpp b/src/plugins/modeleditor/modeleditor.cpp index 8443839d581..0229ceba00f 100644 --- a/src/plugins/modeleditor/modeleditor.cpp +++ b/src/plugins/modeleditor/modeleditor.cpp @@ -233,7 +233,7 @@ void ModelEditor::init() d->noDiagramLabel = new QLabel(d->diagramStack); const QString placeholderText = - tr("" + Tr::tr("" "
" "
Open a diagram
" "
" @@ -333,13 +333,13 @@ void ModelEditor::init() syncToggleButton->setDefaultAction(d->actionHandler->synchronizeBrowserAction()); QMenu *syncMenu = new QMenu(syncToggleButton); QActionGroup *syncGroup = new QActionGroup(syncMenu); - d->syncBrowserWithDiagramAction = syncMenu->addAction(tr("Synchronize Structure with Diagram")); + d->syncBrowserWithDiagramAction = syncMenu->addAction(Tr::tr("Synchronize Structure with Diagram")); d->syncBrowserWithDiagramAction->setCheckable(true); d->syncBrowserWithDiagramAction->setActionGroup(syncGroup); - d->syncDiagramWithBrowserAction = syncMenu->addAction(tr("Synchronize Diagram with Structure")); + d->syncDiagramWithBrowserAction = syncMenu->addAction(Tr::tr("Synchronize Diagram with Structure")); d->syncDiagramWithBrowserAction->setCheckable(true); d->syncDiagramWithBrowserAction->setActionGroup(syncGroup); - d->syncEachOtherAction = syncMenu->addAction(tr("Keep Synchronized")); + d->syncEachOtherAction = syncMenu->addAction(Tr::tr("Keep Synchronized")); d->syncEachOtherAction->setCheckable(true); d->syncEachOtherAction->setActionGroup(syncGroup); syncToggleButton->setMenu(syncMenu); @@ -573,13 +573,13 @@ void ModelEditor::exportToImage(bool selectedElements) if (diagram) { if (d->lastExportDirPath.isEmpty()) d->lastExportDirPath = d->document->filePath().toFileInfo().canonicalPath(); - QString filter = tr("Images (*.png *.jpeg *.jpg *.tif *.tiff);;PDF (*.pdf)"); + QString filter = Tr::tr("Images (*.png *.jpeg *.jpg *.tif *.tiff);;PDF (*.pdf)"); #ifndef QT_NO_SVG - filter += tr(";;SVG (*.svg)"); + filter += Tr::tr(";;SVG (*.svg)"); #endif // QT_NO_SVG QString fileName = FileUtils::getSaveFilePath( nullptr, - selectedElements ? tr("Export Selected Elements") : tr("Export Diagram"), + selectedElements ? Tr::tr("Export Selected Elements") : Tr::tr("Export Diagram"), FilePath::fromString(d->lastExportDirPath), filter).toString(); if (!fileName.isEmpty()) { qmt::DocumentController *documentController = d->document->documentController(); @@ -602,11 +602,11 @@ void ModelEditor::exportToImage(bool selectedElements) if (success) d->lastExportDirPath = QFileInfo(fileName).canonicalPath(); else if (selectedElements) - QMessageBox::critical(Core::ICore::dialogParent(), tr("Exporting Selected Elements Failed"), - tr("Exporting the selected elements of the current diagram into file
\"%1\"
failed.").arg(fileName)); + QMessageBox::critical(Core::ICore::dialogParent(), Tr::tr("Exporting Selected Elements Failed"), + Tr::tr("Exporting the selected elements of the current diagram into file
\"%1\"
failed.").arg(fileName)); else - QMessageBox::critical(Core::ICore::dialogParent(), tr("Exporting Diagram Failed"), - tr("Exporting the diagram into file
\"%1\"
failed.").arg(fileName)); + QMessageBox::critical(Core::ICore::dialogParent(), Tr::tr("Exporting Diagram Failed"), + Tr::tr("Exporting the diagram into file
\"%1\"
failed.").arg(fileName)); } } } @@ -1096,7 +1096,7 @@ void ModelEditor::initToolbars() styleEngineElementType = qmt::StyleEngine::TypeSwimlane; } QIcon icon; - QString newElementName = tr("New %1").arg(tool.m_name); + QString newElementName = Tr::tr("New %1").arg(tool.m_name); if (!tool.m_stereotype.isEmpty() && stereotypeIconElement != qmt::StereotypeIcon::ElementAny) { const qmt::Style *style = documentController->styleController()->adaptStyle(styleEngineElementType); icon = stereotypeController->createIcon( @@ -1139,32 +1139,32 @@ void ModelEditor::initToolbars() toolBars.insert(generalId, toolBar); toolBarLayout->addWidget( new DragTool(QIcon(":/modelinglib/48x48/package.png"), - tr("Package"), tr("New Package"), QLatin1String(qmt::ELEMENT_TYPE_PACKAGE), + Tr::tr("Package"), Tr::tr("New Package"), QLatin1String(qmt::ELEMENT_TYPE_PACKAGE), QString(), toolBar)); toolBarLayout->addWidget( new DragTool(QIcon(":/modelinglib/48x48/component.png"), - tr("Component"), tr("New Component"), QLatin1String(qmt::ELEMENT_TYPE_COMPONENT), + Tr::tr("Component"), Tr::tr("New Component"), QLatin1String(qmt::ELEMENT_TYPE_COMPONENT), QString(), toolBar)); toolBarLayout->addWidget( new DragTool(QIcon(":/modelinglib/48x48/class.png"), - tr("Class"), tr("New Class"), QLatin1String(qmt::ELEMENT_TYPE_CLASS), + Tr::tr("Class"), Tr::tr("New Class"), QLatin1String(qmt::ELEMENT_TYPE_CLASS), QString(), toolBar)); toolBarLayout->addWidget( new DragTool(QIcon(":/modelinglib/48x48/item.png"), - tr("Item"), tr("New Item"), QLatin1String(qmt::ELEMENT_TYPE_ITEM), + Tr::tr("Item"), Tr::tr("New Item"), QLatin1String(qmt::ELEMENT_TYPE_ITEM), QString(), toolBar)); toolBarLayout->addWidget(Layouting::createHr(d->leftToolBox)); toolBarLayout->addWidget( new DragTool(QIcon(":/modelinglib/48x48/annotation.png"), - tr("Annotation"), QString(), QLatin1String(qmt::ELEMENT_TYPE_ANNOTATION), + Tr::tr("Annotation"), QString(), QLatin1String(qmt::ELEMENT_TYPE_ANNOTATION), QString(), toolBar)); toolBarLayout->addWidget( new DragTool(QIcon(":/modelinglib/48x48/boundary.png"), - tr("Boundary"), QString(), QLatin1String(qmt::ELEMENT_TYPE_BOUNDARY), + Tr::tr("Boundary"), QString(), QLatin1String(qmt::ELEMENT_TYPE_BOUNDARY), QString(), toolBar)); toolBarLayout->addWidget( new DragTool(QIcon(":/modelinglib/48x48/swimlane.png"), - tr("Swimlane"), QString(), QLatin1String(qmt::ELEMENT_TYPE_SWIMLANE), + Tr::tr("Swimlane"), QString(), QLatin1String(qmt::ELEMENT_TYPE_SWIMLANE), QString(), toolBar)); } diff --git a/src/plugins/modeleditor/modelsmanager.cpp b/src/plugins/modeleditor/modelsmanager.cpp index 6b3e49fcade..787c5556fda 100644 --- a/src/plugins/modeleditor/modelsmanager.cpp +++ b/src/plugins/modeleditor/modelsmanager.cpp @@ -6,8 +6,9 @@ #include "diagramsviewmanager.h" #include "extdocumentcontroller.h" #include "modeldocument.h" -#include "modeleditor_constants.h" #include "modeleditor.h" +#include "modeleditor_constants.h" +#include "modeleditortr.h" #include "modelindexer.h" #include "pxnodecontroller.h" @@ -97,7 +98,7 @@ ModelsManager::ModelsManager(QObject *parent) ProjectExplorer::Constants::M_FOLDERCONTEXT); folderContainer->insertGroup(ProjectExplorer::Constants::G_FOLDER_FILES, Constants::EXPLORER_GROUP_MODELING); - d->openDiagramContextMenuItem = new QAction(tr("Open Diagram"), this); + d->openDiagramContextMenuItem = new QAction(Tr::tr("Open Diagram"), this); Core::Command *cmd = Core::ActionManager::registerAction( d->openDiagramContextMenuItem, Constants::ACTION_EXPLORER_OPEN_DIAGRAM, projectTreeContext); diff --git a/src/plugins/modeleditor/pxnodecontroller.cpp b/src/plugins/modeleditor/pxnodecontroller.cpp index 1338a79f93b..d17e2232f83 100644 --- a/src/plugins/modeleditor/pxnodecontroller.cpp +++ b/src/plugins/modeleditor/pxnodecontroller.cpp @@ -3,11 +3,12 @@ #include "pxnodecontroller.h" -#include "pxnodeutilities.h" -#include "componentviewcontroller.h" #include "classviewcontroller.h" +#include "componentviewcontroller.h" +#include "modeleditortr.h" #include "modelutilities.h" #include "packageviewcontroller.h" +#include "pxnodeutilities.h" #include "qmt/model/mpackage.h" #include "qmt/model/mclass.h" @@ -134,7 +135,7 @@ void PxNodeController::addFileSystemEntry(const QString &filePath, int line, int QFileInfo fileInfo(filePath); if (fileInfo.exists() && fileInfo.isFile()) { auto menu = new QMenu; - menu->addAction(new MenuAction(tr("Add Component %1").arg(elementName), elementName, + menu->addAction(new MenuAction(Tr::tr("Add Component %1").arg(elementName), elementName, MenuAction::TYPE_ADD_COMPONENT, menu)); const QStringList classNames = Utils::toList( d->classViewController->findClassDeclarations( @@ -143,7 +144,7 @@ void PxNodeController::addFileSystemEntry(const QString &filePath, int line, int menu->addSeparator(); int index = 0; for (const QString &className : classNames) { - auto action = new MenuAction(tr("Add Class %1").arg(className), elementName, + auto action = new MenuAction(Tr::tr("Add Class %1").arg(className), elementName, MenuAction::TYPE_ADD_CLASS, index, menu); action->className = className; menu->addAction(action); @@ -161,15 +162,15 @@ void PxNodeController::addFileSystemEntry(const QString &filePath, int line, int // ignore line and column QString stereotype; auto menu = new QMenu; - auto action = new MenuAction(tr("Add Package %1").arg(elementName), elementName, + auto action = new MenuAction(Tr::tr("Add Package %1").arg(elementName), elementName, MenuAction::TYPE_ADD_PACKAGE, menu); action->packageStereotype = stereotype; menu->addAction(action); - action = new MenuAction(tr("Add Package and Diagram %1").arg(elementName), elementName, + action = new MenuAction(Tr::tr("Add Package and Diagram %1").arg(elementName), elementName, MenuAction::TYPE_ADD_PACKAGE_AND_DIAGRAM, menu); action->packageStereotype = stereotype; menu->addAction(action); - action = new MenuAction(tr("Add Component Model"), elementName, + action = new MenuAction(Tr::tr("Add Component Model"), elementName, MenuAction::TYPE_ADD_COMPONENT_MODEL, menu); action->packageStereotype = stereotype; menu->addAction(action); @@ -300,7 +301,7 @@ void PxNodeController::onMenuActionTriggered(PxNodeController::MenuAction *actio package->setName(action->elementName); if (!action->packageStereotype.isEmpty()) package->setStereotypes({action->packageStereotype}); - d->diagramSceneController->modelController()->undoController()->beginMergeSequence(tr("Create Component Model")); + d->diagramSceneController->modelController()->undoController()->beginMergeSequence(Tr::tr("Create Component Model")); QStringList relativeElements = qmt::NameController::buildElementsPath( d->pxnodeUtilities->calcRelativePath(filePath, d->anchorFolder), true); if (qmt::MObject *existingObject = d->pxnodeUtilities->findSameObject(relativeElements, package)) { @@ -321,7 +322,7 @@ void PxNodeController::onMenuActionTriggered(PxNodeController::MenuAction *actio } if (newObject) { - d->diagramSceneController->modelController()->undoController()->beginMergeSequence(tr("Drop Node")); + d->diagramSceneController->modelController()->undoController()->beginMergeSequence(Tr::tr("Drop Node")); qmt::MObject *parentForDiagram = nullptr; QStringList relativeElements = qmt::NameController::buildElementsPath( d->pxnodeUtilities->calcRelativePath(filePath, d->anchorFolder),