87b54140871d34c1b5e94d2befcadd5874bec68c
[apps/home/settings.git] / setting-network / src / setting-network-con.c
1 /*
2  * setting
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
5  *
6  * Contact: MyoungJune Park <mj2004.park@samsung.com>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21 #include <setting-network-con.h>
22 /*#include <tethering.h> */
23
24 static int setting_network_con_create(void *cb);
25 static int setting_network_con_destroy(void *cb);
26 static int setting_network_con_update(void *cb);
27 static int setting_network_con_cleanup(void *cb);
28
29 setting_view setting_view_network_con = {
30         .create = setting_network_con_create,
31         .destroy = setting_network_con_destroy,
32         .update = setting_network_con_update,
33         .cleanup = setting_network_con_cleanup,
34 };
35
36 static Eina_Bool __add_other_apn(void *data)
37 {
38         SETTING_TRACE_BEGIN;
39         SettingNetworkUG *ad = (SettingNetworkUG *)data;
40
41         /*show other APN whose type is not internet/APN */
42         connection_profile_iterator_h profile_iter = NULL;
43         connection_profile_h profile_h = NULL;
44
45         char *profile_name = NULL;
46         char *apn = NULL;
47         bool profile_bhidden = false;
48         connection_profile_type_e profile_type = CONNECTION_PROFILE_TYPE_CELLULAR;
49         connection_cellular_service_type_e service_type = CONNECTION_CELLULAR_SERVICE_TYPE_UNKNOWN;
50
51         int rv = connection_get_profile_iterator(ad->connection, CONNECTION_ITERATOR_TYPE_REGISTERED, &profile_iter);
52         if (rv != CONNECTION_ERROR_NONE) {
53                 SETTING_TRACE_ERROR("Fail to get profile iterator [%d]", rv);
54                 ad->add_apn_timer = NULL;
55                 return FALSE;
56         }
57
58         int cnt = 0;
59         int item_cnt = 0;
60         Elm_Object_Item *last_item = NULL;
61
62         Setting_GenGroupItem_Data *item_data = NULL;
63
64         int     before_groupstyle = SETTING_GROUP_STYLE_NONE;
65
66         while (connection_profile_iterator_has_next(profile_iter)) {
67                 if (cnt >= MAX_PROFILE_NUM) {
68                         break;
69                 }
70                 if (connection_profile_iterator_next(profile_iter, &profile_h) != CONNECTION_ERROR_NONE) {
71                         SETTING_TRACE_ERROR("Fail to get profile handle");
72                         break;
73                 }
74
75                 if (connection_profile_get_type(profile_h, &profile_type) != CONNECTION_ERROR_NONE) {
76                         SETTING_TRACE_ERROR("Fail to get profile type");
77                         continue;
78                 }
79                 if (connection_profile_get_cellular_service_type(profile_h, &service_type) != CONNECTION_ERROR_NONE) {
80                         SETTING_TRACE_ERROR("Fail to get service type");
81                         continue;
82                 }
83
84                 if (connection_profile_get_name(profile_h, &profile_name) != CONNECTION_ERROR_NONE) {
85                         SETTING_TRACE_ERROR("Fail to get profile name");
86                         continue;
87                 }
88
89                 if (connection_profile_is_cellular_hidden(profile_h, &profile_bhidden) != CONNECTION_ERROR_NONE) {
90                         SETTING_TRACE_ERROR("Fail to get profile hidden attr (true/false)");
91                         continue;
92                 }
93
94                 if (connection_profile_get_cellular_apn(profile_h, &apn) != CONNECTION_ERROR_NONE) {
95                         SETTING_TRACE_ERROR("Fail to get apn");
96                         G_FREE(profile_name);
97                         continue;
98                 }
99
100                 SETTING_TRACE("Record[%d:%s], profile_name:%s, profile_type:%d, service_type:%d",
101                               cnt, apn, profile_name, profile_type, service_type);
102                 if (CONNECTION_PROFILE_TYPE_CELLULAR != profile_type) {
103                         G_FREE(apn);
104                         G_FREE(profile_name);
105                         continue;
106                 }
107                 if (profile_bhidden == false
108                     && CONNECTION_CELLULAR_SERVICE_TYPE_MMS != service_type
109                     && CONNECTION_CELLULAR_SERVICE_TYPE_INTERNET != service_type) { /*unknow, match with ad->con_name */
110                         if (before_groupstyle == SETTING_GROUP_STYLE_NONE) {
111                                 last_item = elm_genlist_item_append(ad->connections_gl, &itc_seperator,
112                                                                     NULL, NULL,
113                                                                     ELM_GENLIST_ITEM_NONE, NULL, NULL);
114                                 elm_genlist_item_select_mode_set(last_item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
115                         }
116
117 #ifdef SUPPORT_REVERSED_ORDER
118                         item_data = setting_create_Gendial_field_def(ad->connections_gl, &itc_1text,
119                                                                      setting_network_con_item_Gendial_mouse_up_cb,
120                                                                      ad, SWALLOW_Type_INVALID, NULL, NULL,
121                                                                      0, apn, NULL,
122                                                                      NULL);
123 #else
124                         item_data = calloc(1, sizeof(Setting_GenGroupItem_Data));
125                         setting_retvm_if(!item_data, FALSE, "calloc failed");
126                         item_data->keyStr = (char *)g_strdup(profile_name);
127                         item_data->sub_desc = (char *)g_strdup(apn);
128                         item_data->swallow_type = SWALLOW_Type_INVALID;
129
130                         item_data->item = elm_genlist_item_insert_after(ad->connections_gl,
131                                                                         &itc_2text, item_data, NULL, last_item,
132                                                                         ELM_GENLIST_ITEM_NONE,
133                                                                         setting_network_con_item_Gendial_mouse_up_cb, ad);
134
135                         last_item = item_data->item;
136 #endif
137
138                         item_data->chk_status = service_type;/*record the service type */
139                         item_cnt++;
140
141                         if (before_groupstyle == SETTING_GROUP_STYLE_NONE) {
142                                 elm_object_item_signal_emit(item_data->item, "elm,state,top", "");
143                                 before_groupstyle = SETTING_GROUP_STYLE_TOP;
144                         } else if (before_groupstyle == SETTING_GROUP_STYLE_TOP) {
145                                 elm_object_item_signal_emit(item_data->item, "elm,state,center", "");
146                                 before_groupstyle = SETTING_GROUP_STYLE_CENTER;
147                         }
148
149                         SETTING_TRACE("profile hidden attribute : %d ", profile_bhidden);
150                 } else {
151                         SETTING_TRACE("profile hidden attribute : %d ", profile_bhidden);
152                 }
153                 G_FREE(apn);
154                 G_FREE(profile_name);
155                 cnt++;
156         }
157
158         if (item_cnt == 1) {
159                 elm_object_item_signal_emit(item_data->item, "elm,state,normal", "");
160         } else if (item_cnt > 1) {
161                 elm_object_item_signal_emit(item_data->item, "elm,state,bottom", "");
162         }
163
164         ad->add_apn_timer = NULL;
165         return FALSE;
166 }
167
168 static void __setting_network_con_genlist_create(void *data)
169 {
170         SETTING_TRACE_BEGIN;
171         setting_retm_if(data == NULL, "data is NULL");
172         SettingNetworkUG *ad = (SettingNetworkUG *) data;
173         elm_genlist_clear(ad->connections_gl);  /* first to clear list */
174
175         Elm_Object_Item *item = NULL;
176         item = elm_genlist_item_append(ad->connections_gl, &itc_seperator, NULL, NULL,
177                                        ELM_GENLIST_ITEM_NONE, NULL, NULL);
178         elm_genlist_item_select_mode_set(item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
179
180         /* scroller is a genlist */
181
182         /* [UI] Internet Connections */
183         SETTING_TRACE("ad->apn_internet:%d, ad->apn_MMS:%d", ad->apn_internet, ad->apn_MMS);
184         ad->apn_internet = __get_profile_name(CONNECTION_CELLULAR_SERVICE_TYPE_INTERNET, ad);
185         Setting_GenGroupItem_Data *internet_conn = setting_create_Gendial_field_def(ad->connections_gl, &itc_2text_3,
186                                                                                     setting_network_con_item_Gendial_mouse_up_cb,
187                                                                                     ad, SWALLOW_Type_INVALID, NULL, NULL,
188                                                                                     0, "IDS_ST_BODY_INTERNET_CONNECTION",
189                                                                                     g_strdup(ad->apn_internet), NULL);
190         if (internet_conn) {
191                 /*internet_conn->group_style = SETTING_GROUP_STYLE_NONE; */
192                 setting_genlist_item_groupstyle_set(internet_conn, SETTING_GROUP_STYLE_NONE);
193         } else {
194                 SETTING_TRACE_ERROR("internet_conn is NULL");
195         }
196         ad->internet_conn = internet_conn;
197
198         if (internet_conn) {
199                 setting_genlist_item_groupstyle_set(internet_conn, SETTING_GROUP_STYLE_TOP);
200         }
201         ad->apn_MMS = __get_profile_name(CONNECTION_CELLULAR_SERVICE_TYPE_MMS, ad);
202         /* [MMS Connections] Internet Connections */
203         Setting_GenGroupItem_Data *mms_conn = setting_create_Gendial_field_def(ad->connections_gl, &itc_2text_3,
204                                                                                setting_network_con_item_Gendial_mouse_up_cb,
205                                                                                ad, SWALLOW_Type_INVALID, NULL, NULL,
206                                                                                0, STR_SETTING_MMS_CONNECTIONS,
207                                                                                g_strdup(ad->apn_MMS), NULL);
208         if (mms_conn) {
209                 setting_genlist_item_groupstyle_set(mms_conn, SETTING_GROUP_STYLE_BOTTOM);
210         } else {
211                 SETTING_TRACE_ERROR("mms_conn is NULL");
212         }
213
214         ad->mms_conn = mms_conn;
215
216
217 #ifdef ENABLED_PREFERRED_NETWORKS
218         setting_create_Gendial_field_def(ad->connections_gl, &itc_1text,
219                                          setting_network_con_item_Gendial_mouse_up_cb,
220                                          ad, SWALLOW_Type_INVALID, NULL, NULL,
221                                          0, "IDS_ST_BODY_PREFERRED_NETWORKS",
222                                          NULL, NULL);
223 #endif
224 #ifdef ENABLED_2G3G_NETWORK
225         /*  create 3g connection option */
226         setting_create_Gendial_field_def(ad->connections_gl, &itc_1text,
227                                          setting_network_con_item_Gendial_mouse_up_cb,
228                                          ad, SWALLOW_Type_INVALID, NULL, NULL,
229                                          0, "2G/3G Connection", NULL, NULL);
230
231 #endif
232
233         /* add other APN
234         if (!ad->is_update) {
235                 if (ad->add_apn_timer) {
236                         ecore_idler_del(ad->add_apn_timer);
237                         ad->add_apn_timer = NULL;
238                 }
239                 ad->add_apn_timer = ecore_timer_add(0.5, (Ecore_Task_Cb) __add_other_apn, ad);
240         } else {
241                 __add_other_apn(ad);
242         }
243         */
244         /*      __add_other_apn(ad); */
245         SETTING_TRACE_END;
246
247 }
248
249 /* ***************************************************
250  *
251  *basic func
252  *
253  ***************************************************/
254
255 /**
256  * Connections
257  */
258 static int setting_network_con_create(void *cb)
259 {
260         SETTING_TRACE_BEGIN;
261         retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER);
262
263         SettingNetworkUG *ad = (SettingNetworkUG *) cb;
264
265         Evas_Object *scroller = elm_genlist_add(ad->win_main_layout);
266         retvm_if(scroller == NULL, SETTING_DRAW_ERR_FAIL_SCROLLER,
267                  "Cannot set scroller object  as contento of layout");
268         elm_genlist_realization_mode_set(scroller, EINA_TRUE);
269         elm_object_style_set(scroller, "dialogue");
270         ad->connections_gl = scroller;
271         evas_object_smart_callback_add(scroller, "realized", __gl_realized_cb, NULL);
272
273         Elm_Object_Item *navi_it = setting_push_layout_navi_bar(_("IDS_ST_BODY_CONNECTIONS"),
274                                                                 _("IDS_ST_BUTTON_BACK"),
275                                                                 NULL,/*_(KeyStr_Reset_Def), */
276                                                                 _(KeyStr_Reset_Def),/*_("IDS_ST_BODY_MYTHEME_CREATE"), */
277                                                                 NULL,
278                                                                 NULL,/*setting_network_con_click_softkey_reset_cb, */
279                                                                 setting_network_con_click_softkey_reset_cb,/*setting_network_con_click_softkey_create_cb, */
280                                                                 ad, scroller, ad->navi_bar, NULL);
281
282         elm_naviframe_item_pop_cb_set(navi_it, setting_network_con_click_softkey_cancel_cb, ad);
283
284         __setting_network_con_genlist_create(ad);
285
286         setting_view_network_con.is_create = 1;
287
288         SETTING_TRACE_END;
289         return SETTING_RETURN_SUCCESS;
290 }
291
292 static int setting_network_con_destroy(void *cb)
293 {
294         SETTING_TRACE_BEGIN;
295         /* error check */
296         retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER);
297
298         SettingNetworkUG *ad = (SettingNetworkUG *) cb;
299         ad->is_update = 0;
300         /*FREE(ad->con_name); */
301         ad->connections_gl = NULL;
302         if (setting_view_network_con.is_create) {
303 #if SUPPORT_TETHERING
304                 if (ad->th_connections) {
305                         SETTING_TRACE("tethering destruction ");
306                         tethering_destroy(ad->th_connections);
307                         ad->th_connections = NULL;
308                 }
309 #endif
310                 if (ad->add_apn_timer) {
311                         ecore_idler_del(ad->add_apn_timer);
312                         ad->add_apn_timer = NULL;
313                 }
314
315                 elm_naviframe_item_pop(ad->navi_bar);
316                 setting_view_network_con.is_create = 0;
317         } else {
318                 SETTING_TRACE("why is this is_create == 0 ?? !!!");
319         }
320
321
322         return SETTING_RETURN_SUCCESS;
323 }
324
325 static int setting_network_con_update(void *cb)
326 {
327         SETTING_TRACE_BEGIN;
328         retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER);
329         SettingNetworkUG *ad = (SettingNetworkUG *) cb;
330         __setting_network_con_genlist_create(ad);
331         return SETTING_RETURN_SUCCESS;
332 }
333
334 static int setting_network_con_cleanup(void *cb)
335 {
336         SETTING_TRACE_BEGIN;
337         return setting_network_con_destroy(cb);
338 }
339
340 /* ***************************************************
341  *
342  *general func
343  *
344  ***************************************************/
345
346 /* ***************************************************
347  *
348  *call back func
349  *
350  ***************************************************/
351
352 static void
353 setting_network_con_item_Gendial_mouse_up_cb(void *data, Evas_Object *obj,
354                                              void *event_info)
355 {
356         SETTING_TRACE_BEGIN;
357         /* error check */
358         setting_retm_if(data == NULL, "Data parameter is NULL");
359         Elm_Object_Item *item = (Elm_Object_Item *) event_info;
360         elm_genlist_item_selected_set(item, 0);
361         Setting_GenGroupItem_Data *list_item =
362             (Setting_GenGroupItem_Data *) elm_object_item_data_get(item);
363         setting_retm_if(NULL == list_item, "list_item is NULL");
364
365         SettingNetworkUG *ad = (SettingNetworkUG *) data;
366         ad->profile_topper_view = NULL;
367
368         SETTING_TRACE("clicking item[%s]", _(list_item->keyStr));
369
370         ad->profile_service_type = 0;
371
372         if (!safeStrCmp("IDS_COM_BODY_NETWORK_OPERATORS", list_item->keyStr)) {
373                 setting_view_change(&setting_view_network_con,
374                                     &setting_view_network_select_network,
375                                     ad);
376         }
377 #ifdef ENABLED_PREFERRED_NETWORKS
378         else if (!safeStrCmp("IDS_ST_BODY_PREFERRED_NETWORKS",
379                              list_item->keyStr)) {
380
381                 int value = -1;
382                 int err = -1;
383
384                 setting_get_int_slp_key(INT_SLP_SETTING_SIM_SLOT, &value,
385                                         &err);
386                 /** @todo check 'err' variable for exception handling */
387                 SETTING_TRACE("INT_SLP_SETTING_SIM_SLOT value:%d", value);
388                 switch (value) {
389                         case VCONFKEY_TELEPHONY_SIM_INSERTED:
390                                 /* To Recreate the view in order to search the perferred network again. */
391                                 /* ret = setting_view_destroy(&setting_view_network_preferred_network, ad); */
392
393                                 setting_view_change(&setting_view_network_con,
394                                                     &setting_view_network_preferred_network,
395                                                     ad);
396
397                                 break;
398
399                         case VCONFKEY_TELEPHONY_SIM_NOT_PRESENT:
400
401                                 setting_create_simple_popup(NULL, ad->win_get,
402                                                             NULL, _(""));/*this code is not used now, so remove the ID which is not in po file*/
403                                 SETTING_TRACE_DEBUG
404                                 ("%s*** [ERR] INCORRECTED SIM. sim_slot_type=%d ***%s",
405                                  SETTING_FONT_RED, value, SETTING_FONT_BLACK);
406                                 return;
407
408                                 break;
409
410                         case VCONFKEY_TELEPHONY_SIM_CARD_ERROR:
411                         case VCONFKEY_TELEPHONY_SIM_UNKNOWN:
412
413                                 setting_create_simple_popup(NULL, ad->win_get,
414                                                             NULL, _("IDS_SIM_BODY_INVALID_SIM_CARD"));
415                                 SETTING_TRACE_DEBUG
416                                 ("%s*** [ERR] INCORRECTED SIM. sim_slot_type=%d ***%s",
417                                  SETTING_FONT_RED, value, SETTING_FONT_BLACK);
418                                 return;
419
420                                 break;
421                         default:
422                                 SETTING_TRACE("Unknown SIM information from vconf");
423                                 break;
424                 }
425         }
426 #endif
427 #ifdef ENABLED_2G3G_NETWORK
428         else if (!safeStrCmp("2G/3G Connection", list_item->keyStr)) {
429                 setting_view_change(&setting_view_network_con,
430                                     &setting_view_network_3gcon, ad);
431         }
432 #endif
433         else if (!safeStrCmp("IDS_ST_BODY_INTERNET_CONNECTION", list_item->keyStr)) {/*connections.. */
434
435                 FREE(ad->con_name);
436                 SETTING_TRACE("list_item->keyStr:%s, ad->con_name:%s", list_item->keyStr, ad->con_name);
437                 ad->con_name = strdup(list_item->keyStr);
438                 ad->profile_service_type = CONNECTION_CELLULAR_SERVICE_TYPE_INTERNET;
439                 setting_view_change(&setting_view_network_con,
440                                     &setting_view_network_con_list,
441                                     ad);
442         } else if (!safeStrCmp(STR_SETTING_MMS_CONNECTIONS, list_item->keyStr)) {
443                 FREE(ad->con_name);
444                 ad->profile_topper_view = &setting_view_network_con;
445                 ad->con_name = strdup(STR_SETTING_MMS_CONNECTIONS);
446                 ad->access_name = strdup(STR_SETTING_MMS_CONNECTIONS);
447                 ad->profile_service_type = CONNECTION_CELLULAR_SERVICE_TYPE_MMS;
448                 setting_view_create(&setting_view_network_connection_create, ad);
449         } else {
450                 FREE(ad->con_name);
451                 ad->profile_topper_view = &setting_view_network_con;
452                 ad->con_name = strdup(list_item->sub_desc);
453                 ad->access_name = strdup(list_item->sub_desc);
454                 ad->profile_service_type = list_item->chk_status;
455                 setting_view_create(&setting_view_network_connection_create, ad);
456         }
457         SETTING_TRACE_END;
458 }
459
460 static void
461 setting_network_con_click_softkey_reset_cb(void *data, Evas_Object *obj, void *event_info)
462 {
463         SETTING_TRACE_BEGIN;
464         /* error check */
465         retm_if(data == NULL, "Data parameter is NULL");
466
467         SettingNetworkUG *ad = (SettingNetworkUG *) data;
468
469         ad->popup_conreset = setting_create_popup_with_btn(ad, ad->win_get,
470                                                            NULL, _("IDS_ST_POP_RESET_TO_DEFAULT_Q"),
471                                                            setting_network_con_reset_popup_cb,
472                                                            0, 2, _("IDS_ST_BUTTON_OK"), _("IDS_ST_BUTTON_CANCEL_ABB"));
473
474         return;
475 }
476
477 void _reset_cb(connection_error_e result, void *user_data)
478 {
479         SETTING_TRACE_BEGIN;
480         setting_retm_if(NULL == user_data, "NULL == data");
481         SettingNetworkUG *ad = (SettingNetworkUG *) user_data;
482
483         if (ad->network_ug_pop) {
484                 evas_object_del(ad->network_ug_pop);
485                 ad->network_ug_pop = NULL;
486         }
487         if (result == CONNECTION_ERROR_NONE) {
488                 SETTING_TRACE("reset successfully");
489                 FREE(ad->apn_internet);
490                 FREE(ad->apn_MMS);
491                 __setting_network_con_genlist_create(ad);
492         } else {
493                 SETTING_TRACE_ERROR("failed to reset ret = %d", result);
494         }
495 }
496
497 static void
498 setting_network_con_reset_popup_cb(void *data, Evas_Object *obj, void *event_info)
499 {
500         SETTING_TRACE_BEGIN;
501
502         /* error check */
503         setting_retm_if(NULL == data, "NULL == data");
504
505         int     response_type = btn_type(obj);
506         int ret = 0;
507
508         SettingNetworkUG *ad = (SettingNetworkUG *) data;
509
510         if (ad) {
511                 evas_object_del(ad->popup_conreset);
512                 ad->popup_conreset = NULL;
513         }
514
515         if (response_type == POPUP_RESPONSE_OK) {
516                 /*setting_create_simple_popup(ad, ad->win_get, NULL, _("IDS_IM_BODY_SUCCESSFULLY_COMPLETED")); */
517                 setting_create_popup_without_btn(ad, ad->win_get, NULL, _("IDS_IM_BODY_SUCCESSFULLY_COMPLETED"),
518                                                  NULL, POPUP_INTERVAL, TRUE, FALSE);
519
520                 if (ad->connection) {
521                         ret = connection_reset_profile(ad->connection, CONNECTION_RESET_DEFAULT_PROFILE,
522                                                        0, _reset_cb, ad);
523                         if (CONNECTION_ERROR_NONE == ret) {
524                                 SETTING_TRACE("Reset successfully");
525                         } else {
526                                 SETTING_TRACE("Failed to reset, ret = %d", ret);
527                         }
528                 }
529         }
530
531         return;
532 }
533
534 #if 0
535 static void
536 setting_network_con_click_softkey_create_cb(void *data, Evas_Object *obj,
537                                             void *event_info)
538 {
539         /* error check */
540         retm_if(data == NULL, "Data parameter is NULL");
541         SettingNetworkUG *ad = (SettingNetworkUG *) data;
542         SETTING_TRACE_BEGIN;
543         /*setting_create_simple_popup(ad, ad->win_get, NULL, _("UX Undefined")); */
544         /*return; */
545
546         /*to add a new connection */
547         /*ad->con_type = -1; */
548         FREE(ad->con_name);
549         ad->con_name = strdup(STR_SETTING_NEW_CONNECTIONS);
550         ad->profile_topper_view = &setting_view_network_con;
551         /*not normal view realtion,so need to change manully */
552         /*setting_view_change(&setting_view_network_con, &setting_view_network_connection_create, ad); */
553         setting_view_create(&setting_view_network_connection_create, ad);
554 }
555 #endif
556
557 static Eina_Bool
558 setting_network_con_click_softkey_cancel_cb(void *data, Elm_Object_Item *it)
559 {
560         SETTING_TRACE_BEGIN;
561         retvm_if(data == NULL, EINA_FALSE, "Data parameter is NULL");
562
563         SettingNetworkUG *ad = (SettingNetworkUG *) data;
564
565         setting_view_change(&setting_view_network_con,
566                             &setting_view_network_main, ad);
567         return EINA_TRUE;
568 }