mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-27 10:10:57 +00:00
Date Time setting for AM:PM as an option
This commit is contained in:
parent
cb21aa91cc
commit
b3cf7150d5
@ -697,6 +697,8 @@ static const unsigned menu_thumbnails_default = 3;
|
||||
|
||||
static const unsigned menu_left_thumbnails_default = 0;
|
||||
|
||||
static const unsigned menu_timedate_style = 3;
|
||||
|
||||
static const bool xmb_vertical_thumbnails = false;
|
||||
|
||||
#ifdef IOS
|
||||
|
@ -1569,6 +1569,7 @@ static struct config_uint_setting *populate_settings_uint(settings_t *settings,
|
||||
#ifdef HAVE_MENU
|
||||
SETTING_UINT("dpi_override_value", &settings->uints.menu_dpi_override_value, true, menu_dpi_override_value, false);
|
||||
SETTING_UINT("menu_thumbnails", &settings->uints.menu_thumbnails, true, menu_thumbnails_default, false);
|
||||
SETTING_UINT("menu_timedate_style", &settings->uints.menu_timedate_style, true, menu_timedate_style, false);
|
||||
#ifdef HAVE_XMB
|
||||
SETTING_UINT("menu_left_thumbnails", &settings->uints.menu_left_thumbnails, true, menu_left_thumbnails_default, false);
|
||||
SETTING_UINT("xmb_alpha_factor", &settings->uints.menu_xmb_alpha_factor, true, xmb_alpha_factor, false);
|
||||
|
@ -393,6 +393,7 @@ typedef struct settings
|
||||
unsigned video_record_scale_factor;
|
||||
unsigned video_stream_scale_factor;
|
||||
|
||||
unsigned menu_timedate_style;
|
||||
unsigned menu_thumbnails;
|
||||
unsigned menu_left_thumbnails;
|
||||
unsigned menu_dpi_override_value;
|
||||
|
@ -1101,6 +1101,8 @@ MSG_HASH(MENU_ENUM_LABEL_THUMBNAILS_UPDATER_LIST,
|
||||
"thumbnails_updater_list")
|
||||
MSG_HASH(MENU_ENUM_LABEL_TIMEDATE_ENABLE,
|
||||
"menu_timedate_enable")
|
||||
MSG_HASH(MENU_ENUM_LABEL_TIMEDATE_STYLE,
|
||||
"menu_timedate_style")
|
||||
MSG_HASH(MENU_ENUM_LABEL_TITLE_COLOR,
|
||||
"menu_title_color")
|
||||
MSG_HASH(MENU_ENUM_LABEL_UI_COMPANION_ENABLE,
|
||||
|
@ -1738,6 +1738,10 @@ int menu_hash_get_help_us_enum(enum msg_hash_enums msg, char *s, size_t len)
|
||||
snprintf(s, len,
|
||||
"Shows current date and/or time inside menu.");
|
||||
break;
|
||||
case MENU_ENUM_LABEL_TIMEDATE_STYLE:
|
||||
snprintf(s, len,
|
||||
"Style to show the current date and/or time in.");
|
||||
break;
|
||||
case MENU_ENUM_LABEL_BATTERY_LEVEL_ENABLE:
|
||||
snprintf(s, len,
|
||||
"Shows current battery level inside menu.");
|
||||
|
@ -2869,6 +2869,38 @@ MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_TIMEDATE_ENABLE,
|
||||
"Show date / time"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_TIMEDATE_STYLE,
|
||||
"Style of date / time"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_SUBLABEL_TIMEDATE_STYLE,
|
||||
"Changes the style current date and/or time is shown inside the menu."
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_TIMEDATE_STYLE_YMD_HMS,
|
||||
"YYYY-MM-DD H:M:S"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_TIMEDATE_STYLE_YMD,
|
||||
"YY-MM-DD"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_TIMEDATE_STYLE_HMS,
|
||||
"HH:MM:SS"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_TIMEDATE_STYLE_HM,
|
||||
"HH:MM"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_TIMEDATE_STYLE_DM_HM,
|
||||
"DD/MM HH:MM"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_TIMEDATE_STYLE_AM_PM,
|
||||
"HH:MM (AM/PM)"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_TITLE_COLOR,
|
||||
"Menu title color"
|
||||
|
@ -295,6 +295,7 @@ default_sublabel_macro(action_bind_sublabel_pointer_enable, MENU_
|
||||
default_sublabel_macro(action_bind_sublabel_thumbnails, MENU_ENUM_SUBLABEL_THUMBNAILS)
|
||||
default_sublabel_macro(action_bind_sublabel_left_thumbnails, MENU_ENUM_SUBLABEL_LEFT_THUMBNAILS)
|
||||
default_sublabel_macro(action_bind_sublabel_timedate_enable, MENU_ENUM_SUBLABEL_TIMEDATE_ENABLE)
|
||||
default_sublabel_macro(action_bind_sublabel_timedate_style, MENU_ENUM_SUBLABEL_TIMEDATE_STYLE)
|
||||
default_sublabel_macro(action_bind_sublabel_battery_level_enable, MENU_ENUM_SUBLABEL_BATTERY_LEVEL_ENABLE)
|
||||
default_sublabel_macro(action_bind_sublabel_navigation_wraparound, MENU_ENUM_SUBLABEL_NAVIGATION_WRAPAROUND)
|
||||
default_sublabel_macro(action_bind_sublabel_audio_resampler_quality, MENU_ENUM_SUBLABEL_AUDIO_RESAMPLER_QUALITY)
|
||||
@ -1273,6 +1274,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
|
||||
case MENU_ENUM_LABEL_TIMEDATE_ENABLE:
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_timedate_enable);
|
||||
break;
|
||||
case MENU_ENUM_LABEL_TIMEDATE_STYLE:
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_timedate_style);
|
||||
break;
|
||||
case MENU_ENUM_LABEL_THUMBNAILS:
|
||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_thumbnails);
|
||||
break;
|
||||
|
@ -3629,7 +3629,7 @@ static void xmb_frame(void *data, video_frame_info_t *video_info)
|
||||
|
||||
datetime.s = timedate;
|
||||
datetime.len = sizeof(timedate);
|
||||
datetime.time_mode = 4;
|
||||
datetime.time_mode = settings->uints.menu_timedate_style;
|
||||
|
||||
menu_display_timedate(&datetime);
|
||||
|
||||
|
@ -5642,6 +5642,9 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
|
||||
menu_displaylist_parse_settings_enum(menu, info,
|
||||
MENU_ENUM_LABEL_TIMEDATE_ENABLE,
|
||||
PARSE_ONLY_BOOL, false);
|
||||
menu_displaylist_parse_settings_enum(menu, info,
|
||||
MENU_ENUM_LABEL_TIMEDATE_STYLE,
|
||||
PARSE_ONLY_UINT, false);
|
||||
menu_displaylist_parse_settings_enum(menu, info,
|
||||
MENU_ENUM_LABEL_BATTERY_LEVEL_ENABLE,
|
||||
PARSE_ONLY_BOOL, false);
|
||||
|
@ -368,6 +368,14 @@ void menu_display_timedate(menu_display_ctx_datetime_t *datetime)
|
||||
strftime(datetime->s, datetime->len,
|
||||
"%d/%m %H:%M", localtime(&time_));
|
||||
break;
|
||||
case 5: /* Time (hours-minutes), in 12 hour AM-PM designation */
|
||||
#if defined(__linux__) && !defined(ANDROID)
|
||||
strftime(datetime->s, datetime->len,
|
||||
"%c", localtime(&time_));
|
||||
#else
|
||||
strftime(datetime->s, datetime->len,
|
||||
"%I:%M %p", localtime(&time_));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -505,6 +505,47 @@ static void setting_get_string_representation_uint_menu_left_thumbnails(
|
||||
}
|
||||
}
|
||||
|
||||
static void setting_get_string_representation_uint_menu_timedate_style(
|
||||
rarch_setting_t *setting,
|
||||
char *s, size_t len)
|
||||
{
|
||||
if (!setting)
|
||||
return;
|
||||
|
||||
switch (*setting->value.target.unsigned_integer)
|
||||
{
|
||||
case 0:
|
||||
strlcpy(s, msg_hash_to_str(
|
||||
MENU_ENUM_LABEL_VALUE_TIMEDATE_STYLE_YMD_HMS), len);
|
||||
break;
|
||||
case 1:
|
||||
strlcpy(s,
|
||||
msg_hash_to_str(
|
||||
MENU_ENUM_LABEL_VALUE_TIMEDATE_STYLE_YMD), len);
|
||||
break;
|
||||
case 2:
|
||||
strlcpy(s,
|
||||
msg_hash_to_str(
|
||||
MENU_ENUM_LABEL_VALUE_TIMEDATE_STYLE_HMS), len);
|
||||
break;
|
||||
case 3:
|
||||
strlcpy(s,
|
||||
msg_hash_to_str(
|
||||
MENU_ENUM_LABEL_VALUE_TIMEDATE_STYLE_HM), len);
|
||||
break;
|
||||
case 4:
|
||||
strlcpy(s,
|
||||
msg_hash_to_str(
|
||||
MENU_ENUM_LABEL_VALUE_TIMEDATE_STYLE_DM_HM), len);
|
||||
break;
|
||||
case 5:
|
||||
strlcpy(s,
|
||||
msg_hash_to_str(
|
||||
MENU_ENUM_LABEL_VALUE_TIMEDATE_STYLE_AM_PM), len);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void setting_get_string_representation_uint_xmb_icon_theme(
|
||||
rarch_setting_t *setting,
|
||||
char *s, size_t len)
|
||||
@ -8225,6 +8266,21 @@ static bool setting_append_list(
|
||||
general_read_handler,
|
||||
SD_FLAG_ADVANCED);
|
||||
|
||||
CONFIG_UINT(list, list_info,
|
||||
&settings->uints.menu_timedate_style,
|
||||
MENU_ENUM_LABEL_TIMEDATE_STYLE,
|
||||
MENU_ENUM_LABEL_VALUE_TIMEDATE_STYLE,
|
||||
menu_timedate_style,
|
||||
&group_info,
|
||||
&subgroup_info,
|
||||
parent_group,
|
||||
general_write_handler,
|
||||
general_read_handler);
|
||||
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint;
|
||||
(*list)[list_info->index - 1].get_string_representation =
|
||||
&setting_get_string_representation_uint_menu_timedate_style;
|
||||
menu_settings_list_current_add_range(list, list_info, 0, 5, 1, true, true);
|
||||
|
||||
CONFIG_BOOL(
|
||||
list, list_info,
|
||||
&settings->bools.menu_battery_level_enable,
|
||||
|
@ -832,6 +832,7 @@ enum msg_hash_enums
|
||||
MENU_LABEL(LEFT_THUMBNAILS),
|
||||
MENU_LABEL(XMB_VERTICAL_THUMBNAILS),
|
||||
MENU_LABEL(TIMEDATE_ENABLE),
|
||||
MENU_LABEL(TIMEDATE_STYLE),
|
||||
MENU_LABEL(BATTERY_LEVEL_ENABLE),
|
||||
MENU_LABEL(MATERIALUI_MENU_COLOR_THEME),
|
||||
MENU_LABEL(QUICK_MENU_OVERRIDE_OPTIONS),
|
||||
@ -2126,6 +2127,12 @@ enum msg_hash_enums
|
||||
MSG_CHEAT_SEARCH_ADD_MATCH_FAIL,
|
||||
MSG_CHEAT_SEARCH_DELETE_MATCH_SUCCESS,
|
||||
MSG_CHEEVOS_HARDCORE_MODE_DISABLED,
|
||||
MENU_ENUM_LABEL_VALUE_TIMEDATE_STYLE_YMD_HMS,
|
||||
MENU_ENUM_LABEL_VALUE_TIMEDATE_STYLE_YMD,
|
||||
MENU_ENUM_LABEL_VALUE_TIMEDATE_STYLE_HMS,
|
||||
MENU_ENUM_LABEL_VALUE_TIMEDATE_STYLE_HM,
|
||||
MENU_ENUM_LABEL_VALUE_TIMEDATE_STYLE_DM_HM,
|
||||
MENU_ENUM_LABEL_VALUE_TIMEDATE_STYLE_AM_PM,
|
||||
|
||||
MSG_LAST
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user