13
0

Initialize per session instant state

Per session (instant.xml) GUI options do not have a sigc::slot<> backed
configuration interface to initialize the Actions.

This fixes a first-time start issue (no instant.xml) where GUI panes
may be visible (default) while the actions are "off" (default).

This is a tentative solution, instant.xml backed ToggleAction
initialization needs to be consolidated somehow.
This commit is contained in:
Robin Gareus 2019-02-28 22:56:35 +01:00
parent 9f571b91d3
commit 00934aec0d
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 33 additions and 27 deletions

View File

@ -2448,13 +2448,13 @@ Editor::set_state (const XMLNode& node, int version)
reset_y_origin (y_origin);
}
if (node.get_property ("join-object-range", yn)) {
RefPtr<Action> act = ActionManager::get_action (X_("MouseMode"), X_("set-mouse-mode-object-range"));
if (act) {
RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic(act);
tact->set_active (!yn);
tact->set_active (yn);
}
yn = false;
node.get_property ("join-object-range", yn);
{
RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (X_("MouseMode"), X_("set-mouse-mode-object-range"));
/* do it twice to force the change */
tact->set_active (!yn);
tact->set_active (yn);
set_mouse_mode(mouse_mode, true);
}
@ -2478,22 +2478,20 @@ Editor::set_state (const XMLNode& node, int version)
_regions->reset_sort_type (sort_type, true);
}
if (node.get_property ("show-editor-mixer", yn)) {
yn = false;
node.get_property ("show-editor-mixer", yn);
{
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (X_("Editor"), X_("show-editor-mixer"));
/* do it twice to force the change */
tact->set_active (!yn);
tact->set_active (yn);
}
if (node.get_property ("show-editor-list", yn)) {
yn = false;
node.get_property ("show-editor-list", yn);
{
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (X_("Editor"), X_("show-editor-list"));
/* do it twice to force the change */
tact->set_active (!yn);
tact->set_active (yn);
}
@ -2503,11 +2501,11 @@ Editor::set_state (const XMLNode& node, int version)
_the_notebook.set_current_page (el_page);
}
if (node.get_property (X_("show-marker-lines"), yn)) {
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("show-marker-lines"));
assert (act);
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
yn = false;
node.get_property (X_("show-marker-lines"), yn);
{
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (X_("Editor"), X_("show-marker-lines"));
/* do it twice to force the change */
tact->set_active (!yn);
tact->set_active (yn);
}

View File

@ -2192,7 +2192,9 @@ Mixer_UI::set_state (const XMLNode& node, int version)
node.get_property ("show-mixer", _visible);
if (node.get_property ("maximised", yn)) {
yn = false;
node.get_property ("maximised", yn);
{
Glib::RefPtr<ToggleAction> act = ActionManager::get_toggle_action (X_("Common"), X_("ToggleMaximalMixer"));
bool fs = act && act->get_active();
if (yn ^ fs) {
@ -2200,22 +2202,27 @@ Mixer_UI::set_state (const XMLNode& node, int version)
}
}
if (node.get_property ("show-mixer-list", yn)) {
yn = true;
node.get_property ("show-mixer-list", yn);
{
Glib::RefPtr<ToggleAction> act = ActionManager::get_toggle_action (X_("Mixer"), X_("ToggleMixerList"));
/* do it twice to force the change */
act->set_active (!yn);
act->set_active (yn);
}
if (node.get_property ("monitor-section-visible", yn)) {
yn = true;
node.get_property ("monitor-section-visible", yn);
{
Glib::RefPtr<ToggleAction> act = ActionManager::get_toggle_action (X_("Mixer"), X_("ToggleMonitorSection"));
/* do it twice to force the change */
act->set_active (!yn);
act->set_active (yn);
}
if (node.get_property ("show-vca-pane", yn)) {
yn = true;
node.get_property ("show-vca-pane", yn);
{
Glib::RefPtr<ToggleAction> act = ActionManager::get_toggle_action (X_("Mixer"), X_("ToggleVCAPane"));
/* do it twice to force the change */
act->set_active (!yn);
@ -2223,13 +2230,14 @@ Mixer_UI::set_state (const XMLNode& node, int version)
}
#ifdef MIXBUS
if (node.get_property ("show-mixbus-pane", yn)) {
yn = true;
node.get_property ("show-mixbus-pane", yn);
{
Glib::RefPtr<ToggleAction> act = ActionManager::get_toggle_action (X_("Mixer"), X_("ToggleMixbusPane"));
/* do it twice to force the change */
act->set_active (!yn);
act->set_active (yn);
}
#endif
//check for the user's plugin_order file