|
|
|
@ -19,11 +19,25 @@
|
|
|
|
|
#include "extension_system\iplugin_manager.h"
|
|
|
|
|
#include "splash_screen.h"
|
|
|
|
|
|
|
|
|
|
namespace
|
|
|
|
|
{
|
|
|
|
|
enum Progress
|
|
|
|
|
{
|
|
|
|
|
PLUGINS_LOADED = 10,
|
|
|
|
|
PLUGINS_INITIALIZED = 90,
|
|
|
|
|
PLUGINS_STARTED = 100
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PluginManagerWatcher::connect()
|
|
|
|
|
{
|
|
|
|
|
QObject::connect( pm, SIGNAL( pluginLoading( const char * ) ), this, SLOT( onPluginLoading( const char * ) ) );
|
|
|
|
|
QObject::connect( pm, SIGNAL( pluginInitializing( const char * ) ), this, SLOT( onPluginInitializing( const char * ) ) );
|
|
|
|
|
QObject::connect( pm, SIGNAL( pluginStarting( const char * ) ), this, SLOT( onPluginStarting( const char * ) ) );
|
|
|
|
|
QObject::connect( pm, SIGNAL( pluginsLoaded() ), this, SLOT( onPluginsLoaded() ) );
|
|
|
|
|
QObject::connect( pm, SIGNAL( pluginsInitialized() ), this, SLOT( onPluginsInitialized() ) );
|
|
|
|
|
QObject::connect( pm, SIGNAL( pluginsStarted() ), this, SLOT( onPluginsStarted() ) );
|
|
|
|
|
QObject::connect( pm, SIGNAL( pluginCount( int ) ), this, SLOT( onPluginCount( int ) ) );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PluginManagerWatcher::disconnect()
|
|
|
|
@ -31,6 +45,10 @@ void PluginManagerWatcher::disconnect()
|
|
|
|
|
QObject::disconnect( pm, SIGNAL( pluginLoading( const char * ) ), this, SLOT( onPluginLoading( const char * ) ) );
|
|
|
|
|
QObject::disconnect( pm, SIGNAL( pluginInitializing( const char * ) ), this, SLOT( onPluginInitializing( const char * ) ) );
|
|
|
|
|
QObject::disconnect( pm, SIGNAL( pluginStarting( const char * ) ), this, SLOT( onPluginStarting( const char * ) ) );
|
|
|
|
|
QObject::disconnect( pm, SIGNAL( pluginsLoaded() ), this, SLOT( onPluginsLoaded() ) );
|
|
|
|
|
QObject::disconnect( pm, SIGNAL( pluginsInitialized() ), this, SLOT( onPluginsInitialized() ) );
|
|
|
|
|
QObject::disconnect( pm, SIGNAL( pluginsStarted() ), this, SLOT( onPluginsStarted() ) );
|
|
|
|
|
QObject::disconnect( pm, SIGNAL( pluginCount( int ) ), this, SLOT( onPluginCount( int ) ) );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PluginManagerWatcher::onPluginLoading( const char *plugin )
|
|
|
|
@ -39,6 +57,8 @@ void PluginManagerWatcher::onPluginLoading( const char *plugin )
|
|
|
|
|
s += plugin;
|
|
|
|
|
s += "...";
|
|
|
|
|
sp->setText( s );
|
|
|
|
|
|
|
|
|
|
sp->advanceProgress( PLUGINS_LOADED / pluginCount );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PluginManagerWatcher::onPluginInitializing( const char *plugin )
|
|
|
|
@ -47,6 +67,8 @@ void PluginManagerWatcher::onPluginInitializing( const char *plugin )
|
|
|
|
|
s += plugin;
|
|
|
|
|
s += "...";
|
|
|
|
|
sp->setText( s );
|
|
|
|
|
|
|
|
|
|
sp->advanceProgress( ( PLUGINS_INITIALIZED - PLUGINS_LOADED ) / pluginCount );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PluginManagerWatcher::onPluginStarting( const char *plugin )
|
|
|
|
@ -55,7 +77,27 @@ void PluginManagerWatcher::onPluginStarting( const char *plugin )
|
|
|
|
|
s += plugin;
|
|
|
|
|
s += "...";
|
|
|
|
|
sp->setText( s );
|
|
|
|
|
|
|
|
|
|
sp->advanceProgress( ( PLUGINS_STARTED - PLUGINS_INITIALIZED ) / pluginCount );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void PluginManagerWatcher::onPluginsLoaded()
|
|
|
|
|
{
|
|
|
|
|
sp->setProgress( PLUGINS_LOADED );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PluginManagerWatcher::onPluginsInitialized()
|
|
|
|
|
{
|
|
|
|
|
sp->setProgress( PLUGINS_INITIALIZED );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PluginManagerWatcher::onPluginsStarted()
|
|
|
|
|
{
|
|
|
|
|
sp->setProgress( PLUGINS_STARTED );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PluginManagerWatcher::onPluginCount( int count )
|
|
|
|
|
{
|
|
|
|
|
pluginCount = count;
|
|
|
|
|
}
|