Fix --template commandline option

This fixed an issue with incorrect ".template" suffix on path itself,
and also correctly hides the dialog's template list.
This commit is contained in:
Robin Gareus 2019-07-18 16:16:11 +02:00
parent d33423a8bd
commit aebdf5f00b
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
1 changed files with 6 additions and 7 deletions

View File

@ -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());