From: Carl Hetherington Date: Thu, 9 Jul 2015 10:43:51 +0000 (+0100) Subject: Stop Ctrl+A working when the content panel is not visible (#577). X-Git-Tag: v2.1.20~3 X-Git-Url: https://git.carlh.net/gitweb/?a=commitdiff_plain;h=3f5b9a71f980525481251461f9c3d63806972470;p=dcpomatic.git Stop Ctrl+A working when the content panel is not visible (#577). --- diff --git a/ChangeLog b/ChangeLog index 2f9fd4fb1..23563601d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2015-07-09 c.hetherington + + * Stop Ctrl+A working when the content tab is not visible (#577). + 2015-07-08 c.hetherington * Remove the (I suspect) rarely used and very limited diff --git a/src/wx/content_panel.cc b/src/wx/content_panel.cc index a578c1628..b3880da57 100644 --- a/src/wx/content_panel.cc +++ b/src/wx/content_panel.cc @@ -50,6 +50,7 @@ using boost::dynamic_pointer_cast; ContentPanel::ContentPanel (wxNotebook* n, boost::shared_ptr film, FilmViewer* viewer) : _timeline_dialog (0) + , _parent (n) , _film (film) , _generally_sensitive (true) { @@ -236,6 +237,13 @@ ContentPanel::selection_changed () void ContentPanel::add_file_clicked () { + /* This method is also called when Ctrl-A is pressed, so check that our notebook page + is visible. + */ + if (_parent->GetCurrentPage() != _panel) { + return; + } + /* The wxFD_CHANGE_DIR here prevents a `could not set working directory' error 123 on Windows when using non-Latin filenames or paths. */ diff --git a/src/wx/content_panel.h b/src/wx/content_panel.h index 452d4a4f8..633ea1bd6 100644 --- a/src/wx/content_panel.h +++ b/src/wx/content_panel.h @@ -98,6 +98,7 @@ private: std::list _panels; ContentMenu* _menu; TimelineDialog* _timeline_dialog; + wxNotebook* _parent; boost::shared_ptr _film; bool _generally_sensitive;