From 91080c31db427c6ded5beab86f7c50c6e7dfe52b Mon Sep 17 00:00:00 2001 From: Roy Vegard Ovesen Date: Sun, 31 Mar 2013 15:28:29 +0200 Subject: [PATCH] Disable some actions that are not allowed while under nsm --- gtk2_ardour/ardour_ui.cc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index d42bdcdd4f..12d73b9f51 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -681,6 +681,23 @@ ARDOUR_UI::startup () _session->set_nsm_state( nsm->is_active() ); } + // nsm requires these actions disabled + vector action_names; + action_names.push_back("Snapshot"); + action_names.push_back("SaveAs"); + action_names.push_back("Rename"); + action_names.push_back("New"); + action_names.push_back("Open"); + action_names.push_back("Recent"); + action_names.push_back("Close"); + + for (vector::const_iterator n = action_names.begin(); n != action_names.end(); ++n) { + Glib::RefPtr act = ActionManager::get_action (X_("Main"), X_(n.base()->c_str())); + if (act) { + act->set_sensitive (false); + } + } + // wait for session is loaded reply from nsm server do { nsm->check ();