summaryrefslogtreecommitdiff
path: root/gtk2_ardour/ardour_ui_ed.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2015-07-27 17:12:35 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2016-02-22 15:31:23 -0500
commit8933d53271c902aa2ab3ef90910e2228671bd77b (patch)
tree648250f84aebfdf58fe091ee20da9453091127eb /gtk2_ardour/ardour_ui_ed.cc
parent1be30e040169863006eb37d8ee2b8ad919febfa3 (diff)
get current tab on startup correct.
Note that Gtk::Notebook will not switch to a page with an invisible widget. This took me TOO LONG to discover. Also move code around between files
Diffstat (limited to 'gtk2_ardour/ardour_ui_ed.cc')
-rw-r--r--gtk2_ardour/ardour_ui_ed.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/gtk2_ardour/ardour_ui_ed.cc b/gtk2_ardour/ardour_ui_ed.cc
index 299a5d7d69..f763b313e5 100644
--- a/gtk2_ardour/ardour_ui_ed.cc
+++ b/gtk2_ardour/ardour_ui_ed.cc
@@ -80,7 +80,6 @@ ARDOUR_UI::create_editor ()
try {
editor = new Editor ();
editor->StateChange.connect (sigc::mem_fun (*this, &ARDOUR_UI::tabbable_state_change));
- editor->add_to_notebook (_tabs, _("Editor"));
}
catch (failed_constructor& err) {
@@ -668,6 +667,18 @@ ARDOUR_UI::save_ardour_state ()
main_window_node.add_property (X_("w"), PBD::to_string (mw, std::dec));
main_window_node.add_property (X_("h"), PBD::to_string (mh, std::dec));
+ string current_tab;
+ int current_page_number = _tabs.get_current_page ();
+ if (editor && (current_page_number == _tabs.page_num (editor->contents()))) {
+ current_tab = "editor";
+ } else if (mixer && (current_page_number == _tabs.page_num (mixer->contents()))) {
+ current_tab = "mixer";
+ } else if (rc_option_editor && (current_page_number == _tabs.page_num (rc_option_editor->contents()))) {
+ current_tab == "preferences";
+ }
+
+ main_window_node.add_property (X_("current-tab"), current_tab);
+
/* Windows */
WM::Manager::instance().add_state (*window_node);