summaryrefslogtreecommitdiff
path: root/src/wx/content_panel.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-07-09 11:43:51 +0100
committerCarl Hetherington <cth@carlh.net>2015-07-09 11:43:51 +0100
commit3f5b9a71f980525481251461f9c3d63806972470 (patch)
tree2b022351858c4a928ea565c4decaabbc02f74dda /src/wx/content_panel.cc
parent13878a9ff227d66729f185a5bac5985f14d6cac7 (diff)
Stop Ctrl+A working when the content panel is not visible (#577).
Diffstat (limited to 'src/wx/content_panel.cc')
-rw-r--r--src/wx/content_panel.cc8
1 files changed, 8 insertions, 0 deletions
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> 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.
*/