summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2014-07-09 00:31:57 +0200
committerLukas Fleischer <calcurse@cryptocrack.de>2014-07-09 00:33:01 +0200
commitcac973fee3d828fac641f6de771054a32cfbbfe3 (patch)
tree92b54735e60543d6541a7f6720d866cfc9226f5c
parent00ceca6000f4f9f160e3bb43e1771657b5cee4bf (diff)
downloadcalcurse-cac973fee3d828fac641f6de771054a32cfbbfe3.zip
Load todo items on startup
Reload (and show) items into the list box after reading data files. Reported-by: BARE Willy sprl <barewillysprl@euphonynet.be> Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
-rw-r--r--src/calcurse.c2
-rw-r--r--src/calcurse.h1
-rw-r--r--src/ui-todo.c5
3 files changed, 8 insertions, 0 deletions
diff --git a/src/calcurse.c b/src/calcurse.c
index 95a6dea..b128dbd 100644
--- a/src/calcurse.c
+++ b/src/calcurse.c
@@ -600,6 +600,8 @@ int main(int argc, char **argv)
io_startup_screen(no_data_file);
}
do_storage(1);
+ ui_todo_load_items();
+ ui_todo_sel_reset();
wins_slctd_set(conf.default_panel);
wins_update(FLAG_ALL);
diff --git a/src/calcurse.h b/src/calcurse.h
index 3c4bcb0..6112ede 100644
--- a/src/calcurse.h
+++ b/src/calcurse.h
@@ -979,6 +979,7 @@ void ui_todo_draw(int, WINDOW *, int, int, void *);
enum listbox_row_type ui_todo_row_type(int, void *);
int ui_todo_height(int, void *);
void ui_todo_load_items(void);
+void ui_todo_sel_reset(void);
void ui_todo_sel_move(int);
void ui_todo_update_panel(int);
void ui_todo_chg_priority(int);
diff --git a/src/ui-todo.c b/src/ui-todo.c
index 8daf283..49cf371 100644
--- a/src/ui-todo.c
+++ b/src/ui-todo.c
@@ -199,6 +199,11 @@ void ui_todo_load_items(void)
listbox_load_items(&lb_todo, n);
}
+void ui_todo_sel_reset(void)
+{
+ listbox_sel_move(&lb_todo, 0);
+}
+
void ui_todo_sel_move(int delta)
{
listbox_sel_move(&lb_todo, delta);