summaryrefslogtreecommitdiff
path: root/gtk2_ardour/session_dialog.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2020-03-25 02:43:20 +0100
committerRobin Gareus <robin@gareus.org>2020-03-25 02:43:20 +0100
commit4d9017a1fb3d51a8f96f3655e6ed6892c2913c2f (patch)
tree80c0368d429f68169bbce457bc16363901fc4b2c /gtk2_ardour/session_dialog.cc
parent993cba5a7ccaaba69e10b8ee41aedf14c4e12b6f (diff)
Also allow scratch sessions via Session > New
Diffstat (limited to 'gtk2_ardour/session_dialog.cc')
-rw-r--r--gtk2_ardour/session_dialog.cc31
1 files changed, 21 insertions, 10 deletions
diff --git a/gtk2_ardour/session_dialog.cc b/gtk2_ardour/session_dialog.cc
index 00523d4a29..6cacbdec0f 100644
--- a/gtk2_ardour/session_dialog.cc
+++ b/gtk2_ardour/session_dialog.cc
@@ -142,6 +142,10 @@ SessionDialog::SessionDialog (bool require_new, const std::string& session_name,
}
inital_height = get_height();
inital_width = get_width();
+
+ if (require_new) {
+ setup_untitled_session ();
+ }
}
SessionDialog::SessionDialog ()
@@ -509,17 +513,8 @@ SessionDialog::new_session_button_clicked ()
get_vbox()->remove (ic_vbox);
get_vbox()->pack_start (session_new_vbox, true, true);
- time_t n;
- time (&n);
- struct tm* now = localtime (&n);
- Glib::DateTime tm (Glib::DateTime::create_now_local (mktime (now)));
-
- new_name_entry.set_text (string_compose (_("Untitled-%1"), tm.format ("%F-%H-%M-%S")));
- new_name_entry.select_region (0, -1);
- new_name_was_edited = false;
-
back_button->set_sensitive (true);
- new_name_entry.grab_focus ();
+ setup_untitled_session ();
}
bool
@@ -544,6 +539,22 @@ SessionDialog::open_button_pressed (GdkEventButton* ev)
}
void
+SessionDialog::setup_untitled_session ()
+{
+ time_t n;
+ time (&n);
+ struct tm* now = localtime (&n);
+ Glib::DateTime tm (Glib::DateTime::create_now_local (mktime (now)));
+
+ new_name_entry.set_text (string_compose (_("Untitled-%1"), tm.format ("%F-%H-%M-%S")));
+ new_name_entry.select_region (0, -1);
+ new_name_was_edited = false;
+
+ back_button->set_sensitive (true);
+ new_name_entry.grab_focus ();
+}
+
+void
SessionDialog::populate_session_templates ()
{
vector<TemplateInfo> templates;