Cleanup: replace some list with vector.
[dcpomatic.git] / src / wx / recipient_dialog.cc
index 66b7f0e19bd24110c1e3bc65092f9ff64bbfb09f..b166f265d0f5f1a5543046e1098944515fa4d8ac 100644 (file)
@@ -38,7 +38,6 @@ LIBDCP_ENABLE_WARNINGS
 
 
 using std::cout;
-using std::list;
 using std::string;
 using std::vector;
 using boost::bind;
@@ -56,7 +55,7 @@ column (string s)
 
 
 RecipientDialog::RecipientDialog (
-       wxWindow* parent, wxString title, string name, string notes, list<string> emails, int utc_offset_hour, int utc_offset_minute, optional<dcp::Certificate> recipient
+       wxWindow* parent, wxString title, string name, string notes, vector<string> emails, int utc_offset_hour, int utc_offset_minute, optional<dcp::Certificate> recipient
        )
        : wxDialog (parent, wxID_ANY, title)
        , _recipient (recipient)
@@ -91,7 +90,8 @@ RecipientDialog::RecipientDialog (
        columns.push_back (EditableListColumn(_("Address")));
        _email_list = new EditableList<string, EmailDialog> (
                this, columns, bind(&RecipientDialog::get_emails, this), bind(&RecipientDialog::set_emails, this, _1), bind(&column, _1),
-               EditableListButton::NEW | EditableListButton::EDIT | EditableListButton::REMOVE, true
+               EditableListTitle::VISIBLE,
+               EditableListButton::NEW | EditableListButton::EDIT | EditableListButton::REMOVE
                );
 
        _sizer->Add (_email_list, wxGBPosition (r, 0), wxGBSpan (1, 2), wxEXPAND);
@@ -187,11 +187,10 @@ RecipientDialog::load_recipient (boost::filesystem::path file)
 void
 RecipientDialog::get_recipient_from_file ()
 {
-       auto d = new wxFileDialog (this, _("Select Certificate File"));
+       auto d = make_wx<wxFileDialog>(this, _("Select Certificate File"));
        if (d->ShowModal () == wxID_OK) {
                load_recipient (boost::filesystem::path (wx_to_std (d->GetPath ())));
        }
-       d->Destroy ();
 
        setup_sensitivity ();
 }
@@ -233,12 +232,10 @@ RecipientDialog::set_emails (vector<string> e)
 }
 
 
-list<string>
+vector<string>
 RecipientDialog::emails () const
 {
-       list<string> e;
-       copy (_emails.begin(), _emails.end(), back_inserter(e));
-       return e;
+       return _emails;
 }