From 0465101f92e45c06009a4d94079cea2218734785 Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Sun, 21 Oct 2007 13:47:43 +0000 Subject: allow simplelists to set the timeout and the start selection. set a slightly saner default timeout talk the selected item when the list is first displayed git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15247 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/list.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'apps/gui/list.c') diff --git a/apps/gui/list.c b/apps/gui/list.c index 5c16c00aeb..2450720a13 100644 --- a/apps/gui/list.c +++ b/apps/gui/list.c @@ -1179,13 +1179,17 @@ bool simplelist_show_list(struct simplelist_info *info) gui_synclist_set_nb_items(&lists, simplelist_line_count*info->selection_size); else gui_synclist_set_nb_items(&lists, info->count*info->selection_size); - + + gui_synclist_select_item(&lists, info->start_selection); + + if (info->get_talk) + info->get_talk(gui_synclist_get_sel_pos(&lists), info->callback_data); gui_synclist_draw(&lists); while(1) { gui_syncstatusbar_draw(&statusbars, true); - action = get_action(CONTEXT_STD, HZ/100); + action = get_action(CONTEXT_STD, info->timeout); if (gui_synclist_do_button(&lists, &action, LIST_WRAP_UNLESS_HELD)) continue; if (info->action_callback) @@ -1218,6 +1222,8 @@ void simplelist_info_init(struct simplelist_info *info, char* title, info->selection_size = 1; info->hide_selection = false; info->scroll_all = false; + info->timeout = HZ/10; + info->start_selection = 0; info->action_callback = NULL; info->get_icon = NULL; info->get_name = NULL; -- cgit v1.2.3