diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-12-17 01:40:51 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-12-17 01:40:51 +0100 |
| commit | 235483a91d4160f4b9b2e53f1a7d5c4cb5b27925 (patch) | |
| tree | 6735b612a8d03988600b02fc186306459c07ff01 /src/tools | |
| parent | 6e8f8563f4e4e6ff04b632aff8d6ae95de945649 (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/tools')
| -rw-r--r-- | src/tools/dcpomatic_combiner.cc | 6 | ||||
| -rw-r--r-- | src/tools/dcpomatic_editor.cc | 6 | ||||
| -rw-r--r-- | src/tools/dcpomatic_verifier.cc | 4 |
3 files changed, 11 insertions, 5 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 |
