Added the BSD licensed xmlformat utility for keeping the xml pretty
[ardour.git] / gtk2_ardour / new_session_dialog.cc
index 9a8bcecc42c16d20b8b8b79b32744e21c697c239..9e094c9ad041d08019a511cd80d4ad07412539ef 100644 (file)
@@ -313,7 +313,6 @@ NewSessionDialog::NewSessionDialog()
        m_treeview->set_enable_search(true);
        m_treeview->set_fixed_height_mode(false);
        m_treeview->set_hover_selection(false);
-       m_treeview->set_hover_expand(true);
        m_treeview->set_size_request(-1, 150);
        recent_scrolledwindow->set_flags(Gtk::CAN_FOCUS);
        recent_scrolledwindow->set_border_width(6);
@@ -358,17 +357,29 @@ NewSessionDialog::NewSessionDialog()
        m_treeview->get_selection()->set_mode (Gtk::SELECTION_SINGLE);
 
        std::string path = ARDOUR::get_user_ardour_path();
+       
        if (path.empty()) {
                path = ARDOUR::get_system_data_path();
        }
+
+       const char * const template_dir_name = X_("templates");
+
        if (!path.empty()) {
-               m_template->set_current_folder (path + X_("templates/"));
+               string user_template_path = path + template_dir_name;
+
+               if (Glib::file_test(user_template_path, Glib::FILE_TEST_IS_DIR))
+               {
+                       m_template->set_current_folder (user_template_path);
+               }
        }
 
-       const std::string sys_templates_dir = ARDOUR::get_system_data_path() + X_("templates");
+       const std::string sys_templates_dir = ARDOUR::get_system_data_path() + template_dir_name;
+       
        if (Glib::file_test(sys_templates_dir, Glib::FILE_TEST_IS_DIR))
+       {
                m_template->add_shortcut_folder(sys_templates_dir);
-       
+       }
+
        m_template->set_title(_("select template"));
        Gtk::FileFilter* session_filter = manage (new (Gtk::FileFilter));
        session_filter->add_pattern(X_("*.ardour"));