- string action_name = "Toggle";
- action_name += legalize_for_path ((*i)->name);
- action_name += "Surface";
-
- string action_label = (*i)->name;
-
- Glib::RefPtr<Action> act = ActionManager::register_toggle_action (editor->editor_actions, action_name.c_str(), action_label.c_str(),
- (bind (mem_fun (*this, &ARDOUR_UI::toggle_control_protocol), *i)));
-
- Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
-
- if ((*i)->protocol || (*i)->requested) {
- tact->set_active ();
+ if (!(*i)->mandatory) {
+
+ string action_name = "Toggle";
+ action_name += legalize_for_path ((*i)->name);
+ action_name += "Surface";
+
+ string action_label = (*i)->name;
+
+ Glib::RefPtr<Action> act = ActionManager::register_toggle_action (editor->editor_actions, action_name.c_str(), action_label.c_str(),
+ (bind (mem_fun (*this, &ARDOUR_UI::toggle_control_protocol), *i)));
+
+ Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
+
+ if ((*i)->protocol || (*i)->requested) {
+ tact->set_active ();
+ }
+
+ ui += "<menuitem action='";
+ ui += action_name;
+ ui += "'/>\n";