diff options
| author | Jonathan Gordon <rockbox@jdgordon.info> | 2008-09-25 07:56:34 +0000 |
|---|---|---|
| committer | Jonathan Gordon <rockbox@jdgordon.info> | 2008-09-25 07:56:34 +0000 |
| commit | 67df5f24341cb040139cf694886e6d06bdd96d70 (patch) | |
| tree | c64252e63309b8dedd2192ffcfaa6ef70c7b84df /apps/gui | |
| parent | 3a0e1cab691ea43c1b3ed5153b30b3467be874ca (diff) | |
| download | rockbox-67df5f24341cb040139cf694886e6d06bdd96d70.zip rockbox-67df5f24341cb040139cf694886e6d06bdd96d70.tar.gz rockbox-67df5f24341cb040139cf694886e6d06bdd96d70.tar.bz2 rockbox-67df5f24341cb040139cf694886e6d06bdd96d70.tar.xz | |
have the info lists set the selection before they are exited, this is sometimes needed by the caller
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18640 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui')
| -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); |