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

@ -95,6 +95,10 @@ ViewManager::ViewManager( QObject* parent )
this, &ViewManager::onInstallationFailed );
connect( JobQueue::instance(), &JobQueue::finished,
this, &ViewManager::next );
if (Calamares::Settings::instance()->disableCancel())
m_quit->setVisible( false );
}
@ -282,9 +286,13 @@ ViewManager::updateButtonLabels()
{
m_quit->setText( tr( "&Done" ) );
m_quit->setToolTip( tr( "The installation is complete. Close the installer." ) );
if (Calamares::Settings::instance()->disableCancel())
m_quit->setVisible( true );
}
else
{
if (Calamares::Settings::instance()->disableCancel())
m_quit->setVisible( false );
m_quit->setText( tr( "&Cancel" ) );
m_quit->setToolTip( tr( "Cancel installation without changing the system." ) );
}