aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui-todo.c
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2014-07-16 20:03:06 +0200
committerLukas Fleischer <calcurse@cryptocrack.de>2014-07-16 20:05:21 +0200
commit46d260a4381f88d4ac8b2dc17179db8beaee5718 (patch)
tree88ff173f79f7bb84545273f315b48a0b14322a3f /src/ui-todo.c
parentb36d253dce737a188bff85891fc5b4c4341f6564 (diff)
downloadcalcurse-46d260a4381f88d4ac8b2dc17179db8beaee5718.tar.gz
calcurse-46d260a4381f88d4ac8b2dc17179db8beaee5718.zip
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 <calcurse@cryptocrack.de>
Diffstat (limited to 'src/ui-todo.c')
-rw-r--r--src/ui-todo.c7
1 files changed, 7 insertions, 0 deletions
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();
}