summaryrefslogtreecommitdiff
path: root/src/wx
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-02-02 00:04:35 +0000
committerCarl Hetherington <cth@carlh.net>2016-02-02 00:04:35 +0000
commit696ff1c534d59483bed3db06705b554f615a7b85 (patch)
tree8f56f83caf5c06dad007c1ba65e43fb9187d28e6 /src/wx
parent0068909541bfd89079bbf4c18c7246b6327e2585 (diff)
Add delete-key shortcut to remove content.
Diffstat (limited to 'src/wx')
-rw-r--r--src/wx/content_panel.cc7
-rw-r--r--src/wx/content_panel.h2
2 files changed, 8 insertions, 1 deletions
diff --git a/src/wx/content_panel.cc b/src/wx/content_panel.cc
index deeef7f80..d1315ac34 100644
--- a/src/wx/content_panel.cc
+++ b/src/wx/content_panel.cc
@@ -328,6 +328,13 @@ ContentPanel::add_folder_clicked ()
void
ContentPanel::remove_clicked ()
{
+ /* This method is also called when Delete is pressed, so check that our notebook page
+ is visible.
+ */
+ if (_parent->GetCurrentPage() != _panel) {
+ return;
+ }
+
BOOST_FOREACH (shared_ptr<Content> i, selected ()) {
_film->remove_content (i);
}
diff --git a/src/wx/content_panel.h b/src/wx/content_panel.h
index 8d11e6289..1115aaf31 100644
--- a/src/wx/content_panel.h
+++ b/src/wx/content_panel.h
@@ -65,11 +65,11 @@ public:
FFmpegContentList selected_ffmpeg ();
void add_file_clicked ();
+ void remove_clicked ();
private:
void selection_changed ();
void add_folder_clicked ();
- void remove_clicked ();
void earlier_clicked ();
void later_clicked ();
void right_click (wxListEvent &);