~aleteoryx/muditaos

ref: f75c6add56dd099b2b8edbe04044387c5c1629da muditaos/module-apps/application-settings-new/windows/PhoneNameWindow.cpp -rw-r--r-- 1.4 KiB
f75c6add — Hubert Chrzaniuk [EGD-5034] Change gain values to reduce echo during call 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
41
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "PhoneNameWindow.hpp"
#include "application-settings-new/ApplicationSettings.hpp"
#include "widgets/InputBox.hpp"

#include <Utils.hpp>

namespace gui
{
    PhoneNameWindow::PhoneNameWindow(app::Application *app) : AppWindow(app, gui::window::name::phone_name)
    {
        buildInterface();
    }

    void PhoneNameWindow::buildInterface()
    {
        AppWindow::buildInterface();
        topBar->setActive(TopBar::Elements::SIM, false);
        topBar->setActive(TopBar::Elements::TIME, true);

        setTitle(utils::localize.get("app_settings_bluetooth_phone_name"));

        inputField = inputBox(this, utils::localize.get("app_settings_bluetooth_phone_name"));
        bottomBar->setActive(BottomBar::Side::LEFT, false);
        bottomBar->setActive(BottomBar::Side::CENTER, true);
        bottomBar->setActive(BottomBar::Side::RIGHT, true);

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

        setFocusItem(inputField);
    }

    void PhoneNameWindow::onBeforeShow(ShowMode mode, SwitchData *data)
    {
        inputField->clear();
        setFocusItem(inputField);
    }
} // namespace gui