Add isModuleEnabled function

This commit is contained in:
dalto 2021-10-23 13:57:24 -05:00
parent 132bca649e
commit e22efab1b3
2 changed files with 18 additions and 1 deletions

View File

@ -269,6 +269,19 @@ Settings::Settings( const QString& settingsFilePath, bool debugMode )
s_instance = this;
}
bool
Settings::isModuleEnabled( QString module )
{
// Iterate over the list of modules searching for a match
for ( const auto& moduleInstance : Calamares::Settings::instance()->moduleInstances() )
{
if ( moduleInstance.key().first == module )
return true;
}
return false;
}
void
Settings::reconcileInstancesAndSequence()
{

View File

@ -152,8 +152,12 @@ public:
*/
bool isSetupMode() const { return m_isSetupMode; }
/** @brief Returns true if the named module is enabled */
bool isModuleEnabled( QString module );
/** @brief Global setting of disable-cancel: can't cancel ever. */
bool disableCancel() const { return m_disableCancel; }
/** @brief Temporary setting of disable-cancel: can't cancel during exec. */
bool disableCancelDuringExec() const { return m_disableCancelDuringExec; }