~aleteoryx/muditaos

ref: 88a9fdedf22428cbfe52f91c8352eae52438e7f1 muditaos/module-apps/application-desktop/windows/UpdateProgress.hpp -rw-r--r-- 1.4 KiB
88a9fded — Kuba [EGD-6883] Change time settings cleanup 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
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once

#include <vector>
#include <apps-common/windows/AppWindow.hpp>
#include <apps-common/windows/Dialog.hpp>
#include <module-gui/gui/widgets/Label.hpp>
#include <module-gui/gui/widgets/TextFixedSize.hpp>
#include <module-gui/gui/widgets/Image.hpp>
#include <module-gui/gui/widgets/BottomBar.hpp>
#include <apps-common/widgets/BarGraph.hpp>

namespace gui
{

    class UpdateProgressWindow : public AppWindow
    {
        unsigned int progressPercent = 0;
        std::string textInfo;

        gui::Label *percentLabel  = nullptr;
        HBarGraph *updateProgress = nullptr;

        fs::path updateFile;

        Text *text  = nullptr;
        Image *icon = nullptr;

        void setVisibleState();
        void invalidate() noexcept;

      public:
        explicit UpdateProgressWindow(app::Application *app);
        void onBeforeShow(ShowMode mode, SwitchData *data) override;
        bool onInput(const InputEvent &inputEvent) override;
        bool handleSwitchData(SwitchData *data) override;
        void rebuild() override;
        void buildInterface() override;
        void destroyInterface() override;
        status_bar::Configuration configureStatusBar(status_bar::Configuration appConfiguration) override;
    };

} /* namespace gui */