From 6071489788010e027798d02a03c6a0da747b660c Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 25 Feb 2019 07:49:10 -0500 Subject: [PATCH] [libcalamaresui] Provide default implementations of next() and back() - These methods are used for multi-page view-steps, which are rare. For all the others, just drop the empty implementation and defer to the base class. --- src/libcalamaresui/viewpages/ViewStep.cpp | 8 ++++++++ src/libcalamaresui/viewpages/ViewStep.h | 4 ++-- src/modules/finished/FinishedViewStep.cpp | 11 ----------- src/modules/finished/FinishedViewStep.h | 3 --- .../InteractiveTerminalViewStep.cpp | 11 ----------- .../interactiveterminal/InteractiveTerminalViewStep.h | 3 --- src/modules/keyboard/KeyboardViewStep.cpp | 11 ----------- src/modules/keyboard/KeyboardViewStep.h | 3 --- src/modules/license/LicenseViewStep.cpp | 11 ----------- src/modules/license/LicenseViewStep.h | 3 --- src/modules/locale/LocaleViewStep.cpp | 11 ----------- src/modules/locale/LocaleViewStep.h | 3 --- src/modules/netinstall/NetInstallViewStep.cpp | 11 ----------- src/modules/netinstall/NetInstallViewStep.h | 3 --- src/modules/plasmalnf/PlasmaLnfViewStep.cpp | 11 ----------- src/modules/plasmalnf/PlasmaLnfViewStep.h | 3 --- src/modules/summary/SummaryViewStep.cpp | 11 ----------- src/modules/summary/SummaryViewStep.h | 3 --- src/modules/tracking/TrackingViewStep.cpp | 11 ----------- src/modules/tracking/TrackingViewStep.h | 3 --- src/modules/users/UsersViewStep.cpp | 11 ----------- src/modules/users/UsersViewStep.h | 3 --- src/modules/webview/WebViewStep.cpp | 11 ----------- src/modules/webview/WebViewStep.h | 2 -- src/modules/welcome/WelcomeViewStep.cpp | 11 ----------- src/modules/welcome/WelcomeViewStep.h | 3 --- 26 files changed, 10 insertions(+), 169 deletions(-) diff --git a/src/libcalamaresui/viewpages/ViewStep.cpp b/src/libcalamaresui/viewpages/ViewStep.cpp index c6acb5208..ec78c316f 100644 --- a/src/libcalamaresui/viewpages/ViewStep.cpp +++ b/src/libcalamaresui/viewpages/ViewStep.cpp @@ -52,6 +52,14 @@ void ViewStep::onLeave() {} +void +ViewStep::next() +{} + +void +ViewStep::back() +{} + void ViewStep::setModuleInstanceKey( const QString& instanceKey ) diff --git a/src/libcalamaresui/viewpages/ViewStep.h b/src/libcalamaresui/viewpages/ViewStep.h index d6b8e1f3c..775f09203 100644 --- a/src/libcalamaresui/viewpages/ViewStep.h +++ b/src/libcalamaresui/viewpages/ViewStep.h @@ -68,8 +68,8 @@ public: //TODO: we might want to make this a QSharedPointer virtual QWidget* widget() = 0; - virtual void next() = 0; - virtual void back() = 0; + virtual void next(); + virtual void back(); virtual bool isNextEnabled() const = 0; virtual bool isBackEnabled() const = 0; diff --git a/src/modules/finished/FinishedViewStep.cpp b/src/modules/finished/FinishedViewStep.cpp index 818a07909..8457aa4cd 100644 --- a/src/modules/finished/FinishedViewStep.cpp +++ b/src/modules/finished/FinishedViewStep.cpp @@ -67,17 +67,6 @@ FinishedViewStep::widget() } -void -FinishedViewStep::next() -{ -} - - -void -FinishedViewStep::back() -{} - - bool FinishedViewStep::isNextEnabled() const { diff --git a/src/modules/finished/FinishedViewStep.h b/src/modules/finished/FinishedViewStep.h index 393527053..b1af598c7 100644 --- a/src/modules/finished/FinishedViewStep.h +++ b/src/modules/finished/FinishedViewStep.h @@ -40,9 +40,6 @@ public: QWidget* widget() override; - void next() override; - void back() override; - bool isNextEnabled() const override; bool isBackEnabled() const override; diff --git a/src/modules/interactiveterminal/InteractiveTerminalViewStep.cpp b/src/modules/interactiveterminal/InteractiveTerminalViewStep.cpp index 3242e47e9..d57eb7d05 100644 --- a/src/modules/interactiveterminal/InteractiveTerminalViewStep.cpp +++ b/src/modules/interactiveterminal/InteractiveTerminalViewStep.cpp @@ -53,17 +53,6 @@ InteractiveTerminalViewStep::widget() } -void -InteractiveTerminalViewStep::next() -{ -} - - -void -InteractiveTerminalViewStep::back() -{} - - bool InteractiveTerminalViewStep::isNextEnabled() const { diff --git a/src/modules/interactiveterminal/InteractiveTerminalViewStep.h b/src/modules/interactiveterminal/InteractiveTerminalViewStep.h index 3d5862935..55486691d 100644 --- a/src/modules/interactiveterminal/InteractiveTerminalViewStep.h +++ b/src/modules/interactiveterminal/InteractiveTerminalViewStep.h @@ -41,9 +41,6 @@ public: QWidget* widget() override; - void next() override; - void back() override; - bool isNextEnabled() const override; bool isBackEnabled() const override; diff --git a/src/modules/keyboard/KeyboardViewStep.cpp b/src/modules/keyboard/KeyboardViewStep.cpp index 3e846db43..40a5385a3 100644 --- a/src/modules/keyboard/KeyboardViewStep.cpp +++ b/src/modules/keyboard/KeyboardViewStep.cpp @@ -65,17 +65,6 @@ KeyboardViewStep::widget() } -void -KeyboardViewStep::next() -{ -} - - -void -KeyboardViewStep::back() -{} - - bool KeyboardViewStep::isNextEnabled() const { diff --git a/src/modules/keyboard/KeyboardViewStep.h b/src/modules/keyboard/KeyboardViewStep.h index 46a52a524..a5bdd579e 100644 --- a/src/modules/keyboard/KeyboardViewStep.h +++ b/src/modules/keyboard/KeyboardViewStep.h @@ -42,9 +42,6 @@ public: QWidget* widget() override; - void next() override; - void back() override; - bool isNextEnabled() const override; bool isBackEnabled() const override; diff --git a/src/modules/license/LicenseViewStep.cpp b/src/modules/license/LicenseViewStep.cpp index a02ef36c6..96a7b8660 100644 --- a/src/modules/license/LicenseViewStep.cpp +++ b/src/modules/license/LicenseViewStep.cpp @@ -59,17 +59,6 @@ LicenseViewStep::widget() } -void -LicenseViewStep::next() -{ -} - - -void -LicenseViewStep::back() -{} - - bool LicenseViewStep::isNextEnabled() const { diff --git a/src/modules/license/LicenseViewStep.h b/src/modules/license/LicenseViewStep.h index cf7b2bc15..a4fabc8e1 100644 --- a/src/modules/license/LicenseViewStep.h +++ b/src/modules/license/LicenseViewStep.h @@ -42,9 +42,6 @@ public: QWidget* widget() override; - void next() override; - void back() override; - bool isNextEnabled() const override; bool isBackEnabled() const override; diff --git a/src/modules/locale/LocaleViewStep.cpp b/src/modules/locale/LocaleViewStep.cpp index 4a30bc307..a7dc432f8 100644 --- a/src/modules/locale/LocaleViewStep.cpp +++ b/src/modules/locale/LocaleViewStep.cpp @@ -190,17 +190,6 @@ LocaleViewStep::widget() } -void -LocaleViewStep::next() -{ -} - - -void -LocaleViewStep::back() -{} - - bool LocaleViewStep::isNextEnabled() const { diff --git a/src/modules/locale/LocaleViewStep.h b/src/modules/locale/LocaleViewStep.h index 8006bc616..3f5c91621 100644 --- a/src/modules/locale/LocaleViewStep.h +++ b/src/modules/locale/LocaleViewStep.h @@ -45,9 +45,6 @@ public: QWidget* widget() override; - void next() override; - void back() override; - bool isNextEnabled() const override; bool isBackEnabled() const override; diff --git a/src/modules/netinstall/NetInstallViewStep.cpp b/src/modules/netinstall/NetInstallViewStep.cpp index 5104390eb..3c4fa5e58 100644 --- a/src/modules/netinstall/NetInstallViewStep.cpp +++ b/src/modules/netinstall/NetInstallViewStep.cpp @@ -69,17 +69,6 @@ NetInstallViewStep::widget() } -void -NetInstallViewStep::next() -{ -} - - -void -NetInstallViewStep::back() -{} - - bool NetInstallViewStep::isNextEnabled() const { diff --git a/src/modules/netinstall/NetInstallViewStep.h b/src/modules/netinstall/NetInstallViewStep.h index ee53f61ce..b07d3f96d 100644 --- a/src/modules/netinstall/NetInstallViewStep.h +++ b/src/modules/netinstall/NetInstallViewStep.h @@ -42,9 +42,6 @@ public: QWidget* widget() override; - void next() override; - void back() override; - bool isNextEnabled() const override; bool isBackEnabled() const override; diff --git a/src/modules/plasmalnf/PlasmaLnfViewStep.cpp b/src/modules/plasmalnf/PlasmaLnfViewStep.cpp index 6e4a3e89c..5525f36fc 100644 --- a/src/modules/plasmalnf/PlasmaLnfViewStep.cpp +++ b/src/modules/plasmalnf/PlasmaLnfViewStep.cpp @@ -76,17 +76,6 @@ PlasmaLnfViewStep::widget() } -void -PlasmaLnfViewStep::next() -{ -} - - -void -PlasmaLnfViewStep::back() -{} - - bool PlasmaLnfViewStep::isNextEnabled() const { diff --git a/src/modules/plasmalnf/PlasmaLnfViewStep.h b/src/modules/plasmalnf/PlasmaLnfViewStep.h index b9a6b72e6..01db17821 100644 --- a/src/modules/plasmalnf/PlasmaLnfViewStep.h +++ b/src/modules/plasmalnf/PlasmaLnfViewStep.h @@ -41,9 +41,6 @@ public: QWidget* widget() override; - void next() override; - void back() override; - bool isNextEnabled() const override; bool isBackEnabled() const override; diff --git a/src/modules/summary/SummaryViewStep.cpp b/src/modules/summary/SummaryViewStep.cpp index 2ebfa449b..6835b2b05 100644 --- a/src/modules/summary/SummaryViewStep.cpp +++ b/src/modules/summary/SummaryViewStep.cpp @@ -51,17 +51,6 @@ SummaryViewStep::widget() } -void -SummaryViewStep::next() -{ -} - - -void -SummaryViewStep::back() -{} - - bool SummaryViewStep::isNextEnabled() const { diff --git a/src/modules/summary/SummaryViewStep.h b/src/modules/summary/SummaryViewStep.h index 9aff35cd0..88f177a4d 100644 --- a/src/modules/summary/SummaryViewStep.h +++ b/src/modules/summary/SummaryViewStep.h @@ -40,9 +40,6 @@ public: QWidget* widget() override; - void next() override; - void back() override; - bool isNextEnabled() const override; bool isBackEnabled() const override; diff --git a/src/modules/tracking/TrackingViewStep.cpp b/src/modules/tracking/TrackingViewStep.cpp index 8927c6865..304e2a971 100644 --- a/src/modules/tracking/TrackingViewStep.cpp +++ b/src/modules/tracking/TrackingViewStep.cpp @@ -67,17 +67,6 @@ TrackingViewStep::widget() } -void -TrackingViewStep::next() -{ -} - - -void -TrackingViewStep::back() -{} - - bool TrackingViewStep::isNextEnabled() const { diff --git a/src/modules/tracking/TrackingViewStep.h b/src/modules/tracking/TrackingViewStep.h index dc3ae823e..aaaf3bbae 100644 --- a/src/modules/tracking/TrackingViewStep.h +++ b/src/modules/tracking/TrackingViewStep.h @@ -43,9 +43,6 @@ public: QWidget* widget() override; - void next() override; - void back() override; - bool isNextEnabled() const override; bool isBackEnabled() const override; diff --git a/src/modules/users/UsersViewStep.cpp b/src/modules/users/UsersViewStep.cpp index ad0fcb118..3b1e6a5ad 100644 --- a/src/modules/users/UsersViewStep.cpp +++ b/src/modules/users/UsersViewStep.cpp @@ -61,17 +61,6 @@ UsersViewStep::widget() } -void -UsersViewStep::next() -{ -} - - -void -UsersViewStep::back() -{} - - bool UsersViewStep::isNextEnabled() const { diff --git a/src/modules/users/UsersViewStep.h b/src/modules/users/UsersViewStep.h index 81b80bced..a1995497c 100644 --- a/src/modules/users/UsersViewStep.h +++ b/src/modules/users/UsersViewStep.h @@ -43,9 +43,6 @@ public: QWidget* widget() override; - void next() override; - void back() override; - bool isNextEnabled() const override; bool isBackEnabled() const override; diff --git a/src/modules/webview/WebViewStep.cpp b/src/modules/webview/WebViewStep.cpp index 145ff36d5..50c270b09 100644 --- a/src/modules/webview/WebViewStep.cpp +++ b/src/modules/webview/WebViewStep.cpp @@ -72,17 +72,6 @@ WebViewStep::widget() } -void -WebViewStep::next() -{ -} - - -void -WebViewStep::back() -{} - - bool WebViewStep::isNextEnabled() const { diff --git a/src/modules/webview/WebViewStep.h b/src/modules/webview/WebViewStep.h index 6430cdcf1..c588318fa 100644 --- a/src/modules/webview/WebViewStep.h +++ b/src/modules/webview/WebViewStep.h @@ -50,8 +50,6 @@ public: QWidget* widget() override; - void next() override; - void back() override; void onActivate() override; bool isNextEnabled() const override; diff --git a/src/modules/welcome/WelcomeViewStep.cpp b/src/modules/welcome/WelcomeViewStep.cpp index f3aa54532..756c5aa74 100644 --- a/src/modules/welcome/WelcomeViewStep.cpp +++ b/src/modules/welcome/WelcomeViewStep.cpp @@ -60,17 +60,6 @@ WelcomeViewStep::widget() } -void -WelcomeViewStep::next() -{ -} - - -void -WelcomeViewStep::back() -{} - - bool WelcomeViewStep::isNextEnabled() const { diff --git a/src/modules/welcome/WelcomeViewStep.h b/src/modules/welcome/WelcomeViewStep.h index 34b84c29f..b556b1ca1 100644 --- a/src/modules/welcome/WelcomeViewStep.h +++ b/src/modules/welcome/WelcomeViewStep.h @@ -43,9 +43,6 @@ public: QWidget* widget() override; - void next() override; - void back() override; - bool isNextEnabled() const override; bool isBackEnabled() const override;