diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-12-30 23:10:49 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-12-30 23:10:49 +0000 |
| commit | 6670f11c639e3515256f4f0eb3699e02155f67c9 (patch) | |
| tree | 1bdd2045e2cd2cb988a2bf209fecc0cb29e817b1 /src/tools | |
| parent | f87a0f16f8cee026ee33c3a46b93b43d4b3cf5ff (diff) | |
Handle exceptions thrown from ServerFinder.
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/dcpomatic.cc | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index 66f795ddf..891c4623c 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -54,6 +54,7 @@ #include "lib/cinema.h" #include "lib/kdm.h" #include "lib/send_kdm_email_job.h" +#include "lib/server_finder.h" using std::cout; using std::string; @@ -632,8 +633,12 @@ class App : public wxApp f->Show (); ui_signaller = new wxUISignaller (this); - this->Bind (wxEVT_IDLE, boost::bind (&App::idle, this)); + Bind (wxEVT_IDLE, boost::bind (&App::idle, this)); + Bind (wxEVT_TIMER, boost::bind (&App::check, this)); + _timer.reset (new wxTimer (this)); + _timer->Start (1000); + return true; } catch (exception& e) @@ -670,6 +675,17 @@ class App : public wxApp { ui_signaller->ui_idle (); } + + void check () + { + try { + ServerFinder::instance()->rethrow (); + } catch (exception& e) { + error_dialog (0, std_to_wx (e.what ())); + } + } + + shared_ptr<wxTimer> _timer; }; IMPLEMENT_APP (App) |
