Load modules asynchronously on startup.
This commit is contained in:
parent
041db41b35
commit
869483055c
@ -20,6 +20,7 @@
|
||||
|
||||
#include "CalamaresWindow.h"
|
||||
#include "CalamaresVersion.h"
|
||||
#include "ModuleLoader.h"
|
||||
#include "Settings.h"
|
||||
#include "utils/CalamaresUtils.h"
|
||||
#include "utils/Logger.h"
|
||||
@ -55,11 +56,6 @@ CalamaresApplication::init()
|
||||
setWindowIcon( QIcon( "from branding" ) );
|
||||
|
||||
initPlugins();
|
||||
|
||||
initJobQueue();
|
||||
|
||||
m_mainwindow = new CalamaresWindow();
|
||||
m_mainwindow->show();
|
||||
}
|
||||
|
||||
|
||||
@ -85,6 +81,20 @@ CalamaresApplication::instance()
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
CalamaresApplication::setDebug( bool enabled )
|
||||
{
|
||||
m_debugMode = enabled;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
CalamaresApplication::isDebug()
|
||||
{
|
||||
return m_debugMode;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
CalamaresApplication::initSettings()
|
||||
{
|
||||
@ -102,7 +112,21 @@ CalamaresApplication::initBranding()
|
||||
void
|
||||
CalamaresApplication::initPlugins()
|
||||
{
|
||||
m_moduleLoader = new Calamares::ModuleLoader(
|
||||
Calamares::Settings::instance()->modulesSearchPaths(), this );
|
||||
connect( m_moduleLoader, &Calamares::ModuleLoader::done,
|
||||
this, &CalamaresApplication::onPluginsReady );
|
||||
m_moduleLoader->start();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
CalamaresApplication::onPluginsReady()
|
||||
{
|
||||
initJobQueue();
|
||||
|
||||
m_mainwindow = new CalamaresWindow();
|
||||
m_mainwindow->show();
|
||||
}
|
||||
|
||||
|
||||
@ -111,19 +135,3 @@ CalamaresApplication::initJobQueue()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
CalamaresApplication::setDebug( bool enabled )
|
||||
{
|
||||
m_debugMode = enabled;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
CalamaresApplication::isDebug()
|
||||
{
|
||||
return m_debugMode;
|
||||
}
|
||||
|
||||
|
||||
|
@ -25,6 +25,11 @@
|
||||
|
||||
class CalamaresWindow;
|
||||
|
||||
namespace Calamares
|
||||
{
|
||||
class ModuleLoader;
|
||||
}
|
||||
|
||||
class CalamaresApplication : public QApplication
|
||||
{
|
||||
Q_OBJECT
|
||||
@ -35,16 +40,20 @@ public:
|
||||
void init();
|
||||
static CalamaresApplication* instance();
|
||||
|
||||
void setDebug( bool enabled );
|
||||
bool isDebug();
|
||||
|
||||
private slots:
|
||||
void onPluginsReady();
|
||||
|
||||
private:
|
||||
void initSettings();
|
||||
void initBranding();
|
||||
void initPlugins();
|
||||
void initJobQueue();
|
||||
|
||||
void setDebug( bool enabled );
|
||||
bool isDebug();
|
||||
|
||||
private:
|
||||
CalamaresWindow* m_mainwindow;
|
||||
Calamares::ModuleLoader* m_moduleLoader;
|
||||
|
||||
bool m_debugMode;
|
||||
//QPointer< Calamares::JobQueue > m_jobQueue;
|
||||
|
Loading…
Reference in New Issue
Block a user