X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Flanguage_tag_widget.cc;h=17683daf1e966bf35747cc7b66e75908aa0d18db;hb=e87f943433216d294b22853411eca5c582be1066;hp=f0766c9d659832102265ba6d8f57c7d4156d26c1;hpb=e0a70cd5cfb11fc2de167f3146acdd437a6faa82;p=dcpomatic.git diff --git a/src/wx/language_tag_widget.cc b/src/wx/language_tag_widget.cc index f0766c9d6..17683daf1 100644 --- a/src/wx/language_tag_widget.cc +++ b/src/wx/language_tag_widget.cc @@ -23,7 +23,11 @@ #include "language_tag_dialog.h" #include "language_tag_widget.h" #include "wx_util.h" +#include "lib/scope_guard.h" +#include +LIBDCP_DISABLE_WARNINGS #include +LIBDCP_ENABLE_WARNINGS using boost::optional; @@ -52,21 +56,21 @@ LanguageTagWidget::LanguageTagWidget (wxWindow* parent, wxString tooltip, option } -LanguageTagWidget::~LanguageTagWidget () +LanguageTagWidget::~LanguageTagWidget() { - _language->Destroy (); - _edit->Destroy (); + _language->Destroy(); + _edit->Destroy(); } void LanguageTagWidget::edit () { - auto d = new LanguageTagDialog(_parent, _tag.get_value_or(dcp::LanguageTag("en"))); - d->ShowModal (); - set (d->get()); - Changed (d->get()); - d->Destroy (); + auto d = make_wx(_parent, _tag.get_value_or(dcp::LanguageTag("en"))); + if (d->ShowModal() == wxID_OK) { + set(d->get()); + Changed(d->get()); + } }