~aleteoryx/muditaos

ref: 621304168edc83453e0f60a7c4a459401f68f822 muditaos/module-apps/application-settings/windows/network/SimContactsImportWindow.cpp -rw-r--r-- 1.7 KiB
62130416 — Przemyslaw Brudny [EGD-7203] Added extra space removal in Text draw line ending 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
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "SimContactsImportWindow.hpp"

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

namespace gui
{
    SimContactsImportWindow::SimContactsImportWindow(
        app::Application *app, std::unique_ptr<SimContactsImportWindowContract::Presenter> simImportPresenter)
        : AppWindow(app, gui::window::name::import_contacts), presenter(std::move(simImportPresenter))
    {
        presenter->attach(this);
        buildInterface();
    }

    void SimContactsImportWindow::onBeforeShow(ShowMode mode, SwitchData *data)
    {
        list->rebuildList();
    }

    void SimContactsImportWindow::onClose(CloseReason reason)
    {
        if (reason != CloseReason::PhoneLock) {
            presenter->clearProviderData();
        }
    }

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

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

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

        list = new ListView(this,
                            style::window::default_left_margin,
                            style::window::default_vertical_pos,
                            style::listview::body_width_with_scroll,
                            style::window::default_body_height,
                            presenter->getSimContactsProvider(),
                            listview::ScrollBarType::Fixed);

        setFocusItem(list);
    }
} // namespace gui