summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-01-05 19:24:06 +0000
committerCarl Hetherington <cth@carlh.net>2018-01-05 19:24:06 +0000
commit66469adf1bd6e5c288542dda601a66b22d955794 (patch)
treef609d0a47d0cbfd21c7d82a54a6c8a89a8303f07 /src
parentf9af170a6240b78bff122c8217b97ea38f3124bd (diff)
More splash screens / config warnings.
Diffstat (limited to 'src')
-rw-r--r--src/tools/dcpomatic_batch.cc31
-rw-r--r--src/tools/dcpomatic_server.cc20
2 files changed, 46 insertions, 5 deletions
diff --git a/src/tools/dcpomatic_batch.cc b/src/tools/dcpomatic_batch.cc
index 36370ea3f..7a4f50622 100644
--- a/src/tools/dcpomatic_batch.cc
+++ b/src/tools/dcpomatic_batch.cc
@@ -34,6 +34,7 @@
#include <wx/aboutdlg.h>
#include <wx/stdpaths.h>
#include <wx/cmdline.h>
+#include <wx/splash.h>
#include <wx/preferences.h>
#include <wx/wx.h>
#include <boost/foreach.hpp>
@@ -280,6 +281,11 @@ class App : public wxApp
{
SetAppName (_("DCP-o-matic Batch Converter"));
+ Config::FailedToLoad.connect (boost::bind (&App::config_failed_to_load, this));
+ Config::Warning.connect (boost::bind (&App::config_warning, this, _1));
+
+ wxSplashScreen* splash = maybe_show_splash ();
+
if (!wxApp::OnInit()) {
return false;
}
@@ -308,12 +314,15 @@ class App : public wxApp
*/
Config::drop ();
- DOMFrame* f = new DOMFrame (_("DCP-o-matic Batch Converter"));
- SetTopWindow (f);
- f->Maximize ();
- f->Show ();
+ _frame = new DOMFrame (_("DCP-o-matic Batch Converter"));
+ SetTopWindow (_frame);
+ _frame->Maximize ();
+ if (splash) {
+ splash->Destroy ();
+ }
+ _frame->Show ();
- JobServer* server = new JobServer (f);
+ JobServer* server = new JobServer (_frame);
new thread (boost::bind (&JobServer::run, server));
signal_manager = new wxSignalManager (this);
@@ -361,6 +370,18 @@ class App : public wxApp
return true;
}
+
+ void config_failed_to_load ()
+ {
+ message_dialog (_frame, _("The existing configuration failed to load. Default values will be used instead. These may take a short time to create."));
+ }
+
+ void config_warning (string m)
+ {
+ message_dialog (_frame, std_to_wx (m));
+ }
+
+ DOMFrame* _frame;
};
IMPLEMENT_APP (App)
diff --git a/src/tools/dcpomatic_server.cc b/src/tools/dcpomatic_server.cc
index 9214d8385..ad990740e 100644
--- a/src/tools/dcpomatic_server.cc
+++ b/src/tools/dcpomatic_server.cc
@@ -28,6 +28,7 @@
#include "lib/signaller.h"
#include "lib/cross.h"
#include <wx/taskbar.h>
+#include <wx/splash.h>
#include <wx/icon.h>
#include <boost/thread.hpp>
#include <boost/foreach.hpp>
@@ -268,6 +269,11 @@ private:
server_log.reset (new ServerLog);
+ Config::FailedToLoad.connect (boost::bind (&App::config_failed_to_load, this));
+ Config::Warning.connect (boost::bind (&App::config_warning, this, _1));
+
+ wxSplashScreen* splash = maybe_show_splash ();
+
dcpomatic_setup_path_encoding ();
dcpomatic_setup_i18n ();
dcpomatic_setup ();
@@ -283,6 +289,10 @@ private:
_timer.reset (new wxTimer (this));
_timer->Start (1000);
+ if (splash) {
+ splash->Destroy ();
+ }
+
return true;
}
@@ -318,6 +328,16 @@ private:
signal_manager->ui_idle ();
}
+ void config_failed_to_load ()
+ {
+ message_dialog (0, _("The existing configuration failed to load. Default values will be used instead. These may take a short time to create."));
+ }
+
+ void config_warning (string m)
+ {
+ message_dialog (0, std_to_wx (m));
+ }
+
boost::thread* _thread;
TaskBarIcon* _icon;
shared_ptr<wxTimer> _timer;