mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-07-20 21:14:12 -04:00
Single api to rule i18n all calls to localistaion in cpp files unified cut off ass many dependencies in i18n header as possible
71 lines
2.6 KiB
C++
71 lines
2.6 KiB
C++
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
|
|
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
|
|
|
|
#include "PhoneModesWindow.hpp"
|
|
#include "application-settings-new/ApplicationSettings.hpp"
|
|
|
|
#include "OptionSetting.hpp"
|
|
|
|
#include <i18n/i18n.hpp>
|
|
|
|
namespace gui
|
|
{
|
|
PhoneModesWindow::PhoneModesWindow(app::Application *app,
|
|
app::settingsInterface::SimParams *simParams,
|
|
app::settingsInterface::OperatorsSettings *operatorsSettings)
|
|
: OptionWindow(app, gui::window::name::phone_modes), simParams(simParams), operatorsSettings(operatorsSettings)
|
|
{
|
|
addOptions(modesOptList());
|
|
}
|
|
|
|
auto PhoneModesWindow::modesOptList() -> std::list<gui::Option>
|
|
{
|
|
std::list<gui::Option> optList;
|
|
|
|
optList.emplace_back(std::make_unique<gui::option::OptionSettings>(
|
|
utils::translate("app_settings_connected"),
|
|
[=](gui::Item &item) { return true; },
|
|
[=](gui::Item &item) {
|
|
if (item.focus) {
|
|
this->clearBottomBarText(BottomBar::Side::CENTER);
|
|
}
|
|
return true;
|
|
},
|
|
this));
|
|
|
|
optList.emplace_back(std::make_unique<gui::option::OptionSettings>(
|
|
utils::translate("app_settings_title_do_not_disturb"),
|
|
[=](gui::Item &item) {
|
|
this->application->switchWindow(gui::window::name::do_not_disturb, nullptr);
|
|
return true;
|
|
},
|
|
[=](gui::Item &item) {
|
|
if (item.focus) {
|
|
this->setBottomBarText(utils::translate(style::strings::common::adjust), BottomBar::Side::CENTER);
|
|
}
|
|
return true;
|
|
},
|
|
this,
|
|
gui::option::SettingRightItem::ArrowWhite));
|
|
|
|
optList.emplace_back(std::make_unique<gui::option::OptionSettings>(
|
|
utils::translate("app_settings_title_offline"),
|
|
[=](gui::Item &item) {
|
|
this->application->switchWindow(gui::window::name::offline, nullptr);
|
|
return true;
|
|
},
|
|
[=](gui::Item &item) {
|
|
if (item.focus) {
|
|
this->setBottomBarText(utils::translate(style::strings::common::adjust), BottomBar::Side::CENTER);
|
|
}
|
|
return true;
|
|
},
|
|
this,
|
|
gui::option::SettingRightItem::ArrowWhite));
|
|
|
|
bottomBar->setText(BottomBar::Side::RIGHT, utils::translate(style::strings::common::back));
|
|
|
|
return optList;
|
|
}
|
|
} // namespace gui
|