From 7fbaf735ed99f5b0d26adb686cfa6ed2bb4267d5 Mon Sep 17 00:00:00 2001 From: Przemyslaw Brudny Date: Thu, 21 Oct 2021 19:11:15 +0200 Subject: [PATCH] [EGD-7813] Option Window titles localizations fix Option Window titles localizations fix. --- .../ApplicationAlarmClock.cpp | 7 +++---- .../models/AlarmsModel.cpp | 3 ++- .../application-calllog/ApplicationCallLog.cpp | 7 +++---- .../windows/CallLogDetailsWindow.cpp | 2 +- .../application-messages/ApplicationMessages.cpp | 9 ++++----- .../application-messages/models/ThreadsModel.cpp | 2 +- .../widgets/SMSOutputWidget.cpp | 2 +- .../application-notes/ApplicationNotes.cpp | 7 +++---- .../application-notes/model/NotesListModel.cpp | 4 ++-- .../application-notes/windows/NoteEditWindow.cpp | 3 ++- .../windows/NotePreviewWindow.cpp | 3 ++- .../application-settings/ApplicationSettings.cpp | 4 ++-- .../windows/bluetooth/AddDeviceWindow.cpp | 1 + .../windows/bluetooth/BluetoothWindow.cpp | 2 ++ .../windows/network/NetworkWindow.cpp | 4 +++- .../windows/security/SecurityMainWindow.cpp | 4 +++- .../windows/system/SystemMainWindow.cpp | 4 +++- .../apps-common/options/OptionWindowName.hpp | 12 ++++++++++++ module-apps/apps-common/windows/OptionWindow.cpp | 15 +++++++++------ module-apps/apps-common/windows/OptionWindow.hpp | 11 +++++++++-- 20 files changed, 68 insertions(+), 38 deletions(-) create mode 100644 module-apps/apps-common/options/OptionWindowName.hpp diff --git a/module-apps/application-alarm-clock/ApplicationAlarmClock.cpp b/module-apps/application-alarm-clock/ApplicationAlarmClock.cpp index 11ab4199982091f12cc6552895580c7cb697270f..b878ce3c11d1debf5a734dc3bf8f5667bd3bd33a 100644 --- a/module-apps/application-alarm-clock/ApplicationAlarmClock.cpp +++ b/module-apps/application-alarm-clock/ApplicationAlarmClock.cpp @@ -102,10 +102,9 @@ namespace app std::make_unique(alarmsProvider); return std::make_unique(app, std::move(presenter)); }); - windowsFactory.attach(utils::translate("common_options_title"), - [](ApplicationCommon *app, const std::string &name) { - return std::make_unique(app, name); - }); + windowsFactory.attach(window::name::option_window, [](ApplicationCommon *app, const std::string &name) { + return std::make_unique(app, name); + }); windowsFactory.attach(style::alarmClock::window::name::dialogYesNo, [](ApplicationCommon *app, const std::string &name) { diff --git a/module-apps/application-alarm-clock/models/AlarmsModel.cpp b/module-apps/application-alarm-clock/models/AlarmsModel.cpp index 48563dc79f9eef2e3da77c765e6929ac927a1526..1badc68d4b71a08718855711e2ea50412231f77a 100644 --- a/module-apps/application-alarm-clock/models/AlarmsModel.cpp +++ b/module-apps/application-alarm-clock/models/AlarmsModel.cpp @@ -6,6 +6,7 @@ #include "application-alarm-clock/widgets/AlarmClockStyle.hpp" #include "application-alarm-clock/windows/AlarmClockOptions.hpp" #include "messages/OptionsWindow.hpp" +#include #include #include @@ -52,7 +53,7 @@ namespace app::alarmClock }; item->inputCallback = [this, record = record.get()](gui::Item &, const gui::InputEvent &event) { if (event.isShortRelease(gui::KeyCode::KEY_LF)) { - application->switchWindow(utils::translate("common_options_title"), + application->switchWindow(window::name::option_window, std::make_unique( alarmsListOptions(application, *record, *alarmsRepository))); } diff --git a/module-apps/application-calllog/ApplicationCallLog.cpp b/module-apps/application-calllog/ApplicationCallLog.cpp index c4b6bcee59963ff35ce7db6c97afa94fbb802c43..6d4e538e0ff4f97c095e5fa21bf0fd804ad63396 100644 --- a/module-apps/application-calllog/ApplicationCallLog.cpp +++ b/module-apps/application-calllog/ApplicationCallLog.cpp @@ -89,10 +89,9 @@ namespace app windowsFactory.attach(calllog::settings::DetailsWindowStr, [](ApplicationCommon *app, const std::string &name) { return std::make_unique(app); }); - windowsFactory.attach(utils::translate("common_options_title"), - [](ApplicationCommon *app, const std::string &name) { - return std::make_unique(app, name); - }); + windowsFactory.attach(window::name::option_window, [](ApplicationCommon *app, const std::string &name) { + return std::make_unique(app, name); + }); windowsFactory.attach(calllog::settings::DialogYesNoStr, [](ApplicationCommon *app, const std::string &name) { return std::make_unique(app, name); }); diff --git a/module-apps/application-calllog/windows/CallLogDetailsWindow.cpp b/module-apps/application-calllog/windows/CallLogDetailsWindow.cpp index 431c724317fcd58ed06c989f4f63a01425cf1be8..26d1f581318891bbe163ca9a21dd61cc71480581 100644 --- a/module-apps/application-calllog/windows/CallLogDetailsWindow.cpp +++ b/module-apps/application-calllog/windows/CallLogDetailsWindow.cpp @@ -225,7 +225,7 @@ namespace gui if (inputEvent.isShortRelease(KeyCode::KEY_LF)) { auto app = dynamic_cast(application); assert(app != nullptr); - app->switchWindow(utils::translate("common_options_title"), + app->switchWindow(window::name::option_window, std::make_unique(calllogWindowOptions(app, record))); return true; diff --git a/module-apps/application-messages/ApplicationMessages.cpp b/module-apps/application-messages/ApplicationMessages.cpp index 443e2ee0312190d2cc7959a65121d73b7aaf2371..a58be631d94bfca3bb560d76a11e9b513c5a967b 100644 --- a/module-apps/application-messages/ApplicationMessages.cpp +++ b/module-apps/application-messages/ApplicationMessages.cpp @@ -126,10 +126,9 @@ namespace app windowsFactory.attach(gui::name::window::new_sms, [](ApplicationCommon *app, const std::string &name) { return std::make_unique(app); }); - windowsFactory.attach(utils::translate("common_options_title"), - [](ApplicationCommon *app, const std::string &name) { - return std::make_unique(app, name); - }); + windowsFactory.attach(window::name::option_window, [](ApplicationCommon *app, const std::string &name) { + return std::make_unique(app, name); + }); windowsFactory.attach(gui::name::window::dialog, [](ApplicationCommon *app, const std::string &name) { return std::make_unique(app, name); }); @@ -408,7 +407,7 @@ namespace app { LOG_INFO("New message options for %s", requestingWindow.c_str()); auto opts = std::make_unique(newMessageWindowOptions(this, requestingWindow, text)); - switchWindow(utils::translate("common_options_title"), std::move(opts)); + switchWindow(window::name::option_window, std::move(opts)); return true; } diff --git a/module-apps/application-messages/models/ThreadsModel.cpp b/module-apps/application-messages/models/ThreadsModel.cpp index 0f138f7af56c3a4588a8eb68be4a570b0e33a1ad..ed2df245bb758ff2ed1d3f74a95d81f1baefadd6 100644 --- a/module-apps/application-messages/models/ThreadsModel.cpp +++ b/module-apps/application-messages/models/ThreadsModel.cpp @@ -56,7 +56,7 @@ auto ThreadsModel::getItem(gui::Order order) -> gui::ListItem * } if (event.is(gui::KeyCode::KEY_LF)) { application->switchWindow( - utils::translate("common_options_title"), + window::name::option_window, std::make_unique(threadWindowOptions(app, item->getThreadItem().get()))); } return false; diff --git a/module-apps/application-messages/widgets/SMSOutputWidget.cpp b/module-apps/application-messages/widgets/SMSOutputWidget.cpp index 59bb9ed0f18d4460e8d53b89ef5476d77e25bccb..34c0d4b36bec52140eaba4d4c573b52c9966c6af 100644 --- a/module-apps/application-messages/widgets/SMSOutputWidget.cpp +++ b/module-apps/application-messages/widgets/SMSOutputWidget.cpp @@ -87,7 +87,7 @@ namespace gui LOG_INFO("Message activated!"); auto app = dynamic_cast(application); assert(app != nullptr); - app->switchWindow(utils::translate("common_options_title"), + app->switchWindow(window::name::option_window, std::make_unique(smsWindowOptions(app, *record))); return true; } diff --git a/module-apps/application-notes/ApplicationNotes.cpp b/module-apps/application-notes/ApplicationNotes.cpp index c0d845d31c23d8b48eccd60f44663b7f4120b5cb..2aace363a5374be5a9e7dc378d88001b43f306fa 100644 --- a/module-apps/application-notes/ApplicationNotes.cpp +++ b/module-apps/application-notes/ApplicationNotes.cpp @@ -122,10 +122,9 @@ namespace app [](ApplicationCommon *app, const std::string &name) { return std::make_unique(app, name); }); - windowsFactory.attach(utils::translate("common_options_title"), - [](ApplicationCommon *app, const std::string &name) { - return std::make_unique(app, name); - }); + windowsFactory.attach(window::name::option_window, [](ApplicationCommon *app, const std::string &name) { + return std::make_unique(app, name); + }); attachPopups({gui::popup::ID::Volume, gui::popup::ID::Tethering, diff --git a/module-apps/application-notes/model/NotesListModel.cpp b/module-apps/application-notes/model/NotesListModel.cpp index e1106b77255a8ecbb682b8846ad8d18592efe81f..7ff458517c70da323e67b642f1dc83a36573ccd9 100644 --- a/module-apps/application-notes/model/NotesListModel.cpp +++ b/module-apps/application-notes/model/NotesListModel.cpp @@ -8,7 +8,7 @@ #include "module-apps/application-notes/windows/NotesOptions.hpp" #include "module-apps/application-notes/data/NoteSwitchData.hpp" #include - +#include #include #include @@ -54,7 +54,7 @@ namespace app::notes item->inputCallback = [this, note = note.get()](gui::Item &, const gui::InputEvent &event) { if (event.isShortRelease(gui::KeyCode::KEY_LF)) { application->switchWindow( - utils::translate("common_options_title"), + window::name::option_window, std::make_unique(noteListOptions(application, *note, *notesRepository))); } return false; diff --git a/module-apps/application-notes/windows/NoteEditWindow.cpp b/module-apps/application-notes/windows/NoteEditWindow.cpp index 185b6c90d77e4af43b61b98a5fca6b9eb2136d31..205f3dd80418d56309c622ea93269fb22c04984c 100644 --- a/module-apps/application-notes/windows/NoteEditWindow.cpp +++ b/module-apps/application-notes/windows/NoteEditWindow.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include @@ -149,7 +150,7 @@ namespace app::notes } if (inputEvent.is(gui::KeyCode::KEY_LF)) { application->switchWindow( - utils::translate("common_options_title"), + window::name::option_window, std::make_unique(noteEditOptions(application, *notesRecord, edit))); } } diff --git a/module-apps/application-notes/windows/NotePreviewWindow.cpp b/module-apps/application-notes/windows/NotePreviewWindow.cpp index 45adc9a63ad8b35ed8bf4b2fa618435e88c9a7bb..0efc21739a1ef54dc44ac9cfb04a0ccc250d9a03 100644 --- a/module-apps/application-notes/windows/NotePreviewWindow.cpp +++ b/module-apps/application-notes/windows/NotePreviewWindow.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include