mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 02:27:39 -04:00
plugins: main_menu_config misc addendum 5efb6d7fac
handle USB or shutdown events, exit for ACTION_STD_MENU, and eliminate unnecessary list redraws Change-Id: Ieedf75805f3a859d1aeb85ef51253636d8870fb6
This commit is contained in:
parent
33c74d948c
commit
667d6c140b
1 changed files with 14 additions and 2 deletions
|
@ -178,6 +178,7 @@ enum plugin_status plugin_start(const void* parameter)
|
||||||
bool done = false;
|
bool done = false;
|
||||||
bool changed = false;
|
bool changed = false;
|
||||||
int action, cur_sel;
|
int action, cur_sel;
|
||||||
|
int ret = PLUGIN_OK;
|
||||||
|
|
||||||
menu_table = rb->root_menu_get_options(&menu_item_count);
|
menu_table = rb->root_menu_get_options(&menu_item_count);
|
||||||
load_from_cfg();
|
load_from_cfg();
|
||||||
|
@ -188,11 +189,11 @@ enum plugin_status plugin_start(const void* parameter)
|
||||||
rb->gui_synclist_set_icon_callback(&list, menu_get_icon);
|
rb->gui_synclist_set_icon_callback(&list, menu_get_icon);
|
||||||
rb->gui_synclist_set_nb_items(&list, menu_item_count);
|
rb->gui_synclist_set_nb_items(&list, menu_item_count);
|
||||||
rb->gui_synclist_set_title(&list, rb->str(LANG_MAIN_MENU), Icon_Rockbox);
|
rb->gui_synclist_set_title(&list, rb->str(LANG_MAIN_MENU), Icon_Rockbox);
|
||||||
|
rb->gui_synclist_draw(&list);
|
||||||
rb->gui_synclist_speak_item(&list);
|
rb->gui_synclist_speak_item(&list);
|
||||||
|
|
||||||
while (!done)
|
while (!done)
|
||||||
{
|
{
|
||||||
rb->gui_synclist_draw(&list);
|
|
||||||
cur_sel = rb->gui_synclist_get_sel_pos(&list);
|
cur_sel = rb->gui_synclist_get_sel_pos(&list);
|
||||||
action = rb->get_action(CONTEXT_LIST, HZ/10);
|
action = rb->get_action(CONTEXT_LIST, HZ/10);
|
||||||
if (rb->gui_synclist_do_button(&list, &action))
|
if (rb->gui_synclist_do_button(&list, &action))
|
||||||
|
@ -256,9 +257,20 @@ enum plugin_status plugin_start(const void* parameter)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ACTION_STD_CANCEL:
|
case ACTION_STD_CANCEL:
|
||||||
|
case ACTION_STD_MENU:
|
||||||
done = true;
|
done = true;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
if (rb->default_event_handler(action) == SYS_USB_CONNECTED)
|
||||||
|
{
|
||||||
|
ret = PLUGIN_USB_CONNECTED;
|
||||||
|
done = true;
|
||||||
}
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!done)
|
||||||
|
rb->gui_synclist_draw(&list);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (changed)
|
if (changed)
|
||||||
|
@ -269,5 +281,5 @@ enum plugin_status plugin_start(const void* parameter)
|
||||||
}
|
}
|
||||||
rb->global_settings->show_icons = show_icons;
|
rb->global_settings->show_icons = show_icons;
|
||||||
|
|
||||||
return PLUGIN_OK;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue