X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Ftools%2Fdcpomatic.cc;h=891c4623ca9b6e1ea1ac995d41108d119468e72f;hb=ad49361b303d1ceff7048fa0e89ba609ca9ce376;hp=420d828b0730635f4c6a36ac9110f9a09e88cb00;hpb=f2c465b7dfedfe845f9599fa98c9722fd86a110e;p=dcpomatic.git diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index 420d828b0..891c4623c 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -53,6 +53,8 @@ #include "lib/exceptions.h" #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; @@ -244,6 +246,7 @@ class Frame : public wxFrame public: Frame (wxString const & title) : wxFrame (NULL, -1, title) + , _hints_dialog (0) , _servers_list_dialog (0) { #ifdef DCPOMATIC_WINDOWS_CONSOLE @@ -347,7 +350,7 @@ private: std_to_wx ( String::compose (wx_to_std (_("The directory %1 already exists and is not empty. " "Are you sure you want to use it?")), - d->get_path().c_str()) + d->get_path().string().c_str()) ) )) { return; @@ -458,7 +461,9 @@ private: if (d->write_to ()) { write_kdm_files (film, d->screens (), d->dcp (), d->from (), d->until (), d->directory ()); } else { - email_kdms (film, d->screens (), d->dcp (), d->from (), d->until ()); + JobManager::instance()->add ( + shared_ptr (new SendKDMEmailJob (film, d->screens (), d->dcp (), d->from (), d->until ())) + ); } } catch (KDMError& e) { error_dialog (this, e.what ()); @@ -548,6 +553,8 @@ private: return; } + maybe_save_then_delete_film (); + ev.Skip (); } @@ -626,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) @@ -664,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 _timer; }; IMPLEMENT_APP (App)