X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=src%2Fwx%2Fcinema_dialog.cc;h=e67fe77ed18626c2390b322d7f7e7ce175004893;hp=264b046d1f5923f73b14ab29bb32435817fd6360;hb=a5d004b0773f633401528392fc28e66d70e13ac8;hpb=88c912d29832aea730bc80fa80ecaaf63e1e3a2a diff --git a/src/wx/cinema_dialog.cc b/src/wx/cinema_dialog.cc index 264b046d1..e67fe77ed 100644 --- a/src/wx/cinema_dialog.cc +++ b/src/wx/cinema_dialog.cc @@ -22,7 +22,6 @@ #include "wx_util.h" #include "lib/dcpomatic_assert.h" #include "lib/util.h" -#include using std::string; using std::vector; @@ -31,6 +30,9 @@ using std::back_inserter; using std::list; using std::cout; using boost::bind; +#if BOOST_VERSION >= 106100 +using namespace boost::placeholders; +#endif static string column (string s) @@ -67,10 +69,10 @@ CinemaDialog::CinemaDialog (wxWindow* parent, wxString title, string name, list< copy (emails.begin(), emails.end(), back_inserter (_emails)); - vector columns; - columns.push_back (wx_to_std (_("Address"))); + vector columns; + columns.push_back (EditableListColumn(_("Address"))); _email_list = new EditableList ( - this, columns, bind (&CinemaDialog::get_emails, this), bind (&CinemaDialog::set_emails, this, _1), bind (&string_not_empty, _1), bind (&column, _1) + this, columns, bind (&CinemaDialog::get_emails, this), bind (&CinemaDialog::set_emails, this, _1), bind (&column, _1) ); sizer->Add (_email_list, wxGBPosition (r, 0), wxGBSpan (1, 2), wxEXPAND); @@ -83,36 +85,8 @@ CinemaDialog::CinemaDialog (wxWindow* parent, wxString title, string name, list< overall_sizer->Add (buttons, wxSizerFlags().Expand().DoubleBorder()); } - _offsets.push_back (Offset (_("UTC-11"), -11, 0)); - _offsets.push_back (Offset (_("UTC-10"), -10, 0)); - _offsets.push_back (Offset (_("UTC-9"), -9, 0)); - _offsets.push_back (Offset (_("UTC-8"), -8, 0)); - _offsets.push_back (Offset (_("UTC-7"), -7, 0)); - _offsets.push_back (Offset (_("UTC-6"), -6, 0)); - _offsets.push_back (Offset (_("UTC-5"), -5, 0)); - _offsets.push_back (Offset (_("UTC-4:30"), -4, 30)); - _offsets.push_back (Offset (_("UTC-4"), -4, 0)); - _offsets.push_back (Offset (_("UTC-3:30"), -3, 30)); - _offsets.push_back (Offset (_("UTC-3"), -3, 0)); - _offsets.push_back (Offset (_("UTC-2"), -2, 0)); - _offsets.push_back (Offset (_("UTC-1"), -1, 0)); - _offsets.push_back (Offset (_("UTC") , 0, 0)); - _offsets.push_back (Offset (_("UTC+1"), 1, 0)); - _offsets.push_back (Offset (_("UTC+2"), 2, 0)); - _offsets.push_back (Offset (_("UTC+3"), 3, 0)); - _offsets.push_back (Offset (_("UTC+4"), 4, 0)); - _offsets.push_back (Offset (_("UTC+5"), 5, 0)); - _offsets.push_back (Offset (_("UTC+5:30"), 5, 30)); - _offsets.push_back (Offset (_("UTC+6"), 6, 0)); - _offsets.push_back (Offset (_("UTC+7"), 7, 0)); - _offsets.push_back (Offset (_("UTC+8"), 8, 0)); - _offsets.push_back (Offset (_("UTC+9"), 9, 0)); - _offsets.push_back (Offset (_("UTC+10"), 10, 0)); - _offsets.push_back (Offset (_("UTC+11"), 11, 0)); - _offsets.push_back (Offset (_("UTC+12"), 12, 0)); - /* Default to UTC */ - size_t sel = 13; + size_t sel = get_offsets (_offsets); for (size_t i = 0; i < _offsets.size(); ++i) { _utc_offset->Append (_offsets[i].name); if (_offsets[i].hour == utc_offset_hour && _offsets[i].minute == utc_offset_minute) { @@ -124,6 +98,8 @@ CinemaDialog::CinemaDialog (wxWindow* parent, wxString title, string name, list< overall_sizer->Layout (); overall_sizer->SetSizeHints (this); + + _name->SetFocus (); } string