From c8d7ee46d9e965b316dafdbaf762958208b601fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Fri, 12 Oct 2018 14:01:45 +0200 Subject: [PATCH] [on-boarding] Delete specialize PopUpController --- apps/apps_container.cpp | 24 ++++++++++++++++++++++-- apps/apps_container.h | 4 ++-- apps/on_boarding/pop_up_controller.cpp | 23 ----------------------- apps/on_boarding/pop_up_controller.h | 9 --------- 4 files changed, 24 insertions(+), 36 deletions(-) diff --git a/apps/apps_container.cpp b/apps/apps_container.cpp index ac4c9e745..c28e0ecae 100644 --- a/apps/apps_container.cpp +++ b/apps/apps_container.cpp @@ -10,6 +10,26 @@ extern "C" { using namespace Shared; +#if EPSILON_SOFTWARE_UPDATE_PROMPT + +static I18n::Message sOnBoardingMessages[] = { + I18n::Message::UpdateAvailable, + I18n::Message::UpdateMessage1, + I18n::Message::UpdateMessage2, + I18n::Message::BlankMessage, + I18n::Message::UpdateMessage3, + I18n::Message::UpdateMessage4}; + +static KDColor sOnBoardingColors[] = { + KDColorBlack, + KDColorBlack, + KDColorBlack, + KDColorWhite, + KDColorBlack, + Palette::YellowDark}; + +#endif + AppsContainer::AppsContainer() : Container(), m_window(), @@ -18,7 +38,7 @@ AppsContainer::AppsContainer() : m_variableBoxController(&m_globalContext), m_examPopUpController(this), #if EPSILON_SOFTWARE_UPDATE_PROMPT - m_updateController(), + m_updateController(sOnBoardingMessages, sOnBoardingColors, 6), #endif m_batteryTimer(BatteryTimer(this)), m_suspendTimer(SuspendTimer(this)), @@ -228,7 +248,7 @@ bool AppsContainer::updateAlphaLock() { } #if EPSILON_SOFTWARE_UPDATE_PROMPT -OnBoarding::UpdateController * AppsContainer::updatePopUpController() { +OnBoarding::PopUpController * AppsContainer::updatePopUpController() { return &m_updateController; } #endif diff --git a/apps/apps_container.h b/apps/apps_container.h index c1f7373b6..73bfa3903 100644 --- a/apps/apps_container.h +++ b/apps/apps_container.h @@ -49,7 +49,7 @@ public: void shutdownDueToLowBattery(); void setShiftAlphaStatus(Ion::Events::ShiftAlphaStatus newStatus); #if EPSILON_SOFTWARE_UPDATE_PROMPT - OnBoarding::UpdateController * updatePopUpController(); + OnBoarding::PopUpController * updatePopUpController(); #endif void redrawWindow(); // Exam pop-up controller delegate @@ -74,7 +74,7 @@ private: VariableBoxController m_variableBoxController; ExamPopUpController m_examPopUpController; #if EPSILON_SOFTWARE_UPDATE_PROMPT - OnBoarding::UpdateController m_updateController; + OnBoarding::PopUpController m_updateController; #endif BatteryTimer m_batteryTimer; SuspendTimer m_suspendTimer; diff --git a/apps/on_boarding/pop_up_controller.cpp b/apps/on_boarding/pop_up_controller.cpp index 928ce7d12..8aa4fae98 100644 --- a/apps/on_boarding/pop_up_controller.cpp +++ b/apps/on_boarding/pop_up_controller.cpp @@ -64,27 +64,4 @@ bool PopUpController::handleEvent(Ion::Events::Event event) { #endif -#if EPSILON_SOFTWARE_UPDATE_PROMPT - -static I18n::Message sOnBoardingMessages[] = { - I18n::Message::UpdateAvailable, - I18n::Message::UpdateMessage1, - I18n::Message::UpdateMessage2, - I18n::Message::BlankMessage, - I18n::Message::UpdateMessage3, - I18n::Message::UpdateMessage4}; - -static KDColor sOnBoardingColors[] = { - KDColorBlack, - KDColorBlack, - KDColorBlack, - KDColorWhite, - KDColorBlack, - Palette::YellowDark}; - -UpdateController::UpdateController() : - PopUpController(sOnBoardingMessages, sOnBoardingColors, 6) {} - -#endif - } diff --git a/apps/on_boarding/pop_up_controller.h b/apps/on_boarding/pop_up_controller.h index 21f0ac6cd..2f09120e5 100644 --- a/apps/on_boarding/pop_up_controller.h +++ b/apps/on_boarding/pop_up_controller.h @@ -35,15 +35,6 @@ private: #endif -#if EPSILON_SOFTWARE_UPDATE_PROMPT - -class UpdateController : public PopUpController { -public: - UpdateController(); -}; - -#endif - } #endif