From cc603c2dafae5585c0d0339675fa09bf766bcb55 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 20 Dec 2006 21:54:39 +0000 Subject: [PATCH] missing template dir patch from tim, fix extend selection to track when track is already selected git-svn-id: svn://localhost/ardour2/trunk@1237 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/editor.cc | 5 +++++ gtk2_ardour/new_session_dialog.cc | 20 ++++++++++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 37fc8ccdc7..95fa048f03 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -2871,6 +2871,11 @@ struct TrackViewByPositionSorter bool Editor::extend_selection_to_track (TimeAxisView& view) { + if (selection->selected (&view)) { + /* already selected, do nothing */ + return false; + } + if (selection->tracks.empty()) { if (!selection->selected (&view)) { diff --git a/gtk2_ardour/new_session_dialog.cc b/gtk2_ardour/new_session_dialog.cc index 4c486eaaf8..9e094c9ad0 100644 --- a/gtk2_ardour/new_session_dialog.cc +++ b/gtk2_ardour/new_session_dialog.cc @@ -357,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"); - if (Glib::file_test(sys_templates_dir, Glib::FILE_TEST_IS_DIR)) - m_template->add_shortcut_folder(sys_templates_dir); + 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"));