summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2019-02-28 22:56:35 +0100
committerRobin Gareus <robin@gareus.org>2019-02-28 23:54:13 +0100
commit00934aec0db8c9fbf0361cdbc4472ae909f1212d (patch)
treeec76385bc2abf8771eeacdd8386d9b5c282101ba /gtk2_ardour/editor.cc
parent9f571b91d34aef559ce8a73c4dbda7a9a094f53d (diff)
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.
Diffstat (limited to 'gtk2_ardour/editor.cc')
-rw-r--r--gtk2_ardour/editor.cc38
1 files changed, 18 insertions, 20 deletions
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc
index b8eb79a8f3..e28a5f826a 100644
--- a/gtk2_ardour/editor.cc
+++ b/gtk2_ardour/editor.cc
@@ -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);
}