From 78cf1ed1194e54348f23ea66ed5d7cc693b2a65d Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 23 Mar 2020 22:40:13 -0600 Subject: [PATCH] prefill new session name with a date-based default Select it, so that typing will immediately replace it --- gtk2_ardour/session_dialog.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gtk2_ardour/session_dialog.cc b/gtk2_ardour/session_dialog.cc index 66a73c64e1..42c2182093 100644 --- a/gtk2_ardour/session_dialog.cc +++ b/gtk2_ardour/session_dialog.cc @@ -507,6 +507,15 @@ 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); + back_button->set_sensitive (true); new_name_entry.grab_focus (); }