[Bug] Fix N_SE-13906, N_SE-13353, N_SE-13514, N_SE-14415, N_SE-13999, N_SE-14395...
authoryigang.jing <yigang.jing@samsung.com>
Tue, 20 Nov 2012 09:00:21 +0000 (17:00 +0800)
committeryigang.jing <yigang.jing@samsung.com>
Thu, 22 Nov 2012 06:26:18 +0000 (14:26 +0800)
Change-Id: I9f59c717144afacfe214e5fc39ac941ebf724838

setting-about/include/setting-about.h
setting-about/src/setting-about-main.c
setting-common/src/setting-common-draw-genlist.c
setting-common/src/setting-common-draw-searchbar.c

index 10b0d8b..4a9df4e 100755 (executable)
@@ -94,6 +94,9 @@ struct _SettingAboutUG {
        TelSimMsisdnList_t my_numbers;
        bool popup_showed_flag; /** if popup has been showed, do not show again*/
 //     MOBILE_AP_HANDLE mobile_ap_handle;
+
+       char *pre_name;  /* store name */
+       bool mouse_move_flag;
 };
 
 extern setting_view setting_view_about_main;
index 539f60a..02b0d62 100755 (executable)
@@ -123,7 +123,7 @@ static void __device_name_changed_cb(void *data, Evas_Object *obj)
 
        SETTING_TRACE("maxLengthReachFlag:[%d], enterKeyPressFlag:%d", list_item->maxLengthReachFlag, list_item->enterKeyPressFlag);
        /* show the popup if the text already reaches max length and the input character is not the enter key */
-       if (list_item->maxLengthReachFlag && list_item->enterKeyPressFlag == false) {
+       if (list_item->maxLengthReachFlag && list_item->enterKeyPressFlag == FALSE) {
                if (!list_item->notify) {
                        list_item->notify = setting_create_popup_without_btn(list_item, list_item->win_main,
                                                                 NULL, _(EXCEED_LIMITATION_STR),
@@ -135,8 +135,18 @@ static void __device_name_changed_cb(void *data, Evas_Object *obj)
                        elm_popup_timeout_set(list_item->notify, POPUP_INTERVAL);
                }
        }
-       list_item->maxLengthReachFlag = false;
-       list_item->enterKeyPressFlag = false;
+
+       if (list_item->enterKeyPressFlag == TRUE) {
+               SETTING_TRACE("ad->pre_name:[%s]", ad->pre_name);
+               elm_entry_entry_set(obj, ad->pre_name);
+       } else {
+               G_FREE(ad->pre_name);
+               ad->pre_name = (char *)g_strdup(entry_str);
+               SETTING_TRACE("ad->pre_name:[%s]", ad->pre_name);
+       }
+
+       list_item->maxLengthReachFlag = FALSE;
+       list_item->enterKeyPressFlag = FALSE;
 
 #if DEVNAME_BLOCK_SPACE
        //block 'Space' key
@@ -166,9 +176,9 @@ static void __device_name_changed_cb(void *data, Evas_Object *obj)
 #endif
        //for genlist update
        G_FREE(list_item->sub_desc);//release first
-       list_item->sub_desc = (char *)g_strdup(entry_str);
+       list_item->sub_desc = (char *)g_strdup(ad->pre_name);
 
-       if (isSpaceStr(entry_str)) {
+       if (isSpaceStr(ad->pre_name)) {
                if (!ad->empty_flag)
                {
                        ad->empty_flag = TRUE;
@@ -496,14 +506,28 @@ static Eina_Bool __timer_update_cb(const void *data)
        return TRUE;
 }
 
-static void
-__about_main_gl_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event)
+static void __about_main_gl_drag(void *data, Evas_Object *obj, void *event)
+{
+       //SETTING_TRACE_BEGIN;
+       ret_if(!data);
+       retm_if(event == NULL, "Invalid argument: event info is NULL");
+       SettingAboutUG *ad = (SettingAboutUG *) data;
+       ad->mouse_move_flag = TRUE;
+}
+
+static void __about_main_gl_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event)
 {
+       SETTING_TRACE_BEGIN;
        ret_if(!data);
        SettingAboutUG *ad = (SettingAboutUG *) data;
        retm_if(event == NULL, "Invalid argument: event info is NULL");
        Evas_Event_Mouse_Up *ev = (Evas_Event_Mouse_Up *)event;
 
+       if (ad->mouse_move_flag) {
+               ad->mouse_move_flag = FALSE;
+               return;
+       }
+
        if (ad->item_dev_name) {
                Elm_Object_Item *selected_item = elm_genlist_at_xy_item_get(ad->genlsit, ev->output.x, ev->output.y, NULL);
                if (ad->item_dev_name->item == selected_item)//do nothing..
@@ -557,12 +581,12 @@ static void __entry_unfocus_cb(void *data, Evas_Object *obj, void *event_info)
                        }
                        ad->popup = setting_create_popup_without_btn(ad, ad->win_get, NULL, _(EMPTY_LIMITATION_STR),
                                             __about_popup_rsp_cb, POPUP_INTERVAL, FALSE, FALSE);
+                       FREE(entry_str_utf8);
                        return;
                } else {
                }
        }
 
-
        if (0 != vconf_set_str(VCONFKEY_SETAPPL_DEVICE_NAME_STR, entry_str_utf8)) {
                SETTING_TRACE_ERROR("Set vconf[%s] failed",
                                    VCONFKEY_SETAPPL_DEVICE_NAME_STR);
@@ -570,6 +594,7 @@ static void __entry_unfocus_cb(void *data, Evas_Object *obj, void *event_info)
 
        FREE(entry_str_utf8);
 
+       elm_entry_select_none(obj);
 }
 
 static void __entry_key_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
@@ -582,7 +607,7 @@ static void __entry_key_down_cb(void *data, Evas *e, Evas_Object *obj, void *eve
           || safeStrCmp(ev->key, "Return") == 0)
        {
                // if entry has 1 char at list, hide ime.
-               if(isSpaceStr(elm_entry_entry_get(obj)))
+               /*if(isSpaceStr(elm_entry_entry_get(obj)))
                {
                        if (ad->popup) {
                                evas_object_del(ad->popup);
@@ -590,7 +615,7 @@ static void __entry_key_down_cb(void *data, Evas *e, Evas_Object *obj, void *eve
                        }
                        ad->popup = setting_create_popup_without_btn(ad, ad->win_get, NULL, _(EMPTY_LIMITATION_STR),
                                             __about_popup_rsp_cb, POPUP_INTERVAL, FALSE, FALSE);
-               }
+               }*/
        }
 }
 
