ui-todo: Large-scale refactoring

This is a complete overhaul of the TODO list user interface. The new
implementation uses the generic list box panel.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
Lukas Fleischer
2014-05-15 14:37:49 +02:00
parent 4210fdd38a
commit 655218b7df
6 changed files with 166 additions and 244 deletions

View File

@@ -45,7 +45,7 @@ llist_t todolist;
/* Returns a structure containing the selected item. */
struct todo *todo_get_item(int item_number)
{
return LLIST_GET_DATA(LLIST_NTH(&todolist, item_number - 1));
return LLIST_GET_DATA(LLIST_NTH(&todolist, item_number));
}
static int todo_cmp_id(struct todo *a, struct todo *b)
@@ -131,9 +131,9 @@ int todo_get_position(struct todo *needle)
int n = 0;
LLIST_FOREACH(&todolist, i) {
n++;
if (LLIST_TS_GET_DATA(i) == needle)
return n;
n++;
}
EXIT(_("todo not found"));