Merge pull request #3373 from lakkatv/master

Restaure Lakka services
This commit is contained in:
Twinaphex 2016-08-10 02:51:05 +02:00 committed by GitHub
commit c07d316b45
10 changed files with 78 additions and 3 deletions

View File

@ -487,7 +487,7 @@ typedef struct settings
bool config_save_on_exit;
#ifdef HAVE_SYSTEMD
#ifdef HAVE_LAKKA
bool ssh_enable;
bool samba_enable;
bool bluetooth_enable;

View File

@ -2122,6 +2122,8 @@ static const char *menu_hash_to_str_us_label_enum(enum msg_hash_enums msg)
return "deferred_updater_settings_list";
case MENU_ENUM_LABEL_DEFERRED_NETWORK_SETTINGS_LIST:
return "deferred_network_settings_list";
case MENU_ENUM_LABEL_DEFERRED_LAKKA_SERVICES_LIST:
return "deferred_lakka_services_list";
case MENU_ENUM_LABEL_DEFERRED_USER_SETTINGS_LIST:
return "deferred_user_settings_list";
case MENU_ENUM_LABEL_DEFERRED_DIRECTORY_SETTINGS_LIST:

View File

@ -174,6 +174,11 @@ static int deferred_push_network_settings_list(menu_displaylist_info_t *info)
return deferred_push_dlist(info, DISPLAYLIST_NETWORK_SETTINGS_LIST);
}
static int deferred_push_lakka_services_list(menu_displaylist_info_t *info)
{
return deferred_push_dlist(info, DISPLAYLIST_LAKKA_SERVICES_LIST);
}
static int deferred_push_user_settings_list(menu_displaylist_info_t *info)
{
return deferred_push_dlist(info, DISPLAYLIST_USER_SETTINGS_LIST);
@ -746,6 +751,12 @@ static int menu_cbs_init_bind_deferred_push_compare_label(
return 0;
}
if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_LAKKA_SERVICES_LIST)))
{
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_lakka_services_list);
return 0;
}
if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_USER_SETTINGS_LIST)))
{
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_user_settings_list);

View File

@ -698,6 +698,14 @@ int generic_action_ok_displaylist_push(const char *path,
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_NETWORK_SETTINGS_LIST;
dl_type = DISPLAYLIST_GENERIC;
break;
case ACTION_OK_DL_LAKKA_SERVICES_LIST:
info.directory_ptr = idx;
info.type = type;
info_path = path;
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_LAKKA_SERVICES_LIST);
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_LAKKA_SERVICES_LIST;
dl_type = DISPLAYLIST_GENERIC;
break;
case ACTION_OK_DL_USER_SETTINGS_LIST:
info.directory_ptr = idx;
info.type = type;
@ -2764,6 +2772,13 @@ static int action_ok_network_list(const char *path,
entry_idx, ACTION_OK_DL_NETWORK_SETTINGS_LIST);
}
static int action_ok_lakka_services(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
{
return generic_action_ok_displaylist_push(path, NULL, label, type, idx,
entry_idx, ACTION_OK_DL_LAKKA_SERVICES_LIST);
}
static int action_ok_user_list(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
{
@ -3509,6 +3524,9 @@ static int menu_cbs_init_bind_ok_compare_label(menu_file_list_cbs_t *cbs,
case MENU_ENUM_LABEL_NETWORK_SETTINGS:
BIND_ACTION_OK(cbs, action_ok_network_list);
break;
case MENU_ENUM_LABEL_LAKKA_SERVICES:
BIND_ACTION_OK(cbs, action_ok_lakka_services);
break;
case MENU_ENUM_LABEL_USER_SETTINGS:
BIND_ACTION_OK(cbs, action_ok_user_list);
break;

View File

@ -284,6 +284,13 @@ static int action_get_network_settings_list(const char *path, const char *label,
return 0;
}
static int action_get_lakka_services_list(const char *path, const char *label,
unsigned menu_type, char *s, size_t len)
{
sanitize_to_string(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_LAKKA_SERVICES), len);
return 0;
}
static int action_get_user_settings_list(const char *path, const char *label,
unsigned menu_type, char *s, size_t len)
{
@ -957,6 +964,12 @@ static int menu_cbs_init_bind_title_compare_label(menu_file_list_cbs_t *cbs,
return 0;
}
if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_LAKKA_SERVICES_LIST)))
{
BIND_ACTION_GET_TITLE(cbs, action_get_lakka_services_list);
return 0;
}
if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_USER_SETTINGS_LIST)))
{
BIND_ACTION_GET_TITLE(cbs, action_get_user_settings_list);

View File

@ -85,6 +85,7 @@ enum
ACTION_OK_DL_RETRO_ACHIEVEMENTS_SETTINGS_LIST,
ACTION_OK_DL_UPDATER_SETTINGS_LIST,
ACTION_OK_DL_NETWORK_SETTINGS_LIST,
ACTION_OK_DL_LAKKA_SERVICES_LIST,
ACTION_OK_DL_USER_SETTINGS_LIST,
ACTION_OK_DL_DIRECTORY_SETTINGS_LIST,
ACTION_OK_DL_PRIVACY_SETTINGS_LIST,

View File

@ -4123,6 +4123,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
case DISPLAYLIST_RETRO_ACHIEVEMENTS_SETTINGS_LIST:
case DISPLAYLIST_UPDATER_SETTINGS_LIST:
case DISPLAYLIST_NETWORK_SETTINGS_LIST:
case DISPLAYLIST_LAKKA_SERVICES_LIST:
case DISPLAYLIST_USER_SETTINGS_LIST:
case DISPLAYLIST_DIRECTORY_SETTINGS_LIST:
case DISPLAYLIST_PRIVACY_SETTINGS_LIST:
@ -4775,6 +4776,22 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
MENU_ENUM_LABEL_STDIN_CMD_ENABLE,
PARSE_ONLY_BOOL, false);
info->need_refresh = true;
info->need_push = true;
break;
case DISPLAYLIST_LAKKA_SERVICES_LIST:
menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_SSH_ENABLE,
PARSE_ONLY_BOOL, false);
menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_SAMBA_ENABLE,
PARSE_ONLY_BOOL, false);
menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_BLUETOOTH_ENABLE,
PARSE_ONLY_BOOL, false);
info->need_refresh = true;
info->need_push = true;
break;

