fix bad re-ordering in ARDOUR_UI::set_session() that changed when transport-related actions are set sensitive (compared to v5)

This specific change has broader scope than the bare minimum required - we could just move/replicate transport_ctrl.set_session()
after session_sensitive_actions have had their sensitivity set to true. But this "seems" like a more thorough solution,
in that it sets all relevant actions groups before doing anythng else.
This commit is contained in:
Paul Davis 2020-01-27 18:24:18 -07:00
parent 7e899b4199
commit 4148d2cee4

View File

@ -98,6 +98,19 @@ ARDOUR_UI::set_session (Session *s)
{
SessionHandlePtr::set_session (s);
/* adjust sensitivity of menu bar options to reflect presence/absence
* of session
*/
ActionManager::set_sensitive (ActionManager::session_sensitive_actions, _session);
ActionManager::set_sensitive (ActionManager::write_sensitive_actions, _session ? _session->writable() : false);
if (_session && _session->locations()->num_range_markers()) {
ActionManager::set_sensitive (ActionManager::range_sensitive_actions, true);
} else {
ActionManager::set_sensitive (ActionManager::range_sensitive_actions, false);
}
transport_ctrl.set_session (s);
if (big_transport_window) {
@ -148,17 +161,6 @@ ARDOUR_UI::set_session (Session *s)
transport_masters_window->set_session (s);
rc_option_editor->set_session (s);
/* sensitize menu bar options that are now valid */
ActionManager::set_sensitive (ActionManager::session_sensitive_actions, true);
ActionManager::set_sensitive (ActionManager::write_sensitive_actions, _session->writable());
if (_session->locations()->num_range_markers()) {
ActionManager::set_sensitive (ActionManager::range_sensitive_actions, true);
} else {
ActionManager::set_sensitive (ActionManager::range_sensitive_actions, false);
}
/* allow wastebasket flush again */
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Main"), X_("FlushWastebasket"));