enum {
MENU_CLOCK = 0,
MENU_LANGUAGE,
+ MENU_VOICE_CONTROL,
MENU_RESET
};
static char *_get_clock_mode(void *data, int id);
static char *_get_language(void *data, int id);
+//static char *_get_location(void *data, int id);
+static char *_get_voice_control_status(void *data, int id);
static void _selected(void *data, int id);
static void _focused(void *data, int id);
.progress_value = NULL,
.progress_evas = NULL,
.update_cb = settings_language_set_state_update_callbacks
+ }
+ /*,
+ {
+ .id = MENU_SUBTITLE,
+ .title = STR_SUBTITLE,
+ .style = STYLE_STATUS_BTN,
+ .disabled = EINA_FALSE,
+ .status = _get_subtitle,
+ .selected = _selected,
+ .focused = _focused,
+ .selected_menu = _selected_menu,
+ .progress_value = NULL,
+ .progress_evas = NULL,
+ .update_cb = settings_language_set_subtitle_state_update_callbacks
+ }*/,
+ /*{
+ .id = MENU_LOCATION,
+ .title = STR_LOCATION,
+ .style = STYLE_STATUS_BTN,
+ .disabled = EINA_FALSE,
+ .status = _get_location,
+ .selected = _selected,
+ .focused = _focused,
+ .selected_menu = _selected_menu,
+ .progress_value = NULL,
+ .progress_evas = NULL,
+ .update_cb = set_callback_for_system_location_change
+ },*/
+ {
+ .id = MENU_VOICE_CONTROL,
+ .title = "Voice control",
+ .style = STYLE_STATUS_BTN,
+ .disabled = EINA_FALSE,
+ .status = _get_voice_control_status,
+ .selected = NULL,
+ .focused = _focused,
+ .selected_menu = _selected_menu,
+ .progress_value = NULL,
+ .progress_evas = NULL,
+ .update_cb = NULL,
},
- /*,
{
.id = MENU_RESET,
.title = STR_RESET,
.progress_value = NULL,
.progress_evas = NULL,
.update_cb = NULL
- },*/
+ },
};
static char *_get_clock_mode(void *data, int id)
return settings_language_get_language_display_str();
}
+static char *_get_voice_control_status(void *data, int id)
+{
+ return strdup("OFF");
+}
+
+/*
+static char *_get_location(void *data, int id)
+{
+ char *country = NULL;
+ char *lang = NULL;
+ char name[64] = {'\0'};
+ i18n_uchar res[64] = {0,};
+ int r = SYSTEM_SETTINGS_ERROR_NONE;
+
+ r = system_settings_get_value_string(
+ SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &lang);
+ if (r != SYSTEM_SETTINGS_ERROR_NONE) {
+ _ERR("failed to get language");
+ return strdup(STR_UNKNOWN);
+ }
+
+ r = system_settings_get_value_string(
+ SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY, &country);
+ if (r != SYSTEM_SETTINGS_ERROR_NONE) {
+ _ERR("failed to get country");
+ free(lang);
+ return strdup(STR_UNKNOWN);
+ }
+
+ r = i18n_ulocale_get_display_country(country, lang, res, sizeof(res));
+ if (r < 0) {
+ _ERR("failed to get display country: %s", get_last_result());
+ free(lang);
+ free(country);
+ return strdup(STR_UNKNOWN);
+ }
+
+ i18n_ustring_copy_au(name, res);
+
+ free(lang);
+ free(country);
+
+ return strdup(name);
+}
+*/
+
+void set_callback_for_system_location_change(void *data)
+{
+ if (data) {
+ //@TODO: set needed callbacks
+ } else {
+ //@TODO: unset previously set callbacks
+ }
+}
+
static void _selected(void *data, int id)
{
switch (id) {