From ddc1535c80dc494c13434478cfc1e1037548b053 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 23 Dec 2018 22:09:19 +0000 Subject: [PATCH] Same fix again for KDM. --- src/tools/dcpomatic_kdm.cc | 98 ++++++++++++++++++++------------------ 1 file changed, 52 insertions(+), 46 deletions(-) diff --git a/src/tools/dcpomatic_kdm.cc b/src/tools/dcpomatic_kdm.cc index c8ab3cbfb..36de84906 100644 --- a/src/tools/dcpomatic_kdm.cc +++ b/src/tools/dcpomatic_kdm.cc @@ -551,69 +551,75 @@ public: private: bool OnInit () - try { - wxInitAllImageHandlers (); + wxSplashScreen* splash = 0; - Config::FailedToLoad.connect (boost::bind (&App::config_failed_to_load, this)); - Config::Warning.connect (boost::bind (&App::config_warning, this, _1)); + try { + wxInitAllImageHandlers (); - wxSplashScreen* splash = maybe_show_splash (); + Config::FailedToLoad.connect (boost::bind (&App::config_failed_to_load, this)); + Config::Warning.connect (boost::bind (&App::config_warning, this, _1)); - SetAppName (_("DCP-o-matic KDM Creator")); + splash = maybe_show_splash (); - if (!wxApp::OnInit()) { - return false; - } + SetAppName (_("DCP-o-matic KDM Creator")); + + if (!wxApp::OnInit()) { + return false; + } #ifdef DCPOMATIC_LINUX - unsetenv ("UBUNTU_MENUPROXY"); + unsetenv ("UBUNTU_MENUPROXY"); #endif #ifdef __WXOSX__ - ProcessSerialNumber serial; - GetCurrentProcess (&serial); - TransformProcessType (&serial, kProcessTransformToForegroundApplication); + ProcessSerialNumber serial; + GetCurrentProcess (&serial); + TransformProcessType (&serial, kProcessTransformToForegroundApplication); #endif - dcpomatic_setup_path_encoding (); - - /* Enable i18n; this will create a Config object - to look for a force-configured language. This Config - object will be wrong, however, because dcpomatic_setup - hasn't yet been called and there aren't any filters etc. - set up yet. - */ - dcpomatic_setup_i18n (); - - /* Set things up, including filters etc. - which will now be internationalised correctly. - */ - dcpomatic_setup (); - - /* Force the configuration to be re-loaded correctly next - time it is needed. - */ - Config::drop (); + dcpomatic_setup_path_encoding (); + + /* Enable i18n; this will create a Config object + to look for a force-configured language. This Config + object will be wrong, however, because dcpomatic_setup + hasn't yet been called and there aren't any filters etc. + set up yet. + */ + dcpomatic_setup_i18n (); + + /* Set things up, including filters etc. + which will now be internationalised correctly. + */ + dcpomatic_setup (); + + /* Force the configuration to be re-loaded correctly next + time it is needed. + */ + Config::drop (); + + _frame = new DOMFrame (_("DCP-o-matic KDM Creator")); + SetTopWindow (_frame); + _frame->Maximize (); + if (splash) { + splash->Destroy (); + splash = 0; + } + _frame->Show (); - _frame = new DOMFrame (_("DCP-o-matic KDM Creator")); - SetTopWindow (_frame); - _frame->Maximize (); - if (splash) { - splash->Destroy (); + signal_manager = new wxSignalManager (this); + Bind (wxEVT_IDLE, boost::bind (&App::idle, this)); + } + catch (exception& e) + { + if (splash) { + splash->Destroy (); + } + error_dialog (0, _("DCP-o-matic could not start"), std_to_wx(e.what())); } - _frame->Show (); - - signal_manager = new wxSignalManager (this); - Bind (wxEVT_IDLE, boost::bind (&App::idle, this)); return true; } - catch (exception& e) - { - error_dialog (0, _("DCP-o-matic could not start"), std_to_wx(e.what())); - return true; - } /* An unhandled exception has occurred inside the main event loop */ bool OnExceptionInMainLoop () -- 2.30.2