summaryrefslogtreecommitdiff
path: root/gtk2_ardour/session_dialog.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2019-07-18 16:16:11 +0200
committerRobin Gareus <robin@gareus.org>2019-07-18 16:16:11 +0200
commitaebdf5f00b22e4cecc384ebd1aff7617f6b7e703 (patch)
tree5b731f8656d6f02109c1d637e13efb0b980d3f9b /gtk2_ardour/session_dialog.cc
parentd33423a8bdc3ad318fbe89e106f2a8bd73c138f8 (diff)
Fix --template commandline option
This fixed an issue with incorrect ".template" suffix on path itself, and also correctly hides the dialog's template list.
Diffstat (limited to 'gtk2_ardour/session_dialog.cc')
-rw-r--r--gtk2_ardour/session_dialog.cc13
1 files changed, 6 insertions, 7 deletions
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());