4 * Copyright 2012 Samsung Electronics Co., Ltd
6 * Licensed under the Flora License, Version 1.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.tizenopensource.org/license
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
20 #include "mh_view_wifi_setup.h"
22 static void __back_btn_cb(void *data, Evas_Object *obj, void *event_info);
24 static void __hide_btn_changed_cb(void *data, Evas_Object *obj, void *event_info)
26 __MOBILE_AP_FUNC_ENTER__;
28 if (data == NULL || obj == NULL) {
29 ERR("Invalid param\n");
33 mh_appdata_t *ad = (mh_appdata_t *)data;
36 ret = tethering_wifi_set_ssid_visibility(ad->handle,
37 !ad->setup.visibility);
38 if (ret != TETHERING_ERROR_NONE) {
39 ERR("tethering_wifi_set_ssid_visibility is failed : %d\n", ret);
43 ad->setup.visibility = !ad->setup.visibility;
45 __MOBILE_AP_FUNC_EXIT__;
48 static void __security_btn_changed_cb(void *data, Evas_Object *obj, void *event_info)
50 __MOBILE_AP_FUNC_ENTER__;
52 if (data == NULL || obj == NULL) {
53 ERR("Invalid param\n");
57 mh_appdata_t *ad = (mh_appdata_t *)data;
58 Eina_Bool pw_disabled = EINA_FALSE;
59 tethering_wifi_security_type_e temp_security_type;
62 if (ad->setup.security_type == TETHERING_WIFI_SECURITY_TYPE_NONE)
63 temp_security_type = TETHERING_WIFI_SECURITY_TYPE_WPA2_PSK;
65 temp_security_type = TETHERING_WIFI_SECURITY_TYPE_NONE;
67 ret = tethering_wifi_set_security_type(ad->handle, temp_security_type);
68 if (ret != TETHERING_ERROR_NONE) {
69 ERR("tethering_wifi_set_security_type is failed : %d\n", ret);
72 ad->setup.security_type = temp_security_type;
74 pw_disabled = ad->setup.security_type != TETHERING_WIFI_SECURITY_TYPE_NONE ?
75 EINA_FALSE : EINA_TRUE;
76 DBG("security_type : %d, pw_disabled : %d\n", ad->setup.security_type, pw_disabled);
78 elm_object_item_disabled_set(ad->setup.pw_item, pw_disabled);
79 elm_genlist_item_update(ad->setup.pw_item);
81 __MOBILE_AP_FUNC_EXIT__;
84 static char *__gl_hide_label_get(void *data, Evas_Object *obj, const char *part)
86 __MOBILE_AP_FUNC_ENTER__;
88 if (data == NULL || obj == NULL || part == NULL) {
89 ERR("Invalid param\n");
93 if (strcmp(part, "elm.text") != 0) {
94 ERR("Invalid param\n");
98 __MOBILE_AP_FUNC_EXIT__;
99 return strdup(_("IDS_MOBILEAP_BODY_HIDE_MY_DEVICE"));
102 static char *__gl_security_label_get(void *data, Evas_Object *obj, const char *part)
104 __MOBILE_AP_FUNC_ENTER__;
106 if (data == NULL || obj == NULL || part == NULL) {
107 ERR("Invalid param\n");
111 if (strcmp(part, "elm.text") != 0) {
112 ERR("Invalid param\n");
116 __MOBILE_AP_FUNC_EXIT__;
117 return strdup(_("IDS_MOBILEAP_BODY_SECURITY"));
120 static char *__gl_name_label_get(void *data, Evas_Object *obj, const char *part)
122 __MOBILE_AP_FUNC_ENTER__;
124 if (data == NULL || obj == NULL || part == NULL) {
125 ERR("Invalid param\n");
129 if (strcmp(part, "elm.text.1") != 0) {
130 ERR("Invalid param\n");
134 mh_appdata_t *ad = (mh_appdata_t *)data;
135 char label[MH_LABEL_LENGTH_MAX] = {0, };
136 char name_change_label[MH_LABEL_LENGTH_MAX] = {0, };
137 char path[MH_LABEL_LENGTH_MAX] = {0, };
138 char *device_name = NULL;
140 DBG("Device name : %s\n", ad->setup.device_name);
142 device_name = elm_entry_utf8_to_markup(ad->setup.device_name);
143 if (device_name == NULL) {
144 ERR("elm_entry_utf8_to_markup is failed\n");
148 snprintf(path, sizeof(path), "%s > %s",
149 S_("IDS_COM_BODY_SETTINGS"),
150 _("IDS_ST_BODY_ABOUT_PHONE"));
151 snprintf(name_change_label, sizeof(name_change_label),
152 _("IDS_MOBILEAP_BODY_DEVICE_NAME_CAN_BE_CHANGED_IN_PS"),
154 snprintf(label, sizeof(label), "%s: %s<br>%s",
155 _("IDS_MOBILEAP_BODY_DEVICE_NAME"),
160 __MOBILE_AP_FUNC_EXIT__;
162 return strdup(label);
165 static Evas_Object *__gl_hide_icon_get(void *data, Evas_Object *obj,
168 __MOBILE_AP_FUNC_ENTER__;
170 if (data == NULL || obj == NULL || part == NULL) {
171 ERR("Invalid param\n");
175 if (strcmp(part, "elm.icon") != 0) {
176 ERR("Invalid param\n");
180 mh_appdata_t *ad = (mh_appdata_t *)data;
181 Evas_Object *btn = NULL;
183 btn = elm_check_add(obj);
185 ERR("btn is NULL\n");
188 elm_object_style_set(btn, "on&off");
189 evas_object_show(btn);
190 evas_object_pass_events_set(btn, EINA_TRUE);
191 evas_object_propagate_events_set(btn, EINA_FALSE);
192 elm_check_state_set(btn, ad->setup.visibility ? EINA_FALSE : EINA_TRUE);
193 evas_object_smart_callback_add(btn, "changed",
194 __hide_btn_changed_cb, (void *)ad);
196 ad->setup.hide_btn = btn;
198 __MOBILE_AP_FUNC_EXIT__;
202 static Evas_Object *__gl_security_icon_get(void *data, Evas_Object *obj,
205 __MOBILE_AP_FUNC_ENTER__;
207 if (data == NULL || obj == NULL || part == NULL) {
208 ERR("Invalid param\n");
212 if (strcmp(part, "elm.icon") != 0) {
213 ERR("Invalid param\n");
217 mh_appdata_t *ad = (mh_appdata_t *)data;
218 Evas_Object *btn = NULL;
220 btn = elm_check_add(obj);
222 elm_object_style_set(btn, "on&off");
223 evas_object_show(btn);
224 evas_object_pass_events_set(btn, EINA_TRUE);
225 evas_object_propagate_events_set(btn, EINA_FALSE);
226 elm_check_state_set(btn, ad->setup.security_type ==
227 TETHERING_WIFI_SECURITY_TYPE_NONE ?
228 EINA_FALSE : EINA_TRUE);
229 evas_object_smart_callback_add(btn, "changed",
230 __security_btn_changed_cb, (void *)ad);
232 ad->setup.security_btn = btn;
234 __MOBILE_AP_FUNC_EXIT__;
238 static Eina_Bool __save_wifi_passphrase(mh_appdata_t *ad)
240 __MOBILE_AP_FUNC_ENTER__;
243 ERR("Invalid param\n");
247 mh_wifi_setting_view_t *st = &ad->setup;
249 const char *entry_string = NULL;
250 char *utf8_string = NULL;
251 char wifi_passphrase[WIFI_PASSPHRASE_LENGTH_MAX + 1] = {0, };
253 entry_string = elm_entry_entry_get(st->pw_entry);
254 if (entry_string == NULL) {
255 ERR("elm_entry_entry_get() Failed!!!\n");
259 utf8_string = elm_entry_markup_to_utf8(entry_string);
260 if (utf8_string == NULL) {
261 ERR("elm_entry_markup_to_utf8() Failed!!!\n");
264 g_strlcpy(wifi_passphrase, utf8_string, sizeof(wifi_passphrase));
267 if (g_strcmp0(st->wifi_passphrase, wifi_passphrase) == 0) {
268 DBG("Password is not changed\n");
272 if (strlen(wifi_passphrase) < WIFI_PASSPHRASE_LENGTH_MIN) {
273 DBG("Password is shorter than %d\n", WIFI_PASSPHRASE_LENGTH_MIN);
274 _prepare_popup(ad, MH_POP_WIFI_PASSWORD_SHORT,
275 _("IDS_ST_BODY_ENTER_PASSWORD_OF_AT_LEAST_8_CHARACTERS"));
280 ret = tethering_wifi_set_passphrase(ad->handle, wifi_passphrase);
281 if (ret != TETHERING_ERROR_NONE) {
282 ERR("tethering_wifi_set_passphrase is failed : %d\n", ret);
286 DBG("SUCCESS : setting up VCONFKEY_MOBILE_HOTSPOT_WIFI_KEY\n");
287 g_strlcpy(st->wifi_passphrase, wifi_passphrase, sizeof(st->wifi_passphrase));
289 __MOBILE_AP_FUNC_EXIT__;
294 static void __passphrase_maxlength_reached_cb(void *data, Evas_Object *obj,
297 __MOBILE_AP_FUNC_ENTER__;
299 if (data == NULL || obj == NULL) {
300 ERR("The param is NULL\n");
304 mh_appdata_t *ad = (mh_appdata_t *)data;
305 char buf[MH_LABEL_LENGTH_MAX] = {0, };
307 if (ad->popup != NULL) {
308 ERR("Popup already exists\n");
312 if (_hide_imf(ad->setup.pw_entry) == EINA_FALSE) {
313 ERR("_hide_imf is failed\n");
316 if (__save_wifi_passphrase(ad) == EINA_FALSE) {
317 ERR("__save_wifi_passphrase is failed\n");
321 snprintf(buf, sizeof(buf),
322 _("IDS_MOBILEAP_POP_PASSWORD_MUST_CONTAIN_AT_LEAST_PD_CHARACTERS_AND_NOT_EXCEED_PD_CHARACTERS"),
323 WIFI_PASSPHRASE_LENGTH_MIN, WIFI_PASSPHRASE_LENGTH_MAX);
325 _prepare_popup(ad, MH_POP_INFORMATION_WO_BUTTON, buf);
328 __MOBILE_AP_FUNC_EXIT__;
331 static void __passphrase_activated_cb(void *data, Evas_Object *obj,
334 __MOBILE_AP_FUNC_ENTER__;
336 if (data == NULL || obj == NULL) {
337 ERR("Invalid param\n");
341 mh_appdata_t *ad = (mh_appdata_t *)data;
343 if (_hide_imf(ad->setup.pw_entry) == EINA_FALSE) {
344 ERR("_hide_imf is failed\n");
347 if (__save_wifi_passphrase(ad) == EINA_FALSE) {
348 ERR("__save_wifi_passphrase is failed\n");
352 __MOBILE_AP_FUNC_EXIT__;
357 static void __pw_entry_changed_cb(void *data, Evas_Object *obj,
360 __MOBILE_AP_FUNC_ENTER__;
362 if (data == NULL || obj == NULL) {
363 ERR("Invalid param\n");
367 mh_appdata_t *ad = (mh_appdata_t *)data;
368 mh_wifi_setting_view_t *st = &ad->setup;
370 if (!elm_object_focus_get(st->pw_layout))
373 if (elm_entry_is_empty(st->pw_entry)) {
374 elm_object_signal_emit(st->pw_layout,
375 "elm,state,eraser,hide", "elm");
377 elm_object_signal_emit(st->pw_layout,
378 "elm,state,eraser,show", "elm");
381 __MOBILE_AP_FUNC_EXIT__;
387 static void __pw_entry_focused_cb(void *data, Evas_Object *obj,
390 __MOBILE_AP_FUNC_ENTER__;
392 if (data == NULL || obj == NULL) {
393 ERR("Invalid param\n");
397 mh_appdata_t *ad = (mh_appdata_t *)data;
398 mh_wifi_setting_view_t *st = &ad->setup;
400 if (!elm_entry_is_empty(st->pw_entry))
401 elm_object_signal_emit(st->pw_layout,
402 "elm,state,eraser,show", "elm");
404 elm_object_signal_emit(st->pw_layout,
405 "elm,state,guidetext,hide", "elm");
407 __MOBILE_AP_FUNC_EXIT__;
413 static void __pw_entry_unfocused_cb(void *data, Evas_Object *obj,
416 __MOBILE_AP_FUNC_ENTER__;
418 if (data == NULL || obj == NULL) {
419 ERR("Invalid param\n");
423 mh_appdata_t *ad = (mh_appdata_t *)data;
424 mh_wifi_setting_view_t *st = &ad->setup;
426 if (elm_entry_is_empty(st->pw_entry))
427 elm_object_signal_emit(st->pw_layout,
428 "elm,state,guidetext,show", "elm");
430 elm_object_signal_emit(st->pw_layout,
431 "elm,state,eraser,hide", "elm");
433 __MOBILE_AP_FUNC_EXIT__;
439 static void __pw_layout_eraser_clicked_cb(void *data, Evas_Object *obj,
440 const char *emission, const char *source)
442 __MOBILE_AP_FUNC_ENTER__;
444 if (data == NULL || obj == NULL) {
445 ERR("Invalid param\n");
449 mh_appdata_t *ad = (mh_appdata_t *)data;
450 mh_wifi_setting_view_t *st = &ad->setup;
452 elm_entry_entry_set(st->pw_entry, "");
454 __MOBILE_AP_FUNC_EXIT__;
460 static Evas_Object *__gl_pw_icon_get(void *data, Evas_Object *obj,
463 __MOBILE_AP_FUNC_ENTER__;
465 if (data == NULL || obj == NULL || part == NULL) {
466 ERR("Invalid param\n");
470 if (strcmp(part, "elm.icon") != 0) {
471 ERR("Invalid part\n");
475 static Elm_Entry_Filter_Limit_Size limit_filter_data;
477 mh_appdata_t *ad = (mh_appdata_t *)data;
478 mh_wifi_setting_view_t *st = &ad->setup;
479 Evas_Object *entry = NULL;
482 st->pw_layout = elm_layout_add(obj);
483 if (st->pw_layout == NULL) {
484 ERR("elm_layout_add returns NULL\n");
487 elm_layout_theme_set(st->pw_layout, "layout", "editfield", "title");
489 entry = elm_entry_add(st->pw_layout);
491 ERR("elm_entry_add returns NULL\n");
492 evas_object_del(st->pw_layout);
493 st->pw_layout = NULL;
496 st->pw_entry = entry;
498 elm_object_part_content_set(st->pw_layout, "elm.swallow.content", entry);
499 elm_object_part_text_set(st->pw_layout, "elm.text",
500 _("IDS_MOBILEAP_BODY_PASSWORD"));
501 elm_object_part_text_set(st->pw_layout, "elm.guidetext",
502 _("IDS_ST_BODY_ENTER_PASSWORD_OF_AT_LEAST_8_CHARACTERS"));
504 /* Set editable mode */
505 DBG("security_type : %d\n", st->security_type);
506 elm_entry_input_panel_enabled_set(entry, st->security_type ==
507 TETHERING_WIFI_SECURITY_TYPE_NONE ?
508 EINA_FALSE : EINA_TRUE);
510 /* Set single line of entry */
511 elm_entry_scrollable_set(entry, EINA_TRUE);
512 elm_entry_single_line_set(entry, EINA_TRUE);
513 elm_entry_input_panel_layout_set(entry, ELM_INPUT_PANEL_LAYOUT_PASSWORD);
515 /* Set the maximum length filter for passphrase entry */
516 limit_filter_data.max_char_count = 0;
517 limit_filter_data.max_byte_count = WIFI_PASSPHRASE_LENGTH_MAX;
518 elm_entry_markup_filter_append(entry,
519 elm_entry_filter_limit_size, &limit_filter_data);
521 ptr = elm_entry_utf8_to_markup(st->wifi_passphrase);
523 elm_entry_entry_set(entry, ptr);
526 ERR("elm_entry_utf8_to_markup is failed\n");
529 if (!elm_entry_is_empty(entry))
530 elm_object_signal_emit(st->pw_layout,
531 "elm,state,guidetext,hide", "elm");
533 evas_object_smart_callback_add(entry, "maxlength,reached",
534 __passphrase_maxlength_reached_cb, data);
535 evas_object_smart_callback_add(entry, "activated",
536 __passphrase_activated_cb, data);
537 evas_object_smart_callback_add(entry, "changed",
538 __pw_entry_changed_cb, data);
539 evas_object_smart_callback_add(entry, "focused",
540 __pw_entry_focused_cb, data);
541 evas_object_smart_callback_add(entry, "unfocused",
542 __pw_entry_unfocused_cb, data);
543 elm_object_signal_callback_add(st->pw_layout, "elm,eraser,clicked", "elm",
544 __pw_layout_eraser_clicked_cb, data);
546 __MOBILE_AP_FUNC_EXIT__;
548 return st->pw_layout;
551 static void __gl_hide_item_sel(void *data, Evas_Object *obj, void *event_info)
553 __MOBILE_AP_FUNC_ENTER__;
555 if (data == NULL || obj == NULL || event_info == NULL) {
556 ERR("param is NULL\n");
560 mh_appdata_t *ad = (mh_appdata_t *)data;
562 elm_genlist_item_selected_set((Elm_Object_Item*)event_info, EINA_FALSE);
564 __hide_btn_changed_cb(data, obj, NULL);
565 elm_check_state_set(ad->setup.hide_btn, ad->setup.visibility ?
566 EINA_FALSE : EINA_TRUE);
568 __MOBILE_AP_FUNC_EXIT__;
571 static void __gl_security_item_sel(void *data, Evas_Object *obj, void *event_info)
573 __MOBILE_AP_FUNC_ENTER__;
575 if (data == NULL || obj == NULL || event_info == NULL) {
576 ERR("param is NULL\n");
580 mh_appdata_t *ad = (mh_appdata_t *)data;
582 elm_genlist_item_selected_set((Elm_Object_Item*)event_info, EINA_FALSE);
584 __security_btn_changed_cb(data, obj, NULL);
585 elm_check_state_set(ad->setup.security_btn, ad->setup.security_type ==
586 TETHERING_WIFI_SECURITY_TYPE_NONE ? EINA_FALSE : EINA_TRUE);
588 __MOBILE_AP_FUNC_EXIT__;
591 static void __free_genlist_itc(mh_appdata_t *ad)
593 __MOBILE_AP_FUNC_ENTER__;
595 elm_genlist_item_class_free(ad->setup.sp_itc);
596 elm_genlist_item_class_free(ad->setup.hide_itc);
597 elm_genlist_item_class_free(ad->setup.security_itc);
598 elm_genlist_item_class_free(ad->setup.pw_itc);
599 elm_genlist_item_class_free(ad->setup.name_itc);
601 __MOBILE_AP_FUNC_EXIT__;
605 static void __set_genlist_itc(mh_appdata_t *ad)
607 __MOBILE_AP_FUNC_ENTER__;
609 ad->setup.sp_itc = elm_genlist_item_class_new();
610 ad->setup.sp_itc->item_style = "dialogue/separator/21/with_line";
611 ad->setup.sp_itc->func.text_get = NULL;
612 ad->setup.sp_itc->func.content_get = NULL;
613 ad->setup.sp_itc->func.state_get = NULL;
614 ad->setup.sp_itc->func.del = NULL;
616 ad->setup.hide_itc = elm_genlist_item_class_new();
617 ad->setup.hide_itc->item_style = "dialogue/1text.1icon";
618 ad->setup.hide_itc->func.text_get = __gl_hide_label_get;
619 ad->setup.hide_itc->func.content_get = __gl_hide_icon_get;
620 ad->setup.hide_itc->func.state_get = NULL;
621 ad->setup.hide_itc->func.del = NULL;
623 ad->setup.security_itc = elm_genlist_item_class_new();
624 ad->setup.security_itc->item_style = "dialogue/1text.1icon";
625 ad->setup.security_itc->func.text_get = __gl_security_label_get;
626 ad->setup.security_itc->func.content_get = __gl_security_icon_get;
627 ad->setup.security_itc->func.state_get = NULL;
628 ad->setup.security_itc->func.del = NULL;
630 ad->setup.pw_itc = elm_genlist_item_class_new();
631 ad->setup.pw_itc->item_style = "dialogue/1icon";
632 ad->setup.pw_itc->func.text_get = NULL;
633 ad->setup.pw_itc->func.content_get = __gl_pw_icon_get;
634 ad->setup.pw_itc->func.state_get = NULL;
635 ad->setup.pw_itc->func.del = NULL;
637 ad->setup.name_itc = elm_genlist_item_class_new();
638 ad->setup.name_itc->item_style = "multiline/1text";
639 ad->setup.name_itc->func.text_get = __gl_name_label_get;
640 ad->setup.name_itc->func.content_get = NULL;
641 ad->setup.name_itc->func.state_get = NULL;
642 ad->setup.name_itc->func.del = NULL;
644 ad->setup.end_sp_itc = elm_genlist_item_class_new();
645 ad->setup.end_sp_itc->item_style = "dialogue/separator/end";
646 ad->setup.end_sp_itc->func.text_get = NULL;
647 ad->setup.end_sp_itc->func.content_get = NULL;
648 ad->setup.end_sp_itc->func.state_get = NULL;
649 ad->setup.end_sp_itc->func.del = NULL;
651 __MOBILE_AP_FUNC_EXIT__;
655 static void __deconstruct_wifi_setup_view(mh_wifi_setting_view_t *st)
657 __MOBILE_AP_FUNC_ENTER__;
664 if (st->pw_entry == NULL) {
665 ERR("pw_entry is NULL");
669 evas_object_smart_callback_del(st->hide_btn, "changed",
670 __hide_btn_changed_cb);
671 evas_object_smart_callback_del(st->security_btn, "changed",
672 __security_btn_changed_cb);
674 evas_object_smart_callback_del(st->pw_entry,
676 __passphrase_maxlength_reached_cb);
677 evas_object_smart_callback_del(st->pw_entry,
679 __passphrase_activated_cb);
681 evas_object_smart_callback_del(st->back_btn, "clicked",
685 st->security_btn = NULL;
686 st->pw_layout = NULL;
692 __MOBILE_AP_FUNC_EXIT__;
695 static void __back_btn_cb(void *data, Evas_Object *obj, void *event_info)
697 __MOBILE_AP_FUNC_ENTER__;
700 ERR("The param is NULL\n");
704 mh_appdata_t *ad = (mh_appdata_t *)data;
705 mh_wifi_setting_view_t *st = &ad->setup;
707 if (_hide_imf(st->pw_entry) == EINA_FALSE) {
708 ERR("_hide_imf is failed\n");
711 if (__save_wifi_passphrase(ad) == EINA_FALSE) {
712 ERR("__save_wifi_passphrase is failed\n");
716 __deconstruct_wifi_setup_view(st);
718 evas_object_del(ad->setup.genlist);
719 __free_genlist_itc(ad);
721 elm_naviframe_item_pop(ad->naviframe);
723 __MOBILE_AP_FUNC_EXIT__;
726 Evas_Object *__create_genlist(mh_appdata_t *ad)
728 __MOBILE_AP_FUNC_ENTER__;
735 void *data = (void *)ad;
736 mh_wifi_setting_view_t *st = &ad->setup;
737 Evas_Object *genlist = NULL;
738 Elm_Object_Item *item = NULL;
740 genlist = elm_genlist_add(ad->naviframe);
741 if (genlist == NULL) {
742 ERR("genlist is NULL\n");
745 elm_object_style_set(genlist, "dialogue");
746 elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS);
748 __set_genlist_itc(ad);
749 item = elm_genlist_item_append(genlist, st->sp_itc, NULL, NULL,
750 ELM_GENLIST_ITEM_NONE, NULL, NULL);
751 elm_genlist_item_select_mode_set(item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
753 st->hide_item = elm_genlist_item_append(genlist, st->hide_itc, data, NULL,
754 ELM_GENLIST_ITEM_NONE, __gl_hide_item_sel, data);
756 st->security_item = elm_genlist_item_append(genlist, st->security_itc, data, NULL,
757 ELM_GENLIST_ITEM_NONE, __gl_security_item_sel, data);
759 DBG("security_type : %d\n", st->security_type);
760 st->pw_item = elm_genlist_item_append(genlist, st->pw_itc, data, NULL,
761 ELM_GENLIST_ITEM_NONE, NULL, NULL);
762 elm_object_item_disabled_set(st->pw_item, st->security_type ==
763 TETHERING_WIFI_SECURITY_TYPE_NONE ?
764 EINA_TRUE : EINA_FALSE);
765 elm_genlist_item_update(st->pw_item);
767 st->name_item = elm_genlist_item_append(genlist, st->name_itc, data, NULL,
768 ELM_GENLIST_ITEM_NONE, NULL, NULL);
769 elm_genlist_item_select_mode_set(st->name_item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
771 item = elm_genlist_item_append(genlist, st->end_sp_itc, NULL, NULL,
772 ELM_GENLIST_ITEM_NONE, NULL, NULL);
773 elm_genlist_item_select_mode_set(item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
776 __MOBILE_AP_FUNC_EXIT__;
781 void mh_draw_wifi_setup_view(mh_appdata_t *ad)
783 __MOBILE_AP_FUNC_ENTER__;
790 mh_wifi_setting_view_t *st = &ad->setup;
792 if (st->conform != NULL) {
793 ERR("Wi-Fi setup view already exists\n");
797 st->conform = elm_conformant_add(ad->naviframe);
798 if (st->conform == NULL) {
799 ERR("elm_conformant_add returns NULL\n");
802 elm_object_style_set(st->conform, "internal_layout");
803 evas_object_show(st->conform);
805 st->genlist = __create_genlist(ad);
806 if (st->genlist == NULL) {
807 ERR("__create_genlist returns NULL\n");
810 elm_object_content_set(st->conform, st->genlist);
812 st->back_btn = elm_button_add(ad->naviframe);
813 if (st->back_btn == NULL) {
814 ERR("elm_button_add returns NULL\n");
817 elm_naviframe_item_push(ad->naviframe,
818 _("IDS_MOBILEAP_MBODY_WI_FI_TETHERING_SETTINGS"),
819 st->back_btn, NULL, st->conform, NULL);
821 /* Style set should be called after elm_naviframe_item_push(). */
822 elm_object_style_set(st->back_btn, "naviframe/back_btn/default");
823 evas_object_smart_callback_add(st->back_btn, "clicked",
825 elm_object_focus_allow_set(st->back_btn, EINA_FALSE);
827 __MOBILE_AP_FUNC_EXIT__;
833 evas_object_del(st->back_btn);
835 evas_object_del(st->genlist);
837 evas_object_del(st->conform);