Start logging cancel callback
This commit is contained in:
parent
ffdf6eae8e
commit
2cb1636ea4
|
@ -18,12 +18,33 @@
|
||||||
#include "../menu_driver.h"
|
#include "../menu_driver.h"
|
||||||
#include "../menu_cbs.h"
|
#include "../menu_cbs.h"
|
||||||
|
|
||||||
|
#ifndef BIND_ACTION_CANCEL
|
||||||
|
#define BIND_ACTION_CANCEL(cbs, name) \
|
||||||
|
cbs->action_cancel = name; \
|
||||||
|
cbs->action_cancel_ident = #name;
|
||||||
|
#endif
|
||||||
|
|
||||||
static int action_cancel_pop_default(const char *path,
|
static int action_cancel_pop_default(const char *path,
|
||||||
const char *label, unsigned type, size_t idx)
|
const char *label, unsigned type, size_t idx)
|
||||||
{
|
{
|
||||||
return menu_entry_go_back();
|
return menu_entry_go_back();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int menu_cbs_init_bind_cancel_compare_label(menu_file_list_cbs_t *cbs,
|
||||||
|
const char *label, uint32_t hash, const char *elem0)
|
||||||
|
{
|
||||||
|
uint32_t elem0_hash = msg_hash_calculate(elem0);
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int menu_cbs_init_bind_cancel_compare_type(
|
||||||
|
menu_file_list_cbs_t *cbs, unsigned type,
|
||||||
|
uint32_t label_hash)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
int menu_cbs_init_bind_cancel(menu_file_list_cbs_t *cbs,
|
int menu_cbs_init_bind_cancel(menu_file_list_cbs_t *cbs,
|
||||||
const char *path, const char *label, unsigned type, size_t idx,
|
const char *path, const char *label, unsigned type, size_t idx,
|
||||||
const char *elem0, const char *elem1,
|
const char *elem0, const char *elem1,
|
||||||
|
@ -32,7 +53,14 @@ int menu_cbs_init_bind_cancel(menu_file_list_cbs_t *cbs,
|
||||||
if (!cbs)
|
if (!cbs)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
cbs->action_cancel = action_cancel_pop_default;
|
BIND_ACTION_CANCEL(cbs, action_cancel_pop_default);
|
||||||
|
|
||||||
|
if (menu_cbs_init_bind_cancel_compare_label(cbs, label, label_hash, elem0) == 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (menu_cbs_init_bind_cancel_compare_type(
|
||||||
|
cbs, type, label_hash) == 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue