X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Ftools%2Fdcpomatic.cc;h=b53f39b451ab3aca2cede112d120e283ad135d75;hb=57d76e4bdea59aa833f5fb75697bcfbebc18cc3a;hp=d40976094a0b95125c533ee6789a588a92fbda61;hpb=79f957a6f37276f71cf98d4fa1ae5e0ab3beb76d;p=dcpomatic.git diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index d40976094..b53f39b45 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -74,6 +74,7 @@ #include "lib/exceptions.h" #include "lib/ffmpeg_encoder.h" #include "lib/film.h" +#include "lib/font_config.h" #include "lib/hints.h" #include "lib/job_manager.h" #include "lib/kdm_with_metadata.h" @@ -387,6 +388,7 @@ public: left_panel->SetSizerAndFit(left_sizer); _controls = new StandardControls(_right_panel, _film_viewer, true); + _controls->set_film(_film_viewer.film()); auto job_manager_view = new JobManagerView(_right_panel, false); auto right_sizer = new wxBoxSizer (wxVERTICAL); @@ -1114,12 +1116,11 @@ private: for (auto i: translations) { body += i.first + "\n" + i.second + "\n\n"; } - list to = { "carl@dcpomatic.com" }; if (dialog.email().find("@") == string::npos) { error_dialog (this, _("You must enter a valid email address when sending translations, " "otherwise the DCP-o-matic maintainers cannot credit you or contact you with questions.")); } else { - Emailer emailer(dialog.email(), to, "DCP-o-matic translations", body); + Emailer emailer(dialog.email(), { "carl@dcpomatic.com" }, "DCP-o-matic translations", body); try { emailer.send ("main.carlh.net", 2525, EmailProtocol::STARTTLS); } catch (NetworkError& e) { @@ -1191,6 +1192,8 @@ private: /* Also stop hearing about analytics-related stuff */ _analytics_message_connection.disconnect (); + FontConfig::drop(); + ev.Skip (); } @@ -1266,14 +1269,20 @@ private: return true; } - if (_film->dirty ()) { - T d (_film->name ()); - switch (d.run ()) { + while (_film->dirty()) { + T dialog(_film->name()); + switch (dialog.run()) { case wxID_NO: return true; case wxID_YES: - _film->write_metadata (); - return true; + try { + _film->write_metadata(); + return true; + } catch (exception& e) { + error_dialog(this, _("Could not save project."), std_to_wx(e.what())); + /* Go round again for another try */ + } + break; case wxID_CANCEL: return false; } @@ -1700,7 +1709,7 @@ private: } catch (exception& e) { - _splash.reset(); + close_splash(); error_dialog (nullptr, wxString::Format ("DCP-o-matic could not start."), std_to_wx(e.what())); } @@ -1812,7 +1821,10 @@ private: void close_splash () { - _splash.reset(); + if (_splash) { + _splash->Destroy(); + _splash = nullptr; + } } void config_failed_to_load (Config::LoadFailure what) @@ -1830,7 +1842,7 @@ private: /* Destroy the splash screen here, as otherwise bad things seem to happen (for reasons unknown) when we open our recreate dialog, close it, *then* try to Destroy the splash (the Destroy fails). */ - _splash.reset(); + close_splash(); auto config = Config::instance(); switch (reason) { @@ -1899,7 +1911,7 @@ private: } DOMFrame* _frame = nullptr; - wx_ptr _splash; + wxSplashScreen* _splash = nullptr; shared_ptr _timer; string _film_to_load; string _film_to_create;