@@ -886,6 +911,8 @@ static int setting_about_main_create(void *cb)
                                           NULL, NULL, ad, conformant,
                                           &ad->navi_bar, NULL);
 
+       evas_object_smart_callback_add(scroller, "drag", __about_main_gl_drag, ad);
+
        evas_object_event_callback_add(scroller, EVAS_CALLBACK_MOUSE_UP,
                                       __about_main_gl_mouse_up, ad);
 
@@ -924,6 +951,8 @@ static int setting_about_main_destroy(void *cb)
                ad->ly_main = NULL;
        }
 
+       G_FREE(ad->pre_name);
+
        setting_view_about_main.is_create = 0;
        return SETTING_RETURN_SUCCESS;
 }
@@ -1160,6 +1189,7 @@ static void __setting_about_main_device_name_clicked(void *data, Evas_Object *ob
 
        if (!elm_object_focus_get(obj)) {
                elm_object_focus_set(obj, EINA_TRUE);
+               elm_entry_cursor_end_set(obj);
        }
 
        //Ecore_IMF_Context *imf_context = (Ecore_IMF_Context *)elm_entry_imf_context_get(obj);
index 76395f1..0d52ec4 100755 (executable)
@@ -124,7 +124,7 @@ static void __entry_changed(void *data, Evas_Object *obj, void *event_info)
        {
                if (elm_entry_is_empty(obj))
                {
-                       elm_object_signal_emit(entry_container, "elm,state,guidetext,show", "elm");
+                       //elm_object_signal_emit(entry_container, "elm,state,guidetext,show", "elm");
                        elm_object_signal_emit(entry_container, "elm,state,eraser,hide", "elm");
                }
                else
@@ -490,7 +490,7 @@ static Evas_Object *__add_button(Setting_GenGroupItem_Data *item_data, Evas_Obje
 static Evas_Object *__add_entry(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
 {
        retv_if(!item_data || !parent, NULL);
-       elm_genlist_mode_set(parent, ELM_LIST_COMPRESS);        /* resolve abnormal height issue */
+       //elm_genlist_mode_set(parent, ELM_LIST_COMPRESS);      /* resolve abnormal height issue */
        Evas_Object *ed_name =
            setting_create_editfiled(parent, _(item_data->keyStr),
                                     item_data->sub_desc);
index 1b432bd..91bb7d1 100755 (executable)
@@ -70,7 +70,7 @@ static void __searchbar_chg_cb(void *data, Evas_Object *obj, void *event_info)
        if(safeStrLen(elm_entry_entry_get(obj)) > 0) {
                elm_object_signal_emit(searchbar_layout, "elm,state,guidetext,hide", "elm");
        } else {
-               elm_object_signal_emit(searchbar_layout, "elm,state,guidetext,show", "elm");
+               //elm_object_signal_emit(searchbar_layout, "elm,state,guidetext,show", "elm");
        }
 }