From 0eb5566dea8e00e3a8a4fd9d7d8867ad712c766f Mon Sep 17 00:00:00 2001
From: Mikael Brunnhede <mbrunnhede@hotmail.com>
Date: Thu, 5 Oct 2017 09:26:25 +0200
Subject: [PATCH] Implemented setting for showing/hiding the "Load Content"
 option in XMB.

---
 config.def.h                 |  1 +
 configuration.c              |  1 +
 configuration.h              |  3 ++-
 intl/msg_hash_chs.h          |  4 ++++
 intl/msg_hash_cht.h          |  4 ++++
 intl/msg_hash_de.h           |  4 ++++
 intl/msg_hash_eo.h           |  4 ++++
 intl/msg_hash_fr.h           |  4 ++++
 intl/msg_hash_it.h           |  4 ++++
 intl/msg_hash_ja.h           |  4 ++++
 intl/msg_hash_ko.h           |  4 ++++
 intl/msg_hash_lbl.h          |  2 ++
 intl/msg_hash_nl.h           |  4 ++++
 intl/msg_hash_pt_br.h        |  6 ++++++
 intl/msg_hash_pt_pt.h        |  4 ++++
 intl/msg_hash_ru.h           |  4 ++++
 intl/msg_hash_us.h           |  4 ++++
 intl/msg_hash_vn.h           |  4 ++++
 menu/cbs/menu_cbs_sublabel.c |  4 ++++
 menu/drivers/xmb.c           |  7 +++++--
 menu/menu_displaylist.c      |  4 ++++
 menu/menu_setting.c          | 15 +++++++++++++++
 msg_hash.h                   |  1 +
 23 files changed, 93 insertions(+), 3 deletions(-)

diff --git a/config.def.h b/config.def.h
index de3adea607..a183446ed8 100644
--- a/config.def.h
+++ b/config.def.h
@@ -238,6 +238,7 @@ static bool default_block_config_read    = true;
 
 static bool menu_show_online_updater     = true;
 static bool menu_show_load_core          = true;
+static bool menu_show_load_content       = true;
 
 #if defined(HAVE_LAKKA) || defined(VITA)
 static bool menu_show_core_updater       = false;
diff --git a/configuration.c b/configuration.c
index 4c415f0390..684a050a38 100644
--- a/configuration.c
+++ b/configuration.c
@@ -1203,6 +1203,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
 #endif
    SETTING_BOOL("xmb_show_music",                &settings->bools.menu_xmb_show_music, true, xmb_show_music, false);
    SETTING_BOOL("menu_show_load_core",           &settings->bools.menu_show_load_core, true, menu_show_load_core, false);
+   SETTING_BOOL("menu_show_load_content",        &settings->bools.menu_show_load_content, true, menu_show_load_content, false);
    SETTING_BOOL("menu_show_online_updater",      &settings->bools.menu_show_online_updater, true, menu_show_online_updater, false);
    SETTING_BOOL("menu_show_core_updater",        &settings->bools.menu_show_core_updater, true, menu_show_core_updater, false);
 #ifdef HAVE_FFMPEG
diff --git a/configuration.h b/configuration.h
index 49dec93958..4201c17274 100644
--- a/configuration.h
+++ b/configuration.h
@@ -126,8 +126,9 @@ typedef struct settings
       bool menu_linear_filter;
       bool menu_horizontal_animation;
       bool menu_show_online_updater;
-      bool menu_show_load_core;
       bool menu_show_core_updater;
+      bool menu_show_load_core;
+      bool menu_show_load_content;
       bool menu_materialui_icons_enable;
       bool menu_xmb_shadows_enable;
       bool menu_xmb_show_settings;
diff --git a/intl/msg_hash_chs.h b/intl/msg_hash_chs.h
index fd1543bf07..1297f39646 100644
--- a/intl/msg_hash_chs.h
+++ b/intl/msg_hash_chs.h
@@ -3067,3 +3067,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CORE,
       "Show Load Core")
 MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CORE,
       "Show/hide the 'Load Core' option.")
+MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CONTENT,
+      "Show Load Content")
+MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CONTENT,
+      "Show/hide the 'Load Content' option.")
diff --git a/intl/msg_hash_cht.h b/intl/msg_hash_cht.h
index 547b97414f..9b4c6c1765 100644
--- a/intl/msg_hash_cht.h
+++ b/intl/msg_hash_cht.h
@@ -3067,3 +3067,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CORE,
       "Show Load Core")
 MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CORE,
       "Show/hide the 'Load Core' option.")
+MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CONTENT,
+      "Show Load Content")
+MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CONTENT,
+      "Show/hide the 'Load Content' option.")
diff --git a/intl/msg_hash_de.h b/intl/msg_hash_de.h
index 85348b73ba..05cc56f83a 100644
--- a/intl/msg_hash_de.h
+++ b/intl/msg_hash_de.h
@@ -3061,3 +3061,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CORE,
       "Show Load Core")
 MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CORE,
       "Show/hide the 'Load Core' option.")
+MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CONTENT,
+      "Show Load Content")
+MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CONTENT,
+      "Show/hide the 'Load Content' option.")
diff --git a/intl/msg_hash_eo.h b/intl/msg_hash_eo.h
index 84ab3e7531..3c795534e0 100644
--- a/intl/msg_hash_eo.h
+++ b/intl/msg_hash_eo.h
@@ -2930,3 +2930,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CORE,
       "Show Load Core")
 MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CORE,
       "Show/hide the 'Load Core' option.")
+MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CONTENT,
+      "Show Load Content")
+MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CONTENT,
+      "Show/hide the 'Load Content' option.")
diff --git a/intl/msg_hash_fr.h b/intl/msg_hash_fr.h
index 681fdc0479..1a388cdfa9 100644
--- a/intl/msg_hash_fr.h
+++ b/intl/msg_hash_fr.h
@@ -3099,3 +3099,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CORE,
       "Show Load Core")
 MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CORE,
       "Show/hide the 'Load Core' option.")
+MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CONTENT,
+      "Show Load Content")
+MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CONTENT,
+      "Show/hide the 'Load Content' option.")
diff --git a/intl/msg_hash_it.h b/intl/msg_hash_it.h
index 7289568cc3..6b711ccf70 100644
--- a/intl/msg_hash_it.h
+++ b/intl/msg_hash_it.h
@@ -3153,3 +3153,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CORE,
       "Show Load Core")
 MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CORE,
       "Show/hide the 'Load Core' option.")
+MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CONTENT,
+      "Show Load Content")
+MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CONTENT,
+      "Show/hide the 'Load Content' option.")
diff --git a/intl/msg_hash_ja.h b/intl/msg_hash_ja.h
index 0217cc6b35..7b030c20fd 100644
--- a/intl/msg_hash_ja.h
+++ b/intl/msg_hash_ja.h
@@ -3069,3 +3069,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CORE,
       "Show Load Core")
 MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CORE,
       "Show/hide the 'Load Core' option.")
+MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CONTENT,
+      "Show Load Content")
+MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CONTENT,
+      "Show/hide the 'Load Content' option.")
diff --git a/intl/msg_hash_ko.h b/intl/msg_hash_ko.h
index 764c96a18b..4546bf035d 100644
--- a/intl/msg_hash_ko.h
+++ b/intl/msg_hash_ko.h
@@ -3062,3 +3062,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CORE,
       "Show Load Core")
 MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CORE,
       "Show/hide the 'Load Core' option.")
+MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CONTENT,
+      "Show Load Content")
+MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CONTENT,
+      "Show/hide the 'Load Content' option.")
diff --git a/intl/msg_hash_lbl.h b/intl/msg_hash_lbl.h
index cbd7c9d842..df024a45b8 100644
--- a/intl/msg_hash_lbl.h
+++ b/intl/msg_hash_lbl.h
@@ -1307,3 +1307,5 @@ MSG_HASH(MENU_ENUM_LABEL_RENAME_ENTRY,
       "rename_entry")
 MSG_HASH(MENU_ENUM_LABEL_MENU_SHOW_LOAD_CORE,
       "menu_show_load_core")
