Merge pull request #1126 from feren/patch-3
Patch to add 'dont-cancel' setting to disable Cancel only during the installation phase
This commit is contained in:
commit
10727c7bd9
@ -163,3 +163,8 @@ dont-chroot: false
|
||||
#
|
||||
# YAML: boolean.
|
||||
disable-cancel: false
|
||||
|
||||
# If this is set to true, the "Cancel" button will be disabled once
|
||||
# you start the 'Installation', meaning there won't be a way to cancel
|
||||
# the Installation until it has finished or installation has failed.
|
||||
dont-cancel: false
|
||||
|
@ -1,5 +1,7 @@
|
||||
/* === This file is part of Calamares - <https://github.com/calamares> ===
|
||||
*
|
||||
* Copyright 2019, Dominic Hayes <ferenosdev@outlook.com>
|
||||
* Copyright 2019, Gabriel Craciunescu <crazy@frugalware.org>
|
||||
* Copyright 2014-2015, Teo Mrnjavac <teo@kde.org>
|
||||
* Copyright 2017-2018, Adriaan de Groot <groot@kde.org>
|
||||
*
|
||||
@ -183,6 +185,7 @@ Settings::Settings( const QString& settingsFilePath,
|
||||
, m_doChroot( true )
|
||||
, m_promptInstall( false )
|
||||
, m_disableCancel( false )
|
||||
, m_dontCancel( false )
|
||||
{
|
||||
cDebug() << "Using Calamares settings file at" << settingsFilePath;
|
||||
QFile file( settingsFilePath );
|
||||
@ -204,6 +207,7 @@ Settings::Settings( const QString& settingsFilePath,
|
||||
m_doChroot = !requireBool( config, "dont-chroot", false );
|
||||
m_isSetupMode = requireBool( config, "oem-setup", !m_doChroot );
|
||||
m_disableCancel = requireBool( config, "disable-cancel", false );
|
||||
m_dontCancel = requireBool( config, "dont-cancel", false );
|
||||
}
|
||||
catch ( YAML::Exception& e )
|
||||
{
|
||||
@ -271,6 +275,12 @@ Settings::disableCancel() const
|
||||
{
|
||||
return m_disableCancel;
|
||||
}
|
||||
|
||||
bool
|
||||
Settings::dontCancel() const
|
||||
{
|
||||
return m_dontCancel;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
/* === This file is part of Calamares - <https://github.com/calamares> ===
|
||||
*
|
||||
* Copyright 2019, Dominic Hayes <ferenosdev@outlook.com>
|
||||
* Copyright 2019, Gabriel Craciunescu <crazy@frugalware.org>
|
||||
* Copyright 2014-2015, Teo Mrnjavac <teo@kde.org>
|
||||
* Copyright 2017-2018, Adriaan de Groot <groot@kde.org>
|
||||
*
|
||||
@ -68,6 +70,8 @@ public:
|
||||
bool isSetupMode() const { return m_isSetupMode; }
|
||||
|
||||
bool disableCancel() const;
|
||||
|
||||
bool dontCancel() const;
|
||||
|
||||
private:
|
||||
static Settings* s_instance;
|
||||
@ -84,6 +88,7 @@ private:
|
||||
bool m_isSetupMode;
|
||||
bool m_promptInstall;
|
||||
bool m_disableCancel;
|
||||
bool m_dontCancel;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
/* === This file is part of Calamares - <https://github.com/calamares> ===
|
||||
*
|
||||
* Copyright 2019, Dominic Hayes <ferenosdev@outlook.com>
|
||||
* Copyright 2019, Gabriel Craciunescu <crazy@frugalware.org>
|
||||
* Copyright 2014-2015, Teo Mrnjavac <teo@kde.org>
|
||||
* Copyright 2017-2018, Adriaan de Groot <groot@kde.org>
|
||||
*
|
||||
@ -281,6 +283,8 @@ ViewManager::next()
|
||||
{
|
||||
m_back->setEnabled( false );
|
||||
m_next->setEnabled( false );
|
||||
if (Calamares::Settings::instance()->dontCancel())
|
||||
m_quit->setEnabled( false );
|
||||
}
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user