mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-10-25 07:58:29 -04:00
Status bar SIM widget refactor Status bar time widget recfactor Status bar lock widget refactor Separation of status bar time widget and desktop main window time widget Fixed issue with wrong calculation of timezone based time
44 lines
1.2 KiB
C++
44 lines
1.2 KiB
C++
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
|
|
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
|
|
|
|
#include "SIM.hpp"
|
|
|
|
namespace gui::top_bar
|
|
{
|
|
using namespace Store;
|
|
|
|
constexpr auto sim1 = "sim1"; // sim 1 indicator
|
|
constexpr auto sim2 = "sim2"; // sim 2 indicator
|
|
constexpr auto simunknown = "simunknown"; // sim - unknown sim state indicator (i.e. no initialization was done)
|
|
constexpr auto simfailed = "simfail"; // sim - notification for sim failure
|
|
|
|
SIM::SIM(Item *parent, uint32_t x, uint32_t y) : StatusBarWidgetBase(parent, x, y, 0, 0)
|
|
{
|
|
set(simunknown);
|
|
}
|
|
|
|
void SIM::update(const Store::GSM::SIM &state)
|
|
{
|
|
if (state == current) {
|
|
return;
|
|
}
|
|
current = state;
|
|
switch (current) {
|
|
case GSM::SIM::SIM1:
|
|
set(sim1);
|
|
break;
|
|
case GSM::SIM::SIM2:
|
|
set(sim2);
|
|
break;
|
|
case GSM::SIM::SIM_FAIL:
|
|
set(simfailed);
|
|
break;
|
|
case GSM::SIM::NONE:
|
|
[[fallthrough]];
|
|
case GSM::SIM::SIM_UNKNOWN:
|
|
set(simunknown);
|
|
break;
|
|
}
|
|
}
|
|
}; // namespace gui::top_bar
|