// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved. // For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include namespace app { void Application::updateStatuses(gui::AppWindow *window) const { window->updateBatteryStatus(); window->updateBluetooth(statusIndicators.bluetoothMode); window->updateAlarmClock(statusIndicators.alarmClockStatus); window->updateSim(); window->updateSignalStrength(); window->updateNetworkAccessTechnology(); window->updatePhoneMode(statusIndicators.phoneMode); } void Application::attachPopups(const std::vector &popupsList) { using namespace gui::popup; for (auto popup : popupsList) { switch (popup) { case ID::Volume: windowsFactory.attach(window::volume_window, [](ApplicationCommon *app, const std::string &name) { return std::make_unique(app, window::volume_window); }); break; case ID::Tethering: case ID::TetheringPhoneModeChangeProhibited: windowsFactory.attach(window::tethering_confirmation_window, [](ApplicationCommon *app, const std::string &name) { return std::make_unique( app, window::tethering_confirmation_window); }); windowsFactory.attach(window::tethering_phonemode_change_window, [](ApplicationCommon *app, const std::string &name) { return std::make_unique( app, window::tethering_phonemode_change_window); }); break; case ID::PhoneModes: windowsFactory.attach(window::phone_modes_window, [](ApplicationCommon *app, const std::string &name) { return std::make_unique(app, window::phone_modes_window); }); break; case ID::BluetoothAuthenticate: case ID::BluetoothInfo: windowsFactory.attach( window::bluetooth_authenticate, [](ApplicationCommon *app, const std::string &name) { return std::make_unique(app, window::bluetooth_authenticate); }); windowsFactory.attach(window::bluetooth_info, [](ApplicationCommon *app, const std::string &name) { return std::make_unique(app, window::bluetooth_info); }); break; case ID::Brightness: break; case ID::PhoneLock: case ID::PhoneLockInput: case ID::PhoneLockInfo: case ID::PhoneLockChangeInfo: windowsFactory.attach( window::phone_lock_window, [this](ApplicationCommon *app, const std::string &name) { auto presenter = std::make_unique(app); auto lockScreenDeepRefreshRate = utils::getNumericValue(settings->getValue( settings::Display::lockScreenDeepRefreshRate, settings::SettingsScope::Global)); return std::make_unique( app, window::phone_lock_window, std::move(presenter), lockScreenDeepRefreshRate); }); windowsFactory.attach( window::phone_lock_info_window, [](ApplicationCommon *app, const std::string &name) { return std::make_unique(app, window::phone_lock_info_window); }); windowsFactory.attach( window::phone_lock_input_window, [](ApplicationCommon *app, const std::string &name) { return std::make_unique(app, window::phone_lock_input_window); }); windowsFactory.attach(window::phone_lock_change_info_window, [](ApplicationCommon *app, const std::string &name) { return std::make_unique( app, window::phone_lock_change_info_window); }); windowsFactory.attach(window::power_off_window, [](ApplicationCommon *app, const std::string &name) { auto presenter = std::make_unique(app); return std::make_unique(app, std::move(presenter)); }); break; case ID::SimLock: case ID::SimInfo: case ID::SimNotReady: windowsFactory.attach(window::sim_unlock_window, [](ApplicationCommon *app, const std::string &name) { return std::make_unique(app, window::sim_unlock_window); }); windowsFactory.attach(window::sim_info_window, [](ApplicationCommon *app, const std::string &name) { return std::make_unique(app, window::sim_info_window); }); windowsFactory.attach( window::sim_not_ready_window, [](ApplicationCommon *app, const std::string &name) { return std::make_unique(app, window::sim_not_ready_window); }); break; case ID::Alarm: windowsFactory.attach(window::alarm_window, [](ApplicationCommon *app, const std::string &name) { auto presenter = std::make_shared(app); return std::make_unique(app, window::alarm_window, presenter); }); default: break; } } } } // namespace app