~aleteoryx/muditaos

ref: 30eeb362d03f925da520cb9ab24f8516924ea9ce muditaos/module-apps/application-settings/windows/system/ChangeTimeZone.hpp -rw-r--r-- 1007 bytes
30eeb362 — Piotr Tański [EGD-7789] Sort timezones by their UTC offset 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
// 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 <application-settings/windows/BaseSettingsWindow.hpp>

namespace gui
{

    class ChangeTimeZone : public BaseSettingsWindow
    {
      public:
        explicit ChangeTimeZone(app::ApplicationCommon *app);

      private:
        [[nodiscard]] auto buildOptionsList() -> std::list<Option> override;
        void onBeforeShow(ShowMode mode, SwitchData *data) override;
        [[nodiscard]] auto setTimeZoneIndex() -> unsigned int;
        [[nodiscard]] auto extractTimeZoneName(const std::string &name) const noexcept -> std::string;

        [[nodiscard]] static auto getTimeZones() -> std::vector<std::string>;
        [[nodiscard]] static auto sortTimeZones(std::vector<std::string> &&timeZones) -> std::vector<std::string>;

        const std::vector<std::string> timeZonesList;
        std::string selectedTimeZone;
    };
} // namespace gui