Slightly grubby hack to fix up the state of the Window->Mixer menu item when the mixer is opened on starting Ardour (#4808).

git-svn-id: svn://localhost/ardour2/branches/3.0@12599 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2012-06-07 21:51:25 +00:00
parent 688d8cca99
commit f13119d2e1
3 changed files with 21 additions and 1 deletions

View File

@ -593,6 +593,12 @@ Mixer_UI::set_session (Session* sess)
if (_visible) {
show_window();
/* Bit of a hack; if we're here, we're opening the mixer because of our
instant XML state having a show-mixer property. Fix up the corresponding
action state.
*/
ActionManager::check_toggleaction ("<Actions>/Common/toggle-mixer");
}
start_updating ();

View File

@ -344,8 +344,20 @@ ActionManager::set_sensitive (vector<RefPtr<Action> >& actions, bool state)
}
}
void
ActionManager::check_toggleaction (string n)
{
set_toggleaction_state (n, true);
}
void
ActionManager::uncheck_toggleaction (string n)
{
set_toggleaction_state (n, false);
}
void
ActionManager::set_toggleaction_state (string n, bool s)
{
char const * name = n.c_str ();
@ -369,7 +381,7 @@ ActionManager::uncheck_toggleaction (string n)
RefPtr<Action> act = get_action (group_name, action_name);
if (act) {
RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic(act);
tact->set_active (false);
tact->set_active (s);
} else {
error << string_compose (_("Unknown action name: %1"), name) << endmsg;
}

View File

@ -86,7 +86,9 @@ namespace ActionManager {
std::vector<std::string>& tooltips,
std::vector<Gtk::AccelKey>& bindings);
extern void check_toggleaction (std::string);
extern void uncheck_toggleaction (std::string);
extern void set_toggleaction_state (std::string, bool);
};
#endif /* __libgtkmm2ext_actions_h__ */