Add a settings.conf option to disable "Cancel" button

In some cases, e.g. when calamares is used as an "initial setup" tool,
we may want to user to go through all the configuration steps in order
to end up with a usable system.
Therefore, disabling the "Cancel" button can be useful in this case.

This commit adds an option to settings.conf which disables this button
when set to "true". If the option is not present in the settings file,
the default behavior ("Cancel" button enabled & visible) is enforced.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
This commit is contained in:
Arnaud Ferraris 2019-01-23 15:56:07 +01:00
parent c9930788f7
commit db3d3a7d03
4 changed files with 28 additions and 0 deletions

View file

@ -81,6 +81,7 @@ Settings::Settings( const QString& settingsFilePath,
, m_debug( debugMode )
, m_doChroot( true )
, m_promptInstall( false )
, m_disableCancel( false )
{
cDebug() << "Using Calamares settings file at" << settingsFilePath;
QFile file( settingsFilePath );
@ -183,6 +184,7 @@ Settings::Settings( const QString& settingsFilePath,
m_brandingComponentName = requireString( config, "branding" );
m_promptInstall = requireBool( config, "prompt-install", false );
m_doChroot = !requireBool( config, "dont-chroot", false );
m_disableCancel = requireBool( config, "disable-cancel", false );
}
catch ( YAML::Exception& e )
{
@ -245,5 +247,11 @@ Settings::doChroot() const
return m_doChroot;
}
bool
Settings::disableCancel() const
{
return m_disableCancel;
}
}