Handling disconnecting status 15/17615/2
authorHyunjee Kim <hj0426.kim@samsung.com>
Mon, 20 Jan 2014 06:12:01 +0000 (15:12 +0900)
committerhyunjee Kim <hj0426.kim@samsung.com>
Fri, 7 Mar 2014 08:26:45 +0000 (00:26 -0800)
Change-Id: I392fa82ad8e940057fb70e6bad733ebff61d844d
Signed-off-by: Hyunjee Kim <hj0426.kim@samsung.com>
packaging/wifi-efl-ug.spec
sources/ui-gadget/include/ug_wifi.h
sources/ui-gadget/viewers-layout/wifi_viewer_list.c

index 740e264..1be849e 100644 (file)
@@ -1,6 +1,6 @@
 Name:       wifi-efl-ug
 Summary:    Wi-Fi UI Gadget
-Version:    0.5.2_45
+Version:    0.5.2_46
 Release:    1
 Group:      App/Network
 License:    Flora License
index 948ce6f..dc152fd 100644 (file)
@@ -78,6 +78,7 @@ typedef struct {
        char *rbutton_setup_wizard_skip;
        popup_manager_object_t *popup_manager;
        eap_connect_data_t *eap_view;
+       bool is_disconnect;
 } wifi_appdata ;
 
 int wifi_exit(void);
index f75ca26..b6eebd4 100644 (file)
@@ -464,6 +464,7 @@ static void __viewer_list_item_clicked_cb(void *data, Evas_Object *obj,
 
        int item_state = gdata->radio_mode;
        int current_state = 0;
+       int ret = -1;
 
        INFO_LOG(UG_NAME_NORMAL, "ssid --- %s", device_info->ssid);
        INFO_LOG(UG_NAME_NORMAL, "ap --- 0x%x", device_info->ap);
@@ -477,8 +478,8 @@ static void __viewer_list_item_clicked_cb(void *data, Evas_Object *obj,
                INFO_LOG(UG_NAME_NORMAL, "header mode [%d]", current_state);
 
                switch (current_state) {
-               case HEADER_MODE_ON:
                case HEADER_MODE_CONNECTED:
+               case HEADER_MODE_ON:
                case HEADER_MODE_CONNECTING:
                        __viewer_list_wifi_connect(device_info);
                        break;
@@ -493,8 +494,15 @@ static void __viewer_list_item_clicked_cb(void *data, Evas_Object *obj,
                }
                break;
 
-       case VIEWER_ITEM_RADIO_MODE_CONNECTING:
        case VIEWER_ITEM_RADIO_MODE_CONNECTED:
+               ret = wlan_manager_disconnect(device_info->ap);
+               if (ret != WLAN_MANAGER_ERR_NONE)
+                       ERROR_LOG(UG_NAME_NORMAL, "Failed disconnect [0x%x]", device_info);
+               else
+                       ug_app_state->is_disconnect = true;
+               break;
+
+       case VIEWER_ITEM_RADIO_MODE_CONNECTING:
        default:
                INFO_LOG(UG_NAME_NORMAL, "Ignore click");
                break;
@@ -510,7 +518,10 @@ static char *viewer_list_get_device_status_txt(wifi_device_info_t *wifi_device,
        char *status_txt = NULL;
        /* The strings are currently hard coded. It will be replaced with string ids later */
        if (VIEWER_ITEM_RADIO_MODE_CONNECTING == mode) {
-               status_txt = g_strdup(sc(PACKAGE, I18N_TYPE_Connecting));
+               if (ug_app_state->is_disconnect)
+                       status_txt = g_strdup(sc(PACKAGE, I18N_TYPE_Disconnecting));
+               else
+                       status_txt = g_strdup(sc(PACKAGE, I18N_TYPE_Connecting));
        } else if (VIEWER_ITEM_RADIO_MODE_CONNECTED == mode) {
                status_txt = g_strdup(sc(PACKAGE, I18N_TYPE_Connected));
        } else if (VIEWER_ITEM_RADIO_MODE_OFF == mode) {
@@ -519,6 +530,7 @@ static char *viewer_list_get_device_status_txt(wifi_device_info_t *wifi_device,
                status_txt = g_strdup(sc(PACKAGE, I18N_TYPE_Unknown));
                INFO_LOG(UG_NAME_NORMAL, "Invalid mode: %d", mode);
        }
+       ug_app_state->is_disconnect = false;
        return status_txt;
 }
 
@@ -530,6 +542,7 @@ Evas_Object* viewer_list_create(Evas_Object *win)
        first_item = NULL;
        last_item = NULL;
        grouptitle = NULL;
+       ug_app_state->is_disconnect = false;
 
        assertm_if(NULL == win, "NULL!!");
        viewer_list = elm_genlist_add(win);