X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Ffull_language_tag_dialog.cc;h=df9a565b4d89c60a74b843fa644a81b5ca75ef93;hb=313319ba2d8544bc25524e02e634804a503b54f1;hp=5b4fc589a69d670ce8945af3a5c1159af5dc0eb8;hpb=5d02ff3376c62b05f3f1bebe5277704474a39526;p=dcpomatic.git diff --git a/src/wx/full_language_tag_dialog.cc b/src/wx/full_language_tag_dialog.cc index 5b4fc589a..df9a565b4 100644 --- a/src/wx/full_language_tag_dialog.cc +++ b/src/wx/full_language_tag_dialog.cc @@ -19,8 +19,8 @@ */ -#include "lib/dcpomatic_assert.h" #include "full_language_tag_dialog.h" +#include "lib/dcpomatic_assert.h" #include #include #include @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include @@ -37,11 +36,11 @@ using std::min; using std::pair; +using std::shared_ptr; using std::string; using std::vector; -using boost::optional; -using std::shared_ptr; using std::weak_ptr; +using boost::optional; #if BOOST_VERSION >= 106100 using namespace boost::placeholders; #endif @@ -111,7 +110,7 @@ public: } private: - wxString OnGetItemText (long item, long column) const + wxString OnGetItemText (long item, long column) const override { if (column == 0) { return _matching_subtags[item].subtag; @@ -173,7 +172,7 @@ private: { auto search = _search->GetValue(); _list->set_search (search.ToStdString()); - if (search.Length() > 0) { + if (search.Length() > 0 && _list->GetItemCount() > 0) { _list->EnsureVisible (0); } SearchChanged (_search->GetValue().ToStdString()); @@ -190,7 +189,7 @@ private: FullLanguageTagDialog::FullLanguageTagDialog (wxWindow* parent, dcp::LanguageTag tag) - : wxDialog (parent, wxID_ANY, "Language Tag", wxDefaultPosition, wxSize(-1, 500)) + : wxDialog (parent, wxID_ANY, _("Language Tag"), wxDefaultPosition, wxSize(-1, 500)) { _current_tag_list = new wxListCtrl (this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT | wxLC_SINGLE_SEL | wxLC_NO_HEADER); _current_tag_list->AppendColumn ("", wxLIST_FORMAT_LEFT, 200);