diff --git a/src/Core/Snapshot.vala b/src/Core/Snapshot.vala index 9aee7ca..cae83d4 100644 --- a/src/Core/Snapshot.vala +++ b/src/Core/Snapshot.vala @@ -564,9 +564,11 @@ public class Snapshot : GLib.Object{ if (!file_exists(delete_trigger_file)){ file_write(delete_trigger_file, ""); + marked_for_deletion = true; + } else { + file_delete(delete_trigger_file); + marked_for_deletion = false; } - - marked_for_deletion = true; } public void parse_log_file(){ diff --git a/src/Gtk/MainWindow.vala b/src/Gtk/MainWindow.vala index 9cad8e3..7c22e14 100644 --- a/src/Gtk/MainWindow.vala +++ b/src/Gtk/MainWindow.vala @@ -616,6 +616,7 @@ class MainWindow : Gtk.Window{ var store = (Gtk.ListStore) snapshot_list_box.treeview.model; bool iterExists = store.get_iter_first (out iter); + bool marked = false; while (iterExists && is_success) { @@ -625,14 +626,19 @@ class MainWindow : Gtk.Window{ store.get (iter, 0, out bak); // mark for deletion bak.mark_for_deletion(); + // have any snapshots been marked? + marked = marked || bak.marked_for_deletion; } iterExists = store.iter_next (ref iter); } App.repo.load_snapshots(); - gtk_messagebox(_("Marked for deletion"), - _("Snapshots will be removed during the next scheduled run"), + string title = (marked ? "Marked " : "Unchecked ") + "for deletion"; + string message = (marked ? "Snapshots will " : "Snapshots will not ") + "be removed during the next scheduled run"; + + gtk_messagebox(_(title), + _(message), this, false); snapshot_list_box.refresh(); diff --git a/src/Gtk/SnapshotListBox.vala b/src/Gtk/SnapshotListBox.vala index c77052e..aa08294 100644 --- a/src/Gtk/SnapshotListBox.vala +++ b/src/Gtk/SnapshotListBox.vala @@ -326,7 +326,7 @@ class SnapshotListBox : Gtk.Box{ mi_remove = item; // mi_mark - item = new ImageMenuItem.with_label(_("Mark for Deletion")); + item = new ImageMenuItem.with_label(_("Mark/Uncheck for Deletion")); item.image = IconManager.lookup_image("edit-delete", 16); item.activate.connect(()=> { mark_selected(); }); menu_snapshots.append(item);