~aleteoryx/muditaos

ref: a53bd826c693062af27c5de0f62e06963a6ce842 muditaos/module-apps/application-call/windows/EmergencyCallWindow.cpp -rw-r--r-- 1.3 KiB
a53bd826 — Lucjan Bryndza [EGD-5737] Merge master into experimental 5 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "EmergencyCallWindow.hpp"

#include "application-call/data/CallAppStyle.hpp"

#include <service-appmgr/Controller.hpp>

namespace gui
{

    EmergencyCallWindow::EmergencyCallWindow(app::Application *app, app::EnterNumberWindowInterface *interface)
        : NumberWindow(app, interface, app::window::name_emergencyCall)
    {
        buildInterface();
    }

    void EmergencyCallWindow::buildInterface()
    {
        using namespace callAppStyle;
        NumberWindow::buildInterface();

        bottomBar->setText(BottomBar::Side::CENTER, utils::localize.get("app_phonebook_ice_contacts_title"));
        bottomBar->setText(BottomBar::Side::RIGHT, utils::localize.get(style::strings::common::back));

        numberDescriptionLabel->setText(utils::localize.get("app_call_emergency_text"));
    }

    bool EmergencyCallWindow::onInput(const InputEvent &inputEvent)
    {
        if (inputEvent.is(gui::KeyCode::KEY_ENTER)) {
            app::manager::Controller::sendAction(application, app::manager::actions::ShowEmergencyContacts);
            return true;
        }

        return NumberWindow::onInput(inputEvent);
    }

} /* namespace gui */