~aleteoryx/muditaos

ref: be66c108884ef3337071c7f66ab2c137df48d00b muditaos/module-apps/application-settings-new/windows/SystemMainWindow.cpp -rw-r--r-- 1.5 KiB
be66c108 — Tomek Sobkowiak [EGD-5347] Replace filelength with file_size 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
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "application-settings-new/ApplicationSettings.hpp"
#include "OptionSetting.hpp"
#include "SystemMainWindow.hpp"

namespace gui
{
    SystemMainWindow::SystemMainWindow(app::Application *app) : BaseSettingsWindow(app, window::name::system)
    {}

    auto SystemMainWindow::buildOptionsList() -> std::list<Option>
    {
        std::list<Option> optionList;
        auto addOption = [&](UTF8 name, const std::string &window) {
            optionList.emplace_back(std::make_unique<option::OptionSettings>(
                utils::translateI18(name),
                [=](Item &item) {
                    LOG_INFO("switching to %s page", window.c_str());
                    application->switchWindow(window, nullptr);
                    return true;
                },
                nullptr,
                nullptr,
                option::SettingRightItem::ArrowWhite));
        };

        addOption("app_settings_language", gui::window::name::language);
        addOption("app_settings_date_and_time", gui::window::name::date_and_time);
        addOption("app_settings_factory_reset", gui::window::name::factory_reset);
        addOption("app_settings_about_your_pure", gui::window::name::about_your_pure);
        addOption("app_settings_certification", gui::window::name::certification);

        return optionList;
    }
} // namespace gui