[libcalamaresui] Move requirements information out of welcome module.

- Move type and rename it; put in Calamares namespace
 - Emit signals from the viewmanager as results come in
 - Remove state changing from welcome view step based on its internal
   requirements checking (for now this breaks progressing past the
   welcome page)
 - Log checking of the requirements
This commit is contained in:
Adriaan de Groot 2017-11-30 12:42:59 -05:00
parent 24e04645b6
commit 27b921bde1
12 changed files with 106 additions and 37 deletions

View file

@ -318,14 +318,27 @@ ModuleManager::loadModules()
void
ModuleManager::checkRequirements()
{
cDebug() << "Checking module requirements ..";
QTimer::singleShot( 0, this, [ this ]()
{
bool acceptable = true;
for (const auto& module : m_loadedModulesByInstanceKey )
{
module->checkRequirements();
auto l = module->checkRequirements();
if ( l.length() > 0 )
{
cDebug() << " .." << module->name() << l.length() << "requirements";
emit requirementsResult( l );
}
for (const auto& r : l)
{
if (r.required && !r.checked)
acceptable = false;
}
}
emit modulesChecked();
emit requirementsComplete( acceptable );
} );
}