13
0

when saving an unnamed session, rename it (GUI edition)

Note that this is done at the GUI level, might need to double check if there are
other paths into a "save" that should be covered. Control surfaces use the action, but
Lua comes to mind
This commit is contained in:
Paul Davis 2020-03-24 14:10:26 -06:00
parent 5f1d802307
commit 97340a5c89
4 changed files with 14 additions and 5 deletions

View File

@ -2024,6 +2024,10 @@ ARDOUR_UI::save_state (const string & name, bool switch_to_it)
return;
}
if (_session->unnamed()) {
rename_session (true);
}
XMLNode* node = new XMLNode (X_("UI"));
WM::Manager::instance().add_state (*node);

View File

@ -684,7 +684,7 @@ private:
bool save_as_progress_update (float fraction, int64_t cnt, int64_t total, Gtk::Label* label, Gtk::ProgressBar* bar);
void save_session_as ();
void archive_session ();
void rename_session ();
void rename_session (bool for_unnamed);
int create_mixer ();
int create_editor ();

View File

@ -225,7 +225,7 @@ ARDOUR_UI::install_actions ()
act = ActionManager::register_action (main_actions, X_("Archive"), _("Archive..."), sigc::mem_fun(*this, &ARDOUR_UI::archive_session));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (main_actions, X_("Rename"), _("Rename..."), sigc::mem_fun(*this, &ARDOUR_UI::rename_session));
act = ActionManager::register_action (main_actions, X_("Rename"), _("Rename..."), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::rename_session), false));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::write_sensitive_actions.push_back (act);

View File

@ -763,7 +763,7 @@ If you still wish to proceed, please use the\n\n\
*/
void
ARDOUR_UI::rename_session ()
ARDOUR_UI::rename_session (bool for_unnamed)
{
if (!_session) {
return;
@ -774,8 +774,13 @@ ARDOUR_UI::rename_session ()
prompter.set_name ("Prompter");
prompter.add_button (Gtk::Stock::SAVE, Gtk::RESPONSE_ACCEPT);
prompter.set_title (_("Rename Session"));
prompter.set_prompt (_("New session name"));
if (for_unnamed) {
prompter.set_title (_("Name Session"));
prompter.set_prompt (_("Session name"));
} else {
prompter.set_title (_("Rename Session"));
prompter.set_prompt (_("New session name"));
}
again:
switch (prompter.run()) {