mirror of
https://github.com/linuxmint/timeshift.git
synced 2024-09-11 08:55:25 +03:00
Merge pull request #577 from DanielVenturini/undo_mark_delete
Undo marked to delete
This commit is contained in:
commit
04ee126ef4
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
public void parse_log_file(){
|
||||
|
@ -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();
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user