~aleteoryx/muditaos

ref: 8e6490863a74d30442b434f91b90a2f07095e2d3 muditaos/module-apps/application-settings/windows/system/CertificationWindow.cpp -rw-r--r-- 4.6 KiB
8e649086 — Mateusz Grzegorzek [BH-395] Librarize application-settings 4 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "CertificationWindow.hpp"

#include <application-settings/widgets/SettingsStyle.hpp>
#include <application-settings/windows/WindowNames.hpp>

#include <Text.hpp>

inline constexpr auto certno = "XXXXXXXXXXXXXXXXXXX";

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

    void CertificationWindow::buildInterface()
    {
        AppWindow::buildInterface();

        setTitle(utils::translate("app_settings_certification"));

        usFccIdText = new gui::Text(this,
                                    style::certification::textfc::x,
                                    style::certification::textfc::y,
                                    style::certification::textfc::width,
                                    style::certification::textfc::height);
        usFccIdText->setFont(::style::window::font::bigbold);
        usFccIdValue = new gui::Text(this,
                                     style::certification::valuefc::x,
                                     style::certification::valuefc::y,
                                     style::certification::valuefc::width,
                                     style::certification::valuefc::height);
        usFccIdImage = new gui::Image(this,
                                      style::certification::imagefc::x,
                                      style::certification::imagefc::y,
                                      style::certification::imagefc::width,
                                      style::certification::imagefc::height,
                                      "settings_certification_fc");

        canadaIcText = new gui::Text(this,
                                     style::certification::textic::x,
                                     style::certification::textic::y,
                                     style::certification::textic::width,
                                     style::certification::textic::height);
        canadaIcText->setFont(::style::window::font::bigbold);
        canadaIcValue = new gui::Text(this,
                                      style::certification::valueic::x,
                                      style::certification::valueic::y,
                                      style::certification::valueic::width,
                                      style::certification::valueic::height);
        canadaIcImage = new gui::Image(this,
                                       style::certification::imageic::x,
                                       style::certification::imageic::y,
                                       style::certification::imageic::width,
                                       style::certification::imageic::height,
                                       "settings_certification_ic");

        europeCeText = new gui::Text(this,
                                     style::certification::textce::x,
                                     style::certification::textce::y,
                                     style::certification::textce::width,
                                     style::certification::textce::height);
        europeCeText->setFont(::style::window::font::bigbold);
        europeCeValue = new gui::Text(this,
                                      style::certification::valuece::x,
                                      style::certification::valuece::y,
                                      style::certification::valuece::width,
                                      style::certification::valuece::height);
        europeCeImage = new gui::Image(this,
                                       style::certification::imagece::x,
                                       style::certification::imagece::y,
                                       style::certification::imagece::width,
                                       style::certification::imagece::height,
                                       "settings_certification_ce");

        bottomBar->setText(BottomBar::Side::RIGHT, utils::translate(style::strings::common::back));
    }

    void CertificationWindow::onBeforeShow(ShowMode mode, SwitchData *data)
    {
        // dummy data for now (to be changed later)
        usFccIdText->setText(utils::translate("app_settings_us_fcc_id"));
        usFccIdValue->setText(certno);
        canadaIcText->setText(utils::translate("app_settings_canada_ic"));
        canadaIcValue->setText(certno);
        europeCeText->setText(utils::translate("app_settings_europe"));
        europeCeValue->setText(certno);
    }
} // namespace gui