diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-12-28 23:49:56 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-12-28 23:49:56 +0000 |
| commit | 4014143952f791973d94c5cfb5bec9e97d1462b7 (patch) | |
| tree | b6abe43ed1b7452d65e12accc5b358c3b58cdbcd /src | |
| parent | 5c6292315aa7c31a076e8ace513f62e062440a33 (diff) | |
ContentMenu was keeping its initial film and not using the current one; should fix #255.
Diffstat (limited to 'src')
| -rw-r--r-- | src/wx/content_menu.cc | 6 | ||||
| -rw-r--r-- | src/wx/content_menu.h | 5 | ||||
| -rw-r--r-- | src/wx/film_editor.cc | 4 | ||||
| -rw-r--r-- | src/wx/timeline.cc | 4 |
4 files changed, 10 insertions, 9 deletions
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<Film> 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<Film> 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<Film>, wxWindow *); + ContentMenu (wxWindow *); ~ContentMenu (); - void popup (ContentList, wxPoint); + void popup (boost::weak_ptr<Film>, ContentList, wxPoint); private: void repeat (); @@ -43,6 +43,7 @@ private: void maybe_found_missing (boost::weak_ptr<Job>, boost::weak_ptr<Content>, boost::weak_ptr<Content>); wxMenu* _menu; + /** Film that we are working with; set up by popup() */ boost::weak_ptr<Film> _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<Film> 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> 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 |
