diff options
| author | Carl Hetherington <cth@carlh.net> | 2023-11-20 00:20:44 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2023-11-20 21:18:40 +0100 |
| commit | 9b5cff118fe03649c0c404b35f2900ff36008637 (patch) | |
| tree | 4b29064824854c0847e6f62f7987928a6369dacd | |
| parent | ff5ed87ed6730b62e037991cbd4a6b5ee43dd7cb (diff) | |
Cleanup: use stack-allocated FileDialog and accept multiple KDMs.
| -rw-r--r-- | src/tools/dcpomatic_player.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/tools/dcpomatic_player.cc b/src/tools/dcpomatic_player.cc index 6c6e756ec..d1668975c 100644 --- a/src/tools/dcpomatic_player.cc +++ b/src/tools/dcpomatic_player.cc @@ -19,6 +19,7 @@ */ #include "wx/about_dialog.h" +#include "wx/file_dialog.h" #include "wx/film_viewer.h" #include "wx/nag_dialog.h" #include "wx/player_config_dialog.h" @@ -698,9 +699,9 @@ private: void file_add_kdm () { - auto d = make_wx<wxFileDialog>(this, _("Select KDM")); + FileDialog dialog(this, _("Select KDM"), wxT("XML files|*.xml|All files|*.*"), wxFD_MULTIPLE, "AddKDMPath"); - if (d->ShowModal() == wxID_OK) { + if (dialog.show()) { DCPOMATIC_ASSERT (_film); auto dcp = std::dynamic_pointer_cast<DCPContent>(_film->content().front()); DCPOMATIC_ASSERT (dcp); @@ -710,7 +711,9 @@ private: _viewer.set_coalesce_player_changes(false); }); _viewer.set_coalesce_player_changes(true); - dcp->add_kdm (dcp::EncryptedKDM(dcp::file_to_string(wx_to_std(d->GetPath()), MAX_KDM_SIZE))); + for (auto path: dialog.paths()) { + dcp->add_kdm(dcp::EncryptedKDM(dcp::file_to_string(path))); + } examine_content(); } } catch (exception& e) { |
