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.
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);
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));
_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 ()) {
}
selection_changed ();
+ return false;
}
void
/*
- 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
FFmpegContentList selected_ffmpeg ();
void add_file_clicked ();
- void remove_clicked (bool hotkey);
+ bool remove_clicked (bool hotkey);
private:
void selection_changed ();