From b5d96f0de28b6efa8710c5c7de71b89d894741b5 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 10 Aug 2022 03:14:08 +0200 Subject: [PATCH] Do not allow to delete the last snapshot In case a user manually renames a session-folder and snapshot it should still be impossible to delete the last snapshot even if it is not named after the session-dir. In theory this is impossible (one cannot delete the current snapshot) --- gtk2_ardour/editor_snapshots.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gtk2_ardour/editor_snapshots.cc b/gtk2_ardour/editor_snapshots.cc index 099dde8023..5320e32055 100644 --- a/gtk2_ardour/editor_snapshots.cc +++ b/gtk2_ardour/editor_snapshots.cc @@ -145,10 +145,9 @@ EditorSnapshots::popup_context_menu (int button, int32_t time, std::string snaps MenuList& items (_menu.items()); items.clear (); - const bool modification_allowed = (_session->snap_name() != snapshot_name && _session->name() != snapshot_name); + const bool modification_allowed = (_session->snap_name() != snapshot_name && _session->name() != snapshot_name && _snapshot_model->children().size () > 1); add_item_with_sensitivity (items, MenuElem (_("Remove"), sigc::bind (sigc::mem_fun (*this, &EditorSnapshots::remove), snapshot_name)), modification_allowed); - add_item_with_sensitivity (items, MenuElem (_("Rename..."), sigc::bind (sigc::mem_fun (*this, &EditorSnapshots::rename), snapshot_name)), modification_allowed); _menu.popup (button, time);