summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-12-17 01:40:51 +0100
committerCarl Hetherington <cth@carlh.net>2025-12-17 01:40:51 +0100
commit235483a91d4160f4b9b2e53f1a7d5c4cb5b27925 (patch)
tree6735b612a8d03988600b02fc186306459c07ff01 /src
parent6e8f8563f4e4e6ff04b632aff8d6ae95de945649 (diff)
Refactor EditableList to take a new pair of functors for new/edit operations.
In the future this will allow more intricate text displays in EditableLists.
Diffstat (limited to 'src')
-rw-r--r--src/tools/dcpomatic_combiner.cc6
-rw-r--r--src/tools/dcpomatic_editor.cc6
-rw-r--r--src/tools/dcpomatic_verifier.cc4
-rw-r--r--src/wx/cinema_dialog.cc14
-rw-r--r--src/wx/cinema_dialog.h2
-rw-r--r--src/wx/editable_list.h101
-rw-r--r--src/wx/extra_kdm_email_dialog.cc14
-rw-r--r--src/wx/extra_kdm_email_dialog.h2
-rw-r--r--src/wx/full_config_dialog.cc12
-rw-r--r--src/wx/kdm_email_preferences_page.cc6
-rw-r--r--src/wx/kdm_email_preferences_page.h2
-rw-r--r--src/wx/metadata_dialog.cc4
-rw-r--r--src/wx/metadata_dialog.h2
-rw-r--r--src/wx/recipient_dialog.cc10
-rw-r--r--src/wx/recipient_dialog.h2
-rw-r--r--src/wx/screen_dialog.cc4
-rw-r--r--src/wx/screen_dialog.h2
-rw-r--r--src/wx/smpte_metadata_dialog.cc4
-rw-r--r--src/wx/smpte_metadata_dialog.h2
19 files changed, 125 insertions, 74 deletions
diff --git a/src/tools/dcpomatic_combiner.cc b/src/tools/dcpomatic_combiner.cc
index b9db5fb8c..8f47dc9ec 100644
--- a/src/tools/dcpomatic_combiner.cc
+++ b/src/tools/dcpomatic_combiner.cc
@@ -104,11 +104,13 @@ public:
vector<EditableListColumn> columns;
columns.push_back(EditableListColumn(_("Input DCP"), 600, true));
- _input = new EditableList<boost::filesystem::path, DirDialogWrapper>(
+ _input = new EditableList<boost::filesystem::path>(
overall_panel,
columns,
boost::bind(&DOMFrame::inputs, this),
boost::bind(&DOMFrame::set_inputs, this, _1),
+ EditableList<boost::filesystem::path>::add_with_dialog<DirDialogWrapper>,
+ EditableList<boost::filesystem::path>::edit_with_dialog<DirDialogWrapper>,
&display_string,
EditableListTitle::VISIBLE,
EditableListButton::NEW | EditableListButton::REMOVE
@@ -204,7 +206,7 @@ private:
_combine->Enable (!_output->GetPath().IsEmpty());
}
- EditableList<boost::filesystem::path, DirDialogWrapper>* _input;
+ EditableList<boost::filesystem::path>* _input;
wxTextCtrl* _annotation_text = nullptr;
DirPickerCtrl* _output;
vector<boost::filesystem::path> _inputs;
diff --git a/src/tools/dcpomatic_editor.cc b/src/tools/dcpomatic_editor.cc
index 6c6892caa..a9b3d881a 100644
--- a/src/tools/dcpomatic_editor.cc
+++ b/src/tools/dcpomatic_editor.cc
@@ -221,13 +221,15 @@ public:
++r;
add_label_to_sizer(sizer, this, _("Reels"), true, wxGBPosition(r, 0));
- _reels = new EditableList<shared_ptr<dcp::Reel>, ReelEditor>(
+ _reels = new EditableList<shared_ptr<dcp::Reel>>(
this,
{ EditableListColumn(_("Name"), 600, true) },
[this]() { return _cpl->reels(); },
[this](vector<shared_ptr<dcp::Reel>> reels) {
_cpl->set(reels);
},
+ EditableList<shared_ptr<dcp::Reel>>::add_with_dialog<ReelEditor>,
+ EditableList<shared_ptr<dcp::Reel>>::edit_with_dialog<ReelEditor>,
[](shared_ptr<dcp::Reel> reel, int) {
return reel->id();
},
@@ -272,7 +274,7 @@ private:
wxTextCtrl* _issuer = nullptr;
wxTextCtrl* _creator = nullptr;
wxTextCtrl* _content_title_text = nullptr;
- EditableList<shared_ptr<dcp::Reel>, ReelEditor>* _reels;
+ EditableList<shared_ptr<dcp::Reel>>* _reels;
};
diff --git a/src/tools/dcpomatic_verifier.cc b/src/tools/dcpomatic_verifier.cc
index 8a509529b..7cd50f24b 100644
--- a/src/tools/dcpomatic_verifier.cc
+++ b/src/tools/dcpomatic_verifier.cc
@@ -128,11 +128,13 @@ public:
auto dcp_sizer = new wxBoxSizer(wxHORIZONTAL);
add_label_to_sizer(dcp_sizer, _overall_panel, _("DCPs"), true, 0, wxALIGN_CENTER_VERTICAL);
- auto dcps = new EditableList<boost::filesystem::path, DirDialogWrapper>(
+ auto dcps = new EditableList<boost::filesystem::path>(
_overall_panel,
{ EditableListColumn(_("DCP"), 300, true) },
boost::bind(&DOMFrame::dcp_paths, this),
boost::bind(&DOMFrame::set_dcp_paths, this, _1),
+ EditableList<boost::filesystem::path>::add_with_dialog<DirDialogWrapper>,
+ EditableList<boost::filesystem::path>::edit_with_dialog<DirDialogWrapper>,
[](boost::filesystem::path p, int) { return p.filename().string(); },
EditableListTitle::INVISIBLE,
EditableListButton::NEW | EditableListButton::REMOVE
diff --git a/src/wx/cinema_dialog.cc b/src/wx/cinema_dialog.cc
index 3b8265e6f..dc27cd015 100644
--- a/src/wx/cinema_dialog.cc
+++ b/src/wx/cinema_dialog.cc
@@ -68,10 +68,16 @@ CinemaDialog::CinemaDialog(wxWindow* parent, wxString title, string name, vector
vector<EditableListColumn> columns;
columns.push_back (EditableListColumn(_("Address"), 500, true));
- _email_list = new EditableList<string, EmailDialog> (
- this, columns, bind(&CinemaDialog::emails, this), bind (&CinemaDialog::set_emails, this, _1), [](string s, int) {
- return s;
- }, EditableListTitle::INVISIBLE, EditableListButton::NEW | EditableListButton::EDIT | EditableListButton::REMOVE
+ _email_list = new EditableList<string> (
+ this,
+ columns,
+ bind(&CinemaDialog::emails, this),
+ bind(&CinemaDialog::set_emails, this, _1),
+ EditableList<string>::add_with_dialog<EmailDialog>,
+ EditableList<string>::edit_with_dialog<EmailDialog>,
+ [](string s, int) { return s; },
+ EditableListTitle::INVISIBLE,
+ EditableListButton::NEW | EditableListButton::EDIT | EditableListButton::REMOVE
);
sizer->Add (_email_list, wxGBPosition(r, 0), wxGBSpan(1, 2), wxEXPAND);
diff --git a/src/wx/cinema_dialog.h b/src/wx/cinema_dialog.h
index 873657772..77f0dec09 100644
--- a/src/wx/cinema_dialog.h
+++ b/src/wx/cinema_dialog.h
@@ -55,7 +55,7 @@ private:
wxTextCtrl* _name;
wxTextCtrl* _notes;
- EditableList<std::string, EmailDialog>* _email_list;
+ EditableList<std::string>* _email_list;
std::vector<std::string> _emails;
Choice* _utc_offset;
std::vector<Offset> _offsets;
diff --git a/src/wx/editable_list.h b/src/wx/editable_list.h
index f1b74b193..6ae1421d4 100644
--- a/src/wx/editable_list.h
+++ b/src/wx/editable_list.h
@@ -69,12 +69,11 @@ enum class EditableListTitle
/** @param T type of things being edited.
- * @param S dialog to edit a thing.
* @param get Function to get a std::vector of the things being edited.
* @param set Function set the things from a a std::vector.
* @param column Function to get the display string for a given column in a given item.
*/
-template<class T, class S>
+template<class T>
class EditableList : public wxPanel
{
public:
@@ -83,6 +82,8 @@ public:
std::vector<EditableListColumn> columns,
std::function<std::vector<T> ()> get,
std::function<void (std::vector<T>)> set,
+ std::function<std::vector<T> (wxWindow*)> add,
+ std::function<void (wxWindow*, T&)> edit,
std::function<std::string (T, int)> column,
EditableListTitle title,
int buttons
@@ -90,6 +91,8 @@ public:
: wxPanel (parent)
, _get (get)
, _set (set)
+ , _add(add)
+ , _edit(edit)
, _columns (columns)
, _column (column)
, _default_width (200)
@@ -138,28 +141,28 @@ public:
{
auto s = new wxBoxSizer (wxVERTICAL);
if (buttons & EditableListButton::NEW) {
- _add = new Button (this, _("Add..."));
- s->Add (_add, 1, wxEXPAND | wxTOP | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
+ _add_button = new Button(this, _("Add..."));
+ s->Add(_add_button, 1, wxEXPAND | wxTOP | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
}
if (buttons & EditableListButton::EDIT) {
- _edit = new Button (this, _("Edit..."));
- s->Add (_edit, 1, wxEXPAND | wxTOP | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
+ _edit_button = new Button(this, _("Edit..."));
+ s->Add(_edit_button, 1, wxEXPAND | wxTOP | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
}
if (buttons & EditableListButton::REMOVE) {
- _remove = new Button (this, _("Remove"));
- s->Add (_remove, 1, wxEXPAND | wxTOP | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
+ _remove_button = new Button(this, _("Remove"));
+ s->Add(_remove_button, 1, wxEXPAND | wxTOP | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
}
_sizer->Add (s, 0, wxLEFT, DCPOMATIC_SIZER_X_GAP);
}
- if (_add) {
- _add->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&EditableList::add_clicked, this));
+ if (_add_button) {
+ _add_button->Bind(wxEVT_COMMAND_BUTTON_CLICKED, boost::bind(&EditableList::add_clicked, this));
}
- if (_edit) {
- _edit->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&EditableList::edit_clicked, this));
+ if (_edit_button) {
+ _edit_button->Bind(wxEVT_COMMAND_BUTTON_CLICKED, boost::bind(&EditableList::edit_clicked, this));
}
- if (_remove) {
- _remove->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&EditableList::remove_clicked, this));
+ if (_remove_button) {
+ _remove_button->Bind(wxEVT_COMMAND_BUTTON_CLICKED, boost::bind(&EditableList::remove_clicked, this));
}
_list->Bind (wxEVT_COMMAND_LIST_ITEM_SELECTED, boost::bind (&EditableList::selection_changed, this));
@@ -203,6 +206,32 @@ public:
boost::signals2::signal<void ()> SelectionChanged;
+ template <class S>
+ static std::vector<T> add_with_dialog(wxWindow* parent)
+ {
+ S dialog(parent);
+
+ if (dialog.ShowModal() == wxID_OK) {
+ return dialog.get();
+ } else {
+ return {};
+ }
+ }
+
+ template <class S>
+ static void edit_with_dialog(wxWindow* parent, T& item)
+ {
+ S dialog(parent);
+ dialog.set(item);
+ if (dialog.ShowModal() == wxID_OK) {
+ auto const value = dialog.get();
+ if (!value.empty()) {
+ DCPOMATIC_ASSERT(value.size() == 1);
+ item = value[0];
+ }
+ }
+ }
+
private:
void add_to_control (T item)
@@ -220,11 +249,11 @@ private:
void selection_changed ()
{
int const i = _list->GetNextItem (-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
- if (_edit) {
- _edit->Enable (i >= 0);
+ if (_edit_button) {
+ _edit_button->Enable(i >= 0);
}
- if (_remove) {
- _remove->Enable (i >= 0);
+ if (_remove_button) {
+ _remove_button->Enable(i >= 0);
}
SelectionChanged ();
@@ -232,18 +261,12 @@ private:
void add_clicked ()
{
- S dialog(this);
-
- if (dialog.ShowModal() == wxID_OK) {
- auto const values = dialog.get();
- static_assert(std::is_same<typename std::remove_const<decltype(values)>::type, std::vector<T>>::value, "get() must return std::vector<T>");
- auto all = _get();
- for (auto item: values) {
- add_to_control(item);
- all.push_back(item);
- }
- _set(all);
+ auto all = _get();
+ for (auto item: _add(this)) {
+ add_to_control(item);
+ all.push_back(item);
}
+ _set(all);
}
void edit_clicked ()
@@ -256,17 +279,7 @@ private:
std::vector<T> all = _get ();
DCPOMATIC_ASSERT (item >= 0 && item < int (all.size ()));
- S dialog(this);
- dialog.set(all[item]);
- if (dialog.ShowModal() == wxID_OK) {
- auto const value = dialog.get();
- static_assert(std::is_same<typename std::remove_const<decltype(value)>::type, std::vector<T>>::value, "get() must return std::vector<T>");
- if (value.empty()) {
- return;
- }
- DCPOMATIC_ASSERT(value.size() == 1);
- all[item] = value[0];
- }
+ _edit(this, all[item]);
for (size_t i = 0; i < _columns.size(); ++i) {
_list->SetItem (item, i, std_to_wx (_column (all[item], i)));
@@ -320,12 +333,14 @@ private:
std::function <std::vector<T> ()> _get;
std::function <void (std::vector<T>)> _set;
+ std::function<std::vector<T> (wxWindow*)> _add;
+ std::function<void (wxWindow*, T&)> _edit;
std::vector<EditableListColumn> _columns;
std::function<std::string (T, int)> _column;
- wxButton* _add = nullptr;
- wxButton* _edit = nullptr;
- wxButton* _remove = nullptr;
+ wxButton* _add_button = nullptr;
+ wxButton* _edit_button = nullptr;
+ wxButton* _remove_button = nullptr;
wxListCtrl* _list;
wxBoxSizer* _sizer;
int _default_width;
diff --git a/src/wx/extra_kdm_email_dialog.cc b/src/wx/extra_kdm_email_dialog.cc
index de11825f4..c427b286d 100644
--- a/src/wx/extra_kdm_email_dialog.cc
+++ b/src/wx/extra_kdm_email_dialog.cc
@@ -45,10 +45,16 @@ ExtraKDMEmailDialog::ExtraKDMEmailDialog (wxWindow* parent, vector<string> email
vector<EditableListColumn> columns;
columns.push_back (EditableListColumn(_("Address"), 500, true));
- _email_list = new EditableList<string, EmailDialog> (
- this, columns, bind(&ExtraKDMEmailDialog::get, this), bind(&ExtraKDMEmailDialog::set, this, _1), [](string s, int) {
- return s;
- }, EditableListTitle::INVISIBLE, EditableListButton::NEW | EditableListButton::EDIT | EditableListButton::REMOVE
+ _email_list = new EditableList<string>(
+ this,
+ columns,
+ bind(&ExtraKDMEmailDialog::get, this),
+ bind(&ExtraKDMEmailDialog::set, this, _1),
+ EditableList<string>::add_with_dialog<EmailDialog>,
+ EditableList<string>::edit_with_dialog<EmailDialog>,
+ [](string s, int) { return s; },
+ EditableListTitle::INVISIBLE,
+ EditableListButton::NEW | EditableListButton::EDIT | EditableListButton::REMOVE
);
sizer->Add (_email_list, wxGBPosition(r, 0), wxGBSpan(1, 2), wxEXPAND);
diff --git a/src/wx/extra_kdm_email_dialog.h b/src/wx/extra_kdm_email_dialog.h
index e04541864..abb3c8ff9 100644
--- a/src/wx/extra_kdm_email_dialog.h
+++ b/src/wx/extra_kdm_email_dialog.h
@@ -35,7 +35,7 @@ public:
private:
void set(std::vector<std::string> emails);
- EditableList<std::string, EmailDialog>* _email_list;
+ EditableList<std::string>* _email_list;
std::vector<std::string> _emails;
};
diff --git a/src/wx/full_config_dialog.cc b/src/wx/full_config_dialog.cc
index 95c4b7052..175785bfe 100644
--- a/src/wx/full_config_dialog.cc
+++ b/src/wx/full_config_dialog.cc
@@ -477,11 +477,13 @@ private:
vector<EditableListColumn> columns;
columns.push_back(EditableListColumn(_("IP address / host name")));
- _servers_list = new EditableList<string, ServerDialog>(
+ _servers_list = new EditableList<string>(
_panel,
columns,
boost::bind(&Config::servers, Config::instance()),
boost::bind(&Config::set_servers, Config::instance(), _1),
+ EditableList<string>::add_with_dialog<ServerDialog>,
+ EditableList<string>::edit_with_dialog<ServerDialog>,
boost::bind(&EncodingServersPage::server_column, this, _1),
EditableListTitle::INVISIBLE,
EditableListButton::NEW | EditableListButton::EDIT | EditableListButton::REMOVE
@@ -509,7 +511,7 @@ private:
}
CheckBox* _use_any_servers;
- EditableList<string, ServerDialog>* _servers_list;
+ EditableList<string>* _servers_list;
};
@@ -693,11 +695,13 @@ private:
vector<EditableListColumn> columns;
columns.push_back(EditableListColumn(_("Address")));
add_label_to_sizer(table, _panel, _("CC addresses"), true, 0, wxLEFT | wxRIGHT | wxALIGN_CENTRE_VERTICAL);
- _cc = new EditableList<string, EmailDialog>(
+ _cc = new EditableList<string>(
_panel,
columns,
bind(&Config::notification_cc, Config::instance()),
bind(&Config::set_notification_cc, Config::instance(), _1),
+ EditableList<string>::add_with_dialog<EmailDialog>,
+ EditableList<string>::edit_with_dialog<EmailDialog>,
[] (string s, int) {
return s;
},
@@ -807,7 +811,7 @@ private:
wxTextCtrl* _subject;
wxTextCtrl* _from;
wxTextCtrl* _to;
- EditableList<string, EmailDialog>* _cc;
+ EditableList<string>* _cc;
wxTextCtrl* _bcc;
wxTextCtrl* _email;
wxButton* _reset_email;
diff --git a/src/wx/kdm_email_preferences_page.cc b/src/wx/kdm_email_preferences_page.cc
index d6e3b0c17..46b4a460a 100644
--- a/src/wx/kdm_email_preferences_page.cc
+++ b/src/wx/kdm_email_preferences_page.cc
@@ -77,13 +77,15 @@ KDMEmailPage::setup()
table->Add(_from, 1, wxEXPAND | wxALL);
vector<EditableListColumn> columns;
- columns.push_back(EditableListColumn(_("Address")));
+ columns.push_back(EditableListColumn(_("Address"), 1024, true));
add_label_to_sizer(table, _panel, _("CC addresses"), true, 0, wxLEFT | wxRIGHT | wxALIGN_CENTRE_VERTICAL);
- _cc = new EditableList<string, EmailDialog>(
+ _cc = new EditableList<string>(
_panel,
columns,
bind(&Config::kdm_cc, Config::instance()),
bind(&Config::set_kdm_cc, Config::instance(), _1),
+ EditableList<string>::add_with_dialog<EmailDialog>,
+ EditableList<string>::edit_with_dialog<EmailDialog>,
[] (string s, int) {
return s;
},
diff --git a/src/wx/kdm_email_preferences_page.h b/src/wx/kdm_email_preferences_page.h
index 4697b0c27..d5ed3dbdb 100644
--- a/src/wx/kdm_email_preferences_page.h
+++ b/src/wx/kdm_email_preferences_page.h
@@ -52,7 +52,7 @@ private:
wxTextCtrl* _subject;
wxTextCtrl* _from;
- EditableList<std::string, EmailDialog>* _cc;
+ EditableList<std::string>* _cc;
wxTextCtrl* _bcc;
wxTextCtrl* _email;
wxButton* _reset_email;
diff --git a/src/wx/metadata_dialog.cc b/src/wx/metadata_dialog.cc
index 22d43a46e..54892ab19 100644
--- a/src/wx/metadata_dialog.cc
+++ b/src/wx/metadata_dialog.cc
@@ -216,11 +216,13 @@ MetadataDialog::setup_standard (wxPanel* panel, wxSizer* sizer)
vector<EditableListColumn> columns;
columns.push_back(EditableListColumn(_("Agency"), 200, true));
columns.push_back(EditableListColumn(_("Label"), 400, true));
- _ratings = new EditableList<dcp::Rating, RatingDialog> (
+ _ratings = new EditableList<dcp::Rating> (
panel,
columns,
boost::bind(&MetadataDialog::ratings, this),
boost::bind(&MetadataDialog::set_ratings, this, _1),
+ EditableList<dcp::Rating>::add_with_dialog<RatingDialog>,
+ EditableList<dcp::Rating>::edit_with_dialog<RatingDialog>,
[this](dcp::Rating r, int c) {
if (c == 0) {
auto iter = _rating_system_agency_to_name.find(r.agency);
diff --git a/src/wx/metadata_dialog.h b/src/wx/metadata_dialog.h
index 5b4efb8c9..1ec5421a9 100644
--- a/src/wx/metadata_dialog.h
+++ b/src/wx/metadata_dialog.h
@@ -57,7 +57,7 @@ protected:
virtual void film_changed(ChangeType type, FilmProperty property);
virtual void setup_sensitivity ();
- EditableList<dcp::Rating, RatingDialog>* _ratings;
+ EditableList<dcp::Rating>* _ratings;
std::unordered_map<std::string, std::string> _rating_system_agency_to_name;
private:
diff --git a/src/wx/recipient_dialog.cc b/src/wx/recipient_dialog.cc
index 69caa3251..e78058f03 100644
--- a/src/wx/recipient_dialog.cc
+++ b/src/wx/recipient_dialog.cc
@@ -82,8 +82,14 @@ RecipientDialog::RecipientDialog (
vector<EditableListColumn> columns;
columns.push_back(EditableListColumn(_("Address"), 400, true));
- _email_list = new EditableList<string, EmailDialog> (
- this, columns, bind(&RecipientDialog::get_emails, this), bind(&RecipientDialog::set_emails, this, _1), bind(&column, _1),
+ _email_list = new EditableList<string> (
+ this,
+ columns,
+ bind(&RecipientDialog::get_emails, this),
+ bind(&RecipientDialog::set_emails, this, _1),
+ EditableList<string>::add_with_dialog<EmailDialog>,
+ EditableList<string>::edit_with_dialog<EmailDialog>,
+ bind(&column, _1),
EditableListTitle::VISIBLE,
EditableListButton::NEW | EditableListButton::EDIT | EditableListButton::REMOVE
);
diff --git a/src/wx/recipient_dialog.h b/src/wx/recipient_dialog.h
index 61f6b3031..8713b9320 100644
--- a/src/wx/recipient_dialog.h
+++ b/src/wx/recipient_dialog.h
@@ -65,7 +65,7 @@ private:
wxTextCtrl* _notes;
wxStaticText* _recipient_thumbprint;
wxButton* _get_recipient_from_file;
- EditableList<std::string, EmailDialog>* _email_list;
+ EditableList<std::string>* _email_list;
std::vector<std::string> _emails;
boost::optional<dcp::Certificate> _recipient;
diff --git a/src/wx/screen_dialog.cc b/src/wx/screen_dialog.cc
index 84d798065..30132f1fc 100644
--- a/src/wx/screen_dialog.cc
+++ b/src/wx/screen_dialog.cc
@@ -208,11 +208,13 @@ ScreenDialog::ScreenDialog (
vector<EditableListColumn> columns;
columns.push_back (EditableListColumn(_("Thumbprint")));
- _trusted_device_list = new EditableList<TrustedDevice, TrustedDeviceDialog> (
+ _trusted_device_list = new EditableList<TrustedDevice> (
this,
columns,
bind (&ScreenDialog::trusted_devices, this),
bind (&ScreenDialog::set_trusted_devices, this, _1),
+ EditableList<TrustedDevice>::add_with_dialog<TrustedDeviceDialog>,
+ EditableList<TrustedDevice>::edit_with_dialog<TrustedDeviceDialog>,
[] (TrustedDevice const& d, int) {
return d.thumbprint();
},
diff --git a/src/wx/screen_dialog.h b/src/wx/screen_dialog.h
index 3435bf711..f8bc2ddaf 100644
--- a/src/wx/screen_dialog.h
+++ b/src/wx/screen_dialog.h
@@ -79,7 +79,7 @@ private:
wxStaticText* _not_valid_after;
wxButton* _get_recipient_from_file;
wxButton* _download_recipient;
- EditableList<TrustedDevice, TrustedDeviceDialog>* _trusted_device_list;
+ EditableList<TrustedDevice>* _trusted_device_list;
boost::optional<dcp::Certificate> _recipient;
std::vector<TrustedDevice> _trusted_devices;
diff --git a/src/wx/smpte_metadata_dialog.cc b/src/wx/smpte_metadata_dialog.cc
index 3c8c516e9..b1b2314d9 100644
--- a/src/wx/smpte_metadata_dialog.cc
+++ b/src/wx/smpte_metadata_dialog.cc
@@ -107,11 +107,13 @@ SMPTEMetadataDialog::setup_advanced (wxPanel* panel, wxSizer* sizer)
vector<EditableListColumn> columns;
columns.push_back(EditableListColumn(_("Version"), 350, true));
- _content_versions = new EditableList<string, ContentVersionDialog> (
+ _content_versions = new EditableList<string> (
panel,
columns,
boost::bind(&SMPTEMetadataDialog::content_versions, this),
boost::bind(&SMPTEMetadataDialog::set_content_versions, this, _1),
+ EditableList<string>::add_with_dialog<ContentVersionDialog>,
+ EditableList<string>::edit_with_dialog<ContentVersionDialog>,
boost::bind(&content_versions_column, _1, _2),
EditableListTitle::INVISIBLE,
EditableListButton::NEW | EditableListButton::REMOVE
diff --git a/src/wx/smpte_metadata_dialog.h b/src/wx/smpte_metadata_dialog.h
index c63efd045..4fd2c388c 100644
--- a/src/wx/smpte_metadata_dialog.h
+++ b/src/wx/smpte_metadata_dialog.h
@@ -68,7 +68,7 @@ private:
wxChoice* _status;
CheckBox* _enable_distributor;
wxTextCtrl* _distributor;
- EditableList<std::string, ContentVersionDialog>* _content_versions;
+ EditableList<std::string>* _content_versions;
};