+MSG_HASH(MENU_ENUM_LABEL_MENU_SHOW_LOAD_CONTENT,
+      "menu_show_load_content")
diff --git a/intl/msg_hash_nl.h b/intl/msg_hash_nl.h
index e84c6d66bd..be72a0c6df 100644
--- a/intl/msg_hash_nl.h
+++ b/intl/msg_hash_nl.h
@@ -2930,3 +2930,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CORE,
       "Show Load Core")
 MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CORE,
       "Show/hide the 'Load Core' option.")
+MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CONTENT,
+      "Show Load Content")
+MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CONTENT,
+      "Show/hide the 'Load Content' option.")
diff --git a/intl/msg_hash_pt_br.h b/intl/msg_hash_pt_br.h
index 6dc2c0783c..82d9819898 100644
--- a/intl/msg_hash_pt_br.h
+++ b/intl/msg_hash_pt_br.h
@@ -3994,3 +3994,9 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CORE,
 MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CORE,
       "Show/hide the 'Load Core' option."
    )
+MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CONTENT,
+      "Show Load Content"
+   )
+MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CONTENT,
+      "Show/hide the 'Load Content' option."
+   )
diff --git a/intl/msg_hash_pt_pt.h b/intl/msg_hash_pt_pt.h
index 7a15fcd2b8..725a434862 100644
--- a/intl/msg_hash_pt_pt.h
+++ b/intl/msg_hash_pt_pt.h
@@ -3037,3 +3037,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CORE,
       "Show Load Core")
 MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CORE,
       "Show/hide the 'Load Core' option.")
+MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CONTENT,
+      "Show Load Content")
+MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CONTENT,
+      "Show/hide the 'Load Content' option.")
diff --git a/intl/msg_hash_ru.h b/intl/msg_hash_ru.h
index ce2115778d..11c665374e 100644
--- a/intl/msg_hash_ru.h
+++ b/intl/msg_hash_ru.h
@@ -3120,3 +3120,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CORE,
       "Show Load Core")
 MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CORE,
       "Show/hide the 'Load Core' option.")
+MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CONTENT,
+      "Show Load Content")
+MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CONTENT,
+      "Show/hide the 'Load Content' option.")
diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h
index a918f38951..c7ee0c364c 100644
--- a/intl/msg_hash_us.h
+++ b/intl/msg_hash_us.h
@@ -3155,3 +3155,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CORE,
       "Show Load Core")
 MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CORE,
       "Show/hide the 'Load Core' option.")
+MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CONTENT,
+      "Show Load Content")
+MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CONTENT,
+      "Show/hide the 'Load Content' option.")
diff --git a/intl/msg_hash_vn.h b/intl/msg_hash_vn.h
index 9e9e3faf89..96b021ede8 100644
--- a/intl/msg_hash_vn.h
+++ b/intl/msg_hash_vn.h
@@ -3091,3 +3091,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CORE,
       "Show Load Core")
 MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CORE,
       "Show/hide the 'Load Core' option.")
+MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CONTENT,
+      "Show Load Content")
+MSG_HASH(MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CONTENT,
+      "Show/hide the 'Load Content' option.")
diff --git a/menu/cbs/menu_cbs_sublabel.c b/menu/cbs/menu_cbs_sublabel.c
index e995bab5b3..141ff7b37d 100644
--- a/menu/cbs/menu_cbs_sublabel.c
+++ b/menu/cbs/menu_cbs_sublabel.c
@@ -292,6 +292,7 @@ default_sublabel_macro(action_bind_sublabel_menu_font,
 default_sublabel_macro(action_bind_sublabel_menu_favorites_tab,                    MENU_ENUM_SUBLABEL_XMB_SHOW_FAVORITES)
 default_sublabel_macro(action_bind_sublabel_menu_images_tab,                       MENU_ENUM_SUBLABEL_XMB_SHOW_IMAGES)
 default_sublabel_macro(action_bind_sublabel_menu_show_load_core,                   MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CORE)
+default_sublabel_macro(action_bind_sublabel_menu_show_load_content,                MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CONTENT)
 default_sublabel_macro(action_bind_sublabel_menu_show_online_updater,              MENU_ENUM_SUBLABEL_MENU_SHOW_ONLINE_UPDATER)
 default_sublabel_macro(action_bind_sublabel_menu_show_core_updater,              MENU_ENUM_SUBLABEL_MENU_SHOW_CORE_UPDATER)
 default_sublabel_macro(action_bind_sublabel_menu_music_tab,                        MENU_ENUM_SUBLABEL_XMB_SHOW_MUSIC)
@@ -604,6 +605,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
          case MENU_ENUM_LABEL_MENU_SHOW_LOAD_CORE:
             BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_show_load_core);
             break;
