[Bug] Fix N_SE-4038: remove the popup when changing region .
authorJing Yigang <yigang.jing@samsung.com>
Fri, 31 Aug 2012 02:17:16 +0000 (10:17 +0800)
committerJing Yigang <yigang.jing@samsung.com>
Fri, 31 Aug 2012 02:17:16 +0000 (10:17 +0800)
Change-Id: I0e7c5654ff4b92528f72405623db4ef8bda6b9e3

setting-phone/src/setting-phone-region-format.c

index 6c538fb..29440c5 100755 (executable)
@@ -453,11 +453,6 @@ static int setting_phone_region_format_destroy(void *cb)
 
        /*  FIXED : destroy only if it was created. */
        if (setting_view_phone_region_format.is_create) {
-               if (ad->gl_region!= NULL) {
-                       elm_genlist_clear(ad->gl_region);
-                       evas_object_del(ad->gl_region);
-                       ad->gl_region = NULL;
-               }
                if (ad->search_idler) {
                        ecore_idler_del(ad->search_idler);
                        ad->search_idler = NULL;
@@ -521,10 +516,6 @@ setting_phone_region_format_mouse_up_Gendial_list_radio_cb(void *data,
            (Setting_GenGroupItem_Data *) elm_object_item_data_get(item);
        SettingPhoneUG *ad = (SettingPhoneUG *) list_item->userdata;
 
-       if (ad->popup) {
-               return;
-       }
-
        SETTING_TRACE("region_keyStr = %s",
                      ad->region_keyStr[list_item->chk_status]);
        /*  if not change, return */
@@ -533,83 +524,21 @@ setting_phone_region_format_mouse_up_Gendial_list_radio_cb(void *data,
        }
        elm_radio_value_set(radio, list_item->chk_status);
 
-       setting_phone_region_format_close_popup_ex(ad);
-}
-
-static void setting_phone_region_format_close_popup_ex(void *data)
-{
-       SETTING_TRACE_BEGIN;
-       setting_retm_if(data == NULL, "Data parameter is NULL");
-       SettingPhoneUG *ad = (SettingPhoneUG *) data;
-
-       char *msg =
-           "IDS_ST_BODY_CHANGING_REGION_WILL_CLOSE_ALL_APPLICATIONS_AND_UNSAVED_DATA_WILL_BE_LOST_CONTINUE_Q";
-       ad->popup_cb = setting_phone_region_format_exit_cb_ex;
-       ad->popup = setting_create_popup_with_btn(ad, ad->win_get, NULL,
-                                        _(msg), ad->popup_cb, 0, 2,
-                                        _("IDS_COM_SK_YES"), _("IDS_COM_SK_NO"));
-}
-
-
-static void
-setting_phone_region_format_exit_cb_ex(void *data, Evas_Object *obj,
-                                      void *event_info)
-{
-       SETTING_TRACE_BEGIN;
-       setting_retm_if(data == NULL, "Data parameter is NULL");
-       SettingPhoneUG *ad = (SettingPhoneUG *) data;
-
-       switch (btn_type(obj)) {
-       case POPUP_RESPONSE_OK:
-               {
-                       ad->prev_region = elm_radio_value_get(ad->chk_region);
-                       SETTING_TRACE("cur_chk_region = %d", ad->prev_region);
-
-                       char region[MAX_REGION_STRLEN];
-                       memset(region, 0x00, MAX_REGION_STRLEN);
-                       snprintf(region, MAX_REGION_STRLEN, "%s.UTF-8", ad->region_keyStr[ad->prev_region]);
-
-                       int ret =
-                           setting_phone_region_format_set_dateformat
-                           (ad->region_keyStr[ad->prev_region], ad);
-                       setting_retm_if(ret == SETTING_RETURN_FAIL,
-                                       "[Error] set date format fail");
-
-                       ret =
-                           vconf_set_str(VCONFKEY_REGIONFORMAT,region);
-                       setting_retm_if(ret != 0,
-                                       "[Error] set value of VCONFKEY_REGIONFORMAT fail");
-
-                       /* after lang-change, go back to the previous page*/
-                       setting_view_change(&setting_view_phone_region_format ,
-                                                               &setting_view_phone_language_region, ad);
-
-                       break;
-               }
-       case POPUP_RESPONSE_CANCEL:
-               {
-                       elm_radio_value_set(ad->chk_region, ad->prev_region);
-                       if (ad->popup) {
-                               evas_object_del(ad->popup);
-                               ad->popup = NULL;
-                       }
-                       return;
-               }
-       default:
-               {
-                       if (ad->popup) {
-                               evas_object_del(ad->popup);
-                               ad->popup = NULL;
-                       }
-                       return;
-               }
-       }
-
-       if (ad->popup) {
-               evas_object_del(ad->popup);
-               ad->popup = NULL;
-       }
-       /* elm_exit(); */
+       ad->prev_region = list_item->chk_status;
+       SETTING_TRACE("cur_chk_region = %d", ad->prev_region);
+
+       char region[MAX_REGION_STRLEN] = {0,};
+       snprintf(region, MAX_REGION_STRLEN, "%s.UTF-8", ad->region_keyStr[ad->prev_region]);
+
+       int ret = setting_phone_region_format_set_dateformat(ad->region_keyStr[ad->prev_region], ad);
+       setting_retm_if(ret == SETTING_RETURN_FAIL, "[Error] set date format fail");
+       
+       ret = vconf_set_str(VCONFKEY_REGIONFORMAT,region);
+       setting_retm_if(ret != 0, "[Error] set value of VCONFKEY_REGIONFORMAT fail");
+       
+       /* after changed, go back to the previous page*/
+       setting_view_change(&setting_view_phone_region_format ,
+                               &setting_view_phone_language_region, ad);
 }
 
 static int