View File

@ -127,6 +127,7 @@ enum menu_displaylist_ctl_state
DISPLAYLIST_RETRO_ACHIEVEMENTS_SETTINGS_LIST,
DISPLAYLIST_UPDATER_SETTINGS_LIST,
DISPLAYLIST_NETWORK_SETTINGS_LIST,
DISPLAYLIST_LAKKA_SERVICES_LIST,
DISPLAYLIST_USER_SETTINGS_LIST,
DISPLAYLIST_DIRECTORY_SETTINGS_LIST,
DISPLAYLIST_PRIVACY_SETTINGS_LIST,

View File

@ -3625,7 +3625,7 @@ static void overlay_enable_toggle_change_handler(void *data)
}
#endif
#ifdef HAVE_SYSTEMD
#ifdef HAVE_LAKKA
static void systemd_service_toggle(const char *path, char *unit, bool enable)
{
int pid = fork();
@ -4376,6 +4376,17 @@ static bool setting_append_list(
parent_group);
menu_settings_list_current_add_enum_idx(list, list_info, MENU_ENUM_LABEL_NETWORK_SETTINGS);
#ifdef HAVE_LAKKA
CONFIG_ACTION(
list, list_info,
msg_hash_to_str(MENU_ENUM_LABEL_LAKKA_SERVICES),
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_LAKKA_SERVICES),
&group_info,
&subgroup_info,
parent_group);
menu_settings_list_current_add_enum_idx(list, list_info, MENU_ENUM_LABEL_LAKKA_SERVICES);
#endif
CONFIG_ACTION(
list, list_info,
msg_hash_to_str(MENU_ENUM_LABEL_PLAYLIST_SETTINGS),
@ -7722,7 +7733,7 @@ static bool setting_append_list(
break;
case SETTINGS_LIST_LAKKA_SERVICES:
{
#if defined(HAVE_SYSTEMD)
#if defined(HAVE_LAKKA)
START_GROUP(list, list_info, &group_info,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_LAKKA_SERVICES),
parent_group);

View File

@ -812,6 +812,7 @@ enum msg_hash_enums
MENU_ENUM_LABEL_DEFERRED_RETRO_ACHIEVEMENTS_SETTINGS_LIST,
MENU_ENUM_LABEL_DEFERRED_UPDATER_SETTINGS_LIST,
MENU_ENUM_LABEL_DEFERRED_NETWORK_SETTINGS_LIST,
MENU_ENUM_LABEL_DEFERRED_LAKKA_SERVICES_LIST,
MENU_ENUM_LABEL_DEFERRED_USER_SETTINGS_LIST,
MENU_ENUM_LABEL_DEFERRED_DIRECTORY_SETTINGS_LIST,
MENU_ENUM_LABEL_DEFERRED_PRIVACY_SETTINGS_LIST,