[N_SE-36723] Added notification state check function
authorsunil85.kim <sunil85.kim@samsung.com>
Tue, 30 Apr 2013 02:27:06 +0000 (11:27 +0900)
committersunil85.kim <sunil85.kim@samsung.com>
Tue, 30 Apr 2013 02:27:27 +0000 (11:27 +0900)
debian/changelog
packaging/wifi-efl-ug.spec
sources/ui-gadget/include/viewer_manager.h
sources/ui-gadget/viewers-layout/viewer_manager.c
sources/ui-gadget/wifi-efl-UG.c

index 6b86460..023cb3c 100644 (file)
@@ -1,3 +1,11 @@
+wifi-efl-ug (0.5.2-14) precise; urgency=low
+
+  * [N_SE-36723] Added notification state check function
+  * Git: magnolia/apps/home/ug-wifi-efl
+  * Tag: wifi-efl-ug_0.5.2-14
+
+ -- sunil85.kim <isurit@sunil85.kim>  Tue, 30 Apr 2013 09:52:17 +0900
+
 wifi-efl-ug (0.5.2-13) precise; urgency=low
 
   * Fix bux TREL-368
index 03df686..6b50f3d 100644 (file)
@@ -1,6 +1,6 @@
 Name:       wifi-efl-ug
 Summary:    Wi-Fi UI Gadget
-Version:    0.5.2_13
+Version:    0.5.2_14
 Release:    1
 Group:      App/Network
 License:    Flora License
index 5d92474..86f9ed8 100644 (file)
@@ -29,6 +29,8 @@ extern "C"
 #include <Elementary.h>
 
 #include "wlan_manager.h"
+#include <vconf.h>
+#include <vconf-keys.h>
 
 typedef enum {
        HEADER_MODE_OFF = 0x01,
@@ -72,6 +74,7 @@ void viewer_manager_specific_scan_response_hlr(GSList *bss_info_list,
                void *user_data);
 void viewer_manager_refresh_ap_info(Elm_Object_Item *item);
 void viewer_manager_update_rssi(void);
+void notification_state_change_cb(keynode_t *node, void *user_data);
 
 #ifdef __cplusplus
 }
index a063997..cdfc281 100644 (file)
@@ -17,8 +17,6 @@
  *
  */
 
-#include <vconf-keys.h>
-
 #include "common.h"
 #include "ug_wifi.h"
 #include "viewer_list.h"
@@ -462,6 +460,7 @@ static Evas_Object *_gl_bottom_content_get(void *data,
        evas_object_propagate_events_set(toggle_btn, EINA_FALSE);
 
        ret = common_util_get_system_registry(VCONFKEY_WIFI_ENABLE_QS);
+
        switch (ret) {
        case 1:
                ao = elm_object_item_access_object_get(manager_object->item_bottom);
@@ -544,6 +543,35 @@ static void __viewer_manager_header_create(Evas_Object* genlist)
        __COMMON_FUNC_EXIT__;
 }
 
+void notification_state_change_cb(keynode_t *node, void *user_data)
+{
+       __COMMON_FUNC_ENTER__;
+
+       int notification_state;
+       Evas_Object *target = NULL;
+
+       assertm_if(NULL == manager_object, "manager_object is NULL");
+       assertm_if(NULL == manager_object->item_bottom, "item_bottom is NULL");
+
+       notification_state = common_util_get_system_registry(VCONFKEY_WIFI_ENABLE_QS);
+       target = elm_object_item_access_object_get(manager_object->item_bottom);
+
+       assertm_if(NULL == target, "Target is NULL");
+
+       if (notification_state == 0) {
+               elm_access_info_set(target, ELM_ACCESS_TYPE, "on/off button");
+               elm_access_info_set(target, ELM_ACCESS_STATE, "off");
+               elm_genlist_item_update(manager_object->item_bottom);
+       } else if (notification_state == 1) {
+               elm_access_info_set(target, ELM_ACCESS_TYPE, "on/off button");
+               elm_access_info_set(target, ELM_ACCESS_STATE, "on");
+               elm_genlist_item_update(manager_object->item_bottom);
+       } else
+               ERROR_LOG(UG_NAME_ERR, "Failed to get notification state");
+
+       __COMMON_FUNC_EXIT__;
+}
+
 static void __viewer_manager_bottom_create(Evas_Object* genlist)
 {
        __COMMON_FUNC_ENTER__;
index 848f23a..2685937 100644 (file)
@@ -255,6 +255,8 @@ static void on_start(ui_gadget_h ug, service_h service, void *priv)
 
        motion_start();
 
+       vconf_notify_key_changed(VCONFKEY_WIFI_ENABLE_QS, notification_state_change_cb, NULL);
+
        __COMMON_FUNC_EXIT__;
 }
 
@@ -284,7 +286,6 @@ static void on_resume(ui_gadget_h ug, service_h service, void *priv)
                                                                VCONFKEY_WIFI_UG_RUN_STATE_ON_FOREGROUND);
 
        __make_scan_if_bss_expired();
-
        __COMMON_FUNC_EXIT__;
 }
 
@@ -293,8 +294,7 @@ static void on_destroy(ui_gadget_h ug, service_h service, void *priv)
        __COMMON_FUNC_ENTER__;
 
        int ret;
-       common_util_set_system_registry(VCONFKEY_WIFI_UG_RUN_STATE,
-                                                                       VCONFKEY_WIFI_UG_RUN_STATE_OFF);
+       common_util_set_system_registry(VCONFKEY_WIFI_UG_RUN_STATE, VCONFKEY_WIFI_UG_RUN_STATE_OFF);
 
        if (!ug || !priv){
                __COMMON_FUNC_EXIT__;
@@ -309,6 +309,7 @@ static void on_destroy(ui_gadget_h ug, service_h service, void *priv)
        winset_popup_manager_destroy(ug_app_state->popup_manager);
        ug_app_state->popup_manager = NULL;
        DEBUG_LOG(UG_NAME_NORMAL, "* view_main destroying...");
+       vconf_ignore_key_changed(VCONFKEY_WIFI_ENABLE_QS, notification_state_change_cb);
        viewer_manager_destroy();
        DEBUG_LOG(UG_NAME_NORMAL, "* manager destroy complete");
        DEBUG_LOG(UG_NAME_NORMAL, "* wlan manager destroying...");