~aleteoryx/muditaos

6f34f435a20c982ceb4fe1e30ebdf500095578da — Przemyslaw Brudny 4 years ago 7c66dbf
[EGD-6696] Fixed settings network window rebuilding on sim selection

Fixed settings network window rebuilding on sim
selection.
M module-apps/application-settings-new/ApplicationSettings.cpp => module-apps/application-settings-new/ApplicationSettings.cpp +1 -1
@@ 131,7 131,7 @@ namespace app
            }
            auto currentWindow = getCurrentWindow();
            if (gui::window::name::network == currentWindow->getName()) {
                currentWindow->rebuild();
                updateWindow(gui::window::name::network, nullptr);
            }
        }


M module-apps/application-settings-new/windows/NetworkWindow.cpp => module-apps/application-settings-new/windows/NetworkWindow.cpp +6 -7
@@ 14,12 14,11 @@ namespace gui
    NetworkWindow::NetworkWindow(app::Application *app,
                                 app::settingsInterface::SimParams *simParams,
                                 app::settingsInterface::OperatorsSettings *operatorsSettings)
        : OptionWindow(app, gui::window::name::network), simParams(simParams), operatorsSettings(operatorsSettings)
    {
        addOptions(netOptList());
    }
        : BaseSettingsWindow(app, gui::window::name::network), simParams(simParams),
          operatorsSettings(operatorsSettings)
    {}

    auto NetworkWindow::netOptList() -> std::list<gui::Option>
    auto NetworkWindow::buildOptionsList() -> std::list<gui::Option>
    {
        std::list<gui::Option> optList;
        std::string simStr;


@@ 69,7 68,7 @@ namespace gui
            utils::translate("app_settings_network_operator_auto_select"),
            [=](gui::Item &item) {
                operatorsSettings->setOperatorsOn(!operatorsOn);
                refreshOptions(netOptList());
                refreshOptionsList();
                return true;
            },
            nullptr,


@@ 113,7 112,7 @@ namespace gui
            utils::translate("app_settings_network_voice_over_lte"),
            [=](gui::Item &item) {
                operatorsSettings->setVoLTEOn(!voLteOn);
                refreshOptions(netOptList());
                refreshOptionsList();
                return true;
            },
            nullptr,

M module-apps/application-settings-new/windows/NetworkWindow.hpp => module-apps/application-settings-new/windows/NetworkWindow.hpp +3 -3
@@ 3,7 3,7 @@

#pragma once

#include "OptionWindow.hpp"
#include "BaseSettingsWindow.hpp"
#include "Application.hpp"

namespace app::settingsInterface


@@ 20,10 20,10 @@ namespace gui
        inline constexpr auto network_window = "Network";
    };

    class NetworkWindow : public OptionWindow
    class NetworkWindow : public BaseSettingsWindow
    {
      private:
        auto netOptList() -> std::list<gui::Option>;
        auto buildOptionsList() -> std::list<Option>;
        app::settingsInterface::SimParams *simParams;
        app::settingsInterface::OperatorsSettings *operatorsSettings;


M module-apps/windows/OptionWindow.cpp => module-apps/windows/OptionWindow.cpp +11 -0
@@ 98,6 98,17 @@ namespace gui
        setFocusItem(optionsList);
    }

    top_bar::Configuration OptionWindow::configureTopBar(top_bar::Configuration appConfiguration)
    {
        appConfiguration.enable(top_bar::Indicator::NetworkAccessTechnology);
        appConfiguration.enable(top_bar::Indicator::Time);
        appConfiguration.enable(top_bar::Indicator::PhoneMode);
        appConfiguration.enable(top_bar::Indicator::Battery);
        appConfiguration.enable(top_bar::Indicator::Signal);
        appConfiguration.enable(top_bar::Indicator::SimCard);
        return appConfiguration;
    }

    void OptionWindow::onClose()
    {
        optionsList->onClose();

M module-apps/windows/OptionWindow.hpp => module-apps/windows/OptionWindow.hpp +1 -0
@@ 40,5 40,6 @@ namespace gui
        void onClose() override;
        void rebuild() override;
        void buildInterface() override;
        top_bar::Configuration configureTopBar(top_bar::Configuration appConfiguration) override;
    };
}; // namespace gui