From: Carl Hetherington Date: Sat, 28 Dec 2013 23:49:56 +0000 (+0000) Subject: ContentMenu was keeping its initial film and not using the current one; should fix... X-Git-Tag: v2.0.48~1023 X-Git-Url: https://main.carlh.net/gitweb/?a=commitdiff_plain;h=4014143952f791973d94c5cfb5bec9e97d1462b7;p=dcpomatic.git ContentMenu was keeping its initial film and not using the current one; should fix #255. --- diff --git a/ChangeLog b/ChangeLog index c80ad2e63..38d967c03 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2013-12-28 Carl Hetherington + * Speculative fix for "find missing" not working on OS X (#255). + * Fix failure to load films with missing still image content (#300). 2013-12-27 Carl Hetherington diff --git a/src/wx/content_menu.cc b/src/wx/content_menu.cc index 6372503d1..b91c82ab1 100644 --- a/src/wx/content_menu.cc +++ b/src/wx/content_menu.cc @@ -43,9 +43,8 @@ enum { ID_remove }; -ContentMenu::ContentMenu (shared_ptr f, wxWindow* p) +ContentMenu::ContentMenu (wxWindow* p) : _menu (new wxMenu) - , _film (f) , _parent (p) { _repeat = _menu->Append (ID_repeat, _("Repeat...")); @@ -66,8 +65,9 @@ ContentMenu::~ContentMenu () } void -ContentMenu::popup (ContentList c, wxPoint p) +ContentMenu::popup (weak_ptr f, ContentList c, wxPoint p) { + _film = f; _content = c; _repeat->Enable (!_content.empty ()); diff --git a/src/wx/content_menu.h b/src/wx/content_menu.h index 9f4bd4cc4..a9f9093c6 100644 --- a/src/wx/content_menu.h +++ b/src/wx/content_menu.h @@ -30,10 +30,10 @@ class Film; class ContentMenu { public: - ContentMenu (boost::shared_ptr, wxWindow *); + ContentMenu (wxWindow *); ~ContentMenu (); - void popup (ContentList, wxPoint); + void popup (boost::weak_ptr, ContentList, wxPoint); private: void repeat (); @@ -43,6 +43,7 @@ private: void maybe_found_missing (boost::weak_ptr, boost::weak_ptr, boost::weak_ptr); wxMenu* _menu; + /** Film that we are working with; set up by popup() */ boost::weak_ptr _film; wxWindow* _parent; ContentList _content; diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc index 04bf6d2a8..dd3ec6b67 100644 --- a/src/wx/film_editor.cc +++ b/src/wx/film_editor.cc @@ -72,7 +72,7 @@ using boost::lexical_cast; /** @param f Film to edit */ FilmEditor::FilmEditor (shared_ptr f, wxWindow* parent) : wxPanel (parent) - , _menu (f, this) + , _menu (this) , _generally_sensitive (true) , _timeline_dialog (0) { @@ -966,7 +966,7 @@ FilmEditor::sequence_video_changed () void FilmEditor::content_right_click (wxListEvent& ev) { - _menu.popup (selected_content (), ev.GetPoint ()); + _menu.popup (_film, selected_content (), ev.GetPoint ()); } void diff --git a/src/wx/timeline.cc b/src/wx/timeline.cc index 0ac9a1d4b..6cc1f79d9 100644 --- a/src/wx/timeline.cc +++ b/src/wx/timeline.cc @@ -336,7 +336,7 @@ Timeline::Timeline (wxWindow* parent, FilmEditor* ed, shared_ptr film) , _left_down (false) , _down_view_position (0) , _first_move (false) - , _menu (film, this) + , _menu (this) , _snap (true) { #ifndef __WXOSX__ @@ -574,7 +574,7 @@ Timeline::right_down (wxMouseEvent& ev) cv->set_selected (true); } - _menu.popup (selected_content (), ev.GetPosition ()); + _menu.popup (_film, selected_content (), ev.GetPosition ()); } void