minor safety fix for the Pane
[ardour.git] / gtk2_ardour / option_editor.cc
index 56cb4ca1d790b960292a04a9f2b1c2c72bf1df07..f19babaae46b37ae126b58d328be77bfa15a9c83 100644 (file)
@@ -1,19 +1,19 @@
 /*
-    Copyright (C) 2001-2009 Paul Davis
+  Copyright (C) 2001-2009 Paul Davis
 
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 2 of the License, or
+  (at your option) any later version.
 
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
 
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+  You should have received a copy of the GNU General Public License
+  along with this program; if not, write to the Free Software
+  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
 */
 #include <algorithm>
@@ -36,7 +36,7 @@
 #include "option_editor.h"
 #include "public_editor.h"
 #include "utils.h"
-#include "i18n.h"
+#include "pbd/i18n.h"
 
 using namespace std;
 using namespace Gtk;
@@ -470,7 +470,7 @@ OptionEditorPage::OptionEditorPage (Gtk::Notebook& n, std::string const & t)
  *  @param o Configuration to edit.
  *  @param t Title for the dialog.
  */
-OptionEditor::OptionEditor (PBD::Configuration* c, std::string const & t)
+OptionEditor::OptionEditor (PBD::Configuration* c)
        : _config (c)
        , option_tree (TreeStore::create (option_columns))
        , option_treeview (option_tree)
@@ -485,6 +485,7 @@ OptionEditor::OptionEditor (PBD::Configuration* c, std::string const & t)
        option_treeview.set_enable_search(true);
        option_treeview.set_search_column(0);
        option_treeview.set_name ("OptionsTreeView");
+       option_treeview.set_headers_visible (false);
 
        option_treeview.get_selection()->set_mode (Gtk::SELECTION_SINGLE);
        option_treeview.get_selection()->signal_changed().connect (sigc::mem_fun (*this, &OptionEditor::treeview_row_selected));
@@ -563,7 +564,7 @@ OptionEditor::add_path_to_treeview (std::string const & pn, Gtk::Widget& widget)
 
                /* foreach path component ... */
 
-               for (std::vector<std::string>::const_iterator s = components.begin(); s != components.end(); ++s) {
+               for (std::vector<std::string>::const_iterator s = components.begin(); s != components.end(); ) {
 
                        bool component_found = false;
 
@@ -627,6 +628,7 @@ OptionEditor::add_path_to_treeview (std::string const & pn, Gtk::Widget& widget)
        }
 
        option_treeview.set_model (option_tree);
+       option_treeview.expand_all ();
 }
 
 /** Add a component to a given page.
@@ -716,7 +718,7 @@ DirectoryOption::selection_changed ()
 /*--------------------------*/
 
 OptionEditorContainer::OptionEditorContainer (PBD::Configuration* c, string const& str)
-       : OptionEditor (c, str)
+       : OptionEditor (c)
 {
        set_border_width (4);
        hpacker.pack_start (treeview(), false, false);
@@ -728,7 +730,8 @@ OptionEditorContainer::OptionEditorContainer (PBD::Configuration* c, string cons
 }
 
 OptionEditorWindow::OptionEditorWindow (PBD::Configuration* c, string const& str)
-       : OptionEditor (c, str)
+       : OptionEditor (c)
+       , ArdourWindow (str)
 {
        container.set_border_width (4);
        hpacker.pack_start (treeview(), false, false);