From de2e1e23de8ce5926f90b1797a5ae493fc62a9b0 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Thu, 22 May 2014 08:06:33 -0700 Subject: [PATCH] List the files to be (un)loaded in the Load/Unload files dialog Updates #880. --- src/project.cpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/project.cpp b/src/project.cpp index 37ee38825..52d580626 100644 --- a/src/project.cpp +++ b/src/project.cpp @@ -154,7 +154,26 @@ void Project::LoadUnloadFiles() { return; if (load_linked == 2) { - if (wxMessageBox(_("Do you want to load/unload the associated files?"), _("(Un)Load files?"), wxYES_NO | wxCENTRE, context->parent) != wxYES) + wxString str = _("Do you want to load/unload the associated files?"); + str += "\n"; + + auto append_file = [&](agi::fs::path const& p, wxString const& unload, wxString const& load) { + if (p.empty()) + str += "\n" + unload; + else + str += "\n" + wxString::Format(load, p.wstring()); + }; + + if (audio != audio_file) + append_file(audio, _("Unload audio"), _("Load audio file: %s")); + if (video != video_file) + append_file(video, _("Unload video"), _("Load video file: %s")); + if (timecodes != timecodes_file) + append_file(timecodes, _("Unload timecodes"), _("Load timecodes file: %s")); + if (keyframes != keyframes_file) + append_file(keyframes, _("Unload keyframes"), _("Load keyframes file: %s")); + + if (wxMessageBox(str, _("(Un)Load files?"), wxYES_NO | wxCENTRE, context->parent) != wxYES) return; }