Display Lakka version in System Information

This commit is contained in:
Jean-André Santoni 2017-05-13 13:12:15 +02:00
parent 541c6e6c41
commit ce9439e722
6 changed files with 50 additions and 0 deletions

View File

@ -1205,6 +1205,26 @@ static void frontend_linux_get_os(char *s,
#endif
}
#ifdef HAVE_LAKKA
static void frontend_linux_get_lakka_version(char *s,
size_t len)
{
char version[128];
size_t vlen;
FILE *command_file = popen("cat /etc/release", "r");
fgets(version, sizeof(version), command_file);
vlen = strlen(version);
if (vlen > 0 && version[vlen-1] == '\n')
version[--vlen] = '\0';
strlcpy(s, version, len);
pclose(command_file);
}
#endif
static void frontend_linux_get_env(int *argc,
char *argv[], void *data, void *params_data)
{
@ -2131,6 +2151,9 @@ frontend_ctx_driver_t frontend_ctx_linux = {
frontend_linux_destroy_signal_handler_state,
NULL, /* attach_console */
NULL, /* detach_console */
#ifdef HAVE_LAKKA
frontend_linux_get_lakka_version, /* get_lakka_version */
#endif
#ifdef ANDROID
"android"
#else

View File

@ -41,5 +41,8 @@ frontend_ctx_driver_t frontend_ctx_null = {
NULL, /* destroy_sighandler_state */
NULL, /* attach_console */
NULL, /* detach_console */
#ifdef HAVE_LAKKA
NULL, /* get_lakka_version */
#endif
"null",
};

View File

@ -85,6 +85,9 @@ typedef struct frontend_ctx_driver
void (*destroy_signal_handler_state)(void);
void (*attach_console)(void);
void (*detach_console)(void);
#ifdef HAVE_LAKKA
void (*get_lakka_version)(char *, size_t);
#endif
const char *ident;

View File

@ -1391,6 +1391,8 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_JACK_SUPPORT,
"JACK support")
MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_KMS_SUPPORT,
"KMS/EGL support")
MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_LAKKA_VERSION,
"Lakka Version")
MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_LIBRETRODB_SUPPORT,
"LibretroDB support")
MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_LIBUSB_SUPPORT,

View File

@ -679,6 +679,24 @@ static int menu_displaylist_parse_system_info(menu_displaylist_info_t *info)
MENU_ENUM_LABEL_SYSTEM_INFO_ENTRY,
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
#ifdef HAVE_LAKKA
if (frontend->get_lakka_version)
{
frontend->get_lakka_version(tmp2, sizeof(tmp2));
fill_pathname_noext(tmp,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_LAKKA_VERSION),
": ",
sizeof(tmp));
strlcat(tmp, frontend->get_lakka_version ?
tmp2 : msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NOT_AVAILABLE),
sizeof(tmp));
menu_entries_append_enum(info->list, tmp, "",
MENU_ENUM_LABEL_SYSTEM_INFO_ENTRY,
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
}
#endif
if (frontend->get_name)
{
frontend->get_name(tmp2, sizeof(tmp2));

View File

@ -1382,6 +1382,7 @@ enum msg_hash_enums
/* System information */
MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_LAKKA_VERSION,
MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_DYNAMIC_SUPPORT,
MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_BUILD_DATE,
MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_GIT_VERSION,