mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 15:25:01 +01:00
Also allow scratch sessions via Session > New
This commit is contained in:
parent
993cba5a7c
commit
4d9017a1fb
2 changed files with 23 additions and 10 deletions
|
|
@ -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
|
||||
|
|
@ -543,6 +538,22 @@ SessionDialog::open_button_pressed (GdkEventButton* ev)
|
|||
return true;
|
||||
}
|
||||
|
||||
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 ()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue