diff --git a/gtk2_ardour/processor_box.cc b/gtk2_ardour/processor_box.cc index eedd7896bf..add816e40f 100644 --- a/gtk2_ardour/processor_box.cc +++ b/gtk2_ardour/processor_box.cc @@ -89,6 +89,7 @@ using namespace Gtkmm2ext; ProcessorBox* ProcessorBox::_current_processor_box = 0; RefPtr ProcessorBox::paste_action; RefPtr ProcessorBox::cut_action; +RefPtr ProcessorBox::rename_action; Glib::RefPtr SendProcessorEntry::_slider; ProcessorEntry::ProcessorEntry (boost::shared_ptr p, Width w) @@ -717,6 +718,11 @@ ProcessorBox::selection_changed () { bool sensitive = (processor_display.selection().empty()) ? false : true; ActionManager::set_sensitive (ActionManager::plugin_selection_sensitive_actions, sensitive); + + /* disallow rename for multiple selections and for plugin inserts */ + rename_action->set_sensitive ( + processor_display.selection().size() == 1 && boost::dynamic_pointer_cast (processor_display.selection().front()->processor()) == 0 + ); } void @@ -1595,9 +1601,8 @@ ProcessorBox::register_actions () paste_action = ActionManager::register_action (popup_act_grp, X_("paste"), _("Paste"), sigc::ptr_fun (ProcessorBox::rb_paste)); - act = ActionManager::register_action (popup_act_grp, X_("rename"), _("Rename"), + rename_action = ActionManager::register_action (popup_act_grp, X_("rename"), _("Rename"), sigc::ptr_fun (ProcessorBox::rb_rename)); - ActionManager::plugin_selection_sensitive_actions.push_back(act); ActionManager::register_action (popup_act_grp, X_("selectall"), _("Select All"), sigc::ptr_fun (ProcessorBox::rb_select_all)); ActionManager::register_action (popup_act_grp, X_("deselectall"), _("Deselect All"), diff --git a/gtk2_ardour/processor_box.h b/gtk2_ardour/processor_box.h index 74ab5c85bb..5c5035c1d2 100644 --- a/gtk2_ardour/processor_box.h +++ b/gtk2_ardour/processor_box.h @@ -244,6 +244,7 @@ class ProcessorBox : public Gtk::HBox, public PluginInterestedObject, public ARD static Glib::RefPtr cut_action; static Glib::RefPtr paste_action; + static Glib::RefPtr rename_action; void paste_processor_state (const XMLNodeList&, boost::shared_ptr); void activate_processor (boost::shared_ptr);