X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Ftools%2Fdcpomatic_player.cc;h=5ce02b1ea1d8e2e2f0b538dac0c20beb417b1c4e;hb=1c73379ed8483dcf71c5ccfc459c2c22516a9aef;hp=600d1c6b440531aaddfff8df315374283d834054;hpb=4e4968464eeef1956cb82392e1fc3b27a792ab89;p=dcpomatic.git diff --git a/src/tools/dcpomatic_player.cc b/src/tools/dcpomatic_player.cc index 600d1c6b4..5ce02b1ea 100644 --- a/src/tools/dcpomatic_player.cc +++ b/src/tools/dcpomatic_player.cc @@ -47,6 +47,7 @@ #include "lib/ffmpeg_content.h" #include "lib/file_log.h" #include "lib/film.h" +#include "lib/font_config.h" #include "lib/image.h" #include "lib/image_jpeg.h" #include "lib/image_png.h" @@ -244,6 +245,8 @@ public: Bind (wxEVT_MENU, boost::bind (&DOMFrame::tools_timing, this), ID_tools_timing); Bind (wxEVT_MENU, boost::bind (&DOMFrame::tools_system_information, this), ID_tools_system_information); + Bind(wxEVT_CLOSE_WINDOW, boost::bind(&DOMFrame::close, this, _1)); + if (Config::instance()->player_mode() == Config::PLAYER_MODE_DUAL) { auto pc = new PlaylistControls (_overall_panel, _viewer); _controls = pc; @@ -313,6 +316,12 @@ public: _viewer.stop(); } + void close(wxCloseEvent& ev) + { + FontConfig::drop(); + ev.Skip(); + } + void setup_main_sizer (Config::PlayerMode mode) { _main_sizer->Detach(_viewer.panel()); @@ -711,7 +720,7 @@ private: void file_save_frame () { - wxFileDialog dialog (this, _("Save frame to file"), "", "", "PNG files (*.png)|*.png|JPEG files (*.jpg,*.jpeg)|*.jpg,*.jpeg", wxFD_SAVE | wxFD_OVERWRITE_PROMPT); + wxFileDialog dialog (this, _("Save frame to file"), "", "", "PNG files (*.png)|*.png|JPEG files (*.jpg;*.jpeg)|*.jpg;*.jpeg", wxFD_SAVE | wxFD_OVERWRITE_PROMPT); if (dialog.ShowModal() == wxID_CANCEL) { return; } @@ -898,16 +907,14 @@ private: DCPOMATIC_ASSERT (dcp); auto job = make_shared(dcp->directories()); - auto progress = new VerifyDCPProgressDialog(this, _("DCP-o-matic Player")); + auto progress = make_wx(this, _("DCP-o-matic Player")); bool const completed = progress->run (job); - progress->Destroy (); if (!completed) { return; } - auto d = new VerifyDCPDialog (this, job); + auto d = make_wx(this, job); d->ShowModal (); - d->Destroy (); } void tools_check_for_updates () @@ -918,9 +925,8 @@ private: void tools_timing () { - auto d = new TimerDisplay(this, _viewer.state_timer(), _viewer.gets()); + auto d = make_wx(this, _viewer.state_timer(), _viewer.gets()); d->ShowModal (); - d->Destroy (); } void tools_system_information () @@ -934,18 +940,16 @@ private: void help_about () { - auto d = new AboutDialog (this); + auto d = make_wx(this); d->ShowModal (); - d->Destroy (); } void help_report_a_problem () { - auto d = new ReportProblemDialog (this); + auto d = make_wx(this); if (d->ShowModal () == wxID_OK) { d->report (); } - d->Destroy (); } void update_checker_state_changed () @@ -964,9 +968,8 @@ private: } if (uc->state() == UpdateChecker::State::YES) { - auto dialog = new UpdateDialog (this, uc->stable (), uc->test ()); + auto dialog = make_wx(this, uc->stable (), uc->test ()); dialog->ShowModal (); - dialog->Destroy (); } else if (uc->state() == UpdateChecker::State::FAILED) { error_dialog (this, _("The DCP-o-matic download server could not be contacted.")); } else { @@ -1168,7 +1171,7 @@ private: bool OnInit () override { - wxSplashScreen* splash = nullptr; + wx_ptr splash; try { wxInitAllImageHandlers ();