~aleteoryx/muditaos

a38685be9188ffe883c97382fb2824646aece02c — Tigran Soghbatyan 4 years ago ccb9e60
[BH-1225] Fix clock formats in apps

Set time format onBeforeShow in applications
M products/BellHybrid/apps/application-bell-meditation-timer/presenter/MeditationProgressPresenter.cpp => products/BellHybrid/apps/application-bell-meditation-timer/presenter/MeditationProgressPresenter.cpp +5 -0
@@ 92,4 92,9 @@ namespace app::meditation
            getView()->intervalReached();
        }
    }

    void MeditationProgressPresenter::onBeforeShow()
    {
        getView()->setTimeFormat(timeModel->getTimeFormat());
    }
} // namespace app::meditation

M products/BellHybrid/apps/application-bell-meditation-timer/presenter/MeditationProgressPresenter.hpp => products/BellHybrid/apps/application-bell-meditation-timer/presenter/MeditationProgressPresenter.hpp +2 -0
@@ 51,6 51,7 @@ namespace app::meditation
            virtual void resume()                                                   = 0;
            virtual void abandon()                                                  = 0;
            virtual void finish()                                                   = 0;
            virtual void onBeforeShow()                                             = 0;
        };
    };



@@ 82,5 83,6 @@ namespace app::meditation
        void resume() override;
        void abandon() override;
        void finish() override;
        void onBeforeShow() override;
    };
} // namespace app::meditation

M products/BellHybrid/apps/application-bell-meditation-timer/windows/MeditationRunningWindow.cpp => products/BellHybrid/apps/application-bell-meditation-timer/windows/MeditationRunningWindow.cpp +1 -1
@@ 108,7 108,7 @@ namespace gui
    void MeditationRunningWindow::onBeforeShow(ShowMode mode, SwitchData *data)
    {
        AppWindow::onBeforeShow(mode, data);

        presenter->onBeforeShow();
        if (mode == ShowMode::GUI_SHOW_INIT) {
            playGong();
            presenter->start();

M products/BellHybrid/apps/application-bell-powernap/presenter/PowerNapProgressPresenter.cpp => products/BellHybrid/apps/application-bell-powernap/presenter/PowerNapProgressPresenter.cpp +5 -0
@@ 78,4 78,9 @@ namespace app::powernap
        return napFinished;
    }

    void PowerNapProgressPresenter::onBeforeShow()
    {
        getView()->setTimeFormat(timeModel->getTimeFormat());
    }

} // namespace app::powernap

M products/BellHybrid/apps/application-bell-powernap/presenter/PowerNapProgressPresenter.hpp => products/BellHybrid/apps/application-bell-powernap/presenter/PowerNapProgressPresenter.hpp +2 -0
@@ 46,6 46,7 @@ namespace app::powernap
            virtual void setTimer(std::unique_ptr<app::TimerWithCallbacks> &&timer) = 0;
            virtual void handleUpdateTimeEvent()                                    = 0;
            virtual bool isNapFinished()                                            = 0;
            virtual void onBeforeShow()                                             = 0;
        };
    };



@@ 68,6 69,7 @@ namespace app::powernap

        void onNapFinished();
        void onNapAlarmFinished();
        void onBeforeShow() override;

      public:
        PowerNapProgressPresenter(app::ApplicationCommon *app,

M products/BellHybrid/apps/application-bell-powernap/windows/PowerNapProgressWindow.cpp => products/BellHybrid/apps/application-bell-powernap/windows/PowerNapProgressWindow.cpp +5 -0
@@ 141,4 141,9 @@ namespace gui
        }
        return true;
    }

    void PowerNapProgressWindow::onBeforeShow(ShowMode mode, SwitchData *data)
    {
        presenter->onBeforeShow();
    }
} // namespace gui

M products/BellHybrid/apps/application-bell-powernap/windows/PowerNapProgressWindow.hpp => products/BellHybrid/apps/application-bell-powernap/windows/PowerNapProgressWindow.hpp +2 -0
@@ 30,6 30,8 @@ namespace gui

        void napEnded() override;

        void onBeforeShow(ShowMode mode, SwitchData *data) override;

      public:
        PowerNapProgressWindow(app::ApplicationCommon *app,
                               std::shared_ptr<app::powernap::PowerNapProgressContract::Presenter> presenter);