mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-15 19:16:40 +01:00
Ask user to confirm overwrite of a snapshot, to fix mantis 2656.
git-svn-id: svn://localhost/ardour2/branches/3.0@5057 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
a63ae4be80
commit
2cea8620b5
1 changed files with 24 additions and 1 deletions
|
|
@ -1898,11 +1898,34 @@ ARDOUR_UI::snapshot_session ()
|
|||
|
||||
switch (prompter.run()) {
|
||||
case RESPONSE_ACCEPT:
|
||||
{
|
||||
prompter.get_result (snapname);
|
||||
if (snapname.length()){
|
||||
|
||||
bool do_save = (snapname.length() != 0);
|
||||
|
||||
vector<sys::path> p;
|
||||
get_state_files_in_directory (session->session_directory().root_path(), p);
|
||||
vector<string> n = get_file_names_no_extension (p);
|
||||
if (find (n.begin(), n.end(), snapname) != n.end()) {
|
||||
|
||||
ArdourDialog confirm (_("Confirm snapshot overwrite"), true);
|
||||
Label m (_("A snapshot already exists with that name. Do you want to overwrite it?"));
|
||||
confirm.get_vbox()->pack_start (m, true, true);
|
||||
confirm.add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
|
||||
confirm.add_button (_("Overwrite"), Gtk::RESPONSE_ACCEPT);
|
||||
confirm.show_all ();
|
||||
switch (confirm.run()) {
|
||||
case RESPONSE_CANCEL:
|
||||
do_save = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (do_save) {
|
||||
std::cout << "DOING IT!" << std::endl;
|
||||
save_state (snapname);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue