summaryrefslogtreecommitdiff
path: root/src/ui-todo.c
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@calcurse.org>2016-01-18 18:09:23 +0100
committerLukas Fleischer <lfleischer@calcurse.org>2016-01-18 18:09:23 +0100
commit1b75acf01b2f5a8d828aca3376022e156f1444ff (patch)
tree49a5481d8322fa50cfc9a480c2ee3da307bdc89f /src/ui-todo.c
parente3ac5542aa1be85ae1116eea44142f85c80b4a34 (diff)
downloadcalcurse-1b75acf01b2f5a8d828aca3376022e156f1444ff.zip
Save active view on the todo panel
Add a configuration option appearance.todoview and use it to automatically save the currently active todo panel view and restore it when restarting calcurse. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
Diffstat (limited to 'src/ui-todo.c')
-rw-r--r--src/ui-todo.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/ui-todo.c b/src/ui-todo.c
index de19272..971c69d 100644
--- a/src/ui-todo.c
+++ b/src/ui-todo.c
@@ -327,3 +327,14 @@ void ui_todo_view_prev(void)
ui_todo_view--;
ui_todo_load_items();
}
+
+void ui_todo_set_view(int view)
+{
+ ui_todo_view = (view < 0 || view >= TODO_VIEWS) ?
+ TODO_SHOW_COMPLETED_VIEW : view;
+}
+
+int ui_todo_get_view(void)
+{
+ return (int)ui_todo_view;
+}