projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix extra widgets appearing when switching between subs and closed captions in the...
[dcpomatic.git]
/
src
/
wx
/
language_tag_widget.cc
diff --git
a/src/wx/language_tag_widget.cc
b/src/wx/language_tag_widget.cc
index f0766c9d659832102265ba6d8f57c7d4156d26c1..88923da15c87b7a29340dd02c0483766ec5ef4e4 100644
(file)
--- a/
src/wx/language_tag_widget.cc
+++ b/
src/wx/language_tag_widget.cc
@@
-22,8
+22,13
@@
#include "dcpomatic_button.h"
#include "language_tag_dialog.h"
#include "language_tag_widget.h"
#include "dcpomatic_button.h"
#include "language_tag_dialog.h"
#include "language_tag_widget.h"
+#include "wx_ptr.h"
#include "wx_util.h"
#include "wx_util.h"
+#include "lib/scope_guard.h"
+#include <dcp/warnings.h>
+LIBDCP_DISABLE_WARNINGS
#include <wx/wx.h>
#include <wx/wx.h>
+LIBDCP_ENABLE_WARNINGS
using boost::optional;
using boost::optional;
@@
-52,21
+57,21
@@
LanguageTagWidget::LanguageTagWidget (wxWindow* parent, wxString tooltip, option
}
}
-LanguageTagWidget::~LanguageTagWidget
()
+LanguageTagWidget::~LanguageTagWidget()
{
{
- _language->Destroy
();
- _edit->Destroy
();
+ _language->Destroy();
+ _edit->Destroy();
}
void
LanguageTagWidget::edit ()
{
}
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<LanguageTagDialog>
(_parent, _tag.get_value_or(dcp::LanguageTag("en")));
+ if (d->ShowModal() == wxID_OK) {
+
set
(d->get());
+
Changed
(d->get());
+ }
}
}