diff --git a/settings.conf b/settings.conf index 517e6c281..d3c4d56fc 100644 --- a/settings.conf +++ b/settings.conf @@ -1,22 +1,40 @@ # Configuration file for Calamares # Syntax is YAML 1.2 --- -# Modules can be core modules (with different interfaces) and QtWidgets page modules. +# Modules can be job modules (with different interfaces) and QtWidgets view modules. # They could all be placed in a number of different paths. modules-search: [ local, /path/to/dir/with/more/modules ] -# We define the module names in the order they should show up (QtWidget page modules, +# We define the module names in the order they should show up (QtWidget view modules, # with one or more pages) OR be executed if enqueued (all other modules). -# Pages can also enqueue jobs for delayed execution. -# TBD: do we want to allow non-page modules (core-modules) to be set as immediate or -# delayed? Is this an intrinsic property of a module? Does it depend on whether it's -# a QProcess, a Python script or a plugin? More research is required. --teo -modules-prepare : +# Pages can also enqueue jobs for delayed execution in the order specified for the +# install phase. + +# Phase 1 - prepare. +# View modules are shown as UI pages, jobs from job modules are executed immediately in +# the background. +# Jobs should be executed sparingly (if at all) in this phase. +prepare: - greeting - locale - keyboard - partition - summary -modules-postinstall : +# Phase 2 - install. +# View modules are not shown. Only the view modules shown in the previous phase are +# allowed, their names should be added here as placeholders to specify the order in +# which view module jobs should be enqueued. Job modules are also allowed. +install: #TODO: actually use this +- partition +- unsquashfs +- locale +- keyboard +- users + +# Phase 3 - postinstall. +# View modules are shown as UI pages, jobs from job modules are executed immediately in +# the background. +# Jobs should be executed sparingly (if at all) in this phase. +postinstall: #TODO: actually use this - finished diff --git a/src/calamares/CalamaresApplication.cpp b/src/calamares/CalamaresApplication.cpp index e05cf41e8..21076efe5 100644 --- a/src/calamares/CalamaresApplication.cpp +++ b/src/calamares/CalamaresApplication.cpp @@ -151,7 +151,7 @@ CalamaresApplication::onPluginsReady() m_mainwindow = new CalamaresWindow(); - m_moduleManager->loadRequiredModules(); + m_moduleManager->loadModulesPrepare(); connect( m_moduleManager, &Calamares::ModuleManager::modulesLoaded, [this] { m_mainwindow->show(); diff --git a/src/libcalamaresui/Settings.cpp b/src/libcalamaresui/Settings.cpp index f9c3e3112..65749f330 100644 --- a/src/libcalamaresui/Settings.cpp +++ b/src/libcalamaresui/Settings.cpp @@ -93,8 +93,9 @@ Settings::Settings( bool debugMode, QObject* parent ) } } - config[ "modules-prepare" ] >> m_viewModulesPrepareList; - config[ "modules-postinstall" ] >> m_viewModulesPostInstallList; + config[ "prepare" ] >> m_modulesPrepareList; + config[ "install" ] >> m_modulesInstallList; + config[ "postinstall" ] >> m_modulesPostInstallList; } catch ( YAML::Exception& e ) { @@ -118,16 +119,23 @@ Settings::modulesSearchPaths() QStringList -Settings::viewModulesPrepare() +Settings::modulesPrepare() { - return m_viewModulesPrepareList; + return m_modulesPrepareList; } QStringList -Settings::viewModulesPostInstall() +Settings::modulesInstall() { - return m_viewModulesPostInstallList; + return m_modulesInstallList; +} + + +QStringList +Settings::modulesPostInstall() +{ + return m_modulesPostInstallList; } diff --git a/src/libcalamaresui/Settings.h b/src/libcalamaresui/Settings.h index f2ee7c88d..35d99653a 100644 --- a/src/libcalamaresui/Settings.h +++ b/src/libcalamaresui/Settings.h @@ -39,17 +39,20 @@ public: QStringList modulesSearchPaths(); - QStringList viewModulesPrepare(); + QStringList modulesPrepare(); - QStringList viewModulesPostInstall(); + QStringList modulesInstall(); + + QStringList modulesPostInstall(); private: static Settings* s_instance; QStringList m_modulesSearchPaths; - QStringList m_viewModulesPrepareList; - QStringList m_viewModulesPostInstallList; + QStringList m_modulesPrepareList; + QStringList m_modulesInstallList; + QStringList m_modulesPostInstallList; }; } diff --git a/src/libcalamaresui/modulesystem/ModuleManager.cpp b/src/libcalamaresui/modulesystem/ModuleManager.cpp index 1b61274de..16f0e5b6e 100644 --- a/src/libcalamaresui/modulesystem/ModuleManager.cpp +++ b/src/libcalamaresui/modulesystem/ModuleManager.cpp @@ -69,9 +69,9 @@ ModuleManager::module( const QString& name ) void -ModuleManager::loadRequiredModules() +ModuleManager::loadModulesPrepare() { - QTimer::singleShot( 0, this, SLOT( doLoadModules() ) ); + QTimer::singleShot( 0, this, SLOT( doLoadModulesPrepare() ) ); } @@ -134,9 +134,9 @@ ModuleManager::doInit() void -ModuleManager::doLoadModules() +ModuleManager::doLoadModulesPrepare() { - foreach ( const QString& moduleName, Settings::instance()->viewModulesPrepare() ) + foreach ( const QString& moduleName, Settings::instance()->modulesPrepare() ) { if ( !m_availableModules.contains( moduleName ) ) { diff --git a/src/libcalamaresui/modulesystem/ModuleManager.h b/src/libcalamaresui/modulesystem/ModuleManager.h index e0865770d..2ccb6921c 100644 --- a/src/libcalamaresui/modulesystem/ModuleManager.h +++ b/src/libcalamaresui/modulesystem/ModuleManager.h @@ -42,7 +42,7 @@ public: QStringList availableModules(); Module* module( const QString& name ); - void loadRequiredModules(); + void loadModulesPrepare(); signals: void initDone(); @@ -50,7 +50,7 @@ signals: private slots: void doInit(); - void doLoadModules(); + void doLoadModulesPrepare(); private: void recursiveLoad( const QString& moduleName );