Disable warnings around all wx includes.
[dcpomatic.git] / src / wx / full_language_tag_dialog.cc
index 5b4fc589a69d670ce8945af3a5c1159af5dc0eb8..19e52ff140eb813f758fb6bfbdc52be1e52c3adc 100644 (file)
 */
 
 
-#include "lib/dcpomatic_assert.h"
 #include "full_language_tag_dialog.h"
+#include "lib/dcpomatic_assert.h"
+#include "lib/warnings.h"
 #include <dcp/language_tag.h>
+DCPOMATIC_DISABLE_WARNINGS
 #include <wx/listctrl.h>
 #include <wx/srchctrl.h>
 #include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
 #include <boost/algorithm/string.hpp>
 #include <boost/bind/bind.hpp>
 #include <boost/optional.hpp>
 #include <boost/signals2.hpp>
-#include <iostream>
 #include <iterator>
 #include <string>
 #include <vector>
 
 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 +113,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 +175,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 +192,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);