Revert "Refactor action_ok"

This reverts commit 04a2dd469ea45f4c272fd153da31535540e2382d.
This commit is contained in:
twinaphex 2015-05-17 18:18:17 +02:00
parent e215b2d6ec
commit 036f0c4cb2
4 changed files with 403 additions and 232 deletions

File diff suppressed because it is too large Load Diff

View File

@ -451,7 +451,6 @@ int menu_entry_iterate(unsigned action)
int menu_entry_action(menu_entry_t *entry, unsigned i, enum menu_action action)
{
menu_displaylist_info_t info = {0};
menu_navigation_t *nav = menu_navigation_get_ptr();
menu_handle_t *menu = menu_driver_get_ptr();
menu_list_t *menu_list = menu_list_get_ptr();
@ -478,14 +477,7 @@ int menu_entry_action(menu_entry_t *entry, unsigned i, enum menu_action action)
case MENU_ACTION_OK:
if (cbs && cbs->action_ok)
{
info.list = menu_list->menu_stack;
info.type = entry->type;
info.directory_ptr = i;
strlcpy(info.path, entry->path, sizeof(info.path));
strlcpy(info.label, entry->label, sizeof(info.label));
return cbs->action_ok(&info);
}
return cbs->action_ok(entry->path, entry->label, entry->type, i);
break;
case MENU_ACTION_START:
if (cbs && cbs->action_start)

View File

@ -716,7 +716,7 @@ static int menu_input_mouse_frame(
return cbs->action_toggle(entry->type, entry->label, MENU_ACTION_RIGHT, true);
if (BIT64_GET(input_mouse, MOUSE_ACTION_BUTTON_L_OK))
return menu_entry_action(entry, nav->selection_ptr, MENU_ACTION_OK);
return cbs->action_ok(entry->path, entry->label, entry->type, nav->selection_ptr);
if (BIT64_GET(input_mouse, MOUSE_ACTION_BUTTON_L_SET_NAVIGATION))
{
@ -846,7 +846,7 @@ static int pointer_tap(menu_file_list_cbs_t *cbs,
|| setting->type == ST_FLOAT || setting->type == ST_STRING))
return cbs->action_toggle(entry->type, entry->label, MENU_ACTION_RIGHT, true);
else if (menu->pointer.ptr == menu->navigation.selection_ptr)
return menu_entry_action(entry, menu->navigation.selection_ptr, MENU_ACTION_OK);
return cbs->action_ok(entry->path, entry->label, entry->type, menu->navigation.selection_ptr);
else
menu_navigation_set(&menu->navigation, menu->pointer.ptr, false);

View File

@ -36,7 +36,8 @@ typedef struct menu_file_list_cbs
{
int (*action_iterate)(const char *label, unsigned action);
int (*action_deferred_push)(menu_displaylist_info_t *info);
int (*action_ok)(menu_displaylist_info_t *info);
int (*action_ok)(const char *path, const char *label, unsigned type,
size_t idx);
int (*action_cancel)(const char *path, const char *label, unsigned type,
size_t idx);
int (*action_start)(unsigned type, const char *label, unsigned action);