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 f10d29b96..a1275a198 100644 --- a/src/libcalamaresui/viewpages/ViewStep.h +++ b/src/libcalamaresui/viewpages/ViewStep.h @@ -68,13 +68,39 @@ public: //TODO: we might want to make this a QSharedPointer virtual QWidget* widget() = 0; - virtual void next() = 0; - virtual void back() = 0; + /** + * @brief Multi-page support, go next + * + * Multi-page view steps need to manage the content visible in the widget + * themselves. This method is called when the user clicks the *next* + * button, and should switch to the next of the multiple-pages. It needs + * to be consistent with both isNextEnabled() and isAtEnd(). + * + * In particular: when isAtEnd() returns false, next() is called when + * the user clicks the button and a new page should be shown by this + * view step. When isAtEnd() returns true, clicking the button will + * switch to the next view step in sequence, rather than a next page + * in the current view step. + */ + virtual void next(); + /// @brief Multi-page support, go back + virtual void back(); + /// @brief Can the user click *next* with currently-filled-in data? virtual bool isNextEnabled() const = 0; + /// @brief Can the user click *previous* with currently-filled-in data? virtual bool isBackEnabled() const = 0; + /** + * @brief Multi-page support, switch to previous view step? + * + * For a multi-page view step, this indicates that the first (beginning) + * page is showing. Clicking *previous* when at the beginning of a view + * step, switches to the previous step, not the previous page of the + * current view step. + */ virtual bool isAtBeginning() const = 0; + /// @brief Multi-page support, switch to next view step? virtual bool isAtEnd() const = 0; /** @@ -103,7 +129,6 @@ public: signals: void nextStatusChanged( bool status ); - void done(); /* Emitted when the viewstep thinks it needs more space than is currently * available for display. @p enlarge is the requested additional space, diff --git a/src/modules/finished/FinishedViewStep.cpp b/src/modules/finished/FinishedViewStep.cpp index 3b807f69c..8457aa4cd 100644 --- a/src/modules/finished/FinishedViewStep.cpp +++ b/src/modules/finished/FinishedViewStep.cpp @@ -67,18 +67,6 @@ FinishedViewStep::widget() } -void -FinishedViewStep::next() -{ - emit done(); -} - - -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 2559ea635..d57eb7d05 100644 --- a/src/modules/interactiveterminal/InteractiveTerminalViewStep.cpp +++ b/src/modules/interactiveterminal/InteractiveTerminalViewStep.cpp @@ -53,18 +53,6 @@ InteractiveTerminalViewStep::widget() } -void -InteractiveTerminalViewStep::next() -{ - emit done(); -} - - -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 053266059..40a5385a3 100644 --- a/src/modules/keyboard/KeyboardViewStep.cpp +++ b/src/modules/keyboard/KeyboardViewStep.cpp @@ -65,19 +65,6 @@ KeyboardViewStep::widget() } -void -KeyboardViewStep::next() -{ - //TODO: actually save those settings somewhere - emit done(); -} - - -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 41ca02a7e..96a7b8660 100644 --- a/src/modules/license/LicenseViewStep.cpp +++ b/src/modules/license/LicenseViewStep.cpp @@ -59,18 +59,6 @@ LicenseViewStep::widget() } -void -LicenseViewStep::next() -{ - emit done(); -} - - -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 4a6eb229a..a7dc432f8 100644 --- a/src/modules/locale/LocaleViewStep.cpp +++ b/src/modules/locale/LocaleViewStep.cpp @@ -190,18 +190,6 @@ LocaleViewStep::widget() } -void -LocaleViewStep::next() -{ - emit done(); -} - - -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 6dd824b32..3c4fa5e58 100644 --- a/src/modules/netinstall/NetInstallViewStep.cpp +++ b/src/modules/netinstall/NetInstallViewStep.cpp @@ -69,18 +69,6 @@ NetInstallViewStep::widget() } -void -NetInstallViewStep::next() -{ - emit done(); -} - - -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/partition/gui/PartitionViewStep.cpp b/src/modules/partition/gui/PartitionViewStep.cpp index 3c71302e0..bee5ad965 100644 --- a/src/modules/partition/gui/PartitionViewStep.cpp +++ b/src/modules/partition/gui/PartitionViewStep.cpp @@ -292,25 +292,8 @@ PartitionViewStep::next() if ( m_core->isDirty() ) m_manualPartitionPage->onRevertClicked(); } - else if ( m_choicePage->currentChoice() == ChoicePage::Erase ) - { - emit done(); - return; - } - else if ( m_choicePage->currentChoice() == ChoicePage::Alongside ) - { - emit done(); - return; - } - else if ( m_choicePage->currentChoice() == ChoicePage::Replace ) - { - emit done(); - return; - } cDebug() << "Choice applied: " << m_choicePage->currentChoice(); - return; } - emit done(); } diff --git a/src/modules/plasmalnf/PlasmaLnfViewStep.cpp b/src/modules/plasmalnf/PlasmaLnfViewStep.cpp index ef319bde4..5525f36fc 100644 --- a/src/modules/plasmalnf/PlasmaLnfViewStep.cpp +++ b/src/modules/plasmalnf/PlasmaLnfViewStep.cpp @@ -76,18 +76,6 @@ PlasmaLnfViewStep::widget() } -void -PlasmaLnfViewStep::next() -{ - emit done(); -} - - -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 4f60a3c4f..6835b2b05 100644 --- a/src/modules/summary/SummaryViewStep.cpp +++ b/src/modules/summary/SummaryViewStep.cpp @@ -51,18 +51,6 @@ SummaryViewStep::widget() } -void -SummaryViewStep::next() -{ - emit done(); -} - - -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 417e10fc0..304e2a971 100644 --- a/src/modules/tracking/TrackingViewStep.cpp +++ b/src/modules/tracking/TrackingViewStep.cpp @@ -67,18 +67,6 @@ TrackingViewStep::widget() } -void -TrackingViewStep::next() -{ - emit done(); -} - - -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 8ff7b0e7b..3b1e6a5ad 100644 --- a/src/modules/users/UsersViewStep.cpp +++ b/src/modules/users/UsersViewStep.cpp @@ -61,18 +61,6 @@ UsersViewStep::widget() } -void -UsersViewStep::next() -{ - emit done(); -} - - -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 1db7c8e41..50c270b09 100644 --- a/src/modules/webview/WebViewStep.cpp +++ b/src/modules/webview/WebViewStep.cpp @@ -72,18 +72,6 @@ WebViewStep::widget() } -void -WebViewStep::next() -{ - emit done(); -} - - -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 86740fb3d..756c5aa74 100644 --- a/src/modules/welcome/WelcomeViewStep.cpp +++ b/src/modules/welcome/WelcomeViewStep.cpp @@ -60,18 +60,6 @@ WelcomeViewStep::widget() } -void -WelcomeViewStep::next() -{ - emit done(); -} - - -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;