mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 18:23:15 +02:00
ADDED: Startup splashscreen
This is purely loading in the background based and has no artificial delay. Will be more useful once kicad.exe ends up loading more on launch immediately ;) Right now the splash is probably visible the longest launching pcbnew standalone. The actual splash image can be considered a placeholder
This commit is contained in:
parent
fa84575510
commit
74d6dc6642
@ -1093,6 +1093,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
|||||||
aBitmapInfoCache[BITMAPS::rectwaveguide].emplace_back( BITMAPS::rectwaveguide, wxT( "rectwaveguide.png" ), -1, wxT( "light" ) );
|
aBitmapInfoCache[BITMAPS::rectwaveguide].emplace_back( BITMAPS::rectwaveguide, wxT( "rectwaveguide.png" ), -1, wxT( "light" ) );
|
||||||
aBitmapInfoCache[BITMAPS::regul].emplace_back( BITMAPS::regul, wxT( "regul.png" ), -1, wxT( "light" ) );
|
aBitmapInfoCache[BITMAPS::regul].emplace_back( BITMAPS::regul, wxT( "regul.png" ), -1, wxT( "light" ) );
|
||||||
aBitmapInfoCache[BITMAPS::regul_3pins].emplace_back( BITMAPS::regul_3pins, wxT( "regul_3pins.png" ), -1, wxT( "light" ) );
|
aBitmapInfoCache[BITMAPS::regul_3pins].emplace_back( BITMAPS::regul_3pins, wxT( "regul_3pins.png" ), -1, wxT( "light" ) );
|
||||||
|
aBitmapInfoCache[BITMAPS::splash].emplace_back( BITMAPS::splash, wxT( "splash.png" ), -1, wxT( "light" ) );
|
||||||
aBitmapInfoCache[BITMAPS::stripline].emplace_back( BITMAPS::stripline, wxT( "stripline.png" ), -1, wxT( "light" ) );
|
aBitmapInfoCache[BITMAPS::stripline].emplace_back( BITMAPS::stripline, wxT( "stripline.png" ), -1, wxT( "light" ) );
|
||||||
aBitmapInfoCache[BITMAPS::stroke_dash].emplace_back( BITMAPS::stroke_dash, wxT( "stroke_dash.png" ), -1, wxT( "light" ) );
|
aBitmapInfoCache[BITMAPS::stroke_dash].emplace_back( BITMAPS::stroke_dash, wxT( "stroke_dash.png" ), -1, wxT( "light" ) );
|
||||||
aBitmapInfoCache[BITMAPS::stroke_dashdot].emplace_back( BITMAPS::stroke_dashdot, wxT( "stroke_dashdot.png" ), -1, wxT( "light" ) );
|
aBitmapInfoCache[BITMAPS::stroke_dashdot].emplace_back( BITMAPS::stroke_dashdot, wxT( "stroke_dashdot.png" ), -1, wxT( "light" ) );
|
||||||
@ -1132,6 +1133,7 @@ void BuildBitmapInfo( std::unordered_map<BITMAPS, std::vector<BITMAP_INFO>>& aBi
|
|||||||
aBitmapInfoCache[BITMAPS::rectwaveguide].emplace_back( BITMAPS::rectwaveguide, wxT( "rectwaveguide_dark.png" ), -1, wxT( "dark" ) );
|
aBitmapInfoCache[BITMAPS::rectwaveguide].emplace_back( BITMAPS::rectwaveguide, wxT( "rectwaveguide_dark.png" ), -1, wxT( "dark" ) );
|
||||||
aBitmapInfoCache[BITMAPS::regul].emplace_back( BITMAPS::regul, wxT( "regul_dark.png" ), -1, wxT( "dark" ) );
|
aBitmapInfoCache[BITMAPS::regul].emplace_back( BITMAPS::regul, wxT( "regul_dark.png" ), -1, wxT( "dark" ) );
|
||||||
aBitmapInfoCache[BITMAPS::regul_3pins].emplace_back( BITMAPS::regul_3pins, wxT( "regul_3pins_dark.png" ), -1, wxT( "dark" ) );
|
aBitmapInfoCache[BITMAPS::regul_3pins].emplace_back( BITMAPS::regul_3pins, wxT( "regul_3pins_dark.png" ), -1, wxT( "dark" ) );
|
||||||
|
aBitmapInfoCache[BITMAPS::splash].emplace_back( BITMAPS::splash, wxT( "splash_dark.png" ), -1, wxT( "dark" ) );
|
||||||
aBitmapInfoCache[BITMAPS::stripline].emplace_back( BITMAPS::stripline, wxT( "stripline_dark.png" ), -1, wxT( "dark" ) );
|
aBitmapInfoCache[BITMAPS::stripline].emplace_back( BITMAPS::stripline, wxT( "stripline_dark.png" ), -1, wxT( "dark" ) );
|
||||||
aBitmapInfoCache[BITMAPS::stroke_dash].emplace_back( BITMAPS::stroke_dash, wxT( "stroke_dash_dark.png" ), -1, wxT( "dark" ) );
|
aBitmapInfoCache[BITMAPS::stroke_dash].emplace_back( BITMAPS::stroke_dash, wxT( "stroke_dash_dark.png" ), -1, wxT( "dark" ) );
|
||||||
aBitmapInfoCache[BITMAPS::stroke_dashdot].emplace_back( BITMAPS::stroke_dashdot, wxT( "stroke_dashdot_dark.png" ), -1, wxT( "dark" ) );
|
aBitmapInfoCache[BITMAPS::stroke_dashdot].emplace_back( BITMAPS::stroke_dashdot, wxT( "stroke_dashdot_dark.png" ), -1, wxT( "dark" ) );
|
||||||
|
@ -43,6 +43,7 @@
|
|||||||
#include <wx/tooltip.h>
|
#include <wx/tooltip.h>
|
||||||
|
|
||||||
#include <advanced_config.h>
|
#include <advanced_config.h>
|
||||||
|
#include <bitmaps.h>
|
||||||
#include <cli/cli_names.h> // Needed for the pre wx 3.2 cli workaround
|
#include <cli/cli_names.h> // Needed for the pre wx 3.2 cli workaround
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
#include <config_params.h>
|
#include <config_params.h>
|
||||||
@ -66,6 +67,8 @@
|
|||||||
#include <thread_pool.h>
|
#include <thread_pool.h>
|
||||||
#include <trace_helpers.h>
|
#include <trace_helpers.h>
|
||||||
|
|
||||||
|
#include <wx/splash.h>
|
||||||
|
|
||||||
#ifdef KICAD_USE_SENTRY
|
#ifdef KICAD_USE_SENTRY
|
||||||
#include <boost/uuid/uuid_io.hpp>
|
#include <boost/uuid/uuid_io.hpp>
|
||||||
#include <boost/uuid/uuid_generators.hpp>
|
#include <boost/uuid/uuid_generators.hpp>
|
||||||
@ -130,6 +133,7 @@ PGM_BASE::PGM_BASE()
|
|||||||
m_Quitting = false;
|
m_Quitting = false;
|
||||||
m_argcUtf8 = 0;
|
m_argcUtf8 = 0;
|
||||||
m_argvUtf8 = nullptr;
|
m_argvUtf8 = nullptr;
|
||||||
|
m_splash = nullptr;
|
||||||
|
|
||||||
setLanguageId( wxLANGUAGE_DEFAULT );
|
setLanguageId( wxLANGUAGE_DEFAULT );
|
||||||
|
|
||||||
@ -139,6 +143,7 @@ PGM_BASE::PGM_BASE()
|
|||||||
|
|
||||||
PGM_BASE::~PGM_BASE()
|
PGM_BASE::~PGM_BASE()
|
||||||
{
|
{
|
||||||
|
HideSplash();
|
||||||
Destroy();
|
Destroy();
|
||||||
|
|
||||||
for( int n = 0; n < m_argcUtf8; n++ )
|
for( int n = 0; n < m_argcUtf8; n++ )
|
||||||
@ -399,6 +404,28 @@ void PGM_BASE::BuildArgvUtf8()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void PGM_BASE::ShowSplash()
|
||||||
|
{
|
||||||
|
if( m_splash )
|
||||||
|
return;
|
||||||
|
|
||||||
|
m_splash = new wxSplashScreen( KiBitmap( BITMAPS::splash ), wxSPLASH_CENTRE_ON_SCREEN, 0,
|
||||||
|
NULL, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE | wxSTAY_ON_TOP );
|
||||||
|
wxYield();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void PGM_BASE::HideSplash()
|
||||||
|
{
|
||||||
|
if( !m_splash )
|
||||||
|
return;
|
||||||
|
|
||||||
|
m_splash->Close();
|
||||||
|
m_splash->Destroy();
|
||||||
|
m_splash = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool PGM_BASE::InitPgm( bool aHeadless, bool aSkipPyInit, bool aIsUnitTest )
|
bool PGM_BASE::InitPgm( bool aHeadless, bool aSkipPyInit, bool aIsUnitTest )
|
||||||
{
|
{
|
||||||
#if defined( __WXMAC__ )
|
#if defined( __WXMAC__ )
|
||||||
@ -479,6 +506,9 @@ 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
|
||||||
|
@ -408,5 +408,7 @@ bool PGM_SINGLE_TOP::OnPgmInit()
|
|||||||
frame->OpenProjectFiles( fileArgs );
|
frame->OpenProjectFiles( fileArgs );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HideSplash();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -544,6 +544,7 @@ enum class BITMAPS : unsigned int
|
|||||||
small_up,
|
small_up,
|
||||||
small_warning,
|
small_warning,
|
||||||
special_tools,
|
special_tools,
|
||||||
|
splash,
|
||||||
spreadsheet,
|
spreadsheet,
|
||||||
stripline,
|
stripline,
|
||||||
stroke_dash,
|
stroke_dash,
|
||||||
|
@ -46,6 +46,7 @@ class wxSingleInstanceChecker;
|
|||||||
class wxApp;
|
class wxApp;
|
||||||
class wxMenu;
|
class wxMenu;
|
||||||
class wxWindow;
|
class wxWindow;
|
||||||
|
class wxSplashScreen;
|
||||||
|
|
||||||
class COMMON_SETTINGS;
|
class COMMON_SETTINGS;
|
||||||
class SETTINGS_MANAGER;
|
class SETTINGS_MANAGER;
|
||||||
@ -352,6 +353,10 @@ public:
|
|||||||
*/
|
*/
|
||||||
bool IsGUI();
|
bool IsGUI();
|
||||||
|
|
||||||
|
|
||||||
|
void ShowSplash();
|
||||||
|
void HideSplash();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* wxWidgets on MSW tends to crash if you spool up more than one print job at a time.
|
* wxWidgets on MSW tends to crash if you spool up more than one print job at a time.
|
||||||
*/
|
*/
|
||||||
@ -407,6 +412,8 @@ protected:
|
|||||||
/// and will return argv as either force converted to ascii in char* or wchar_t only
|
/// and will return argv as either force converted to ascii in char* or wchar_t only
|
||||||
|
|
||||||
int m_argcUtf8;
|
int m_argcUtf8;
|
||||||
|
|
||||||
|
wxSplashScreen* m_splash;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -353,6 +353,8 @@ bool PGM_KICAD::OnPgmInit()
|
|||||||
frame->Show( true );
|
frame->Show( true );
|
||||||
frame->Raise();
|
frame->Raise();
|
||||||
|
|
||||||
|
HideSplash();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -636,6 +636,7 @@ set( BMAPS_OTHER
|
|||||||
creepage_clearance
|
creepage_clearance
|
||||||
cpw
|
cpw
|
||||||
cpw_back
|
cpw_back
|
||||||
|
light
|
||||||
microstrip
|
microstrip
|
||||||
microstrip_zodd_zeven
|
microstrip_zodd_zeven
|
||||||
pads_npth
|
pads_npth
|
||||||
@ -648,6 +649,7 @@ set( BMAPS_OTHER
|
|||||||
rectwaveguide
|
rectwaveguide
|
||||||
regul
|
regul
|
||||||
regul_3pins
|
regul_3pins
|
||||||
|
splash
|
||||||
stripline
|
stripline
|
||||||
stroke_dash
|
stroke_dash
|
||||||
stroke_dashdot
|
stroke_dashdot
|
||||||
|
BIN
resources/bitmaps_png/banners/splash_1240.afdesign
Normal file
BIN
resources/bitmaps_png/banners/splash_1240.afdesign
Normal file
Binary file not shown.
BIN
resources/bitmaps_png/png/splash.png
Normal file
BIN
resources/bitmaps_png/png/splash.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 340 KiB |
BIN
resources/bitmaps_png/png/splash_dark.png
Normal file
BIN
resources/bitmaps_png/png/splash_dark.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 340 KiB |
10404
resources/bitmaps_png/sources/dark/splash.svg
Normal file
10404
resources/bitmaps_png/sources/dark/splash.svg
Normal file
File diff suppressed because it is too large
Load Diff
After Width: | Height: | Size: 780 KiB |
10404
resources/bitmaps_png/sources/light/splash.svg
Normal file
10404
resources/bitmaps_png/sources/light/splash.svg
Normal file
File diff suppressed because it is too large
Load Diff
After Width: | Height: | Size: 780 KiB |
Loading…
x
Reference in New Issue
Block a user