diff --git a/settings.conf b/settings.conf index c2aa48a37..982f4ebbe 100644 --- a/settings.conf +++ b/settings.conf @@ -188,3 +188,11 @@ disable-cancel: false # # YAML: boolean. disable-cancel-during-exec: false + +# If this is set to true, then once the end of the sequence has +# been reached, the quit (done) button is clicked automatically +# and Calamares will close. Default is false: the user will see +# that the end of installation has been reached, and that things are ok. +# +# +quit-at-end: false diff --git a/src/libcalamares/Settings.cpp b/src/libcalamares/Settings.cpp index 7e1c15e30..da388ea32 100644 --- a/src/libcalamares/Settings.cpp +++ b/src/libcalamares/Settings.cpp @@ -232,6 +232,7 @@ Settings::Settings( const QString& settingsFilePath, bool debugMode ) m_isSetupMode = requireBool( config, "oem-setup", !m_doChroot ); m_disableCancel = requireBool( config, "disable-cancel", false ); m_disableCancelDuringExec = requireBool( config, "disable-cancel-during-exec", false ); + m_quitAtEnd = requireBool( config, "quit-at-end", false ); } catch ( YAML::Exception& e ) { diff --git a/src/libcalamares/Settings.h b/src/libcalamares/Settings.h index 94474c09c..3cedd6e2b 100644 --- a/src/libcalamares/Settings.h +++ b/src/libcalamares/Settings.h @@ -101,6 +101,9 @@ public: /** @brief Temporary setting of disable-cancel: can't cancel during exec. */ bool disableCancelDuringExec() const { return m_disableCancelDuringExec; } + /** @brief Is quit-at-end set? (Quit automatically when done) */ + bool quitAtEnd() const { return m_quitAtEnd; } + private: static Settings* s_instance; @@ -117,6 +120,7 @@ private: bool m_promptInstall; bool m_disableCancel; bool m_disableCancelDuringExec; + bool m_quitAtEnd; }; } // namespace Calamares diff --git a/src/libcalamaresui/ViewManager.cpp b/src/libcalamaresui/ViewManager.cpp index 6ee0d5de3..9972c3af9 100644 --- a/src/libcalamaresui/ViewManager.cpp +++ b/src/libcalamaresui/ViewManager.cpp @@ -426,6 +426,10 @@ ViewManager::updateButtonLabels() m_quit->setVisible( true ); // At end, always visible and enabled. setButtonIcon( m_quit, "dialog-ok-apply" ); updateCancelEnabled( true ); + if ( settings->quitAtEnd() ) + { + m_quit->click(); + } } else {