+         case MENU_ENUM_LABEL_MENU_SHOW_LOAD_CONTENT:
+            BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_show_load_content);
+            break;
          case MENU_ENUM_LABEL_MENU_SHOW_ONLINE_UPDATER:
             BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_show_online_updater);
             break;
diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c
index aa2d3de5ed..c8e21a465b 100755
--- a/menu/drivers/xmb.c
+++ b/menu/drivers/xmb.c
@@ -4329,8 +4329,11 @@ static int xmb_list_push(void *data, void *userdata,
                }
             }
 
-            entry.enum_idx      = MENU_ENUM_LABEL_LOAD_CONTENT_LIST;
-            menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
+            if (settings->bools.menu_show_load_content)
+            {
+               entry.enum_idx      = MENU_ENUM_LABEL_LOAD_CONTENT_LIST;
+               menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
+            }
 
             entry.enum_idx      = MENU_ENUM_LABEL_ADD_CONTENT_LIST;
             menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c
index 730881b0f9..55d86f3f80 100644
--- a/menu/menu_displaylist.c
+++ b/menu/menu_displaylist.c
@@ -5282,6 +5282,10 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
                MENU_ENUM_LABEL_MENU_SHOW_LOAD_CORE,
                PARSE_ONLY_BOOL, false);
 
+         menu_displaylist_parse_settings_enum(menu, info,
+               MENU_ENUM_LABEL_MENU_SHOW_LOAD_CONTENT,
+               PARSE_ONLY_BOOL, false);
+
 #if defined(HAVE_NETWORKING) && !defined(HAVE_LAKKA)
          menu_displaylist_parse_settings_enum(menu, info,
                MENU_ENUM_LABEL_MENU_SHOW_ONLINE_UPDATER,
diff --git a/menu/menu_setting.c b/menu/menu_setting.c
index 454e7eb761..b0e4918ce4 100644
--- a/menu/menu_setting.c
+++ b/menu/menu_setting.c
@@ -5394,6 +5394,21 @@ static bool setting_append_list(
                   general_read_handler,
                   SD_FLAG_NONE);
 
+            CONFIG_BOOL(
+                  list, list_info,
+                  &settings->bools.menu_show_load_content,
+                  MENU_ENUM_LABEL_MENU_SHOW_LOAD_CONTENT,
+                  MENU_ENUM_LABEL_VALUE_MENU_SHOW_LOAD_CONTENT,
+                  menu_show_load_content,
+                  MENU_ENUM_LABEL_VALUE_OFF,
+                  MENU_ENUM_LABEL_VALUE_ON,
+                  &group_info,
+                  &subgroup_info,
+                  parent_group,
+                  general_write_handler,
+                  general_read_handler,
+                  SD_FLAG_NONE);
+
             CONFIG_BOOL(
                   list, list_info,
                   &settings->bools.menu_xmb_show_settings,
diff --git a/msg_hash.h b/msg_hash.h
index 8836c9b4c0..7680ac96fe 100644
--- a/msg_hash.h
+++ b/msg_hash.h
@@ -673,6 +673,7 @@ enum msg_hash_enums
 
    /* Menu settings */
    MENU_LABEL(MENU_SHOW_LOAD_CORE),
+   MENU_LABEL(MENU_SHOW_LOAD_CONTENT),
    MENU_LABEL(MENU_SHOW_ONLINE_UPDATER),
    MENU_LABEL(MENU_SHOW_CORE_UPDATER),
    MENU_LABEL(RUN_MUSIC),