diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-08-11 01:36:05 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-08-11 19:39:04 +0100 |
| commit | b75b2a81c24716e21442178b77ee0276ddff843c (patch) | |
| tree | 3e090cb6b27eba4afc113fc211c6efdb0cfbcc1b /src | |
| parent | a983627b357e25478a524a20cafa4a68a4b9299f (diff) | |
Show a splash screen if config needs creating.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/config.cc | 10 | ||||
| -rw-r--r-- | src/lib/config.h | 3 | ||||
| -rw-r--r-- | src/tools/dcpomatic.cc | 19 |
3 files changed, 27 insertions, 5 deletions
diff --git a/src/lib/config.cc b/src/lib/config.cc index f71fff86c..cc62bfed3 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -119,7 +119,7 @@ Config::restore_defaults () void Config::read () { - if (!boost::filesystem::exists (file ())) { + if (!have_existing ()) { /* Make a new set of signing certificates and key */ _signer_chain.reset (new dcp::CertificateChain (openssl_path ())); /* And similar for decryption of KDMs */ @@ -263,7 +263,7 @@ Config::read () /** @return Filename to write configuration to */ boost::filesystem::path -Config::file () const +Config::file () { boost::filesystem::path p; #ifdef DCPOMATIC_OSX @@ -456,3 +456,9 @@ Config::add_to_history (boost::filesystem::path p) changed (); } + +bool +Config::have_existing () +{ + return boost::filesystem::exists (file ()); +} diff --git a/src/lib/config.h b/src/lib/config.h index eeb167d0d..70971085a 100644 --- a/src/lib/config.h +++ b/src/lib/config.h @@ -417,10 +417,11 @@ public: static Config* instance (); static void drop (); static void restore_defaults (); + static bool have_existing (); private: Config (); - boost::filesystem::path file () const; + static boost::filesystem::path file (); void read (); void set_defaults (); void set_kdm_email_to_default (); diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index cc85da0ef..743172e9b 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -35,6 +35,7 @@ #include "lib/send_kdm_email_job.h" #include "lib/server_finder.h" #include "lib/update.h" +#include "lib/cross.h" #include "lib/content_factory.h" #include "wx/film_viewer.h" #include "wx/film_editor.h" @@ -55,6 +56,7 @@ #include <wx/stdpaths.h> #include <wx/cmdline.h> #include <wx/preferences.h> +#include <wx/splash.h> #ifdef __WXMSW__ #include <shellapi.h> #endif @@ -776,6 +778,18 @@ private: bool OnInit () try { + wxInitAllImageHandlers (); + + wxSplashScreen* splash = 0; + if (!Config::have_existing ()) { + wxBitmap bitmap; + boost::filesystem::path p = shared_path () / "splash.png"; + if (bitmap.LoadFile (std_to_wx (p.string ()), wxBITMAP_TYPE_PNG)) { + splash = new wxSplashScreen (bitmap, wxSPLASH_CENTRE_ON_SCREEN | wxSPLASH_NO_TIMEOUT, 0, 0, -1); + wxYield (); + } + } + SetAppName (_("DCP-o-matic")); if (!wxApp::OnInit()) { @@ -792,8 +806,6 @@ private: TransformProcessType (&serial, kProcessTransformToForegroundApplication); #endif - wxInitAllImageHandlers (); - dcpomatic_setup_path_encoding (); /* Enable i18n; this will create a Config object @@ -817,6 +829,9 @@ private: _frame = new DOMFrame (_("DCP-o-matic")); SetTopWindow (_frame); _frame->Maximize (); + if (splash) { + splash->Destroy (); + } _frame->Show (); if (!_film_to_load.empty() && boost::filesystem::is_directory (_film_to_load)) { |
