From eaeaac598d5c06a138a5e8ea012f7a959461e473 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Thu, 30 May 2024 21:18:38 -0400 Subject: FS#13431: Provide a way to view the rockbox license in the menus This adds a "Legal Notices" entry under the System menu that will launch the text viewer plugin to display: 1) COPYING.txt (containing the GPLv2 overall license for Rockbox) 2) LICENSES.txt (containing all other relevant licenses and notices) Change-Id: Id41ae491b6f9a6ec5663090246d0f6b661cddea5 --- apps/lang/english-us.lang | 14 ++++++++++++++ apps/lang/english.lang | 14 ++++++++++++++ apps/menus/main_menu.c | 14 +++++++++++++- 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/apps/lang/english-us.lang b/apps/lang/english-us.lang index 586dc80914..680b3e0883 100644 --- a/apps/lang/english-us.lang +++ b/apps/lang/english-us.lang @@ -16298,3 +16298,17 @@ *: "Always 1" + + id: LANG_LEGAL_NOTICES + desc: in system menu + user: core + + *: "Legal Notices" + + + *: "Legal Notices" + + + *: "Legal Notices" + + diff --git a/apps/lang/english.lang b/apps/lang/english.lang index fdedf01866..a93cff90ec 100644 --- a/apps/lang/english.lang +++ b/apps/lang/english.lang @@ -16374,3 +16374,17 @@ *: "Always 1" + + id: LANG_LEGAL_NOTICES + desc: in system menu + user: core + + *: "Legal Notices" + + + *: "Legal Notices" + + + *: "Legal Notices" + + diff --git a/apps/menus/main_menu.c b/apps/menus/main_menu.c index 73c9f7be33..a483a72eb0 100644 --- a/apps/menus/main_menu.c +++ b/apps/menus/main_menu.c @@ -121,6 +121,15 @@ static int show_credits(void) return 0; } +static int show_legal(void) +{ + if (plugin_load(VIEWERS_DIR "/text_viewer.rock", "/.rockbox/docs/COPYING.txt") != PLUGIN_OK) + show_info(); + if (plugin_load(VIEWERS_DIR "/text_viewer.rock", "/.rockbox/docs/LICENSES.txt") != PLUGIN_OK) + show_info(); + return 0; +} + #define SIZE_FMT "%s %s" struct info_data @@ -469,9 +478,12 @@ MENUITEM_FUNCTION(show_runtime_item, 0, ID2P(LANG_RUNNING_TIME), MENUITEM_FUNCTION(debug_menu_item, 0, ID2P(LANG_DEBUG), debug_menu, NULL, Icon_NOICON); +MENUITEM_FUNCTION(show_legal_item, 0, ID2P(LANG_LEGAL_NOTICES), + show_legal, NULL, Icon_NOICON); + MAKE_MENU(info_menu, ID2P(LANG_SYSTEM), 0, Icon_System_menu, &show_info_item, &show_credits_item, - &show_runtime_item, &debug_menu_item); + &show_runtime_item, &show_legal_item, &debug_menu_item); /* INFO MENU */ /***********************************/ -- cgit v1.2.3