summaryrefslogtreecommitdiff
path: root/src/wx/content_menu.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-08-23 00:27:12 +0100
committerCarl Hetherington <cth@carlh.net>2016-08-24 10:01:52 +0100
commitdf28b0e939bd0f12ae31e6f7ba94fa954496b3b8 (patch)
tree9dcdf8708fe678fc1419e90dc6fdc3f8da8fafb2 /src/wx/content_menu.cc
parent2f1d460898f40844d47d6a3b858449ac09d8b342 (diff)
Allow import of OV/VF DCPs (#906).
Diffstat (limited to 'src/wx/content_menu.cc')
-rw-r--r--src/wx/content_menu.cc23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/wx/content_menu.cc b/src/wx/content_menu.cc
index 70fc766ac..3b1fd3189 100644
--- a/src/wx/content_menu.cc
+++ b/src/wx/content_menu.cc
@@ -53,6 +53,7 @@ enum {
ID_properties,
ID_re_examine,
ID_kdm,
+ ID_ov,
ID_remove
};
@@ -65,7 +66,9 @@ ContentMenu::ContentMenu (wxWindow* p)
_find_missing = _menu->Append (ID_find_missing, _("Find missing..."));
_properties = _menu->Append (ID_properties, _("Properties..."));
_re_examine = _menu->Append (ID_re_examine, _("Re-examine..."));
+ _menu->AppendSeparator ();
_kdm = _menu->Append (ID_kdm, _("Add KDM..."));
+ _ov = _menu->Append (ID_ov, _("Add OV..."));
_menu->AppendSeparator ();
_remove = _menu->Append (ID_remove, _("Remove"));
@@ -75,6 +78,7 @@ ContentMenu::ContentMenu (wxWindow* p)
_parent->Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&ContentMenu::properties, this), ID_properties);
_parent->Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&ContentMenu::re_examine, this), ID_re_examine);
_parent->Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&ContentMenu::kdm, this), ID_kdm);
+ _parent->Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&ContentMenu::ov, this), ID_ov);
_parent->Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&ContentMenu::remove, this), ID_remove);
}
@@ -338,6 +342,25 @@ ContentMenu::kdm ()
}
void
+ContentMenu::ov ()
+{
+ DCPOMATIC_ASSERT (!_content.empty ());
+ shared_ptr<DCPContent> dcp = dynamic_pointer_cast<DCPContent> (_content.front ());
+ DCPOMATIC_ASSERT (dcp);
+
+ wxDirDialog* d = new wxDirDialog (_parent, _("Select OV"));
+
+ if (d->ShowModal() == wxID_OK) {
+ dcp->add_ov (wx_to_std (d->GetPath ()));
+ shared_ptr<Film> film = _film.lock ();
+ DCPOMATIC_ASSERT (film);
+ film->examine_content (dcp);
+ }
+
+ d->Destroy ();
+}
+
+void
ContentMenu::properties ()
{
ContentPropertiesDialog* d = new ContentPropertiesDialog (_parent, _content.front ());