diff options
| author | Carl Hetherington <cth@carlh.net> | 2026-04-10 18:50:42 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2026-04-11 17:31:31 +0200 |
| commit | 6bb2409c52bddfd9c696f5f37a56b92c43c1986d (patch) | |
| tree | 837b84e4427e5a796cbe2b9937bac3f5083b3e91 /src | |
| parent | 8279483fd21636ccc772d71094fc15f49afcfa7c (diff) | |
Extract load_dcps.
Diffstat (limited to 'src')
| -rw-r--r-- | src/tools/dcpomatic_verifier.cc | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/tools/dcpomatic_verifier.cc b/src/tools/dcpomatic_verifier.cc index d24100ff3..ee428d434 100644 --- a/src/tools/dcpomatic_verifier.cc +++ b/src/tools/dcpomatic_verifier.cc @@ -145,7 +145,19 @@ public: auto dcp_sizer = new wxBoxSizer(wxHORIZONTAL); add_label_to_sizer(dcp_sizer, _overall_panel, _("DCPs"), true, 0, wxALIGN_CENTER_VERTICAL); - auto add = [this](wxWindow* parent) { + auto load_dcps = [this](vector<boost::filesystem::path> const& dcps) { + wxProgressDialog progress(variant::wx::dcpomatic(), _("Examining DCPs")); + vector<DCPPath> dcp_paths; + for (auto path: dcps) { + for (auto const& dcp: dcp::find_potential_dcps(path)) { + progress.Pulse(); + dcp_paths.push_back(DCPPath(dcp, _kdms)); + } + } + return dcp_paths; + }; + + auto add = [this, &load_dcps](wxWindow* parent) { #if wxCHECK_VERSION(3, 1, 4) DirDialog dialog(parent, _("Select DCP(s)"), wxDD_MULTIPLE, "AddVerifierInputPath"); #else @@ -153,15 +165,7 @@ public: #endif if (dialog.show()) { - wxProgressDialog progress(variant::wx::dcpomatic(), _("Examining DCPs")); - vector<DCPPath> paths; - for (auto path: dialog.paths()) { - for (auto const& dcp: dcp::find_potential_dcps(path)) { - progress.Pulse(); - paths.push_back(DCPPath(dcp, _kdms)); - } - } - return paths; + return load_dcps(dialog.paths()); } else { return std::vector<DCPPath>{}; } |
