From aebdf5f00b22e4cecc384ebd1aff7617f6b7e703 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 18 Jul 2019 16:16:11 +0200 Subject: Fix --template commandline option This fixed an issue with incorrect ".template" suffix on path itself, and also correctly hides the dialog's template list. --- gtk2_ardour/session_dialog.cc | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'gtk2_ardour/session_dialog.cc') diff --git a/gtk2_ardour/session_dialog.cc b/gtk2_ardour/session_dialog.cc index 11b01d8948..8dcb0b5a23 100644 --- a/gtk2_ardour/session_dialog.cc +++ b/gtk2_ardour/session_dialog.cc @@ -104,6 +104,10 @@ SessionDialog::SessionDialog (bool require_new, const std::string& session_name, info_frame.set_border_width (12); get_vbox()->pack_start (info_frame, false, false); + if (!template_name.empty()) { + load_template_override = template_name; + } + setup_new_session_page (); if (!new_only) { @@ -113,10 +117,6 @@ SessionDialog::SessionDialog (bool require_new, const std::string& session_name, get_vbox()->pack_start (session_new_vbox, true, true); } - if (!template_name.empty()) { - load_template_override = template_name; - } - get_vbox()->show_all (); /* fill data models and show/hide accordingly */ @@ -285,8 +285,7 @@ std::string SessionDialog::session_template_name () { if (!load_template_override.empty()) { - string the_path (ARDOUR::user_template_directory()); - return Glib::build_filename (the_path, load_template_override + ARDOUR::template_suffix); + return Glib::build_filename (ARDOUR::user_template_directory (), load_template_override); } if (template_chooser.get_selection()->count_selected_rows() > 0) { @@ -681,7 +680,7 @@ SessionDialog::setup_new_session_page () HBox* template_hbox = manage (new HBox); //if the "template override" is provided, don't give the user any template selections (?) - if ( load_template_override.empty() ) { + if (load_template_override.empty()) { template_hbox->set_spacing (8); Gtk::ScrolledWindow *template_scroller = manage (new Gtk::ScrolledWindow()); -- cgit v1.2.3