diff options
| -rw-r--r-- | apps/gui/list.c | 5 | ||||
| -rw-r--r-- | apps/gui/list.h | 6 |
2 files changed, 7 insertions, 4 deletions
diff --git a/apps/gui/list.c b/apps/gui/list.c index 77ec090..6f0b4ed 100644 --- a/apps/gui/list.c +++ b/apps/gui/list.c @@ -876,7 +876,7 @@ bool simplelist_show_list(struct simplelist_info *info) else gui_synclist_set_nb_items(&lists, info->count*info->selection_size); - gui_synclist_select_item(&lists, info->start_selection); + gui_synclist_select_item(&lists, info->selection); gui_synclist_draw(&lists); gui_synclist_speak_item(&lists); @@ -910,6 +910,7 @@ bool simplelist_show_list(struct simplelist_info *info) else if(default_event_handler(action) == SYS_USB_CONNECTED) return true; } + info->selection = gui_synclist_get_sel_pos(&lists); talk_shutup(); return false; } @@ -923,7 +924,7 @@ void simplelist_info_init(struct simplelist_info *info, char* title, info->hide_selection = false; info->scroll_all = false; info->timeout = HZ/10; - info->start_selection = 0; + info->selection = 0; info->action_callback = NULL; info->get_icon = NULL; info->get_name = NULL; diff --git a/apps/gui/list.h b/apps/gui/list.h index 8db9c24..efbb56e 100644 --- a/apps/gui/list.h +++ b/apps/gui/list.h @@ -206,7 +206,9 @@ struct simplelist_info { bool hide_selection; bool scroll_all; int timeout; - int start_selection; /* the item to select when the list is first displayed */ + int selection; /* the item to select when the list is first displayed */ + /* when the list is exited, this will be set to the + index of the last item selected */ int (*action_callback)(int action, struct gui_synclist *lists); /* can be NULL */ /* action_callback notes: action == the action pressed by the user @@ -244,7 +246,7 @@ void simplelist_addline(int line_number, const char *fmt, ...); info.get_name = NULL; info.get_voice = NULL; info.timeout = HZ/10; - info.start_selection = 0; + info.selection = 0; */ void simplelist_info_init(struct simplelist_info *info, char* title, int count, void* data); |