Added new option "--no-splash" to suppress the "splash" screen. This won't speed up the application startup, because the same initialization work still needs to be performed.
This commit is contained in:
parent
717ad7140b
commit
1563ed5c69
13
src/Main.cpp
13
src/Main.cpp
@ -113,14 +113,19 @@ static int lamexp_initialize_ipc(MUtils::IPCChannel *const ipcChannel)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void lamexp_show_splash(const MUtils::CPUFetaures::cpu_info_t &cpuFeatures, SettingsModel *const settingsModel)
|
static void initialize_lamexp(const MUtils::OS::ArgumentMap &arguments, const MUtils::CPUFetaures::cpu_info_t &cpuFeatures, SettingsModel *const settingsModel)
|
||||||
{
|
{
|
||||||
QScopedPointer<InitializationThread> poInitializationThread(new InitializationThread(cpuFeatures));
|
QScopedPointer<InitializationThread> poInitializationThread(new InitializationThread(cpuFeatures));
|
||||||
|
if (arguments.contains("no-splash"))
|
||||||
|
{
|
||||||
|
poInitializationThread->runSyncronized();
|
||||||
|
return;
|
||||||
|
}
|
||||||
SplashScreen::showSplash(poInitializationThread.data());
|
SplashScreen::showSplash(poInitializationThread.data());
|
||||||
settingsModel->slowStartup(poInitializationThread->getSlowIndicator());
|
settingsModel->slowStartup(poInitializationThread->getSlowIndicator());
|
||||||
}
|
}
|
||||||
|
|
||||||
static int lamexp_main_loop(const MUtils::CPUFetaures::cpu_info_t &cpuFeatures, MUtils::IPCChannel *const ipcChannel, int &iShutdown)
|
static int lamexp_main_loop(const MUtils::OS::ArgumentMap &arguments, const MUtils::CPUFetaures::cpu_info_t &cpuFeatures, MUtils::IPCChannel *const ipcChannel, int &iShutdown)
|
||||||
{
|
{
|
||||||
int iResult = -1;
|
int iResult = -1;
|
||||||
bool bAccepted = true;
|
bool bAccepted = true;
|
||||||
@ -131,7 +136,7 @@ static int lamexp_main_loop(const MUtils::CPUFetaures::cpu_info_t &cpuFeatures,
|
|||||||
QScopedPointer<SettingsModel> settingsModel(new SettingsModel() );
|
QScopedPointer<SettingsModel> settingsModel(new SettingsModel() );
|
||||||
|
|
||||||
//Show splash screen
|
//Show splash screen
|
||||||
lamexp_show_splash(cpuFeatures, settingsModel.data());
|
initialize_lamexp(arguments, cpuFeatures, settingsModel.data());
|
||||||
|
|
||||||
//Validate settings
|
//Validate settings
|
||||||
settingsModel->validate();
|
settingsModel->validate();
|
||||||
@ -260,7 +265,7 @@ static int lamexp_main(int &argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Main application loop
|
//Main application loop
|
||||||
iResult = lamexp_main_loop(cpuFeatures, ipcChannel.data(), iShutdown);
|
iResult = lamexp_main_loop(arguments, cpuFeatures, ipcChannel.data(), iShutdown);
|
||||||
|
|
||||||
//Final clean-up
|
//Final clean-up
|
||||||
qDebug("Shutting down, please wait...\n");
|
qDebug("Shutting down, please wait...\n");
|
||||||
|
@ -825,6 +825,11 @@ void InitializationThread::selfTest(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void InitializationThread::runSyncronized(void)
|
||||||
|
{
|
||||||
|
run();
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
// EVENTS
|
// EVENTS
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
|
@ -45,6 +45,7 @@ public:
|
|||||||
bool getSuccess(void) { return !isRunning() && m_bSuccess; }
|
bool getSuccess(void) { return !isRunning() && m_bSuccess; }
|
||||||
bool getSlowIndicator(void) { return m_slowIndicator; }
|
bool getSlowIndicator(void) { return m_slowIndicator; }
|
||||||
|
|
||||||
|
void runSyncronized(void);
|
||||||
static void selfTest(void);
|
static void selfTest(void);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
Loading…
Reference in New Issue
Block a user