Fix broken content remove button.
authorCarl Hetherington <cth@carlh.net>
Sun, 21 Feb 2016 19:50:39 +0000 (19:50 +0000)
committerCarl Hetherington <cth@carlh.net>
Sun, 21 Feb 2016 19:50:39 +0000 (19:50 +0000)
src/tools/dcpomatic.cc
src/wx/content_panel.cc
src/wx/content_panel.h

index 7d41ff2e6d04dc9dbdcfe467d6ec73291a5fd472..1e40fbd697a0935d8457d3cb04e9396c170b72b8 100644 (file)
@@ -251,7 +251,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()), ID_remove);
+               Bind (wxEVT_MENU, boost::bind (&ContentPanel::remove_clicked, _film_editor->content_panel(), true), ID_remove);
                wxAcceleratorTable accel_table (2, accel);
                SetAcceleratorTable (accel_table);
 
index a68998232f6b02bb582c03328f80f7d07badb4bb..59a43fa37827d850e808e7c601f636a899d63ff6 100644 (file)
@@ -123,7 +123,7 @@ ContentPanel::ContentPanel (wxNotebook* n, boost::shared_ptr<Film> film, FilmVie
        _content->Bind (wxEVT_DROP_FILES, boost::bind (&ContentPanel::files_dropped, this, _1));
        _add_file->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&ContentPanel::add_file_clicked, this));
        _add_folder->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&ContentPanel::add_folder_clicked, this));
-       _remove->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&ContentPanel::remove_clicked, this));
+       _remove->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&ContentPanel::remove_clicked, this, false));
        _earlier->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&ContentPanel::earlier_clicked, this));
        _later->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&ContentPanel::later_clicked, this));
        _timeline->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&ContentPanel::timeline_clicked, this));
@@ -326,12 +326,12 @@ ContentPanel::add_folder_clicked ()
 }
 
 void
-ContentPanel::remove_clicked ()
+ContentPanel::remove_clicked (bool hotkey)
 {
-       /* This method is also called when Delete is pressed, so check that our notebook page
+       /* If the method was called because Delete was pressed check that our notebook page
           is visible and that the content list is focussed.
        */
-       if (_parent->GetCurrentPage() != _panel || !_content->HasFocus()) {
+       if (hotkey && (_parent->GetCurrentPage() != _panel || !_content->HasFocus())) {
                return;
        }
 
index 1115aaf31c1f8cb44656e56957bcc9e6be118a67..5f6faa0a36e47a3d269c6a90f178d237813e98cb 100644 (file)
@@ -65,7 +65,7 @@ public:
        FFmpegContentList selected_ffmpeg ();
 
        void add_file_clicked ();
-       void remove_clicked ();
+       void remove_clicked (bool hotkey);
 
 private:
        void selection_changed ();