tizen 2.4 release
[apps/home/settings.git] / setting-phone / src / setting-phone.c
index caa16ef..b2a9deb 100644 (file)
@@ -37,6 +37,8 @@
 #include <locale.h>
 #include <setting-cfg.h>
 
+#include <eventsystem.h>
+#include <system_settings.h>
 
 #ifndef UG_MODULE_API
 #define UG_MODULE_API __attribute__ ((visibility("default")))
@@ -188,7 +190,7 @@ static void setting_phone_update_item(void *data)
                }
 
                if (region_automatic == 1) {
-                       item_to_update->sub_desc = (char *)g_strdup(_("IDS_COM_BODY_AUTOMATIC"));
+                       item_to_update->sub_desc = (char *)g_strdup(_("IDS_ST_BODY_ANSWERINGMODE_AUTOMATIC"));
                } else {
                        item_to_update->sub_desc = setting_phone_lang_get_region_str(pa_region);
                }
@@ -251,6 +253,7 @@ char *setting_phone_lang_get_region_str(const char *region)
        if (strlen(str_displayname) < 256) {
                strcpy(source, str_displayname);
        } else {
+               FREE(str_displayname);
                return NULL;
        }
        u_strFromUTF8(dest, 256, &len, source, 256, &errcode);
@@ -279,7 +282,7 @@ char *setting_phone_lang_str_to_utf8(const UChar *unichars)
        UErrorCode status = U_ZERO_ERROR;
 
        len = u_strlen(unichars);
-       len_str = sizeof(char) * 4 * (len + 1);
+       len_str = sizeof(char)*4*(len+1);
        str = (char *)calloc(1, len_str);
        if (!str) {
                return NULL;
@@ -488,7 +491,7 @@ char *setting_phone_lang_get_example_desc(const char *region, void *data)
        eina_strbuf_append_printf(temp_str,
                                  "%s", _("IDS_ST_BODY_REGIONAL_EXAMPLE"));
        eina_strbuf_append_printf(temp_str, "<br>%s : %s", _("IDS_ST_BODY_DATE"), date);
-       eina_strbuf_append_printf(temp_str, "<br>%s : %s", _("IDS_COM_BODY_DETAILS_TIME"), time);
+       eina_strbuf_append_printf(temp_str, "<br>%s : %s", _("IDS_ST_HEADER_TIME"), time);
        eina_strbuf_append_printf(temp_str, "<br>%s : %s", _("IDS_ST_BODY_NUMBER"), number);
 
        SETTING_TRACE("temp_str: %s", temp_str);
@@ -574,19 +577,16 @@ static void *setting_phone_ug_on_create(ui_gadget_h ug, enum ug_mode mode,
        /* register view node table */
        setting_view_node_table_intialize();
 
-       setting_create_Gendial_itc("1line", &(phoneUG->itc_1text_1icon_2));
-       setting_create_Gendial_itc("1line", &(phoneUG->itc_1text_1icon));
+       setting_create_Gendial_itc(SETTING_GENLIST_ICON_1LINE_STYLE, &(phoneUG->itc_1text_1icon_2));
+       setting_create_Gendial_itc(SETTING_GENLIST_ICON_1LINE_STYLE, &(phoneUG->itc_1text_1icon));
+       setting_create_Gendial_itc(SETTING_GENLIST_ICON_1LINE_STYLE, &(phoneUG->itc_1text_tb));
+       setting_create_Gendial_itc(SETTING_GENLIST_ICON_1LINE_STYLE, &(phoneUG->itc_1text));
+       setting_create_Gendial_itc(SETTING_GENLIST_ICON_1LINE_STYLE, &(phoneUG->itc_1icon_1text_sub));
 
        /* 2 text - genlist > items */
        setting_create_Gendial_itc("dialogue/2text", &(phoneUG->itc_1icon_2text));
-
-       setting_create_Gendial_itc("1line", &(phoneUG->itc_1text_tb));
-       setting_create_Gendial_itc("1line", &(phoneUG->itc_1text));
-       setting_create_Gendial_itc("2line.top", &(phoneUG->itc_2text_3_parent));
-       setting_create_Gendial_itc("1line", &(phoneUG->itc_1icon_1text_sub));
-
-
-       setting_create_Gendial_itc("2line.top", &(phoneUG->itc_2text_2));
+       setting_create_Gendial_itc(SETTING_GENLIST_2LINE_STYLE, &(phoneUG->itc_2text_3_parent));
+       setting_create_Gendial_itc(SETTING_GENLIST_2LINE_STYLE, &(phoneUG->itc_2text_2));
        setting_create_Gendial_itc("multiline/1text",
                                   &(phoneUG->itc_bg_1icon));
        phoneUG->pattern_generator = NULL;
@@ -808,9 +808,39 @@ UG_MODULE_API int setting_plugin_search_init(app_control_h service, void *priv,
        int i;
        int size = sizeof(s_cfg_node_array) / sizeof(s_cfg_node_array[0]);
        for (i = 0; i < size; i++) {
-               Setting_Cfg_Node_T *node = setting_plugin_search_item_subindex_add(s_cfg_node_array[i].key_name, s_cfg_node_array[i].ug_args, IMG_DisplayLanguage, s_cfg_node_array[i].item_type,  s_cfg_node_array[i].data, "Language and Region");
+               Setting_Cfg_Node_T *node = setting_plugin_search_item_subindex_add(s_cfg_node_array[i].key_name, s_cfg_node_array[i].ug_args, IMG_LanguageInput, s_cfg_node_array[i].item_type,  s_cfg_node_array[i].data, "Language and Region");
                *pplist = eina_list_append(*pplist, node);
        }
        return 0;
 }
 
+int set_language_helper(char *lang)
+{
+       #if 0
+       int ret = vconf_set_str(VCONFKEY_LANGSET, lang);
+       if (ret == 0) {
+               /* on success */
+               /* set event system */
+               setting_set_event_system(SYS_EVENT_LANGUAGE_SET, EVT_KEY_LANGUAGE_SET, lang);
+       }
+       #else
+       int ret = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, lang);
+       #endif
+       return ret;
+}
+
+int set_regionformat_helper(char *region)
+{
+
+       #if 0
+       int ret = vconf_set_str(VCONFKEY_REGIONFORMAT, region);
+       if (ret == 0) {
+               /* set event system */
+               setting_set_event_system(SYS_EVENT_REGION_FORMAT, EVT_KEY_REGION_FORMAT, region);
+       }
+       #else
+       int ret = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY, region);
+       #endif
+       return ret;
+}
+