diff options
author | Julien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr> | 2016-07-26 07:54:19 +0200 |
---|---|---|
committer | Julien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr> | 2016-07-26 08:02:40 +0200 |
commit | c71cc6fe5b2ded2ff7dce36999e917f707b8e939 (patch) | |
tree | 60b338bb250a1ae1aad3635ac5329df1989c07c4 /gtk2_ardour | |
parent | 37dc4bd8a7039bfad6e8e6b014aace49a21f6f76 (diff) |
When showing a prefs pane, select the row in the tree
When programmatically showing a pane, instead of directly asking the
preferences notebook to show the pane, search for the asked path in the
panes tree, and select it. Since OptionEditor listens to selection
changes in its TreeView, the correct pane will be shown, with the added
benefit that the corresponding section in the tree will be highlighted
so that the user knows which pane is currently shown.
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/option_editor.cc | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/gtk2_ardour/option_editor.cc b/gtk2_ardour/option_editor.cc index 9a21e600a0..9809b05165 100644 --- a/gtk2_ardour/option_editor.cc +++ b/gtk2_ardour/option_editor.cc @@ -636,15 +636,12 @@ OptionEditor::add_page (std::string const & pn, Gtk::Widget& w) void OptionEditor::set_current_page (string const & p) { - int i = 0; - while (i < _notebook.get_n_pages ()) { - if (_notebook.get_tab_label_text (*_notebook.get_nth_page (i)) == p) { - _notebook.set_current_page (i); - return; - } + TreeModel::iterator row_iter = find_path_in_treemodel(p); - ++i; + if (row_iter) { + option_treeview.get_selection()->select(row_iter); } + } |