From f1ba2e127034c19feaea6cfe59d39f87087045b1 Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Tue, 8 Jul 2014 18:25:54 +0200 Subject: [PATCH] Add prettyStatus to Locale module. --- src/modules/locale/LocalePage.cpp | 12 ++++++++++++ src/modules/locale/LocalePage.h | 2 ++ src/modules/locale/LocaleViewStep.cpp | 14 ++++++++++++++ src/modules/locale/LocaleViewStep.h | 4 ++++ 4 files changed, 32 insertions(+) diff --git a/src/modules/locale/LocalePage.cpp b/src/modules/locale/LocalePage.cpp index 1b30be2d9..041771a3d 100644 --- a/src/modules/locale/LocalePage.cpp +++ b/src/modules/locale/LocalePage.cpp @@ -149,3 +149,15 @@ LocalePage::init() emit m_tzWidget->locationChanged( m_tzWidget->getCurrentLocation() ); } + +QString +LocalePage::prettyStatus() const +{ + QString status; + status += tr( "Set timezone to %1/%2.
" ) + .arg( m_regionCombo->currentText() ) + .arg( m_timezoneCombo->currentText() ); + + return status; +} + diff --git a/src/modules/locale/LocalePage.h b/src/modules/locale/LocalePage.h index 67a5205f4..dcd3d6ef8 100644 --- a/src/modules/locale/LocalePage.h +++ b/src/modules/locale/LocalePage.h @@ -32,6 +32,8 @@ public: void init(); + QString prettyStatus() const; + private: TimeZoneWidget* m_tzWidget; QComboBox* m_regionCombo; diff --git a/src/modules/locale/LocaleViewStep.cpp b/src/modules/locale/LocaleViewStep.cpp index 62500d459..47e3bde75 100644 --- a/src/modules/locale/LocaleViewStep.cpp +++ b/src/modules/locale/LocaleViewStep.cpp @@ -103,6 +103,13 @@ LocaleViewStep::prettyName() const } +QString +LocaleViewStep::prettyStatus() const +{ + return m_prettyStatus; +} + + QWidget* LocaleViewStep::widget() { @@ -149,3 +156,10 @@ LocaleViewStep::jobs() const { return QList< Calamares::job_ptr >(); } + + +void +LocaleViewStep::onLeave() +{ + m_prettyStatus = m_actualWidget->prettyStatus(); +} diff --git a/src/modules/locale/LocaleViewStep.h b/src/modules/locale/LocaleViewStep.h index 93f79343d..652cccc5e 100644 --- a/src/modules/locale/LocaleViewStep.h +++ b/src/modules/locale/LocaleViewStep.h @@ -40,6 +40,7 @@ public: virtual ~LocaleViewStep(); QString prettyName() const override; + QString prettyStatus() const override; QWidget* widget() override; @@ -53,12 +54,15 @@ public: QList< Calamares::job_ptr > jobs() const override; + void onLeave() override; + private: QWidget* m_widget; QFutureWatcher< void > m_initWatcher; LocalePage* m_actualWidget; bool m_nextEnabled; + QString m_prettyStatus; }; #endif // LOCALEVIEWSTEP_H