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 | |
parent | 3a0e1cab691ea43c1b3ed5153b30b3467be874ca (diff) | |
download | rockbox-67df5f24341cb040139cf694886e6d06bdd96d70.tar.gz rockbox-67df5f24341cb040139cf694886e6d06bdd96d70.zip |
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
-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 77ec090b04..6f0b4ed19c 100644 --- a/apps/gui/list.c +++ b/apps/gui/list.c | |||
@@ -876,7 +876,7 @@ bool simplelist_show_list(struct simplelist_info *info) | |||
876 | else | 876 | else |
877 | gui_synclist_set_nb_items(&lists, info->count*info->selection_size); | 877 | gui_synclist_set_nb_items(&lists, info->count*info->selection_size); |
878 | 878 | ||
879 | gui_synclist_select_item(&lists, info->start_selection); | 879 | gui_synclist_select_item(&lists, info->selection); |
880 | 880 | ||
881 | gui_synclist_draw(&lists); | 881 | gui_synclist_draw(&lists); |
882 | gui_synclist_speak_item(&lists); | 882 | gui_synclist_speak_item(&lists); |
@@ -910,6 +910,7 @@ bool simplelist_show_list(struct simplelist_info *info) | |||
910 | else if(default_event_handler(action) == SYS_USB_CONNECTED) | 910 | else if(default_event_handler(action) == SYS_USB_CONNECTED) |
911 | return true; | 911 | return true; |
912 | } | 912 | } |
913 | info->selection = gui_synclist_get_sel_pos(&lists); | ||
913 | talk_shutup(); | 914 | talk_shutup(); |
914 | return false; | 915 | return false; |
915 | } | 916 | } |
@@ -923,7 +924,7 @@ void simplelist_info_init(struct simplelist_info *info, char* title, | |||
923 | info->hide_selection = false; | 924 | info->hide_selection = false; |
924 | info->scroll_all = false; | 925 | info->scroll_all = false; |
925 | info->timeout = HZ/10; | 926 | info->timeout = HZ/10; |
926 | info->start_selection = 0; | 927 | info->selection = 0; |
927 | info->action_callback = NULL; | 928 | info->action_callback = NULL; |
928 | info->get_icon = NULL; | 929 | info->get_icon = NULL; |
929 | info->get_name = NULL; | 930 | info->get_name = NULL; |
diff --git a/apps/gui/list.h b/apps/gui/list.h index 8db9c24d48..efbb56ea5f 100644 --- a/apps/gui/list.h +++ b/apps/gui/list.h | |||
@@ -206,7 +206,9 @@ struct simplelist_info { | |||
206 | bool hide_selection; | 206 | bool hide_selection; |
207 | bool scroll_all; | 207 | bool scroll_all; |
208 | int timeout; | 208 | int timeout; |
209 | int start_selection; /* the item to select when the list is first displayed */ | 209 | int selection; /* the item to select when the list is first displayed */ |
210 | /* when the list is exited, this will be set to the | ||
211 | index of the last item selected */ | ||
210 | int (*action_callback)(int action, struct gui_synclist *lists); /* can be NULL */ | 212 | int (*action_callback)(int action, struct gui_synclist *lists); /* can be NULL */ |
211 | /* action_callback notes: | 213 | /* action_callback notes: |
212 | action == the action pressed by the user | 214 | action == the action pressed by the user |
@@ -244,7 +246,7 @@ void simplelist_addline(int line_number, const char *fmt, ...); | |||
244 | info.get_name = NULL; | 246 | info.get_name = NULL; |
245 | info.get_voice = NULL; | 247 | info.get_voice = NULL; |
246 | info.timeout = HZ/10; | 248 | info.timeout = HZ/10; |
247 | info.start_selection = 0; | 249 | info.selection = 0; |
248 | */ | 250 | */ |
249 | void simplelist_info_init(struct simplelist_info *info, char* title, | 251 | void simplelist_info_init(struct simplelist_info *info, char* title, |
250 | int count, void* data); | 252 | int count, void* data); |