French translation update
[ardour.git] / gtk2_ardour / option_editor.cc
index 9a21e600a0f56a4aa891650816f342301741ac2e..995f12ab48dcf2faed49b4f908f1b09c0bf1136d 100644 (file)
@@ -524,11 +524,13 @@ OptionEditor::treeview_row_selected ()
 {
        Glib::RefPtr<Gtk::TreeSelection> selection = option_treeview.get_selection();
        TreeModel::iterator iter = selection->get_selected();
-       if(iter) {
+
+       if (iter) {
                TreeModel::Row row = *iter;
                Gtk::Widget* w = row[option_columns.widget];
                if (w) {
                        _notebook.set_current_page (_notebook.page_num (*w));
+                       cerr << "OE: set current page to " << _notebook.page_num (*w) << endl;
                }
        }
 }
@@ -636,15 +638,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);
        }
+
 }
 
 
@@ -689,8 +688,7 @@ OptionEditorContainer::OptionEditorContainer (PBD::Configuration* c, string cons
        hpacker.pack_start (notebook(), true, true);
        pack_start (hpacker, true, true);
 
-       hpacker.show_all ();
-       show ();
+       show_all ();
 }
 
 OptionEditorWindow::OptionEditorWindow (PBD::Configuration* c, string const& str)