From 5d3fa897277ad087a817007a1a9b640771c86088 Mon Sep 17 00:00:00 2001 From: Ben Loftis Date: Thu, 27 Aug 2009 18:12:00 +0000 Subject: [PATCH] add shortcuts to both SYSTEM and USER templates folder. git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@5599 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/new_session_dialog.cc | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/gtk2_ardour/new_session_dialog.cc b/gtk2_ardour/new_session_dialog.cc index 023b6063ba..f7634c8458 100644 --- a/gtk2_ardour/new_session_dialog.cc +++ b/gtk2_ardour/new_session_dialog.cc @@ -399,20 +399,21 @@ NewSessionDialog::NewSessionDialog() const char * const template_dir_name = X_("templates"); - if (!path.empty()) { - 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); - } + //if SYSTEM template folder exists, add it to the file chooser + const std::string sys_templates_path = ARDOUR::get_system_data_path() + template_dir_name; +printf("system template path = %s\n", sys_templates_path.c_str()); + if (Glib::file_test(sys_templates_path, Glib::FILE_TEST_IS_DIR)) + { + m_template->add_shortcut_folder(sys_templates_path); + m_template->set_current_folder (sys_templates_path); } - 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)) + //if USER template folder exists, add it to the file chooser + const std::string user_template_path = ARDOUR::get_user_ardour_path() + template_dir_name; + if (Glib::file_test(user_template_path, Glib::FILE_TEST_IS_DIR)) { - m_template->add_shortcut_folder(sys_templates_dir); + m_template->add_shortcut_folder(user_template_path); + m_template->set_current_folder (user_template_path); } m_template->set_title(_("select template"));