From 46d260a4381f88d4ac8b2dc17179db8beaee5718 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Wed, 16 Jul 2014 20:03:06 +0200 Subject: Warn when reloading with unsaved modifications Since the reload operation overwrites all changes, warn before reloading if there are unsaved modifications. Signed-off-by: Lukas Fleischer --- src/ui-todo.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/ui-todo.c') diff --git a/src/ui-todo.c b/src/ui-todo.c index 900bbfe..858596d 100644 --- a/src/ui-todo.c +++ b/src/ui-todo.c @@ -54,6 +54,7 @@ void ui_todo_add(void) } todo_add(todo_input, ch - '0', NULL); ui_todo_load_items(); + io_set_modified(); } } @@ -88,9 +89,11 @@ void ui_todo_delete(void) case 1: todo_delete(item); ui_todo_load_items(); + io_set_modified(); break; case 2: todo_delete_note(item); + io_set_modified(); break; default: wins_erase_status_bar(); @@ -109,6 +112,7 @@ void ui_todo_edit(void) status_mesg(mesg, ""); updatestring(win[STA].p, &item->mesg, 0, 1); + io_set_modified(); } /* Pipe a todo item to an external program. */ @@ -241,6 +245,7 @@ void ui_todo_chg_priority(int diff) item_new = todo_add(item->mesg, id, item->note); todo_delete(item); + io_set_modified(); listbox_set_sel(&lb_todo, todo_get_position(item_new)); } @@ -260,6 +265,7 @@ void ui_todo_flag(void) struct todo *item = todo_get_item(listbox_get_sel(&lb_todo)); todo_flag(item); + io_set_modified(); } void ui_todo_view_note(void) @@ -278,4 +284,5 @@ void ui_todo_edit_note(void) struct todo *item = todo_get_item(listbox_get_sel(&lb_todo)); todo_edit_note(item, conf.editor); + io_set_modified(); } -- cgit v1.2.3-54-g00ecf