mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-04-20 23:17:35 -04:00
Refactored LockWindow TitleBar handling. Added Sim pin request block on lockedPhone. Added Sim info popup added when pin changed. Updated assets. Removed old PinLock structures. Cleared LockBox structures. Removed old settings sim setters. New CellularMessage adaptation. Cleared Lock structure.
89 lines
2.6 KiB
C++
89 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 "PostUpdateWindow.hpp"
|
|
|
|
#include <locks/data/LockStyle.hpp>
|
|
#include <application-desktop/data/DesktopData.hpp>
|
|
#include <application-desktop/windows/Names.hpp>
|
|
|
|
#include <i18n/i18n.hpp>
|
|
|
|
using namespace gui;
|
|
|
|
PostUpdateWindow::PostUpdateWindow(app::Application *app)
|
|
: AppWindow(app, app::window::name::desktop_post_update_window)
|
|
{
|
|
buildInterface();
|
|
}
|
|
|
|
void PostUpdateWindow::onBeforeShow(ShowMode mode, SwitchData *data)
|
|
{
|
|
if (data == nullptr) {
|
|
LOG_ERROR("Received null pointer");
|
|
}
|
|
else {
|
|
auto *item = dynamic_cast<CurrentOsVersion *>(data);
|
|
if (item != nullptr) {
|
|
currentOsVersion = item->getCurrentOsVersion();
|
|
auto info = utils::translate("app_desktop_update_success");
|
|
utils::findAndReplaceAll(info, "$VERSION", currentOsVersion);
|
|
infoIcon->text->setText(info);
|
|
}
|
|
}
|
|
setVisibleState();
|
|
}
|
|
|
|
void PostUpdateWindow::setVisibleState()
|
|
{
|
|
bottomBar->setActive(BottomBar::Side::CENTER, true);
|
|
}
|
|
|
|
bool PostUpdateWindow::onInput(const InputEvent &inputEvent)
|
|
{
|
|
if (inputEvent.isShortRelease(KeyCode::KEY_ENTER) && bottomBar->isActive(BottomBar::Side::CENTER)) {
|
|
application->switchWindow(gui::name::window::main_window);
|
|
return true;
|
|
}
|
|
return AppWindow::onInput(inputEvent);
|
|
}
|
|
|
|
void PostUpdateWindow::rebuild()
|
|
{
|
|
destroyInterface();
|
|
buildInterface();
|
|
}
|
|
|
|
top_bar::Configuration PostUpdateWindow::configureTopBar(top_bar::Configuration appConfiguration)
|
|
{
|
|
appConfiguration.enable(top_bar::Indicator::Time);
|
|
appConfiguration.disable(top_bar::Indicator::Lock);
|
|
appConfiguration.disable(top_bar::Indicator::Battery);
|
|
appConfiguration.disable(top_bar::Indicator::Signal);
|
|
appConfiguration.disable(top_bar::Indicator::SimCard);
|
|
return appConfiguration;
|
|
}
|
|
|
|
void PostUpdateWindow::buildInterface()
|
|
{
|
|
AppWindow::buildInterface();
|
|
|
|
setTitle(utils::translate("app_desktop_update_muditaos"));
|
|
|
|
bottomBar->setText(BottomBar::Side::CENTER, utils::translate("common_ok"));
|
|
|
|
infoIcon = new gui::Icon(this,
|
|
style::window::default_left_margin,
|
|
style::header::height,
|
|
style::window::default_body_width,
|
|
style::window::default_body_height,
|
|
"circle_success",
|
|
"");
|
|
infoIcon->setAlignment(Alignment::Horizontal::Center);
|
|
}
|
|
|
|
void PostUpdateWindow::destroyInterface()
|
|
{
|
|
erase();
|
|
}
|