diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2020-01-27 18:24:18 -0700 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2020-01-27 18:24:30 -0700 |
commit | 4148d2cee42468462e0e30466f74d32d6c6f2b3d (patch) | |
tree | dc27815fb44ce1b8d97c71354e81eb2c7dab4ddf /gtk2_ardour/ardour_ui_dialogs.cc | |
parent | 7e899b4199ac64f1a0c6010319221e321cadb71a (diff) |
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.
Diffstat (limited to 'gtk2_ardour/ardour_ui_dialogs.cc')
-rw-r--r-- | gtk2_ardour/ardour_ui_dialogs.cc | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/gtk2_ardour/ardour_ui_dialogs.cc b/gtk2_ardour/ardour_ui_dialogs.cc index 5fe1a261c8..dcdbb3f3b1 100644 --- a/gtk2_ardour/ardour_ui_dialogs.cc +++ b/gtk2_ardour/ardour_ui_dialogs.cc @@ -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")); |