diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-04-26 21:55:23 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-04-26 21:55:23 +0100 |
| commit | 694d242518613145fd115d26ea19c383c710dc45 (patch) | |
| tree | 396bdc1a3dff9cd32924368b24f078f7c8b96e18 | |
| parent | cb161dbe271a9f05826758f40d27e37333a27a31 (diff) | |
Fix non-working delete key.
| -rw-r--r-- | ChangeLog | 2 | ||||
| -rw-r--r-- | src/tools/dcpomatic.cc | 9 | ||||
| -rw-r--r-- | src/wx/content_panel.cc | 6 | ||||
| -rw-r--r-- | src/wx/content_panel.h | 4 |
4 files changed, 16 insertions, 5 deletions
@@ -1,5 +1,7 @@ 2016-04-26 Carl Hetherington <cth@carlh.net> + * Fix non-working delete key. + * Updated ru_RU and uk_UA translations from Igor Voytovich. * Updated sv_SE translation from Adam Klotblixt. diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index 5676e6e57..6f5bdd664 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -249,7 +249,7 @@ public: accel[0].Set (wxACCEL_CTRL, static_cast<int>('A'), ID_add_file); accel[1].Set (wxACCEL_NORMAL, WXK_DELETE, ID_remove); Bind (wxEVT_MENU, boost::bind (&ContentPanel::add_file_clicked, _film_editor->content_panel()), ID_add_file); - Bind (wxEVT_MENU, boost::bind (&ContentPanel::remove_clicked, _film_editor->content_panel(), true), ID_remove); + Bind (wxEVT_MENU, boost::bind (&DOMFrame::remove_clicked, this, _1), ID_remove); wxAcceleratorTable accel_table (2, accel); SetAcceleratorTable (accel_table); @@ -259,6 +259,13 @@ public: UpdateChecker::instance()->StateChanged.connect (boost::bind (&DOMFrame::update_checker_state_changed, this)); } + void remove_clicked (wxCommandEvent& ev) + { + if (_film_editor->content_panel()->remove_clicked (true)) { + ev.Skip (); + } + } + void new_film (boost::filesystem::path path) { shared_ptr<Film> film (new Film (path)); diff --git a/src/wx/content_panel.cc b/src/wx/content_panel.cc index efc445bc9..654378248 100644 --- a/src/wx/content_panel.cc +++ b/src/wx/content_panel.cc @@ -343,14 +343,15 @@ ContentPanel::add_folder_clicked () _film->examine_and_add_content (content); } -void +/** @return true if this remove "click" should be ignored */ +bool ContentPanel::remove_clicked (bool hotkey) { /* If the method was called because Delete was pressed check that our notebook page is visible and that the content list is focussed. */ if (hotkey && (_parent->GetCurrentPage() != _panel || !_content->HasFocus())) { - return; + return true; } BOOST_FOREACH (shared_ptr<Content> i, selected ()) { @@ -358,6 +359,7 @@ ContentPanel::remove_clicked (bool hotkey) } selection_changed (); + return false; } void diff --git a/src/wx/content_panel.h b/src/wx/content_panel.h index e356b5a49..9e6cf9f24 100644 --- a/src/wx/content_panel.h +++ b/src/wx/content_panel.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net> + Copyright (C) 2012-2016 Carl Hetherington <cth@carlh.net> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -65,7 +65,7 @@ public: FFmpegContentList selected_ffmpeg (); void add_file_clicked (); - void remove_clicked (bool hotkey); + bool remove_clicked (bool hotkey); private: void selection_changed (); |
