Call destroy function for wireless popups 69/137569/1
authorAbhishek Sansanwal <abhishek.s94@samsung.com>
Thu, 6 Jul 2017 10:41:47 +0000 (16:11 +0530)
committerAbhishek Sansanwal <abhishek.s94@samsung.com>
Thu, 6 Jul 2017 10:44:39 +0000 (16:14 +0530)
Description: Instead of hiding popups individually
the destroy function is called which takes cares of
hiding wireless popups

Signed-off-by: Abhishek Sansanwal <abhishek.s94@samsung.com>
Change-Id: Id5e09de34086174ebe399942e3683e55715eb9a8

src/layout/layout_network.c

index 993b62a..170a06b 100644 (file)
@@ -566,6 +566,7 @@ void _popup_connecting_wired_status(struct _priv *priv)
 void _popup_connecting_wireless_status(struct _priv *priv)
 {
        Evas_Object *ly, *stop_btn;
+       _destroy_wireless_status_popup();
        connecting_wireless_popup = utils_add_popup(priv->base, STYLE_POPUP, STR_WIRELESS, NULL);
         if (!connecting_wireless_popup) {
                 _ERR("Add popup failed");
@@ -597,6 +598,7 @@ void _popup_connecting_wireless_status(struct _priv *priv)
 void _popup_connected_wireless_status(struct _priv *priv)
 {
         Evas_Object *ly, *done_btn;
+       _destroy_wireless_status_popup();
         connected_wireless_popup = utils_add_popup(priv->base, STYLE_POPUP, STR_WIRELESS, NULL);
         if (!connected_wireless_popup) {
                 _ERR("Add popup failed");
@@ -627,6 +629,7 @@ void _popup_connected_wireless_status(struct _priv *priv)
 void _popup_failed_wireless_status(struct _priv *priv)
 {
         Evas_Object *ly, *close_btn, *retry_btn;
+       _destroy_wireless_status_popup();
         failed_wireless_popup = utils_add_popup(priv->base, STYLE_POPUP, STR_WIRELESS, NULL);
         if (!failed_wireless_popup) {
                 _ERR("Add popup failed");
@@ -1019,8 +1022,6 @@ void _wireless_selected_cb(Elm_Object_Item *it, void *data)
        } else {
                if (!viewmgr_update_view(VIEW_WIRELESS_LIST, VIEW_HIDE, priv))
                        _ERR("Hide view failed");
-               evas_object_hide(failed_wireless_popup);
-               evas_object_hide(connected_wireless_popup);
                _popup_connecting_wireless_status(priv);
                if (!datamgr_select(priv->wirelessmgr, it, NULL)) {
                        _ERR("Unavailable status for selecting wifi.");
@@ -1278,8 +1279,6 @@ static void _data_event_cb(enum event_type type, void *data)
 
        case EVENT_DATA_SELECT_FAIL:
                _DBG("Failed to connect");
-               evas_object_hide(connecting_wireless_popup);
-               evas_object_hide(connected_wireless_popup);
                _popup_failed_wireless_status(priv);
 
 /*             listmgr_foreach_list(priv->listmgr, LIST_WIRELESS,
@@ -1303,8 +1302,6 @@ static void _data_event_cb(enum event_type type, void *data)
 
        case EVENT_DATA_CONNECTED:
                _DBG("Connected succesfully");
-               evas_object_hide(connecting_wireless_popup);
-               evas_object_hide(failed_wireless_popup);
                _popup_connected_wireless_status(priv);
                elm_object_item_signal_emit(priv->connecting_wireless_item,
                                SIG_LOADING_STOP, SRC_ELM);
@@ -1324,8 +1321,6 @@ static void _data_event_cb(enum event_type type, void *data)
                break;
 
        case EVENT_DATA_INVALID_PWD_WIRELESS: {
-               evas_object_hide(connecting_wireless_popup);
-               evas_object_hide(connected_wireless_popup);
                _popup_failed_wireless_status(priv);
 
                _DBG("Invalid password");
@@ -1620,8 +1615,6 @@ Eina_Bool _keyboard_down_cb(void *data, Evas_Object *obj, Evas_Object *src, Evas
         {
              _DBG("Done Key Pressed from IME");
 
-               evas_object_hide(failed_wireless_popup);
-               evas_object_hide(connected_wireless_popup);
                _popup_connecting_wireless_status(priv);
                _connect_wifi_with_passcode(priv);
         }