Stop Ctrl+A working when the content panel is not visible (#577).
authorCarl Hetherington <cth@carlh.net>
Thu, 9 Jul 2015 10:43:51 +0000 (11:43 +0100)
committerCarl Hetherington <cth@carlh.net>
Thu, 9 Jul 2015 10:43:51 +0000 (11:43 +0100)
ChangeLog
src/wx/content_panel.cc
src/wx/content_panel.h

index 2f9fd4fb17d2ce28a36a12dde052617b3af40420..23563601dd0d35ee69755396a36148d7ebf5cf4b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2015-07-09  c.hetherington  <cth@carlh.net>
+
+       * Stop Ctrl+A working when the content tab is not visible (#577).
+
 2015-07-08  c.hetherington  <cth@carlh.net>
 
        * Remove the (I suspect) rarely used and very limited
index a578c16285ebe508408d766fca5c37c312cb9309..b3880da5744fb854d1a56dd3705e6aa192610032 100644 (file)
@@ -50,6 +50,7 @@ using boost::dynamic_pointer_cast;
 
 ContentPanel::ContentPanel (wxNotebook* n, boost::shared_ptr<Film> 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.
        */
index 452d4a4f853c259584d5c53b4930fe9cfdbc61e1..633ea1bd604abdfc646421bb53a4894b8c07d6e3 100644 (file)
@@ -98,6 +98,7 @@ private:
        std::list<ContentSubPanel *> _panels;
        ContentMenu* _menu;
        TimelineDialog* _timeline_dialog;
+       wxNotebook* _parent;
 
        boost::shared_ptr<Film> _film;
        bool _generally_sensitive;