From f93af36364ab804accae2ce161198f449eb38113 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 7 Feb 2018 22:19:18 +0100 Subject: [PATCH] Pass menu_label to bind OK --- menu/cbs/menu_cbs_ok.c | 8 +++++--- menu/menu_cbs.c | 3 ++- menu/menu_cbs.h | 3 ++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c index 3178c4db51..ea83383082 100644 --- a/menu/cbs/menu_cbs_ok.c +++ b/menu/cbs/menu_cbs_ok.c @@ -4525,7 +4525,8 @@ static int menu_cbs_init_bind_ok_compare_type(menu_file_list_cbs_t *cbs, { BIND_ACTION_OK(cbs, action_ok_deferred_list_stub); } - else if (menu_label_hash == MENU_LABEL_CURSOR_MANAGER_LIST) + else if (string_is_equal(menu_label, + msg_hash_to_str(MENU_ENUM_LABEL_CURSOR_MANAGER_LIST))) { BIND_ACTION_OK(cbs, action_ok_cursor_manager_list); } @@ -4643,7 +4644,8 @@ static int menu_cbs_init_bind_ok_compare_type(menu_file_list_cbs_t *cbs, } int menu_cbs_init_bind_ok(menu_file_list_cbs_t *cbs, - const char *path, const char *label, unsigned type, size_t idx, + const char *path, const char *menu_label, + const char *label, unsigned type, size_t idx, uint32_t label_hash, uint32_t menu_label_hash) { if (!cbs) @@ -4654,7 +4656,7 @@ int menu_cbs_init_bind_ok(menu_file_list_cbs_t *cbs, if (menu_cbs_init_bind_ok_compare_label(cbs, label, label_hash) == 0) return 0; - if (menu_cbs_init_bind_ok_compare_type(cbs, label, label_hash, menu_label_hash, type) == 0) + if (menu_cbs_init_bind_ok_compare_type(cbs, menu_label, label_hash, menu_label_hash, type) == 0) return 0; return -1; diff --git a/menu/menu_cbs.c b/menu/menu_cbs.c index 28dd055114..77b64699a9 100644 --- a/menu/menu_cbs.c +++ b/menu/menu_cbs.c @@ -237,7 +237,8 @@ void menu_cbs_init(void *data, /* It will try to find a corresponding callback function inside * menu_cbs_ok.c, then map this callback to the entry. */ - menu_cbs_init_bind_ok(cbs, path, label, type, idx, label_hash, menu_label_hash); + menu_cbs_init_bind_ok(cbs, path, menu_label, + label, type, idx, label_hash, menu_label_hash); menu_cbs_init_log(repr_label, "OK", cbs->action_ok_ident); diff --git a/menu/menu_cbs.h b/menu/menu_cbs.h index a73aee774e..ae7b482b1f 100644 --- a/menu/menu_cbs.h +++ b/menu/menu_cbs.h @@ -215,7 +215,8 @@ int menu_cbs_init_bind_cancel(menu_file_list_cbs_t *cbs, const char *path, const char *label, unsigned type, size_t idx); int menu_cbs_init_bind_ok(menu_file_list_cbs_t *cbs, - const char *path, const char *label, unsigned type, size_t idx, + const char *path, const char *menu_label, + const char *label, unsigned type, size_t idx, uint32_t label_hash, uint32_t menu_label_hash); int menu_cbs_init_bind_deferred_push(menu_file_list_cbs_t *cbs,