[N_SE-25814] Modify check button event
authorsunil85.kim <sunil85.kim@samsung.com>
Wed, 13 Mar 2013 08:05:55 +0000 (17:05 +0900)
committersunil85.kim <sunil85.kim@samsung.com>
Wed, 13 Mar 2013 08:09:47 +0000 (17:09 +0900)
Change-Id: I0590811c65aee9f72617b962fa9083fcdea03625

debian/changelog
packaging/libug-setting-wifidirect-efl.spec
ug-wifidirect/src/wfd_ug_genlist.c

index 40bd29f..a745b8f 100755 (executable)
@@ -1,3 +1,11 @@
+ug-setting-wifidirect-efl (1.0.9) precise; urgency=low
+
+  * [N_SE-25814] Modify check button event
+  * Git: rsa/apps/home/ug-wifi-direct
+  * Tag: libug-setting-wifidirect-efl_1.0.9
+
+ -- sunil85.kim <isurit@sunil85.kim>  Wed, 13 Mar 2013 17:06:19 +0900
+
 ug-setting-wifidirect-efl (1.0.8) precise; urgency=low
 
   * Fix bug of invitation behavior
index 298dd2b..75d6c25 100755 (executable)
@@ -3,7 +3,7 @@
 
 Name:       libug-setting-wifidirect-efl
 Summary:    Wi-Fi Direct setting UI gadget 
-Version:    1.0.8
+Version:    1.0.9
 Release:    1
 Group:      TO_BE_FILLED
 License:    Flora License
index bb2345c..35d4103 100755 (executable)
@@ -96,6 +96,36 @@ static char *_gl_header_label_get(void *data, Evas_Object *obj, const char *part
 }
 
 /**
+ *  This function let the ug call it when click header
+ *  @return   void
+ *  @param[in] data the pointer to the main data structure
+ *  @param[in] obj the pointer to the evas object
+ *  @param[in] event_info the pointer to the event information
+ */
+static void _gl_header_sel(void *data, Evas_Object *obj, void *event_info)
+{
+       __WDUG_LOG_FUNC_ENTER__;
+       struct ug_data *ugd = (struct ug_data *) data;
+
+       Elm_Object_Item *item = (Elm_Object_Item *)event_info;
+       if (item != NULL)
+               elm_genlist_item_selected_set(item, EINA_FALSE);
+
+       if (ugd == NULL)
+               WDUG_LOGE("Incorrect parameter(NULL)\n");
+       else {
+               if(!ugd->wfd_onoff) {
+                       WDUG_LOGD("Wi-Fi direct switch on\n");
+                       wfd_client_switch_on(ugd);
+               } else {
+                       WDUG_LOGD("Wi-Fi direct switch off\n");
+                       wfd_client_switch_off(ugd);
+               }
+       }
+       __WDUG_LOG_FUNC_EXIT__;
+}
+
+/**
  *     This function let the ug get the icon of header
  *     @return   the icon of header
  *     @param[in] data the pointer to the main data structure
@@ -122,6 +152,7 @@ static Evas_Object *_gl_header_icon_get(void *data, Evas_Object *obj, const char
                onoff = elm_check_add(obj);
                elm_object_style_set(onoff, "on&off");
                elm_check_state_set(onoff, ugd->wfd_onoff);
+               evas_object_smart_callback_add(onoff, "changed", _gl_header_sel , ugd);
                evas_object_show(onoff);
        }