summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2007-10-21 13:47:43 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2007-10-21 13:47:43 +0000
commit0465101f92e45c06009a4d94079cea2218734785 (patch)
treea76c9920bb7d4ed3135cf072a9d0dd097dfea9fd /apps
parentc1051549b93d1905602ba25409cbd8f4a607c3b5 (diff)
downloadrockbox-0465101f92e45c06009a4d94079cea2218734785.zip
rockbox-0465101f92e45c06009a4d94079cea2218734785.tar.gz
rockbox-0465101f92e45c06009a4d94079cea2218734785.tar.bz2
rockbox-0465101f92e45c06009a4d94079cea2218734785.tar.xz
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
Diffstat (limited to 'apps')
-rw-r--r--apps/debug_menu.c1
-rw-r--r--apps/gui/list.c10
-rw-r--r--apps/gui/list.h4
3 files changed, 13 insertions, 2 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index 81f1c58..5bb8a8b 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -1880,6 +1880,7 @@ static bool dbg_tagcache_info(void)
simplelist_info_init(&info, "Database Info", 8, NULL);
info.action_callback = database_callback;
info.hide_selection = true;
+ info.timeout = TIMEOUT_NOBLOCK;
tagcache_screensync_enable(true);
return simplelist_show_list(&info);
}
diff --git a/apps/gui/list.c b/apps/gui/list.c
index 5c16c00..2450720 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;
diff --git a/apps/gui/list.h b/apps/gui/list.h
index e6a80f4..742e30d 100644
--- a/apps/gui/list.h
+++ b/apps/gui/list.h
@@ -267,6 +267,8 @@ struct simplelist_info {
char selection_size; /* list selection size, usually 1 */
bool hide_selection;
bool scroll_all;
+ int timeout;
+ int start_selection; /* the item to select when the list is first displayed */
int (*action_callback)(int action, struct gui_synclist *lists); /* can be NULL */
/* action_callback notes:
action == the action pressed by the user
@@ -303,6 +305,8 @@ void simplelist_addline(int line_number, const char *fmt, ...);
info.get_icon = NULL;
info.get_name = NULL;
info.get_voice = NULL;
+ info.timeout = HZ/10;
+ info.start_selection = 0;
*/
void simplelist_info_init(struct simplelist_info *info, char* title,
int count, void* data);