classify all region actions based on how they get a list of regions to operate on; use this in Editor::sensitize_the_right_region_actions()

There are still problems because actions like trim_front()
that use the edit point get the edit point with different
results than the code that sensitizes actions
This commit is contained in:
Paul Davis 2017-02-14 16:09:32 +01:00
parent 2cc94f8880
commit 0a41daa932
5 changed files with 168 additions and 242 deletions

View file

@ -353,6 +353,16 @@ class PublicEditor : public Gtkmm2ext::Tabbable {
static sigc::signal<void> DropDownKeys;
struct RegionAction {
Glib::RefPtr<Gtk::Action> action;
Editing::RegionActionTarget target;
RegionAction (Glib::RefPtr<Gtk::Action> a, Editing::RegionActionTarget tgt)
: action (a), target (tgt) {}
};
std::map<std::string,RegionAction> region_action_map;
Glib::RefPtr<Gtk::ActionGroup> editor_actions;
Glib::RefPtr<Gtk::ActionGroup> editor_menu_actions;
Glib::RefPtr<Gtk::ActionGroup> _region_actions;