From 61cc8998676e27cd9f677b51954edabe7a72b6a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Andr=C3=A9=20Santoni?= Date: Sat, 12 Aug 2017 16:37:20 +0200 Subject: [PATCH] (XMB) Display the favorites tab, part 1 --- intl/msg_hash_lbl.h | 2 ++ intl/msg_hash_us.h | 2 ++ menu/cbs/menu_cbs_title.c | 2 ++ menu/drivers/xmb.c | 19 +++++++++++++++++++ menu/menu_driver.h | 1 + msg_hash.h | 1 + 6 files changed, 27 insertions(+) diff --git a/intl/msg_hash_lbl.h b/intl/msg_hash_lbl.h index e56ffe5f8a..6097c8569b 100644 --- a/intl/msg_hash_lbl.h +++ b/intl/msg_hash_lbl.h @@ -397,6 +397,8 @@ MSG_HASH(MENU_ENUM_LABEL_FILE_BROWSER_SHADER, "file_browser_shader") MSG_HASH(MENU_ENUM_LABEL_FILE_BROWSER_SHADER_PRESET, "file_browser_shader_preset") +MSG_HASH(MENU_ENUM_LABEL_FAVORITES_TAB, + "favorites_tab") MSG_HASH(MENU_ENUM_LABEL_FPS_SHOW, "fps_show") MSG_HASH(MENU_ENUM_LABEL_FRAME_THROTTLE_ENABLE, diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index c5118e44a2..9d1bcf10a6 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -615,6 +615,8 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_FALSE, "False") MSG_HASH(MENU_ENUM_LABEL_VALUE_FASTFORWARD_RATIO, "Maximum Run Speed") +MSG_HASH(MENU_ENUM_LABEL_VALUE_FAVORITES_TAB, + "Favorites") MSG_HASH(MENU_ENUM_LABEL_VALUE_FPS_SHOW, "Display Framerate") MSG_HASH(MENU_ENUM_LABEL_VALUE_FRAME_THROTTLE_ENABLE, diff --git a/menu/cbs/menu_cbs_title.c b/menu/cbs/menu_cbs_title.c index abe3bbd528..e2808ccd44 100644 --- a/menu/cbs/menu_cbs_title.c +++ b/menu/cbs/menu_cbs_title.c @@ -247,6 +247,8 @@ static int action_get_title_group_settings(const char *path, const char *label, strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_MAIN_MENU), len); else if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_HISTORY_TAB))) strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_HISTORY_TAB), len); + else if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_FAVORITES_TAB))) + strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_FAVORITES_TAB), len); else if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_IMAGES_TAB))) strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_IMAGES_TAB), len); else if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_MUSIC_TAB))) diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 555b26c6e6..11b7510e3a 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -90,6 +90,7 @@ enum XMB_TEXTURE_MAIN_MENU = 0, XMB_TEXTURE_SETTINGS, XMB_TEXTURE_HISTORY, + XMB_TEXTURE_FAVORITES, XMB_TEXTURE_MUSICS, #ifdef HAVE_FFMPEG XMB_TEXTURE_MOVIES, @@ -150,6 +151,7 @@ enum XMB_SYSTEM_TAB_MAIN = 0, XMB_SYSTEM_TAB_SETTINGS, XMB_SYSTEM_TAB_HISTORY, + XMB_SYSTEM_TAB_FAVORITES, XMB_SYSTEM_TAB_MUSIC, #ifdef HAVE_FFMPEG XMB_SYSTEM_TAB_VIDEO, @@ -302,6 +304,7 @@ typedef struct xmb_handle #endif xmb_node_t settings_tab_node; xmb_node_t history_tab_node; + xmb_node_t favorites_tab_node; xmb_node_t add_tab_node; xmb_node_t netplay_tab_node; @@ -1540,6 +1543,8 @@ static xmb_node_t* xmb_get_node(xmb_handle_t *xmb, unsigned i) #endif case XMB_SYSTEM_TAB_HISTORY: return &xmb->history_tab_node; + case XMB_SYSTEM_TAB_FAVORITES: + return &xmb->favorites_tab_node; #ifdef HAVE_NETWORKING case XMB_SYSTEM_TAB_NETPLAY: return &xmb->netplay_tab_node; @@ -3286,6 +3291,8 @@ static void *xmb_init(void **userdata, bool video_is_threaded) xmb->tabs[++xmb->system_tab_end] = XMB_SYSTEM_TAB_SETTINGS; if (settings->bools.menu_xmb_show_history) xmb->tabs[++xmb->system_tab_end] = XMB_SYSTEM_TAB_HISTORY; + /* TODO if (settings->bools.menu_xmb_show_favorites)*/ + xmb->tabs[++xmb->system_tab_end] = XMB_SYSTEM_TAB_FAVORITES; #ifdef HAVE_IMAGEVIEWER if (settings->bools.menu_xmb_show_images) xmb->tabs[++xmb->system_tab_end] = XMB_SYSTEM_TAB_IMAGES; @@ -3435,6 +3442,8 @@ static const char *xmb_texture_path(unsigned id) return "settings.png"; case XMB_TEXTURE_HISTORY: return "history.png"; + case XMB_TEXTURE_FAVORITES: + return "favorites.png"; case XMB_TEXTURE_MUSICS: return "musics.png"; #ifdef HAVE_FFMPEG @@ -3561,6 +3570,10 @@ static void xmb_context_reset_textures( xmb->history_tab_node.alpha = xmb->categories.active.alpha; xmb->history_tab_node.zoom = xmb->categories.active.zoom; + xmb->favorites_tab_node.icon = xmb->textures.list[XMB_TEXTURE_FAVORITES]; + xmb->favorites_tab_node.alpha = xmb->categories.active.alpha; + xmb->favorites_tab_node.zoom = xmb->categories.active.zoom; + xmb->music_tab_node.icon = xmb->textures.list[XMB_TEXTURE_MUSICS]; xmb->music_tab_node.alpha = xmb->categories.active.alpha; xmb->music_tab_node.zoom = xmb->categories.active.zoom; @@ -3872,6 +3885,12 @@ static void xmb_list_cache(void *data, enum menu_list_type type, unsigned action menu_stack->list[stack_size - 1].type = MENU_HISTORY_TAB; break; + case XMB_SYSTEM_TAB_FAVORITES: + menu_stack->list[stack_size - 1].label = + strdup(msg_hash_to_str(MENU_ENUM_LABEL_FAVORITES_TAB)); + menu_stack->list[stack_size - 1].type = + MENU_FAVORITES_TAB; + break; #ifdef HAVE_NETWORKING case XMB_SYSTEM_TAB_NETPLAY: menu_stack->list[stack_size - 1].label = diff --git a/menu/menu_driver.h b/menu/menu_driver.h index 51b10df75a..b58c93d489 100644 --- a/menu/menu_driver.h +++ b/menu/menu_driver.h @@ -139,6 +139,7 @@ enum menu_settings_type MENU_SETTINGS, MENU_SETTINGS_TAB, MENU_HISTORY_TAB, + MENU_FAVORITES_TAB, MENU_MUSIC_TAB, MENU_VIDEO_TAB, MENU_IMAGES_TAB, diff --git a/msg_hash.h b/msg_hash.h index fbbe36c3f6..fb3cdff09b 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -1197,6 +1197,7 @@ enum msg_hash_enums MENU_LABEL(HORIZONTAL_MENU), MENU_LABEL(SETTINGS_TAB), MENU_LABEL(HISTORY_TAB), + MENU_LABEL(FAVORITES_TAB), MENU_LABEL(ADD_TAB), MENU_LABEL(NETPLAY_TAB), MENU_LABEL(PLAYLISTS_TAB),