Fix issues related to the splash screen when no config file found:

- do not show it before the application is actually started.
- hide the splash screen before displaying dialogs.
Fixes #15047
https://gitlab.com/kicad/code/kicad/-/issues/15047
This commit is contained in:
jean-pierre charras 2023-06-24 18:09:43 +02:00
parent b3d7aea4df
commit 1094cc5331
3 changed files with 10 additions and 3 deletions

View File

@ -506,9 +506,6 @@ bool PGM_BASE::InitPgm( bool aHeadless, bool aSkipPyInit, bool aIsUnitTest )
SetLanguagePath(); SetLanguagePath();
SetDefaultLanguage( tmp ); SetDefaultLanguage( tmp );
if( !aHeadless )
ShowSplash();
m_settings_manager = std::make_unique<SETTINGS_MANAGER>( aHeadless ); m_settings_manager = std::make_unique<SETTINGS_MANAGER>( aHeadless );
// Our unit test mocks break if we continue // Our unit test mocks break if we continue
@ -566,6 +563,10 @@ bool PGM_BASE::InitPgm( bool aHeadless, bool aSkipPyInit, bool aIsUnitTest )
if( ADVANCED_CFG::GetCfg().m_UpdateUIEventInterval != 0 ) if( ADVANCED_CFG::GetCfg().m_UpdateUIEventInterval != 0 )
wxUpdateUIEvent::SetUpdateInterval( ADVANCED_CFG::GetCfg().m_UpdateUIEventInterval ); wxUpdateUIEvent::SetUpdateInterval( ADVANCED_CFG::GetCfg().m_UpdateUIEventInterval );
// Now the application can safely start, show the splash screen
if( !aHeadless )
ShowSplash();
return true; return true;
} }

View File

@ -370,6 +370,9 @@ bool IFACE::loadGlobalLibTable()
{ {
if( !( m_start_flags & KFCTL_CLI ) ) if( !( m_start_flags & KFCTL_CLI ) )
{ {
// Ensure the splash screen does not hide the dialog:
Pgm().HideSplash();
DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG symDialog( nullptr ); DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG symDialog( nullptr );
if( symDialog.ShowModal() != wxID_OK ) if( symDialog.ShowModal() != wxID_OK )

View File

@ -385,6 +385,9 @@ bool IFACE::loadGlobalLibTable()
{ {
if( !( m_start_flags & KFCTL_CLI ) ) if( !( m_start_flags & KFCTL_CLI ) )
{ {
// Ensure the splash screen does not hide the dialog:
Pgm().HideSplash();
DIALOG_GLOBAL_FP_LIB_TABLE_CONFIG fpDialog( nullptr ); DIALOG_GLOBAL_FP_LIB_TABLE_CONFIG fpDialog( nullptr );
if( fpDialog.ShowModal() != wxID_OK ) if( fpDialog.ShowModal() != wxID_OK )