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.
25 #include <Elementary.h>
27 #include <ui-gadget-module.h>
28 #include <wifi-direct.h>
31 #include "wfd_ug_view.h"
32 #include "wfd_client.h"
34 Elm_Gen_Item_Class select_all_itc;
35 Elm_Gen_Item_Class device_itc;
38 * This function let the ug call it when click 'back' button in multi connect view
40 * @param[in] data the pointer to the main data structure
41 * @param[in] obj the pointer to the evas object
42 * @param[in] event_info the pointer to the event information
44 void _multiconnect_view_back_btn_cb(void *data, Evas_Object * obj, void *event_info)
46 __WDUG_LOG_FUNC_ENTER__;
47 struct ug_data *ugd = (struct ug_data *)data;
50 WDUG_LOGE("The param is NULL\n");
54 ugd->multiconn_view_genlist = NULL;
55 elm_naviframe_item_pop(ugd->naviframe);
57 __WDUG_LOG_FUNC_EXIT__;
62 * This function let the ug reset the connected failed peers
64 * @param[in] event_info the pointer to the event information
66 gboolean __wfd_multi_connect_reset_cb(void *data)
68 __WDUG_LOG_FUNC_ENTER__;
70 struct ug_data *ugd = (struct ug_data *)data;
72 /* remove the failed peers*/
73 for (i = 0; i < ugd->raw_multi_selected_peer_cnt; i++) {
74 if (ugd->raw_multi_selected_peers[i].conn_status == PEER_CONN_STATUS_FAILED_TO_CONNECT) {
75 memset(&ugd->raw_multi_selected_peers[i], 0x00, sizeof(device_type_s));
76 ugd->raw_multi_selected_peer_cnt--;
80 wfd_ug_view_update_peers(ugd);
82 __WDUG_LOG_FUNC_EXIT__;
87 * This function let the ug free the selected peers in multi connect view
89 * @param[in] data the pointer to the main data structure
91 void wfd_free_multi_selected_peers(void *data)
93 __WDUG_LOG_FUNC_ENTER__;
95 struct ug_data *ugd = (struct ug_data *)data;
97 /* destroy the created group */
98 wifi_direct_destroy_group();
100 /* release the selected peers */
101 for (i = 0; i < ugd->raw_multi_selected_peer_cnt; i++) {
102 memset(&ugd->raw_multi_selected_peers[i], 0x00, sizeof(device_type_s));
105 ugd->raw_multi_selected_peer_cnt = 0;
106 ugd->multi_connect_mode = WFD_MULTI_CONNECT_MODE_NONE;
108 __WDUG_LOG_FUNC_EXIT__;
113 * This function let the ug stop to connect to selected peer
114 * @return If success, return 0, else return -1
115 * @param[in] data the pointer to the main data structure
117 int wfd_stop_multi_connect(void *data)
119 __WDUG_LOG_FUNC_ENTER__;
120 struct ug_data *ugd = (struct ug_data *)data;
122 /* change the title of failed peers */
123 ugd->multi_connect_mode = WFD_MULTI_CONNECT_MODE_COMPLETED;
124 wfd_ug_view_refresh_glitem(ugd->multi_connect_wfd_item);
126 wfd_client_set_p2p_group_owner_intent(7);
128 /* after 30s, remove the failed peers */
129 g_timeout_add(30000 /*ms*/, __wfd_multi_connect_reset_cb, ugd);
131 __WDUG_LOG_FUNC_EXIT__;
136 * This function let the ug start to connect the selected peers
137 * @return If success, return 0, else return -1
138 * @param[in] data the pointer to the main data structure
140 int wfd_start_multi_connect(void *data)
142 __WDUG_LOG_FUNC_ENTER__;
143 struct ug_data *ugd = (struct ug_data *)data;
146 if (ugd->raw_multi_selected_peer_cnt > 0) {
147 ugd->multi_connect_mode = WFD_MULTI_CONNECT_MODE_IN_PROGRESS;
149 res = wfd_client_group_add();
151 WDUG_LOGE("Failed to add group");
152 wfd_free_multi_selected_peers(ugd);
154 __WDUG_LOG_FUNC_EXIT__;
159 WDUG_LOGD("No selected peers.\n");
163 __WDUG_LOG_FUNC_EXIT__;
168 * This function let the ug connect to the next selected peer automatically
169 * @return If stop the timer, return false, else return true
170 * @param[in] data the pointer to the main data structure
172 gboolean wfd_multi_connect_next_cb(void *data)
174 __WDUG_LOG_FUNC_ENTER__;
175 struct ug_data *ugd = (struct ug_data *)data;
179 // Reset g_source handler..
180 ugd->g_source_multi_connect_next = 0;
182 if (ugd->raw_multi_selected_peer_cnt > 0) {
183 ugd->multi_connect_mode = WFD_MULTI_CONNECT_MODE_IN_PROGRESS;
184 for (i = 0; i < ugd->raw_multi_selected_peer_cnt; i++) {
185 if (ugd->raw_multi_selected_peers[i].conn_status == PEER_CONN_STATUS_WAIT_FOR_CONNECT) {
186 res = wfd_client_connect(ugd->raw_multi_selected_peers[i].mac_addr);
188 WDUG_LOGD("Failed to connect [%s].\n", ugd->raw_multi_selected_peers[i].ssid);
189 ugd->raw_multi_selected_peers[i].conn_status = PEER_CONN_STATUS_FAILED_TO_CONNECT;
191 ugd->raw_multi_selected_peers[i].conn_status = PEER_CONN_STATUS_CONNECTING;
197 if (i >= ugd->raw_multi_selected_peer_cnt) {
198 // All selected peers are touched.
199 WDUG_LOGD("Stop Multi Connect...\n");
200 wfd_stop_multi_connect(ugd);
203 WDUG_LOGD("No selected peers.\n");
207 __WDUG_LOG_FUNC_EXIT__;
212 * This function let the ug call it when click 'connect' button in multi connect view
214 * @param[in] data the pointer to the main data structure
215 * @param[in] obj the pointer to the evas object
216 * @param[in] event_info the pointer to the event information
218 void _connect_btn_cb(void *data, Evas_Object *obj, void *event_info)
220 __WDUG_LOG_FUNC_ENTER__;
221 struct ug_data *ugd = (struct ug_data *)data;
224 char popup_text[MAX_POPUP_TEXT_SIZE] = {0};
225 WDUG_LOGD("_connect_btn_cb \n");
227 for (i = 0; i < ugd->gl_available_peer_cnt ; i++) {
228 if (TRUE == ugd->multi_conn_dev_list[i].dev_sel_state) {
229 WDUG_LOGD("ugd->peers[i].mac_addr = %s, i = %d\n", ugd->multi_conn_dev_list[i].peer.mac_addr, i);
231 memcpy(&ugd->raw_multi_selected_peers[count], &ugd->multi_conn_dev_list[i].peer, sizeof(device_type_s));
232 ugd->raw_multi_selected_peers[count].conn_status = PEER_CONN_STATUS_WAIT_FOR_CONNECT;
237 ugd->raw_multi_selected_peer_cnt = count;
239 /* if more than 7 device selected, show the popup */
240 if (count > MAX_POPUP_PEER_NUM) {
241 snprintf(popup_text, MAX_POPUP_TEXT_SIZE, _("IDS_WFD_POP_MULTI_CONNECT"), count);
242 wfd_ug_warn_popup(ugd, popup_text, POP_TYPE_MULTI_CONNECT_POPUP);
245 /* start multi connection */
246 wfd_start_multi_connect(ugd);
248 elm_naviframe_item_pop(ugd->naviframe);
250 //ToDo: Do we need to free multiconn_view_genlist?
251 ugd->multiconn_view_genlist = NULL;
252 _change_multi_button_title(ugd);
254 __WDUG_LOG_FUNC_EXIT__;
259 * This function let the ug delete 'select(n)' notify
261 * @param[in] data the pointer to the main data structure
263 static void _wfd_multi_del_select_info_label(void *data)
265 __WDUG_LOG_FUNC_ENTER__;
266 struct ug_data *ugd = (struct ug_data *)data;
269 WDUG_LOGE("The param is NULL\n");
274 evas_object_del(ugd->notify);
278 if (ugd->notify_layout) {
279 evas_object_del(ugd->notify_layout);
280 ugd->notify_layout = NULL;
283 __WDUG_LOG_FUNC_EXIT__;
288 * This function let the ug add 'select(n)' notify
290 * @param[in] data the pointer to the main data structure
291 * @param[in] count the number of selected peers
293 static void _wfd_multi_add_select_info_label(void *data, int count)
295 __WDUG_LOG_FUNC_ENTER__;
297 char select_lablel[MAX_POPUP_TEXT_SIZE] = {0};
298 struct ug_data *ugd = (struct ug_data *)data;
300 if (NULL == ugd || count <= 0) {
301 WDUG_LOGE("The param is NULL\n");
305 /* delete previous notify */
306 _wfd_multi_del_select_info_label(ugd);
309 ugd->notify = elm_notify_add(ugd->base);
310 if (NULL == ugd->notify) {
311 WDUG_LOGE("Add notify failed\n");
315 /* set the align to center of bottom */
316 elm_notify_align_set(ugd->notify, ELM_NOTIFY_ALIGN_FILL, 1.0);
318 ugd->notify_layout = elm_layout_add(ugd->notify);
319 if (NULL == ugd->notify_layout) {
320 evas_object_del(ugd->notify);
325 elm_layout_theme_set(ugd->notify_layout, "standard", "selectioninfo", "vertical/bottom_64");
326 elm_object_content_set(ugd->notify, ugd->notify_layout);
328 snprintf(select_lablel, MAX_POPUP_TEXT_SIZE, _("IDS_WFD_POP_SELECTED_DEVICE_NUM"), count);
329 elm_object_part_text_set(ugd->notify_layout, "elm.text", select_lablel);
330 elm_notify_timeout_set(ugd->notify, 3);
331 evas_object_show(ugd->notify);
333 __WDUG_LOG_FUNC_EXIT__;
338 * This function let the ug call it when click the peer in multi connect view
340 * @param[in] data the pointer to the main data structure
341 * @param[in] obj the pointer to the evas object
342 * @param[in] event_info the pointer to the event information
344 static void _wfd_gl_multi_sel_cb(void *data, Evas_Object *obj, void *event_info)
346 __WDUG_LOG_FUNC_ENTER__;
352 bool is_selct_all = TRUE;
354 Evas_Object *chk_box = NULL;
355 char msg[MAX_POPUP_TEXT_SIZE] = {0};
356 struct ug_data *ugd = (struct ug_data *)data;
357 Elm_Object_Item *item = (Elm_Object_Item *)event_info;
359 if (NULL == ugd || NULL == item) {
360 WDUG_LOGE("The param is NULL\n");
364 elm_genlist_item_selected_set(item, EINA_FALSE);
365 index = elm_genlist_item_index_get(item) - 3; /* subtract the previous items */
366 WDUG_LOGD("selected index = %d \n", index);
368 WDUG_LOGE("The index is invalid.\n");
372 chk_box = elm_object_item_part_content_get((Elm_Object_Item *)event_info, "elm.icon.1");
373 state = elm_check_state_get(chk_box);
374 WDUG_LOGD("state = %d \n", state);
375 elm_check_state_set(chk_box, !state);
377 ugd->multi_conn_dev_list[index].dev_sel_state = !state;
378 WDUG_LOGD("ptr->dev_sel_state = %d \n", ugd->multi_conn_dev_list[index].dev_sel_state);
379 WDUG_LOGD("ptr->peer.mac_addr = %s \n", ugd->multi_conn_dev_list[index].peer.mac_addr);
381 /* update the checkbox and button */
382 for (; i < ugd->gl_available_dev_cnt_at_multiconn_view; i++) {
383 if (ugd->multi_conn_dev_list[i].dev_sel_state) {
387 is_selct_all = FALSE;
391 chk_box = elm_object_item_part_content_get(ugd->mcview_select_all_item, "elm.icon");
392 elm_check_state_set(chk_box, is_selct_all);
394 if (ugd->multi_connect_btn) {
395 wfd_ug_view_refresh_button(ugd->multi_connect_btn, _("IDS_WFD_BUTTON_CONNECT"), is_sel);
399 snprintf(msg, MAX_POPUP_TEXT_SIZE, _("IDS_WFD_POP_SELECTED_DEVICE_NUM"), sel_count);
400 _wfd_multi_add_select_info_label(ugd, sel_count);
402 _wfd_multi_del_select_info_label(ugd);
405 __WDUG_LOG_FUNC_EXIT__;
409 * This function let the ug call it when click the 'select all' item in multi connect view
411 * @param[in] data the pointer to the main data structure
412 * @param[in] obj the pointer to the evas object
413 * @param[in] event_info the pointer to the event information
415 static void _wfd_gl_sel_cb(void *data, Evas_Object *obj, void *event_info)
418 char msg[MAX_POPUP_TEXT_SIZE] = {0};
419 struct ug_data *ugd = (struct ug_data *)data;
421 elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
423 if (NULL == ugd || NULL == obj) {
424 WDUG_LOGE("NULL parameters.\n");
428 Evas_Object *sel_chkbox = elm_object_item_part_content_get(ugd->mcview_select_all_item, "elm.icon");
429 if (sel_chkbox == NULL) {
430 WDUG_LOGD("select-all chkbox is NULL\n");
434 Eina_Bool state = elm_check_state_get(sel_chkbox);
441 elm_check_state_set(sel_chkbox, state);
442 WDUG_LOGD("state = %d \n", state);
446 Elm_Object_Item *item = NULL;
447 Evas_Object *chk_box = NULL;
449 /* set the state of all the available devices */
450 for (i = 0; i < ugd->gl_available_dev_cnt_at_multiconn_view; i++) {
452 ugd->multi_conn_dev_list[i].dev_sel_state = state;
453 item = ugd->multi_conn_dev_list[i].peer.gl_item;
454 chk_box = elm_object_item_part_content_get(item, "elm.icon.1");
455 elm_check_state_set(chk_box, state);
462 /* update the connect button */
463 if (ugd->multi_connect_btn) {
464 wfd_ug_view_refresh_button(ugd->multi_connect_btn, _("IDS_WFD_BUTTON_CONNECT"), is_sel);
467 /* tickernoti popup */
469 snprintf(msg, MAX_POPUP_TEXT_SIZE, _("IDS_WFD_POP_SELECTED_DEVICE_NUM"), sel_count);
470 _wfd_multi_add_select_info_label(ugd, sel_count);
472 _wfd_multi_del_select_info_label(ugd);
477 * This function let the ug get the label of peer
478 * @return the label of peer
479 * @param[in] data the pointer to the main data structure
480 * @param[in] obj the pointer to the evas object
481 * @param[in] part the pointer to the part of item
483 static char *_wfd_gl_device_label_get(void *data, Evas_Object *obj, const char *part)
485 WDUG_LOGD("part %s", part);
486 device_type_s *peer = (device_type_s *)data;
492 if (!strcmp(part, "elm.text")) {
493 return strdup(peer->ssid);
499 * This function let the ug get the icon path of peer
500 * @return the icon path of titile
501 * @param[in] peer the pointer to the peer
503 static char *__wfd_get_device_icon_path(device_type_s *peer)
505 char *img_path = NULL;
507 switch (peer->category) {
508 case WFD_DEVICE_TYPE_COMPUTER:
509 img_path = WFD_ICON_DEVICE_COMPUTER;
511 case WFD_DEVICE_TYPE_INPUT_DEVICE:
512 img_path = WFD_ICON_DEVICE_INPUT_DEVICE;
514 case WFD_DEVICE_TYPE_PRINTER:
515 img_path = WFD_ICON_DEVICE_PRINTER;
517 case WFD_DEVICE_TYPE_CAMERA:
518 img_path = WFD_ICON_DEVICE_CAMERA;
520 case WFD_DEVICE_TYPE_STORAGE:
521 img_path = WFD_ICON_DEVICE_STORAGE;
523 case WFD_DEVICE_TYPE_NW_INFRA:
524 img_path = WFD_ICON_DEVICE_NETWORK_INFRA;
526 case WFD_DEVICE_TYPE_DISPLAYS:
527 img_path = WFD_ICON_DEVICE_DISPLAY;
529 case WFD_DEVICE_TYPE_MM_DEVICES:
530 img_path = WFD_ICON_DEVICE_MULTIMEDIA_DEVICE;
532 case WFD_DEVICE_TYPE_GAME_DEVICES:
533 img_path = WFD_ICON_DEVICE_GAMING_DEVICE;
535 case WFD_DEVICE_TYPE_TELEPHONE:
536 img_path = WFD_ICON_DEVICE_TELEPHONE;
538 case WFD_DEVICE_TYPE_AUDIO:
539 img_path = WFD_ICON_DEVICE_AUDIO_DEVICE;
542 img_path = WFD_ICON_DEVICE_COMPUTER;
551 * This function let the ug call it when click the check box
553 * @param[in] data the pointer to the main data structure
554 * @param[in] obj the pointer to the evas object
555 * @param[in] event_info the pointer to the event information
557 static void _wfd_check_clicked_cb(void *data, Evas_Object *obj, void *event_info)
560 WDUG_LOGE("NULL parameters.\n");
564 Eina_Bool state = elm_check_state_get(obj);
565 elm_check_state_set(obj, !state);
566 WDUG_LOGD("state = %d \n", state);
570 * This function let the ug get the icon of peer
571 * @return the icon of peer
572 * @param[in] data the pointer to the main data structure
573 * @param[in] obj the pointer to the evas object
574 * @param[in] part the pointer to the part of item
576 static Evas_Object *_wfd_gl_device_icon_get(void *data, Evas_Object *obj, const char *part)
578 char *img_path = NULL;
579 device_type_s *peer = (device_type_s *) data;
580 Evas_Object *icon = NULL;
582 WDUG_LOGD("Part %s", part);
584 if (!strcmp(part, "elm.icon.1")) {
585 WDUG_LOGD("Part %s", part);
586 icon = elm_check_add(obj);
587 elm_check_state_set(icon, EINA_FALSE);
588 evas_object_smart_callback_add(icon, "changed", _wfd_check_clicked_cb, (void *)data);
589 } else if (!strcmp(part, "elm.icon.2")) {
590 img_path = __wfd_get_device_icon_path(peer);
591 icon = elm_icon_add(obj);
592 elm_icon_file_set(icon, img_path, NULL);
593 evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
594 elm_icon_resizable_set(icon, 1, 1);
595 evas_object_show(icon);
602 * This function let the ug get the label of select all
603 * @return the label of select all
604 * @param[in] data the pointer to the main data structure
605 * @param[in] obj the pointer to the evas object
606 * @param[in] part the pointer to the part of item
608 static char *_wfd_gl_select_all_label_get(void *data, Evas_Object *obj, const char *part)
610 if (!strcmp(part, "elm.text")) {
611 WDUG_LOGD("Adding text %s", part);
612 return strdup("Select all");
618 * This function let the ug get the icon of select all
619 * @return the icon of select all
620 * @param[in] data the pointer to the main data structure
621 * @param[in] obj the pointer to the evas object
622 * @param[in] part the pointer to the part of item
624 static Evas_Object *_wfd_gl_select_all_icon_get(void *data, Evas_Object *obj, const char *part)
626 Evas_Object *icon = NULL;
628 if (!strcmp(part, "elm.icon")) {
629 WDUG_LOGD("Part %s", part);
630 icon = elm_check_add(obj);
631 elm_check_state_set(icon, EINA_FALSE);
632 evas_object_smart_callback_add(icon, "changed", _wfd_check_clicked_cb, (void *)data);
639 * This function let the ug fee the multi connect devices
641 * @param[in] data the pointer to the main data structure
643 int wfd_free_multiconnect_device(struct ug_data *ugd)
645 __WDUG_LOG_FUNC_ENTER__;
649 if (ugd->multiconn_view_genlist == NULL) {
653 if (ugd->mcview_title_item != NULL) {
654 elm_object_item_del(ugd->mcview_title_item);
655 ugd->mcview_title_item = NULL;
658 if (ugd->mcview_select_all_item != NULL) {
659 elm_object_item_del(ugd->mcview_select_all_item);
660 ugd->mcview_select_all_item = NULL;
663 if (ugd->mcview_nodevice_item != NULL) {
664 elm_object_item_del(ugd->mcview_nodevice_item);
665 ugd->mcview_nodevice_item = NULL;
668 for (i = 0; i < ugd->gl_available_dev_cnt_at_multiconn_view; i++) {
669 if (ugd->multi_conn_dev_list[i].peer.gl_item != NULL) {
670 elm_object_item_del(ugd->multi_conn_dev_list[i].peer.gl_item);
671 ugd->multi_conn_dev_list[i].peer.gl_item = NULL;
674 ugd->gl_available_dev_cnt_at_multiconn_view = 0;
676 __WDUG_LOG_FUNC_EXIT__;
681 * This function let the ug update the multi connect devices
683 * @param[in] data the pointer to the main data structure
685 int wfd_update_multiconnect_device(struct ug_data *ugd)
687 __WDUG_LOG_FUNC_ENTER__;
690 device_type_s *device = NULL;
691 Evas_Object *genlist = NULL;
694 genlist = ugd->multiconn_view_genlist;
695 if (ugd->multiconn_view_genlist == NULL) {
699 wfd_free_multiconnect_device(ugd);
702 for (i = 0; i < ugd->raw_discovered_peer_cnt; i++) {
703 device = &ugd->raw_discovered_peers[i];
704 if (device->is_connected == FALSE) {
708 ugd->gl_available_dev_cnt_at_multiconn_view = count;
710 if (ugd->gl_available_dev_cnt_at_multiconn_view == 0) {
711 WDUG_LOGE("There are No peers\n");
712 ugd->mcview_title_item = elm_genlist_item_append(genlist, &title_itc, ugd, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
713 elm_genlist_item_select_mode_set(ugd->mcview_title_item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
714 ugd->mcview_nodevice_item = elm_genlist_item_append(genlist, &noitem_itc, (void *)ugd, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
715 elm_genlist_item_select_mode_set(ugd->mcview_nodevice_item , ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
717 ugd->mcview_title_item = elm_genlist_item_append(genlist, &title_itc, ugd, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
718 elm_genlist_item_select_mode_set(ugd->mcview_title_item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
719 ugd->mcview_select_all_item = elm_genlist_item_append(genlist, &select_all_itc, ugd, NULL, ELM_GENLIST_ITEM_NONE, _wfd_gl_sel_cb, ugd);
722 for (i = 0; i < ugd->raw_discovered_peer_cnt; i++) {
723 device = &ugd->raw_discovered_peers[i];
724 if (device->is_connected == FALSE) {
725 WDUG_LOGD("%dth peer being added on genlist\n", i);
727 if (ugd->multi_conn_dev_list[count].peer.gl_item != NULL) {
728 elm_object_item_del(ugd->multi_conn_dev_list[count].peer.gl_item);
731 ugd->multi_conn_dev_list[count].peer.gl_item = NULL;
732 memcpy(&ugd->multi_conn_dev_list[count].peer, device, sizeof(device_type_s));
733 ugd->multi_conn_dev_list[count].dev_sel_state = FALSE;
734 ugd->multi_conn_dev_list[count].peer.gl_item = elm_genlist_item_append(genlist, &device_itc,
735 (void *)&ugd->multi_conn_dev_list[count].peer, NULL, ELM_GENLIST_ITEM_NONE, _wfd_gl_multi_sel_cb, ugd);
741 __WDUG_LOG_FUNC_EXIT__;
746 * This function let the ug create the view for multi connection
748 * @param[in] ugd the pointer to the main data structure
750 void wfd_create_multiconnect_view(struct ug_data *ugd)
752 __WDUG_LOG_FUNC_ENTER__;
754 Evas_Object *back_btn = NULL;
755 Evas_Object *genlist = NULL;
756 Elm_Object_Item *navi_item = NULL;
759 WDUG_LOGE("Incorrect parameter(NULL)");
763 select_all_itc.item_style = "1text.1icon.3";
764 select_all_itc.func.text_get = _wfd_gl_select_all_label_get;
765 select_all_itc.func.content_get = _wfd_gl_select_all_icon_get;
766 select_all_itc.func.state_get = NULL;
767 select_all_itc.func.del = NULL;
769 device_itc.item_style = "1text.2icon.2";
770 device_itc.func.text_get = _wfd_gl_device_label_get;
771 device_itc.func.content_get = _wfd_gl_device_icon_get;
772 device_itc.func.state_get = NULL;
773 device_itc.func.del = NULL;
775 WDUG_LOGD("_wifid_create_multiconnect_view");
776 back_btn = elm_button_add(ugd->naviframe);
777 elm_object_style_set(back_btn, "naviframe/back_btn/default");
778 evas_object_smart_callback_add(back_btn, "clicked", _multiconnect_view_back_btn_cb, (void *)ugd);
779 elm_object_focus_allow_set(back_btn, EINA_FALSE);
781 genlist = elm_genlist_add(ugd->naviframe);
782 ugd->multiconn_view_genlist = genlist;
783 ugd->mcview_title_item = NULL;
785 wfd_update_multiconnect_device(ugd);
787 evas_object_show(genlist);
789 navi_item = elm_naviframe_item_push(ugd->naviframe, _("Multi connect"), back_btn, NULL, genlist, NULL);
791 /* create scan button */
792 ugd->multi_scan_btn = elm_button_add(ugd->naviframe);
793 elm_object_style_set(ugd->multi_scan_btn, "naviframe/toolbar/default");
794 elm_object_text_set(ugd->multi_scan_btn, _("IDS_WFD_BUTTON_SCAN"));
795 evas_object_smart_callback_add(ugd->multi_scan_btn, "clicked", _scan_btn_cb, (void *)ugd);
796 elm_object_item_part_content_set(navi_item, "toolbar_button1", ugd->multi_scan_btn);
798 /* create connect button */
799 ugd->multi_connect_btn = elm_button_add(ugd->naviframe);
800 elm_object_style_set(ugd->multi_connect_btn, "naviframe/toolbar/default");
801 elm_object_text_set(ugd->multi_connect_btn, _("IDS_WFD_BUTTON_CONNECT"));
802 evas_object_smart_callback_add(ugd->multi_connect_btn, "clicked", _connect_btn_cb, (void *)ugd);
803 elm_object_disabled_set(ugd->multi_connect_btn, EINA_TRUE);
804 elm_object_item_part_content_set(navi_item, "toolbar_button2", ugd->multi_connect_btn);
806 __WDUG_LOG_FUNC_EXIT__;