summaryrefslogtreecommitdiff
path: root/src
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
parent13878a9ff227d66729f185a5bac5985f14d6cac7 (diff)
Stop Ctrl+A working when the content panel is not visible (#577).
Diffstat (limited to 'src')
-rw-r--r--src/wx/content_panel.cc8
-rw-r--r--src/wx/content_panel.h1
2 files changed, 9 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.
*/
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<ContentSubPanel *> _panels;
ContentMenu* _menu;
TimelineDialog* _timeline_dialog;
+ wxNotebook* _parent;
boost::shared_ptr<Film> _film;
bool _generally_sensitive;