diff options
-rw-r--r-- | apps/bookmark.c | 3 | ||||
-rw-r--r-- | apps/cuesheet.c | 2 | ||||
-rw-r--r-- | apps/gui/list.c | 39 | ||||
-rw-r--r-- | apps/gui/list.h | 13 | ||||
-rw-r--r-- | apps/gui/option_select.c | 8 | ||||
-rw-r--r-- | apps/menu.c | 2 | ||||
-rw-r--r-- | apps/onplay.c | 3 | ||||
-rw-r--r-- | apps/playlist_viewer.c | 6 | ||||
-rw-r--r-- | apps/plugin.h | 7 | ||||
-rw-r--r-- | apps/plugins/calendar.c | 2 | ||||
-rw-r--r-- | apps/plugins/chessbox/chessbox_pgn.c | 3 | ||||
-rw-r--r-- | apps/plugins/keybox.c | 2 | ||||
-rw-r--r-- | apps/plugins/keyremap.c | 2 | ||||
-rw-r--r-- | apps/plugins/lrcplayer.c | 3 | ||||
-rw-r--r-- | apps/plugins/main_menu_config.c | 2 | ||||
-rw-r--r-- | apps/plugins/open_plugins.c | 4 | ||||
-rw-r--r-- | apps/plugins/properties.c | 2 | ||||
-rw-r--r-- | apps/plugins/puzzles/rockbox.c | 6 | ||||
-rw-r--r-- | apps/plugins/random_folder_advance_config.c | 2 | ||||
-rw-r--r-- | apps/plugins/rb_info.c | 2 | ||||
-rw-r--r-- | apps/plugins/shopper.c | 2 | ||||
-rw-r--r-- | apps/plugins/shortcuts/shortcuts_view.c | 7 | ||||
-rw-r--r-- | apps/plugins/text_editor.c | 2 | ||||
-rw-r--r-- | apps/radio/presets.c | 3 | ||||
-rw-r--r-- | apps/recorder/recording.c | 2 | ||||
-rw-r--r-- | apps/screens.c | 6 | ||||
-rw-r--r-- | apps/tree.c | 2 | ||||
-rw-r--r-- | docs/PLUGIN_API | 2 |
28 files changed, 53 insertions, 86 deletions
diff --git a/apps/bookmark.c b/apps/bookmark.c index 70dbd8075d..d594c51320 100644 --- a/apps/bookmark.c +++ b/apps/bookmark.c | |||
@@ -793,8 +793,7 @@ static int select_bookmark(const char* bookmark_file_name, bool show_dont_resume | |||
793 | refresh = false; | 793 | refresh = false; |
794 | } | 794 | } |
795 | 795 | ||
796 | list_do_action(CONTEXT_BOOKMARKSCREEN, HZ / 2, | 796 | list_do_action(CONTEXT_BOOKMARKSCREEN, HZ / 2, &list, &action); |
797 | &list, &action, LIST_WRAP_UNLESS_HELD); | ||
798 | item = gui_synclist_get_sel_pos(&list) / 2; | 797 | item = gui_synclist_get_sel_pos(&list) / 2; |
799 | 798 | ||
800 | if (bookmarks->show_dont_resume) | 799 | if (bookmarks->show_dont_resume) |
diff --git a/apps/cuesheet.c b/apps/cuesheet.c index 98040f9992..236d250c69 100644 --- a/apps/cuesheet.c +++ b/apps/cuesheet.c | |||
@@ -481,7 +481,7 @@ void browse_cuesheet(struct cuesheet *cue) | |||
481 | { | 481 | { |
482 | gui_synclist_draw(&lists); | 482 | gui_synclist_draw(&lists); |
483 | action = get_action(CONTEXT_LIST,TIMEOUT_BLOCK); | 483 | action = get_action(CONTEXT_LIST,TIMEOUT_BLOCK); |
484 | if (gui_synclist_do_button(&lists, &action, LIST_WRAP_UNLESS_HELD)) | 484 | if (gui_synclist_do_button(&lists, &action)) |
485 | continue; | 485 | continue; |
486 | switch (action) | 486 | switch (action) |
487 | { | 487 | { |
diff --git a/apps/gui/list.c b/apps/gui/list.c index 713942af18..85404b7f0c 100644 --- a/apps/gui/list.c +++ b/apps/gui/list.c | |||
@@ -595,8 +595,7 @@ static void _lists_uiviewport_update_callback(unsigned short id, void *data) | |||
595 | gui_synclist_draw(current_lists); | 595 | gui_synclist_draw(current_lists); |
596 | } | 596 | } |
597 | 597 | ||
598 | bool gui_synclist_do_button(struct gui_synclist * lists, | 598 | bool gui_synclist_do_button(struct gui_synclist * lists, int *actionptr) |
599 | int *actionptr, enum list_wrap wrap) | ||
600 | { | 599 | { |
601 | int action = *actionptr; | 600 | int action = *actionptr; |
602 | static bool pgleft_allow_cancel = false; | 601 | static bool pgleft_allow_cancel = false; |
@@ -642,24 +641,15 @@ bool gui_synclist_do_button(struct gui_synclist * lists, | |||
642 | 641 | ||
643 | /* Disable the skin redraw callback */ | 642 | /* Disable the skin redraw callback */ |
644 | current_lists = NULL; | 643 | current_lists = NULL; |
645 | switch (wrap) | 644 | |
646 | { | 645 | /* Prevent list wraparound by repeating actions */ |
647 | case LIST_WRAP_ON: | 646 | if (action == ACTION_STD_PREVREPEAT || |
648 | lists->limit_scroll = !lists->wraparound; | 647 | action == ACTION_STD_NEXTREPEAT || |
649 | break; | 648 | action == ACTION_LISTTREE_PGUP || |
650 | case LIST_WRAP_OFF: | 649 | action == ACTION_LISTTREE_PGDOWN) |
651 | lists->limit_scroll = true; | 650 | lists->limit_scroll = true; |
652 | break; | 651 | else |
653 | case LIST_WRAP_UNLESS_HELD: | 652 | lists->limit_scroll = !lists->wraparound; |
654 | if (action == ACTION_STD_PREVREPEAT || | ||
655 | action == ACTION_STD_NEXTREPEAT || | ||
656 | action == ACTION_LISTTREE_PGUP || | ||
657 | action == ACTION_LISTTREE_PGDOWN) | ||
658 | lists->limit_scroll = true; | ||
659 | else | ||
660 | lists->limit_scroll = !lists->wraparound; | ||
661 | break; | ||
662 | }; | ||
663 | 653 | ||
664 | switch (action) | 654 | switch (action) |
665 | { | 655 | { |
@@ -795,8 +785,7 @@ int list_do_action_timeout(struct gui_synclist *lists, int timeout) | |||
795 | } | 785 | } |
796 | 786 | ||
797 | bool list_do_action(int context, int timeout, | 787 | bool list_do_action(int context, int timeout, |
798 | struct gui_synclist *lists, int *action, | 788 | struct gui_synclist *lists, int *action) |
799 | enum list_wrap wrap) | ||
800 | /* Combines the get_action() (with possibly overridden timeout) and | 789 | /* Combines the get_action() (with possibly overridden timeout) and |
801 | gui_synclist_do_button() calls. Returns the list action from | 790 | gui_synclist_do_button() calls. Returns the list action from |
802 | do_button, and places the action from get_action in *action. */ | 791 | do_button, and places the action from get_action in *action. */ |
@@ -804,7 +793,7 @@ bool list_do_action(int context, int timeout, | |||
804 | timeout = list_do_action_timeout(lists, timeout); | 793 | timeout = list_do_action_timeout(lists, timeout); |
805 | keyclick_set_callback(gui_synclist_keyclick_callback, lists); | 794 | keyclick_set_callback(gui_synclist_keyclick_callback, lists); |
806 | *action = get_action(context, timeout); | 795 | *action = get_action(context, timeout); |
807 | return gui_synclist_do_button(lists, action, wrap); | 796 | return gui_synclist_do_button(lists, action); |
808 | } | 797 | } |
809 | 798 | ||
810 | bool gui_synclist_item_is_onscreen(struct gui_synclist *lists, | 799 | bool gui_synclist_item_is_onscreen(struct gui_synclist *lists, |
@@ -871,7 +860,6 @@ bool simplelist_show_list(struct simplelist_info *info) | |||
871 | struct gui_synclist lists; | 860 | struct gui_synclist lists; |
872 | int action, old_line_count = simplelist_line_count; | 861 | int action, old_line_count = simplelist_line_count; |
873 | list_get_name *getname; | 862 | list_get_name *getname; |
874 | int wrap = global_settings.list_wraparound ? LIST_WRAP_UNLESS_HELD : LIST_WRAP_OFF; | ||
875 | if (info->get_name) | 863 | if (info->get_name) |
876 | getname = info->get_name; | 864 | getname = info->get_name; |
877 | else | 865 | else |
@@ -914,8 +902,7 @@ bool simplelist_show_list(struct simplelist_info *info) | |||
914 | 902 | ||
915 | while(1) | 903 | while(1) |
916 | { | 904 | { |
917 | list_do_action(CONTEXT_LIST, info->timeout, | 905 | list_do_action(CONTEXT_LIST, info->timeout, &lists, &action); |
918 | &lists, &action, wrap); | ||
919 | 906 | ||
920 | /* We must yield in this case or no other thread can run */ | 907 | /* We must yield in this case or no other thread can run */ |
921 | if (info->timeout == TIMEOUT_NOBLOCK) | 908 | if (info->timeout == TIMEOUT_NOBLOCK) |
diff --git a/apps/gui/list.h b/apps/gui/list.h index 20410471a2..19f0ccbbff 100644 --- a/apps/gui/list.h +++ b/apps/gui/list.h | |||
@@ -30,12 +30,6 @@ | |||
30 | 30 | ||
31 | #define SCROLLBAR_WIDTH global_settings.scrollbar_width | 31 | #define SCROLLBAR_WIDTH global_settings.scrollbar_width |
32 | 32 | ||
33 | enum list_wrap { | ||
34 | LIST_WRAP_ON = 0, | ||
35 | LIST_WRAP_OFF, | ||
36 | LIST_WRAP_UNLESS_HELD, | ||
37 | }; | ||
38 | |||
39 | enum synclist_cursor | 33 | enum synclist_cursor |
40 | { | 34 | { |
41 | SYNCLIST_CURSOR_NOSTYLE = 0, | 35 | SYNCLIST_CURSOR_NOSTYLE = 0, |
@@ -238,9 +232,7 @@ extern bool gui_synclist_keyclick_callback(int action, void* data); | |||
238 | * returns true if the action was handled. | 232 | * returns true if the action was handled. |
239 | * NOTE: *action may be changed regardless of return value | 233 | * NOTE: *action may be changed regardless of return value |
240 | */ | 234 | */ |
241 | extern bool gui_synclist_do_button(struct gui_synclist * lists, | 235 | extern bool gui_synclist_do_button(struct gui_synclist * lists, int *action); |
242 | int *action, | ||
243 | enum list_wrap); | ||
244 | #if !defined(PLUGIN) | 236 | #if !defined(PLUGIN) |
245 | struct listitem_viewport_cfg { | 237 | struct listitem_viewport_cfg { |
246 | struct wps_data *data; | 238 | struct wps_data *data; |
@@ -283,8 +275,7 @@ extern int list_do_action_timeout(struct gui_synclist *lists, int timeout); | |||
283 | list_do_action_timeout) with the gui_synclist_do_button call, for | 275 | list_do_action_timeout) with the gui_synclist_do_button call, for |
284 | convenience. */ | 276 | convenience. */ |
285 | extern bool list_do_action(int context, int timeout, | 277 | extern bool list_do_action(int context, int timeout, |
286 | struct gui_synclist *lists, int *action, | 278 | struct gui_synclist *lists, int *action); |
287 | enum list_wrap wrap); | ||
288 | 279 | ||
289 | 280 | ||
290 | /** Simplelist implementation. | 281 | /** Simplelist implementation. |
diff --git a/apps/gui/option_select.c b/apps/gui/option_select.c index 3f110ce526..e154467428 100644 --- a/apps/gui/option_select.c +++ b/apps/gui/option_select.c | |||
@@ -511,9 +511,13 @@ bool option_screen(const struct settings_list *setting, | |||
511 | gui_synclist_speak_item(&lists); | 511 | gui_synclist_speak_item(&lists); |
512 | while (!done) | 512 | while (!done) |
513 | { | 513 | { |
514 | /* override user wraparound setting; used mainly by EQ settings. | ||
515 | * Not sure this is justified? */ | ||
516 | if (!allow_wrap) | ||
517 | lists.wraparound = false; | ||
518 | |||
514 | if (list_do_action(CONTEXT_LIST, HZ, /* HZ so the status bar redraws */ | 519 | if (list_do_action(CONTEXT_LIST, HZ, /* HZ so the status bar redraws */ |
515 | &lists, &action, | 520 | &lists, &action)) |
516 | allow_wrap? LIST_WRAP_UNLESS_HELD: LIST_WRAP_OFF)) | ||
517 | { | 521 | { |
518 | /* setting changed */ | 522 | /* setting changed */ |
519 | selected = gui_synclist_get_sel_pos(&lists); | 523 | selected = gui_synclist_get_sel_pos(&lists); |
diff --git a/apps/menu.c b/apps/menu.c index fd3c041e36..85dac8a214 100644 --- a/apps/menu.c +++ b/apps/menu.c | |||
@@ -450,7 +450,7 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected, | |||
450 | action = new_action; | 450 | action = new_action; |
451 | } | 451 | } |
452 | 452 | ||
453 | if (LIKELY(gui_synclist_do_button(&lists, &action, LIST_WRAP_UNLESS_HELD))) | 453 | if (LIKELY(gui_synclist_do_button(&lists, &action))) |
454 | continue; | 454 | continue; |
455 | #ifdef HAVE_QUICKSCREEN | 455 | #ifdef HAVE_QUICKSCREEN |
456 | else if (action == ACTION_STD_QUICKSCREEN) | 456 | else if (action == ACTION_STD_QUICKSCREEN) |
diff --git a/apps/onplay.c b/apps/onplay.c index e44e81ee5d..e4e2a7b3b8 100644 --- a/apps/onplay.c +++ b/apps/onplay.c | |||
@@ -429,8 +429,7 @@ static bool playing_time(void) | |||
429 | gui_synclist_draw(&pt_lists); | 429 | gui_synclist_draw(&pt_lists); |
430 | gui_synclist_speak_item(&pt_lists); | 430 | gui_synclist_speak_item(&pt_lists); |
431 | while (true) { | 431 | while (true) { |
432 | if (list_do_action(CONTEXT_LIST, HZ/2, | 432 | if (list_do_action(CONTEXT_LIST, HZ/2, &pt_lists, &key) == 0 |
433 | &pt_lists, &key, LIST_WRAP_UNLESS_HELD) == 0 | ||
434 | && key!=ACTION_NONE && key!=ACTION_UNKNOWN) | 433 | && key!=ACTION_NONE && key!=ACTION_UNKNOWN) |
435 | { | 434 | { |
436 | talk_force_shutup(); | 435 | talk_force_shutup(); |
diff --git a/apps/playlist_viewer.c b/apps/playlist_viewer.c index 2f23d87c2b..d2774e67b0 100644 --- a/apps/playlist_viewer.c +++ b/apps/playlist_viewer.c | |||
@@ -844,8 +844,7 @@ enum playlist_viewer_result playlist_viewer_ex(const char* filename) | |||
844 | } | 844 | } |
845 | 845 | ||
846 | /* Timeout so we can determine if play status has changed */ | 846 | /* Timeout so we can determine if play status has changed */ |
847 | bool res = list_do_action(CONTEXT_TREE, HZ/2, | 847 | bool res = list_do_action(CONTEXT_TREE, HZ/2, &playlist_lists, &button); |
848 | &playlist_lists, &button, LIST_WRAP_UNLESS_HELD); | ||
849 | /* during moving, another redraw is going to be needed, | 848 | /* during moving, another redraw is going to be needed, |
850 | * since viewer.selected_track is updated too late (after the first draw) | 849 | * since viewer.selected_track is updated too late (after the first draw) |
851 | * drawing the moving item needs it */ | 850 | * drawing the moving item needs it */ |
@@ -1131,8 +1130,7 @@ bool search_playlist(void) | |||
1131 | gui_synclist_speak_item(&playlist_lists); | 1130 | gui_synclist_speak_item(&playlist_lists); |
1132 | while (!exit) | 1131 | while (!exit) |
1133 | { | 1132 | { |
1134 | if (list_do_action(CONTEXT_LIST, HZ/4, | 1133 | if (list_do_action(CONTEXT_LIST, HZ/4, &playlist_lists, &button)) |
1135 | &playlist_lists, &button, LIST_WRAP_UNLESS_HELD)) | ||
1136 | continue; | 1134 | continue; |
1137 | switch (button) | 1135 | switch (button) |
1138 | { | 1136 | { |
diff --git a/apps/plugin.h b/apps/plugin.h index 6bbad26489..0563a8d21f 100644 --- a/apps/plugin.h +++ b/apps/plugin.h | |||
@@ -157,12 +157,12 @@ int plugin_open(const char *plugin, const char *parameter); | |||
157 | #define PLUGIN_MAGIC 0x526F634B /* RocK */ | 157 | #define PLUGIN_MAGIC 0x526F634B /* RocK */ |
158 | 158 | ||
159 | /* increase this every time the api struct changes */ | 159 | /* increase this every time the api struct changes */ |
160 | #define PLUGIN_API_VERSION 253 | 160 | #define PLUGIN_API_VERSION 254 |
161 | 161 | ||
162 | /* update this to latest version if a change to the api struct breaks | 162 | /* update this to latest version if a change to the api struct breaks |
163 | backwards compatibility (and please take the opportunity to sort in any | 163 | backwards compatibility (and please take the opportunity to sort in any |
164 | new function which are "waiting" at the end of the function table) */ | 164 | new function which are "waiting" at the end of the function table) */ |
165 | #define PLUGIN_MIN_API_VERSION 253 | 165 | #define PLUGIN_MIN_API_VERSION 254 |
166 | 166 | ||
167 | /* 239 Marks the removal of ARCHOS HWCODEC and CHARCELL */ | 167 | /* 239 Marks the removal of ARCHOS HWCODEC and CHARCELL */ |
168 | 168 | ||
@@ -373,8 +373,7 @@ struct plugin_api { | |||
373 | int item_number); | 373 | int item_number); |
374 | void (*gui_synclist_add_item)(struct gui_synclist * lists); | 374 | void (*gui_synclist_add_item)(struct gui_synclist * lists); |
375 | void (*gui_synclist_del_item)(struct gui_synclist * lists); | 375 | void (*gui_synclist_del_item)(struct gui_synclist * lists); |
376 | bool (*gui_synclist_do_button)(struct gui_synclist * lists, | 376 | bool (*gui_synclist_do_button)(struct gui_synclist * lists, int *action); |
377 | int *action, enum list_wrap wrap); | ||
378 | void (*gui_synclist_set_title)(struct gui_synclist *lists, const char* title, | 377 | void (*gui_synclist_set_title)(struct gui_synclist *lists, const char* title, |
379 | enum themable_icons icon); | 378 | enum themable_icons icon); |
380 | enum yesno_res (*gui_syncyesno_run)(const struct text_message * main_message, | 379 | enum yesno_res (*gui_syncyesno_run)(const struct text_message * main_message, |
diff --git a/apps/plugins/calendar.c b/apps/plugins/calendar.c index 3299a81273..a70f47c34b 100644 --- a/apps/plugins/calendar.c +++ b/apps/plugins/calendar.c | |||
@@ -964,7 +964,7 @@ static bool view_events(int selected, struct shown *shown) | |||
964 | while (!exit) | 964 | while (!exit) |
965 | { | 965 | { |
966 | button = rb->get_action(CONTEXT_LIST, TIMEOUT_BLOCK); | 966 | button = rb->get_action(CONTEXT_LIST, TIMEOUT_BLOCK); |
967 | rb->gui_synclist_do_button(&gui_memos, &button, LIST_WRAP_UNLESS_HELD); | 967 | rb->gui_synclist_do_button(&gui_memos, &button); |
968 | 968 | ||
969 | switch (button) | 969 | switch (button) |
970 | { | 970 | { |
diff --git a/apps/plugins/chessbox/chessbox_pgn.c b/apps/plugins/chessbox/chessbox_pgn.c index ccbcc7e91d..bb35bec726 100644 --- a/apps/plugins/chessbox/chessbox_pgn.c +++ b/apps/plugins/chessbox/chessbox_pgn.c | |||
@@ -686,9 +686,8 @@ struct pgn_game_node* pgn_show_game_list(struct pgn_game_node* first_game){ | |||
686 | while (true) { | 686 | while (true) { |
687 | curr_selection = rb->gui_synclist_get_sel_pos(&games_list); | 687 | curr_selection = rb->gui_synclist_get_sel_pos(&games_list); |
688 | button = rb->get_action(CONTEXT_LIST,TIMEOUT_BLOCK); | 688 | button = rb->get_action(CONTEXT_LIST,TIMEOUT_BLOCK); |
689 | if (rb->gui_synclist_do_button(&games_list,&button,LIST_WRAP_OFF)){ | 689 | if (rb->gui_synclist_do_button(&games_list, &button)) |
690 | continue; | 690 | continue; |
691 | } | ||
692 | switch (button) { | 691 | switch (button) { |
693 | case ACTION_STD_OK: | 692 | case ACTION_STD_OK: |
694 | return get_game_info(curr_selection, first_game); | 693 | return get_game_info(curr_selection, first_game); |
diff --git a/apps/plugins/keybox.c b/apps/plugins/keybox.c index 38783508e7..cb2e23a94a 100644 --- a/apps/plugins/keybox.c +++ b/apps/plugins/keybox.c | |||
@@ -567,7 +567,7 @@ static int keybox(void) | |||
567 | { | 567 | { |
568 | rb->gui_synclist_draw(&kb_list); | 568 | rb->gui_synclist_draw(&kb_list); |
569 | button = rb->get_action(CONTEXT_LIST, TIMEOUT_BLOCK); | 569 | button = rb->get_action(CONTEXT_LIST, TIMEOUT_BLOCK); |
570 | if (rb->gui_synclist_do_button(&kb_list, &button, LIST_WRAP_UNLESS_HELD)) | 570 | if (rb->gui_synclist_do_button(&kb_list, &button)) |
571 | continue; | 571 | continue; |
572 | 572 | ||
573 | switch (button) | 573 | switch (button) |
diff --git a/apps/plugins/keyremap.c b/apps/plugins/keyremap.c index aaf530318a..8699d86bd2 100644 --- a/apps/plugins/keyremap.c +++ b/apps/plugins/keyremap.c | |||
@@ -2054,7 +2054,7 @@ enum plugin_status plugin_start(const void* parameter) | |||
2054 | redraw = true; | 2054 | redraw = true; |
2055 | 2055 | ||
2056 | ret = menu_action_cb(&action, selected_item, &exit, &lists); | 2056 | ret = menu_action_cb(&action, selected_item, &exit, &lists); |
2057 | if (rb->gui_synclist_do_button(&lists,&action,LIST_WRAP_UNLESS_HELD)) | 2057 | if (rb->gui_synclist_do_button(&lists, &action)) |
2058 | continue; | 2058 | continue; |
2059 | selected_item = rb->gui_synclist_get_sel_pos(&lists); | 2059 | selected_item = rb->gui_synclist_get_sel_pos(&lists); |
2060 | 2060 | ||
diff --git a/apps/plugins/lrcplayer.c b/apps/plugins/lrcplayer.c index 6c26db7a33..32d001add9 100644 --- a/apps/plugins/lrcplayer.c +++ b/apps/plugins/lrcplayer.c | |||
@@ -2078,8 +2078,7 @@ static int timetag_editor(void) | |||
2078 | while (!exit) | 2078 | while (!exit) |
2079 | { | 2079 | { |
2080 | button = rb->get_action(CONTEXT_TREE, TIMEOUT_BLOCK); | 2080 | button = rb->get_action(CONTEXT_TREE, TIMEOUT_BLOCK); |
2081 | if (rb->gui_synclist_do_button(&gui_editor, &button, | 2081 | if (rb->gui_synclist_do_button(&gui_editor, &button)) |
2082 | LIST_WRAP_UNLESS_HELD)) | ||
2083 | continue; | 2082 | continue; |
2084 | 2083 | ||
2085 | switch (button) | 2084 | switch (button) |
diff --git a/apps/plugins/main_menu_config.c b/apps/plugins/main_menu_config.c index 9f651094b1..a5488ed2c0 100644 --- a/apps/plugins/main_menu_config.c +++ b/apps/plugins/main_menu_config.c | |||
@@ -188,7 +188,7 @@ enum plugin_status plugin_start(const void* parameter) | |||
188 | { | 188 | { |
189 | cur_sel = rb->gui_synclist_get_sel_pos(&list); | 189 | cur_sel = rb->gui_synclist_get_sel_pos(&list); |
190 | action = rb->get_action(CONTEXT_LIST,TIMEOUT_BLOCK); | 190 | action = rb->get_action(CONTEXT_LIST,TIMEOUT_BLOCK); |
191 | if (rb->gui_synclist_do_button(&list,&action,LIST_WRAP_UNLESS_HELD)) | 191 | if (rb->gui_synclist_do_button(&list, &action)) |
192 | continue; | 192 | continue; |
193 | 193 | ||
194 | switch (action) | 194 | switch (action) |
diff --git a/apps/plugins/open_plugins.c b/apps/plugins/open_plugins.c index 0bd9740fe7..7230387efb 100644 --- a/apps/plugins/open_plugins.c +++ b/apps/plugins/open_plugins.c | |||
@@ -681,7 +681,7 @@ static void edit_menu(int selection) | |||
681 | { | 681 | { |
682 | action = rb->get_action(CONTEXT_LIST,TIMEOUT_BLOCK); | 682 | action = rb->get_action(CONTEXT_LIST,TIMEOUT_BLOCK); |
683 | 683 | ||
684 | if (rb->gui_synclist_do_button(&lists,&action,LIST_WRAP_UNLESS_HELD)) | 684 | if (rb->gui_synclist_do_button(&lists, &action)) |
685 | continue; | 685 | continue; |
686 | selected_item = rb->gui_synclist_get_sel_pos(&lists); | 686 | selected_item = rb->gui_synclist_get_sel_pos(&lists); |
687 | switch (action) | 687 | switch (action) |
@@ -864,7 +864,7 @@ reopen_datfile: | |||
864 | { | 864 | { |
865 | action = rb->get_action(CONTEXT_LIST,TIMEOUT_BLOCK); | 865 | action = rb->get_action(CONTEXT_LIST,TIMEOUT_BLOCK); |
866 | 866 | ||
867 | if (rb->gui_synclist_do_button(&lists,&action,LIST_WRAP_UNLESS_HELD)) | 867 | if (rb->gui_synclist_do_button(&lists, &action)) |
868 | continue; | 868 | continue; |
869 | selection = rb->gui_synclist_get_sel_pos(&lists); | 869 | selection = rb->gui_synclist_get_sel_pos(&lists); |
870 | switch (action) | 870 | switch (action) |
diff --git a/apps/plugins/properties.c b/apps/plugins/properties.c index 89ea722e9e..ff8c281bed 100644 --- a/apps/plugins/properties.c +++ b/apps/plugins/properties.c | |||
@@ -397,7 +397,7 @@ enum plugin_status plugin_start(const void* parameter) | |||
397 | { | 397 | { |
398 | button = rb->get_action(CONTEXT_LIST, HZ); | 398 | button = rb->get_action(CONTEXT_LIST, HZ); |
399 | /* HZ so the status bar redraws corectly */ | 399 | /* HZ so the status bar redraws corectly */ |
400 | if (rb->gui_synclist_do_button(&properties_lists,&button,LIST_WRAP_UNLESS_HELD)) | 400 | if (rb->gui_synclist_do_button(&properties_lists, &button)) |
401 | continue; | 401 | continue; |
402 | switch(button) | 402 | switch(button) |
403 | { | 403 | { |
diff --git a/apps/plugins/puzzles/rockbox.c b/apps/plugins/puzzles/rockbox.c index 09b247e184..563820ba23 100644 --- a/apps/plugins/puzzles/rockbox.c +++ b/apps/plugins/puzzles/rockbox.c | |||
@@ -2458,7 +2458,7 @@ static int list_choose(const char *list_str, const char *title, int sel) | |||
2458 | { | 2458 | { |
2459 | rb->gui_synclist_draw(&list); | 2459 | rb->gui_synclist_draw(&list); |
2460 | int button = rb->get_action(CONTEXT_LIST, TIMEOUT_BLOCK); | 2460 | int button = rb->get_action(CONTEXT_LIST, TIMEOUT_BLOCK); |
2461 | if(rb->gui_synclist_do_button(&list, &button, LIST_WRAP_UNLESS_HELD)) | 2461 | if(rb->gui_synclist_do_button(&list, &button)) |
2462 | continue; | 2462 | continue; |
2463 | switch(button) | 2463 | switch(button) |
2464 | { | 2464 | { |
@@ -2672,7 +2672,7 @@ static bool config_menu(void) | |||
2672 | { | 2672 | { |
2673 | rb->gui_synclist_draw(&list); | 2673 | rb->gui_synclist_draw(&list); |
2674 | int button = rb->get_action(CONTEXT_LIST, TIMEOUT_BLOCK); | 2674 | int button = rb->get_action(CONTEXT_LIST, TIMEOUT_BLOCK); |
2675 | if(rb->gui_synclist_do_button(&list, &button, LIST_WRAP_UNLESS_HELD)) | 2675 | if(rb->gui_synclist_do_button(&list, &button)) |
2676 | continue; | 2676 | continue; |
2677 | switch(button) | 2677 | switch(button) |
2678 | { | 2678 | { |
@@ -2757,7 +2757,7 @@ static int do_preset_menu(struct preset_menu *menu, char *title, int selected) | |||
2757 | { | 2757 | { |
2758 | rb->gui_synclist_draw(&list); | 2758 | rb->gui_synclist_draw(&list); |
2759 | int button = rb->get_action(CONTEXT_LIST, TIMEOUT_BLOCK); | 2759 | int button = rb->get_action(CONTEXT_LIST, TIMEOUT_BLOCK); |
2760 | if(rb->gui_synclist_do_button(&list, &button, LIST_WRAP_UNLESS_HELD)) | 2760 | if(rb->gui_synclist_do_button(&list, &button)) |
2761 | continue; | 2761 | continue; |
2762 | switch(button) | 2762 | switch(button) |
2763 | { | 2763 | { |
diff --git a/apps/plugins/random_folder_advance_config.c b/apps/plugins/random_folder_advance_config.c index 2c22298cd4..5688ff93d3 100644 --- a/apps/plugins/random_folder_advance_config.c +++ b/apps/plugins/random_folder_advance_config.c | |||
@@ -317,7 +317,7 @@ static int edit_list(void) | |||
317 | { | 317 | { |
318 | rb->gui_synclist_draw(&lists); | 318 | rb->gui_synclist_draw(&lists); |
319 | button = rb->get_action(CONTEXT_LIST,TIMEOUT_BLOCK); | 319 | button = rb->get_action(CONTEXT_LIST,TIMEOUT_BLOCK); |
320 | if (rb->gui_synclist_do_button(&lists,&button,LIST_WRAP_UNLESS_HELD)) | 320 | if (rb->gui_synclist_do_button(&lists, &button)) |
321 | continue; | 321 | continue; |
322 | selection = rb->gui_synclist_get_sel_pos(&lists); | 322 | selection = rb->gui_synclist_get_sel_pos(&lists); |
323 | switch (button) | 323 | switch (button) |
diff --git a/apps/plugins/rb_info.c b/apps/plugins/rb_info.c index 1385a5a9fc..f123a623d2 100644 --- a/apps/plugins/rb_info.c +++ b/apps/plugins/rb_info.c | |||
@@ -557,7 +557,7 @@ enum plugin_status plugin_start(const void* parameter) | |||
557 | else | 557 | else |
558 | redraw = true; | 558 | redraw = true; |
559 | ret = menu_action_cb(&action, selected_item, &exit, &lists); | 559 | ret = menu_action_cb(&action, selected_item, &exit, &lists); |
560 | if (rb->gui_synclist_do_button(&lists,&action,LIST_WRAP_UNLESS_HELD)) | 560 | if (rb->gui_synclist_do_button(&lists, &action)) |
561 | continue; | 561 | continue; |
562 | selected_item = rb->gui_synclist_get_sel_pos(&lists); | 562 | selected_item = rb->gui_synclist_get_sel_pos(&lists); |
563 | } | 563 | } |
diff --git a/apps/plugins/shopper.c b/apps/plugins/shopper.c index 31ef44b831..25a484a31e 100644 --- a/apps/plugins/shopper.c +++ b/apps/plugins/shopper.c | |||
@@ -315,7 +315,7 @@ enum plugin_status plugin_start(const void* parameter) | |||
315 | rb->gui_synclist_draw(&lists); | 315 | rb->gui_synclist_draw(&lists); |
316 | cur_sel = rb->gui_synclist_get_sel_pos(&lists); | 316 | cur_sel = rb->gui_synclist_get_sel_pos(&lists); |
317 | button = rb->get_action(CONTEXT_LIST,TIMEOUT_BLOCK); | 317 | button = rb->get_action(CONTEXT_LIST,TIMEOUT_BLOCK); |
318 | if (rb->gui_synclist_do_button(&lists,&button,LIST_WRAP_UNLESS_HELD)) | 318 | if (rb->gui_synclist_do_button(&lists, &button)) |
319 | continue; | 319 | continue; |
320 | switch (button) | 320 | switch (button) |
321 | { | 321 | { |
diff --git a/apps/plugins/shortcuts/shortcuts_view.c b/apps/plugins/shortcuts/shortcuts_view.c index 9584731989..2a7970bebe 100644 --- a/apps/plugins/shortcuts/shortcuts_view.c +++ b/apps/plugins/shortcuts/shortcuts_view.c | |||
@@ -59,13 +59,8 @@ enum sc_list_action_type draw_sc_list(struct gui_synclist *gui_sc) | |||
59 | /* user input */ | 59 | /* user input */ |
60 | button = rb->get_action(CONTEXT_LIST, HZ); | 60 | button = rb->get_action(CONTEXT_LIST, HZ); |
61 | /* HZ so the status bar redraws corectly */ | 61 | /* HZ so the status bar redraws corectly */ |
62 | if (rb->gui_synclist_do_button(gui_sc, &button, | 62 | if (rb->gui_synclist_do_button(gui_sc, &button)) |
63 | LIST_WRAP_UNLESS_HELD)) { | ||
64 | /* automatic handling of user input. | ||
65 | * _UNLESS_HELD can be _ON or _OFF also | ||
66 | * selection changed, so redraw */ | ||
67 | continue; | 63 | continue; |
68 | } | ||
69 | switch (button) { /* process the user input */ | 64 | switch (button) { /* process the user input */ |
70 | case ACTION_STD_OK: | 65 | case ACTION_STD_OK: |
71 | return SCLA_SELECT; | 66 | return SCLA_SELECT; |
diff --git a/apps/plugins/text_editor.c b/apps/plugins/text_editor.c index 748e872d0b..8740606c58 100644 --- a/apps/plugins/text_editor.c +++ b/apps/plugins/text_editor.c | |||
@@ -394,7 +394,7 @@ enum plugin_status plugin_start(const void* parameter) | |||
394 | rb->gui_synclist_draw(&lists); | 394 | rb->gui_synclist_draw(&lists); |
395 | cur_sel = rb->gui_synclist_get_sel_pos(&lists); | 395 | cur_sel = rb->gui_synclist_get_sel_pos(&lists); |
396 | button = rb->get_action(CONTEXT_LIST,TIMEOUT_BLOCK); | 396 | button = rb->get_action(CONTEXT_LIST,TIMEOUT_BLOCK); |
397 | if (rb->gui_synclist_do_button(&lists,&button,LIST_WRAP_UNLESS_HELD)) | 397 | if (rb->gui_synclist_do_button(&lists, &button)) |
398 | continue; | 398 | continue; |
399 | switch (button) | 399 | switch (button) |
400 | { | 400 | { |
diff --git a/apps/radio/presets.c b/apps/radio/presets.c index 51bdabdfce..6966f7e591 100644 --- a/apps/radio/presets.c +++ b/apps/radio/presets.c | |||
@@ -490,8 +490,7 @@ int handle_radio_presets(void) | |||
490 | while (result == 0) | 490 | while (result == 0) |
491 | { | 491 | { |
492 | gui_synclist_draw(&lists); | 492 | gui_synclist_draw(&lists); |
493 | list_do_action(CONTEXT_STD, TIMEOUT_BLOCK, | 493 | list_do_action(CONTEXT_STD, TIMEOUT_BLOCK, &lists, &action); |
494 | &lists, &action, LIST_WRAP_UNLESS_HELD); | ||
495 | switch (action) | 494 | switch (action) |
496 | { | 495 | { |
497 | case ACTION_STD_MENU: | 496 | case ACTION_STD_MENU: |
diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c index 0a3c7af494..6c52adf5d3 100644 --- a/apps/recorder/recording.c +++ b/apps/recorder/recording.c | |||
@@ -1265,7 +1265,7 @@ bool recording_screen(bool no_source) | |||
1265 | } | 1265 | } |
1266 | 1266 | ||
1267 | /* let list handle the button */ | 1267 | /* let list handle the button */ |
1268 | gui_synclist_do_button(&lists, &button, LIST_WRAP_UNLESS_HELD); | 1268 | gui_synclist_do_button(&lists, &button); |
1269 | 1269 | ||
1270 | 1270 | ||
1271 | switch(button) | 1271 | switch(button) |
diff --git a/apps/screens.c b/apps/screens.c index 24d1fed915..7c5440f50d 100644 --- a/apps/screens.c +++ b/apps/screens.c | |||
@@ -714,8 +714,7 @@ bool browse_id3(struct mp3entry *id3, int playlist_display_index, int playlist_a | |||
714 | gui_synclist_draw(&id3_lists); | 714 | gui_synclist_draw(&id3_lists); |
715 | gui_synclist_speak_item(&id3_lists); | 715 | gui_synclist_speak_item(&id3_lists); |
716 | while (true) { | 716 | while (true) { |
717 | if(!list_do_action(CONTEXT_LIST,HZ/2, | 717 | if(!list_do_action(CONTEXT_LIST,HZ/2, &id3_lists, &key) |
718 | &id3_lists, &key,LIST_WRAP_UNLESS_HELD) | ||
719 | && key!=ACTION_NONE && key!=ACTION_UNKNOWN) | 718 | && key!=ACTION_NONE && key!=ACTION_UNKNOWN) |
720 | { | 719 | { |
721 | if (key == ACTION_STD_OK || key == ACTION_STD_CANCEL) | 720 | if (key == ACTION_STD_OK || key == ACTION_STD_CANCEL) |
@@ -793,8 +792,7 @@ int view_runtime(void) | |||
793 | say_runtime = false; | 792 | say_runtime = false; |
794 | } | 793 | } |
795 | gui_synclist_draw(&lists); | 794 | gui_synclist_draw(&lists); |
796 | list_do_action(CONTEXT_STD, HZ, | 795 | list_do_action(CONTEXT_STD, HZ, &lists, &action); |
797 | &lists, &action, LIST_WRAP_UNLESS_HELD); | ||
798 | if(action == ACTION_STD_CANCEL) | 796 | if(action == ACTION_STD_CANCEL) |
799 | break; | 797 | break; |
800 | if(action == ACTION_STD_OK) { | 798 | if(action == ACTION_STD_OK) { |
diff --git a/apps/tree.c b/apps/tree.c index cef990617c..a034fd0545 100644 --- a/apps/tree.c +++ b/apps/tree.c | |||
@@ -649,7 +649,7 @@ static int dirbrowse(void) | |||
649 | button = get_action(CONTEXT_TREE|ALLOW_SOFTLOCK, | 649 | button = get_action(CONTEXT_TREE|ALLOW_SOFTLOCK, |
650 | list_do_action_timeout(&tree_lists, HZ/2)); | 650 | list_do_action_timeout(&tree_lists, HZ/2)); |
651 | oldbutton = button; | 651 | oldbutton = button; |
652 | gui_synclist_do_button(&tree_lists, &button,LIST_WRAP_UNLESS_HELD); | 652 | gui_synclist_do_button(&tree_lists, &button); |
653 | tc.selected_item = gui_synclist_get_sel_pos(&tree_lists); | 653 | tc.selected_item = gui_synclist_get_sel_pos(&tree_lists); |
654 | switch ( button ) { | 654 | switch ( button ) { |
655 | case ACTION_STD_OK: | 655 | case ACTION_STD_OK: |
diff --git a/docs/PLUGIN_API b/docs/PLUGIN_API index 7b251104d6..0a256ff147 100644 --- a/docs/PLUGIN_API +++ b/docs/PLUGIN_API | |||
@@ -669,7 +669,7 @@ void gui_synclist_del_item(struct gui_synclist * lists) | |||
669 | \param lists | 669 | \param lists |
670 | \description | 670 | \description |
671 | 671 | ||
672 | bool gui_synclist_do_button(struct gui_synclist * lists, unsigned *action, enum list_wrap wrap) | 672 | bool gui_synclist_do_button(struct gui_synclist * lists, unsigned *action) |
673 | \group list | 673 | \group list |
674 | \param lists | 674 | \param lists |
675 | \param action | 675 | \param action |