From: Kim Gibyoung Date: Wed, 17 Jul 2013 08:15:14 +0000 (+0900) Subject: Change order of popup button X-Git-Tag: submit/tizen_2.2/20130717.150119 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d897ab56e106261d7f36aceb51c81993a92f16e4;p=apps%2Fhome%2Fug-wifi-direct.git Change order of popup button fix bug(N_SE-45954) and relove prevent issue(minor) Change-Id: I60deda45f1dd394def4d2ae69954ebd2c0f8d3b4 --- diff --git a/packaging/libug-setting-wifidirect-efl.spec b/packaging/libug-setting-wifidirect-efl.spec index 1d82003..ca0793b 100755 --- a/packaging/libug-setting-wifidirect-efl.spec +++ b/packaging/libug-setting-wifidirect-efl.spec @@ -3,7 +3,7 @@ Name: libug-setting-wifidirect-efl Summary: Wi-Fi Direct setting UI gadget -Version: 1.1.2 +Version: 1.1.3 Release: 1 Group: TO_BE_FILLED License: Flora License diff --git a/popup-wifidirect/src/wfd-app-popup-view.c b/popup-wifidirect/src/wfd-app-popup-view.c index f286b7d..d6dd497 100755 --- a/popup-wifidirect/src/wfd-app-popup-view.c +++ b/popup-wifidirect/src/wfd-app-popup-view.c @@ -343,6 +343,8 @@ static Evas_Object *wfd_draw_pop_type_c(Evas_Object * win, wfd_popup_t * pop) elm_object_part_content_set(popup, "button1", btn1); evas_object_smart_callback_add(btn1, "clicked", __popup_resp_cb, (void*) pop->resp_data1); + ea_object_event_callback_add(popup, EA_CALLBACK_BACK, __popup_resp_cb, + (void*) pop->resp_data1); btn2 = elm_button_add(popup); elm_object_style_set(btn2, "popup_button/default"); @@ -350,8 +352,6 @@ static Evas_Object *wfd_draw_pop_type_c(Evas_Object * win, wfd_popup_t * pop) elm_object_part_content_set(popup, "button2", btn2); evas_object_smart_callback_add(btn2, "clicked", __popup_resp_cb, (void*) pop->resp_data2); - ea_object_event_callback_add(popup, EA_CALLBACK_BACK, __popup_resp_cb, - (void*) pop->resp_data2); evas_object_show(popup); evas_object_show(win); @@ -551,8 +551,8 @@ Evas_Object *wfd_draw_pop_type_display(Evas_Object * win, wfd_popup_t * pop) elm_object_style_set(label, "popup/default"); elm_label_line_wrap_set(label, ELM_WRAP_MIXED); elm_object_text_set(label, pop->text); - evas_object_size_hint_weight_set(label, EVAS_HINT_EXPAND, 0.0); - evas_object_size_hint_align_set(label, EVAS_HINT_FILL, 0.0); + evas_object_size_hint_weight_set(label, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(label, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_box_pack_end(box, label); evas_object_show(label); @@ -593,6 +593,8 @@ Evas_Object *wfd_draw_pop_type_display(Evas_Object * win, wfd_popup_t * pop) elm_object_part_content_set(popup, "button1", btn1); evas_object_smart_callback_add(btn1, "clicked", __popup_resp_cb, (void*) pop->resp_data1); + ea_object_event_callback_add(popup, EA_CALLBACK_BACK, __popup_resp_cb, + (void*) pop->resp_data1); } if (pop->resp_data2 == WFD_POP_RESP_APRV_CONNECT_NO) { @@ -603,8 +605,6 @@ Evas_Object *wfd_draw_pop_type_display(Evas_Object * win, wfd_popup_t * pop) elm_object_part_content_set(popup, "button2", btn2); evas_object_smart_callback_add(btn2, "clicked", __popup_resp_cb, (void*) pop->resp_data2); - ea_object_event_callback_add(popup, EA_CALLBACK_BACK, __popup_resp_cb, - (void*) pop->resp_data2); } elm_object_content_set(popup, box); @@ -665,7 +665,7 @@ Evas_Object *wfd_draw_pop_type_keypad(Evas_Object * win, wfd_popup_t * pop) elm_object_style_set(label, "popup/default"); elm_label_line_wrap_set(label, ELM_WRAP_MIXED); elm_object_text_set(label, pop->text); - evas_object_size_hint_weight_set(label, EVAS_HINT_EXPAND, 0.0); + evas_object_size_hint_weight_set(label, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(label, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_box_pack_end(box, label); evas_object_show(label); @@ -707,14 +707,14 @@ Evas_Object *wfd_draw_pop_type_keypad(Evas_Object * win, wfd_popup_t * pop) elm_object_text_set(btn1, pop->label1); elm_object_part_content_set(pinpopup, "button1", btn1); evas_object_smart_callback_add(btn1, "clicked", __popup_resp_cb, (void *)pop->resp_data1); + ea_object_event_callback_add(pinpopup, EA_CALLBACK_BACK, __popup_resp_cb, + (void*) pop->resp_data1); btn2 = elm_button_add(pinpopup); elm_object_style_set(btn2, "popup_button/default"); elm_object_text_set(btn2, pop->label2); elm_object_part_content_set(pinpopup, "button2", btn2); evas_object_smart_callback_add(btn2, "clicked", __popup_resp_cb, (void *)pop->resp_data2); - ea_object_event_callback_add(pinpopup, EA_CALLBACK_BACK, __popup_resp_cb, - (void*) pop->resp_data2); elm_object_content_set(pinpopup, box); evas_object_show(pinpopup); @@ -747,10 +747,10 @@ void wfd_prepare_popup(int type, void *userdata) case /* MT */ WFD_POP_APRV_CONNECTION_WPS_PUSHBUTTON_REQ: snprintf(pop->text, sizeof(pop->text), IDS_WFD_POP_CONNECT_Q, ad->peer_name); - snprintf(pop->label1, sizeof(pop->label1), "%s", dgettext("sys_string", "IDS_COM_SK_YES")); - snprintf(pop->label2, sizeof(pop->label2), "%s", dgettext("sys_string", "IDS_COM_SK_NO")); - pop->resp_data1 = WFD_POP_RESP_APRV_CONNECT_PBC_YES; - pop->resp_data2 = WFD_POP_RESP_APRV_CONNECT_NO; + snprintf(pop->label1, sizeof(pop->label1), "%s", dgettext("sys_string", "IDS_COM_SK_NO")); + snprintf(pop->label2, sizeof(pop->label2), "%s", dgettext("sys_string", "IDS_COM_SK_YES")); + pop->resp_data1 = WFD_POP_RESP_APRV_CONNECT_NO; + pop->resp_data2 = WFD_POP_RESP_APRV_CONNECT_PBC_YES; ad->popup = wfd_draw_pop_type_c(ad->win, pop); break; @@ -758,10 +758,10 @@ void wfd_prepare_popup(int type, void *userdata) case WFD_POP_APRV_CONNECTION_INVITATION_REQ: snprintf(pop->text, sizeof(pop->text), IDS_WFD_POP_CONNECT_Q, ad->peer_name); - snprintf(pop->label1, sizeof(pop->label1), "%s", dgettext("sys_string", "IDS_COM_SK_YES")); - snprintf(pop->label2, sizeof(pop->label2), "%s", dgettext("sys_string", "IDS_COM_SK_NO")); - pop->resp_data1 = WFD_POP_RESP_APRV_CONNECT_INVITATION_YES; - pop->resp_data2 = WFD_POP_RESP_APRV_CONNECT_NO; + snprintf(pop->label1, sizeof(pop->label1), "%s", dgettext("sys_string", "IDS_COM_SK_NO")); + snprintf(pop->label2, sizeof(pop->label2), "%s", dgettext("sys_string", "IDS_COM_SK_YES")); + pop->resp_data1 = WFD_POP_RESP_APRV_CONNECT_NO; + pop->resp_data2 = WFD_POP_RESP_APRV_CONNECT_INVITATION_YES; ad->popup = wfd_draw_pop_type_c(ad->win, pop); break; @@ -769,11 +769,11 @@ void wfd_prepare_popup(int type, void *userdata) case /* MT */ WFD_POP_APRV_CONNECTION_WPS_DISPLAY_REQ: snprintf(pop->text, sizeof(pop->text), IDS_WFD_POP_ENTER_PIN_WITH_KEYPAD, ad->peer_name); - snprintf(pop->label1, sizeof(pop->label1), "%s", dgettext("sys_string", "IDS_COM_SK_OK")); - snprintf(pop->label2, sizeof(pop->label2), "%s", dgettext("sys_string", "IDS_COM_POP_CANCEL")); + snprintf(pop->label1, sizeof(pop->label1), "%s", dgettext("sys_string", "IDS_COM_POP_CANCEL")); + snprintf(pop->label2, sizeof(pop->label2), "%s", dgettext("sys_string", "IDS_COM_SK_OK")); pop->timeout = WFD_POP_TIMER_120; - pop->resp_data1 = WFD_POP_RESP_APRV_CONNECT_DISPLAY_OK; - pop->resp_data2 = WFD_POP_RESP_APRV_CONNECT_NO; + pop->resp_data1 = WFD_POP_RESP_APRV_CONNECT_NO; + pop->resp_data2 = WFD_POP_RESP_APRV_CONNECT_DISPLAY_OK; ad->popup = wfd_draw_pop_type_c(ad->win, pop); break; @@ -781,11 +781,11 @@ void wfd_prepare_popup(int type, void *userdata) case /* MT */ WFD_POP_APRV_CONNECTION_WPS_KEYPAD_REQ: snprintf(pop->text, sizeof(pop->text), IDS_WFD_POP_ENTER_PIN, ad->peer_name, WFD_POP_TIMER_120); - snprintf(pop->label1, sizeof(pop->label1), "%s", dgettext("sys_string", "IDS_COM_SK_OK")); - snprintf(pop->label2, sizeof(pop->label2), "%s", dgettext("sys_string", "IDS_COM_POP_CANCEL")); + snprintf(pop->label1, sizeof(pop->label1), "%s", dgettext("sys_string", "IDS_COM_POP_CANCEL")); + snprintf(pop->label2, sizeof(pop->label2), "%s", dgettext("sys_string", "IDS_COM_SK_OK")); pop->timeout = WFD_POP_TIMER_120; - pop->resp_data1 = WFD_POP_RESP_APRV_CONNECT_KEYPAD_YES; - pop->resp_data2 = WFD_POP_RESP_APRV_CONNECT_NO; + pop->resp_data1 = WFD_POP_RESP_APRV_CONNECT_NO; + pop->resp_data2 = WFD_POP_RESP_APRV_CONNECT_KEYPAD_YES; ad->popup = wfd_draw_pop_type_c(ad->win, pop); break; @@ -802,11 +802,11 @@ void wfd_prepare_popup(int type, void *userdata) case /* MO */ WFD_POP_PROG_CONNECT_WITH_KEYPAD: snprintf(pop->text, sizeof(pop->text), IDS_WFD_POP_CONNECTING_WITH_KEYPAD, ad->peer_name, WFD_POP_TIMER_120, ad->peer_name); - snprintf(pop->label1, sizeof(pop->label1), "%s", dgettext("sys_string", "IDS_COM_SK_OK")); - snprintf(pop->label2, sizeof(pop->label2), "%s", dgettext("sys_string", "IDS_COM_POP_CANCEL")); + snprintf(pop->label1, sizeof(pop->label1), "%s", dgettext("sys_string", "IDS_COM_POP_CANCEL")); + snprintf(pop->label2, sizeof(pop->label2), "%s", dgettext("sys_string", "IDS_COM_SK_OK")); pop->timeout = WFD_POP_TIMER_120; - pop->resp_data1 = WFD_POP_RESP_PROG_CONNECT_KEYPAD_OK; - pop->resp_data2 = WFD_POP_RESP_APRV_CONNECT_NO; + pop->resp_data1 = WFD_POP_RESP_APRV_CONNECT_NO; + pop->resp_data2 = WFD_POP_RESP_PROG_CONNECT_KEYPAD_OK; ad->popup = wfd_draw_pop_type_keypad(ad->win, pop); break; @@ -833,4 +833,4 @@ void wfd_prepare_popup(int type, void *userdata) __WDPOP_LOG_FUNC_EXIT__; return; -} \ No newline at end of file +} diff --git a/ug-wifidirect/src/wfd_ug_about_view.c b/ug-wifidirect/src/wfd_ug_about_view.c index 8c2374b..812694a 100755 --- a/ug-wifidirect/src/wfd_ug_about_view.c +++ b/ug-wifidirect/src/wfd_ug_about_view.c @@ -78,7 +78,6 @@ void _wifid_create_about_view(struct ug_data *ugd) __WDUG_LOG_FUNC_ENTER__; Evas_Object *back_btn = NULL; - Elm_Object_Item *navi_item = NULL; Evas_Object *genlist = NULL; Elm_Object_Item *item = NULL; @@ -110,7 +109,7 @@ void _wifid_create_about_view(struct ug_data *ugd) evas_object_smart_callback_add(back_btn, "clicked", _about_view_back_btn_cb, (void *)ugd); elm_object_focus_allow_set(back_btn, EINA_FALSE); - navi_item = elm_naviframe_item_push(ugd->naviframe, IDS_WFD_TITLE_ABOUT_WIFI_DIRECT, back_btn, NULL, genlist, NULL); + elm_naviframe_item_push(ugd->naviframe, IDS_WFD_TITLE_ABOUT_WIFI_DIRECT, back_btn, NULL, genlist, NULL); __WDUG_LOG_FUNC_EXIT__; } diff --git a/ug-wifidirect/src/wfd_ug_popup.c b/ug-wifidirect/src/wfd_ug_popup.c index ff4b0fb..0b807bf 100755 --- a/ug-wifidirect/src/wfd_ug_popup.c +++ b/ug-wifidirect/src/wfd_ug_popup.c @@ -221,7 +221,6 @@ void wfd_ug_act_popup(void *data, const char *message, int popup_type) Evas_Object *btn1 = NULL, *btn2 = NULL; popup = elm_popup_add(ugd->base); - ea_object_event_callback_add(popup, EA_CALLBACK_BACK, ea_popup_back_cb, NULL); evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_object_text_set(popup, message); @@ -232,11 +231,11 @@ void wfd_ug_act_popup(void *data, const char *message, int popup_type) /* set the different text by type */ if (popup_type == POPUP_TYPE_WIFI_OFF || popup_type == POPUP_TYPE_HOTSPOT_OFF) { - elm_object_text_set(btn1, S_("IDS_COM_SK_YES")); - elm_object_text_set(btn2, S_("IDS_COM_SK_NO")); + elm_object_text_set(btn1, S_("IDS_COM_SK_NO")); + elm_object_text_set(btn2, S_("IDS_COM_SK_YES")); } else { - elm_object_text_set(btn1, S_("IDS_COM_SK_OK")); - elm_object_text_set(btn2, S_("IDS_COM_SK_CANCEL")); + elm_object_text_set(btn1, S_("IDS_COM_SK_CANCEL")); + elm_object_text_set(btn2, S_("IDS_COM_SK_OK")); } elm_object_part_content_set(popup, "button1", btn1); @@ -244,16 +243,18 @@ void wfd_ug_act_popup(void *data, const char *message, int popup_type) /* set the different callback by type */ if (popup_type == POPUP_TYPE_WIFI_OFF) { - evas_object_smart_callback_add(btn1, "clicked", _wfd_ug_act_popup_wifi_ok_cb, (void *)ugd); - evas_object_smart_callback_add(btn2, "clicked", _wfd_ug_act_popup_wifi_cancel_cb, (void *)ugd); + evas_object_smart_callback_add(btn1, "clicked", _wfd_ug_act_popup_wifi_cancel_cb, (void*) ugd); + ea_object_event_callback_add(popup, EA_CALLBACK_BACK, _wfd_ug_act_popup_wifi_cancel_cb, (void*) ugd); + evas_object_smart_callback_add(btn2, "clicked", _wfd_ug_act_popup_wifi_ok_cb, (void*) ugd); } else if (popup_type == POPUP_TYPE_HOTSPOT_OFF) { - evas_object_smart_callback_add(btn1, "clicked", _wfd_ug_act_popup_hotspot_ok_cb, (void *)ugd); - evas_object_smart_callback_add(btn2, "clicked", _wfd_ug_act_popup_hotspot_cancel_cb, (void *)ugd); - } else if (popup_type == POP_TYPE_DISCONNECT || - popup_type == POP_TYPE_DISCONNECT_ALL || - popup_type == POP_TYPE_SCAN_AGAIN) { - evas_object_smart_callback_add(btn1, "clicked", _wfd_ug_act_popup_disconnect_all_ok_cb, (void *)ugd); - evas_object_smart_callback_add(btn2, "clicked", _wfd_ug_act_popup_disconnect_all_cancel_cb, (void *)ugd); + evas_object_smart_callback_add(btn1, "clicked", _wfd_ug_act_popup_hotspot_cancel_cb, (void*) ugd); + ea_object_event_callback_add(popup, EA_CALLBACK_BACK, _wfd_ug_act_popup_hotspot_cancel_cb, (void*) ugd); + evas_object_smart_callback_add(btn2, "clicked", _wfd_ug_act_popup_hotspot_ok_cb, (void*) ugd); + } else if (popup_type == POP_TYPE_DISCONNECT || popup_type == POP_TYPE_DISCONNECT_ALL || + popup_type == POP_TYPE_SCAN_AGAIN) { + evas_object_smart_callback_add(btn1, "clicked", _wfd_ug_act_popup_disconnect_all_cancel_cb, (void*) ugd); + ea_object_event_callback_add(popup, EA_CALLBACK_BACK, _wfd_ug_act_popup_disconnect_all_cancel_cb, (void*) ugd); + evas_object_smart_callback_add(btn2, "clicked", _wfd_ug_act_popup_disconnect_all_ok_cb, (void*) ugd); } evas_object_show(popup);