From 5f552253c4d4c99e6889ab94de492f7a515452e9 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 20 Oct 2016 15:47:02 +0200 Subject: [PATCH] Add sublabel to menu_entry_t --- menu/cbs/menu_cbs_select.c | 11 +++++++++++ menu/drivers/xmb.c | 1 + menu/menu_input.c | 1 + menu/widgets/menu_entry.c | 9 +++++++++ menu/widgets/menu_entry.h | 1 + 5 files changed, 23 insertions(+) diff --git a/menu/cbs/menu_cbs_select.c b/menu/cbs/menu_cbs_select.c index 39c06eff57..84a46a635c 100644 --- a/menu/cbs/menu_cbs_select.c +++ b/menu/cbs/menu_cbs_select.c @@ -41,6 +41,17 @@ static int action_select_default(const char *path, const char *label, unsigned t menu_file_list_cbs_t *cbs = NULL; file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0); + entry.path[0] = '\0'; + entry.label[0] = '\0'; + entry.sublabel[0] = '\0'; + entry.value[0] = '\0'; + entry.rich_label[0] = '\0'; + entry.enum_idx = MSG_UNKNOWN; + entry.entry_idx = 0; + entry.idx = 0; + entry.type = 0; + entry.spacing = 0; + menu_entry_get(&entry, 0, idx, NULL, false); cbs = menu_entries_get_actiondata_at_offset(selection_buf, idx); diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 150b008935..f928b09531 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -751,6 +751,7 @@ static void xmb_update_thumbnail_path(void *data, unsigned i) entry.path[0] = '\0'; entry.label[0] = '\0'; + entry.sublabel[0] = '\0'; entry.value[0] = '\0'; entry.rich_label[0] = '\0'; entry.enum_idx = MSG_UNKNOWN; diff --git a/menu/menu_input.c b/menu/menu_input.c index 8b145ccb73..25660b67b9 100644 --- a/menu/menu_input.c +++ b/menu/menu_input.c @@ -471,6 +471,7 @@ void menu_input_post_iterate(int *ret, unsigned action) entry.path[0] = '\0'; entry.label[0] = '\0'; + entry.sublabel[0] = '\0'; entry.value[0] = '\0'; entry.rich_label[0] = '\0'; entry.enum_idx = MSG_UNKNOWN; diff --git a/menu/widgets/menu_entry.c b/menu/widgets/menu_entry.c index cc07638ff1..76371f1c85 100644 --- a/menu/widgets/menu_entry.c +++ b/menu/widgets/menu_entry.c @@ -84,6 +84,7 @@ void menu_entry_get_path(uint32_t i, char *s, size_t len) entry.path[0] = '\0'; entry.label[0] = '\0'; + entry.sublabel[0] = '\0'; entry.value[0] = '\0'; entry.rich_label[0] = '\0'; entry.enum_idx = MSG_UNKNOWN; @@ -103,6 +104,7 @@ void menu_entry_get_rich_label(uint32_t i, char *s, size_t len) entry.path[0] = '\0'; entry.label[0] = '\0'; + entry.sublabel[0] = '\0'; entry.value[0] = '\0'; entry.rich_label[0] = '\0'; entry.enum_idx = MSG_UNKNOWN; @@ -125,6 +127,7 @@ void menu_entry_get_label(uint32_t i, char *s, size_t len) entry.path[0] = '\0'; entry.label[0] = '\0'; + entry.sublabel[0] = '\0'; entry.value[0] = '\0'; entry.rich_label[0] = '\0'; entry.enum_idx = MSG_UNKNOWN; @@ -144,6 +147,7 @@ unsigned menu_entry_get_spacing(uint32_t i) entry.path[0] = '\0'; entry.label[0] = '\0'; + entry.sublabel[0] = '\0'; entry.value[0] = '\0'; entry.rich_label[0] = '\0'; entry.enum_idx = MSG_UNKNOWN; @@ -163,6 +167,7 @@ unsigned menu_entry_get_type_new(uint32_t i) entry.path[0] = '\0'; entry.label[0] = '\0'; + entry.sublabel[0] = '\0'; entry.value[0] = '\0'; entry.rich_label[0] = '\0'; entry.enum_idx = MSG_UNKNOWN; @@ -268,6 +273,7 @@ void menu_entry_pathdir_get_value(uint32_t i, char *s, size_t len) entry.path[0] = '\0'; entry.label[0] = '\0'; + entry.sublabel[0] = '\0'; entry.value[0] = '\0'; entry.rich_label[0] = '\0'; entry.enum_idx = MSG_UNKNOWN; @@ -297,6 +303,7 @@ void menu_entry_reset(uint32_t i) entry.path[0] = '\0'; entry.label[0] = '\0'; + entry.sublabel[0] = '\0'; entry.value[0] = '\0'; entry.rich_label[0] = '\0'; entry.enum_idx = MSG_UNKNOWN; @@ -317,6 +324,7 @@ void menu_entry_get_value(uint32_t i, void *data, char *s, size_t len) entry.path[0] = '\0'; entry.label[0] = '\0'; + entry.sublabel[0] = '\0'; entry.value[0] = '\0'; entry.rich_label[0] = '\0'; entry.enum_idx = MSG_UNKNOWN; @@ -431,6 +439,7 @@ int menu_entry_select(uint32_t i) entry.path[0] = '\0'; entry.label[0] = '\0'; + entry.sublabel[0] = '\0'; entry.value[0] = '\0'; entry.rich_label[0] = '\0'; entry.enum_idx = MSG_UNKNOWN; diff --git a/menu/widgets/menu_entry.h b/menu/widgets/menu_entry.h index 7fe41cbe8c..741263ffeb 100644 --- a/menu/widgets/menu_entry.h +++ b/menu/widgets/menu_entry.h @@ -47,6 +47,7 @@ typedef struct menu_entry { char path[PATH_MAX_LENGTH]; char label[PATH_MAX_LENGTH]; + char sublabel[PATH_MAX_LENGTH]; char rich_label[PATH_MAX_LENGTH]; char value[PATH_MAX_LENGTH]; size_t entry_idx;