Supporters update.
[dcpomatic.git] / src / wx / dcp_text_track_dialog.cc
index d48b3be2624d57b6036a8f8ea342f19708c13726..be31de0cea0ad323bc9661d66c623831f6ca7bb5 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2018 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2020 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #include "dcp_text_track_dialog.h"
+#include "language_tag_widget.h"
 #include <boost/algorithm/string.hpp>
 
+
 using std::string;
 
+
 DCPTextTrackDialog::DCPTextTrackDialog (wxWindow* parent)
        : TableDialog (parent, _("DCP Text Track"), 2, 1, true)
 {
        add (_("Name"), true);
        add (_name = new wxTextCtrl (this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(300, -1)));
        add (_("Language"), true);
-       add (_language = new wxTextCtrl (this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(150, -1)));
+       _language = new LanguageTagWidget (this, wxT(""), boost::none);
+       add (_language->sizer());
 
        layout ();
 }
 
+
 DCPTextTrack
 DCPTextTrackDialog::get () const
 {
-       return DCPTextTrack(wx_to_std(_name->GetValue()), wx_to_std(_language->GetValue()));
+       DCPOMATIC_ASSERT (_language->get());
+       return DCPTextTrack(wx_to_std(_name->GetValue()), _language->get());
 }