4 * Copyright 2012-2013 Samsung Electronics Co., Ltd
6 * Licensed under the Flora License, Version 1.1 (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://floralicense.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.
21 * This file implements wifi direct system popup view functions.
23 * @file wfd-app-popup-view.c
24 * @author Sungsik Jang (sungsik.jang@samsung.com)
31 #include <notification.h>
33 #include "wifi-direct.h"
35 #include "wfd-app-strings.h"
36 #include "wfd-app-util.h"
38 extern wfd_appdata_t *g_wfd_ad;
39 extern wfd_popup_t *g_wfd_pop;
40 extern unsigned char g_wfd_peer_mac[6];
41 extern unsigned char g_wfd_peer_name[32];
42 static Ecore_Timer *pb_timer = NULL;
46 * This function let the ug make a callback for click the button in popup
48 * @param[in] data the pointer to the main data structure
49 * @param[in] obj the pointer to the evas object
50 * @param[in] event_info the pointer to the event information
52 static void __popup_resp_cb(void *data, Evas_Object * obj, void *event_info)
54 __WDPOP_LOG_FUNC_ENTER__;
55 wfd_appdata_t *ad = wfd_get_appdata();
57 int resp = (int) data;
58 char msg[WFD_POP_STR_MAX_LEN] = {0};
60 WDPOP_LOGI( "popup resp : %d\n", resp);
63 case /* MT */ WFD_POP_RESP_APRV_CONNECT_PBC_YES:
66 "WFD_POP_RESP_APRV_CONNECT_PBC_YES\n");
69 result = wifi_direct_accept_connection(ad->peer_mac);
71 "wifi_direct_accept_connection() result=[%d]\n",
73 if (result == WIFI_DIRECT_ERROR_NONE) {
74 /* tickernoti popup */
75 notification_status_message_post(_("IDS_WFD_POP_CONNECTING"));
78 "wifi_direct_accept_connection() FAILED!!\n");
79 evas_object_hide(ad->win);
81 /* tickernoti popup */
82 snprintf(msg, WFD_POP_STR_MAX_LEN, IDS_WFD_POP_CONNECT_FAILED, ad->peer_name);
83 notification_status_message_post(msg);
88 case WFD_POP_RESP_APRV_CONNECT_INVITATION_YES:
90 "WFD_POP_RESP_APRV_CONNECT_INVITATION_YES [" MACSTR "]\n", MAC2STR(ad->peer_mac));
93 result = wifi_direct_connect(ad->peer_mac);
95 "wifi_direct_connect() result=[%d]\n",
97 if (result == WIFI_DIRECT_ERROR_NONE) {
98 /* tickernoti popup */
99 notification_status_message_post(_("IDS_WFD_POP_CONNECTING"));
102 "wifi_direct_connect() FAILED!!\n");
103 evas_object_hide(ad->win);
105 /* tickernoti popup */
106 snprintf(msg, WFD_POP_STR_MAX_LEN, IDS_WFD_POP_CONNECT_FAILED, ad->peer_name);
107 notification_status_message_post(msg);
112 case /* MT */ WFD_POP_RESP_APRV_CONNECT_DISPLAY_OK:
117 "WFD_POP_RESP_APRV_CONNECT_DISPLAY_OK\n");
120 if (wifi_direct_generate_wps_pin() != WIFI_DIRECT_ERROR_NONE) {
121 WDPOP_LOGD( "wifi_direct_generate_wps_pin() is failed\n");
125 if (wifi_direct_get_wps_pin(&pin) != WIFI_DIRECT_ERROR_NONE) {
126 WDPOP_LOGD( "wifi_direct_generate_wps_pin() is failed\n");
130 strncpy(ad->pin_number, pin, 64);
131 ad->pin_number[63] = '\0';
134 WDPOP_LOGD( "button ok: pin [%s]", ad->pin_number);
136 result = wifi_direct_accept_connection(ad->peer_mac);
137 if (result == WIFI_DIRECT_ERROR_NONE) {
138 wfd_prepare_popup(WFD_POP_PROG_CONNECT_WITH_PIN, NULL);
141 "wifi_direct_accept_connection() failed. result=[%d]\n", result);
142 /* tickernoti popup */
143 snprintf(msg, WFD_POP_STR_MAX_LEN, IDS_WFD_POP_CONNECT_FAILED, ad->peer_name);
144 notification_status_message_post(msg);
149 case /* MO */ WFD_POP_RESP_PROG_CONNECT_KEYPAD_OK:
152 "WFD_POP_RESP_PROG_CONNECT_KEYPAD_OK\n");
156 int len = strlen(ad->pin_number);
157 WDPOP_LOGD( "button ok: pin [%s]", ad->pin_number);
161 notification_status_message_post(_("IDS_CST_BODY_PASSWORD_TOO_LONG"));
163 notification_status_message_post(_("IDS_ST_BODY_PASSWORD_TOO_SHORT"));
164 wfd_prepare_popup(WFD_POP_PROG_CONNECT_WITH_KEYPAD, (void *) NULL);
169 WDPOP_LOGD( "pin=[%s]\n", ad->pin_number);
171 result = wifi_direct_set_wps_pin(ad->pin_number);
172 if (result != WIFI_DIRECT_ERROR_NONE) {
173 /* tickernoti popup */
174 snprintf(msg, WFD_POP_STR_MAX_LEN, IDS_WFD_POP_CONNECT_FAILED, ad->peer_name);
175 notification_status_message_post(msg);
179 //result = wifi_direct_activate_pushbutton();
180 result = wifi_direct_accept_connection(ad->peer_mac);
182 "wifi_direct_accept_connection(%s) result=[%d]\n",
183 ad->peer_mac, result);
184 if (result != WIFI_DIRECT_ERROR_NONE) {
186 "wifi_direct_accept_connection() FAILED!!\n");
187 evas_object_hide(ad->win);
189 /* tickernoti popup */
190 snprintf(msg, WFD_POP_STR_MAX_LEN, IDS_WFD_POP_CONNECT_FAILED, ad->peer_name);
191 notification_status_message_post(msg);
196 case /* MT */ WFD_POP_RESP_APRV_CONNECT_KEYPAD_YES:
199 "WFD_POP_RESP_APRV_CONNECT_KEYPAD_YES\n");
202 ecore_timer_del(pb_timer);
206 wfd_prepare_popup(WFD_POP_PROG_CONNECT_WITH_KEYPAD, (void *) NULL);
210 case /* MT */ WFD_POP_RESP_APRV_CONNECT_NO:
213 "WFD_POP_RESP_APRV_CONNECT_NO: destroy_popup...\n");
217 ecore_timer_del(pb_timer);
221 result = wifi_direct_disconnect(ad->peer_mac);
223 "wifi_direct_disconnect[%s] result=[%d]\n",
224 ad->peer_mac, result);
230 WDPOP_LOGE( "Unknown respone\n");
231 evas_object_hide(ad->win);
236 __WDPOP_LOG_FUNC_EXIT__;
240 * This function let the app destroy the popup
244 void wfd_destroy_popup()
246 __WDPOP_LOG_FUNC_ENTER__;
247 wfd_appdata_t *ad = wfd_get_appdata();
250 WDPOP_LOGE( "ad is NULL\n");
255 evas_object_del(ad->popup);
259 if (ad->popup_timeout_handle > 0) {
260 g_source_remove(ad->popup_timeout_handle);
261 ad->popup_timeout_handle = 0;
264 evas_object_hide(ad->win);
266 __WDPOP_LOG_FUNC_EXIT__;
271 * This function let the app create a popup which includes no button
273 * @param[in] win the window object
274 * @param[in] pop the pointer to the prepared popup
276 static Evas_Object *wfd_draw_pop_type_a(Evas_Object * win, wfd_popup_t * pop)
278 __WDPOP_LOG_FUNC_ENTER__;
281 popup = elm_popup_add(win);
282 evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
283 elm_object_text_set(popup, pop->text);
284 elm_popup_timeout_set(popup, pop->timeout);
285 evas_object_show(popup);
286 evas_object_show(win);
288 __WDPOP_LOG_FUNC_EXIT__;
293 * This function let the app create a popup which includes one button
295 * @param[in] win the window object
296 * @param[in] pop the pointer to the prepared popup
298 static Evas_Object *wfd_draw_pop_type_b(Evas_Object * win, wfd_popup_t * pop)
300 __WDPOP_LOG_FUNC_ENTER__;
301 Evas_Object *popup = NULL;
302 Evas_Object *btn = NULL;
304 popup = elm_popup_add(win);
305 evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
306 elm_object_text_set(popup, pop->text);
308 btn = elm_button_add(popup);
309 elm_object_style_set(btn, "popup_button/default");
310 elm_object_text_set(btn, pop->label1);
311 elm_object_part_content_set(popup, "button1", btn);
312 evas_object_smart_callback_add(btn, "clicked", __popup_resp_cb, (void *) pop->resp_data1);
314 evas_object_show(popup);
315 evas_object_show(win);
317 __WDPOP_LOG_FUNC_EXIT__;
322 * This function let the app create a popup which includes two buttons
324 * @param[in] win the window object
325 * @param[in] pop the pointer to the prepared popup
327 static Evas_Object *wfd_draw_pop_type_c(Evas_Object * win, wfd_popup_t * pop)
329 __WDPOP_LOG_FUNC_ENTER__;
330 Evas_Object *popup = NULL;
331 Evas_Object *btn1 = NULL, *btn2 = NULL;
333 popup = elm_popup_add(win);
334 evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
335 elm_object_text_set(popup, pop->text);
337 btn1 = elm_button_add(popup);
338 elm_object_style_set(btn1, "popup_button/default");
339 elm_object_text_set(btn1, pop->label1);
340 elm_object_part_content_set(popup, "button1", btn1);
341 evas_object_smart_callback_add(btn1, "clicked", __popup_resp_cb,
342 (void *) pop->resp_data1);
344 btn2 = elm_button_add(popup);
345 elm_object_style_set(btn2, "popup_button/default");
346 elm_object_text_set(btn2, pop->label2);
347 elm_object_part_content_set(popup, "button2", btn2);
348 evas_object_smart_callback_add(btn2, "clicked", __popup_resp_cb,
349 (void *) pop->resp_data2);
351 evas_object_show(popup);
352 evas_object_show(win);
354 __WDPOP_LOG_FUNC_EXIT__;
359 * This function let the ug make a change callback for password input
361 * @param[in] data the pointer to the main data structure
362 * @param[in] obj the pointer to the evas object
363 * @param[in] event_info the pointer to the event information
365 static void _smart_ime_cb(void *data, Evas_Object * obj, void *event_info)
367 __WDPOP_LOG_FUNC_ENTER__;
368 wfd_appdata_t *ad = wfd_get_appdata();
370 Ecore_IMF_Context *imf_context = NULL;
371 imf_context = (Ecore_IMF_Context *) ad->pin_entry;
373 if (NULL == imf_context) {
374 WDPOP_LOGE( "Error!!! Ecore_IMF_Context is NULL!!");
378 const char *txt = elm_entry_markup_to_utf8(elm_entry_entry_get((const Evas_Object *) imf_context));
380 WDPOP_LOGD( "* text [%s], len=[%d]", txt, strlen(txt));
381 strncpy(ad->pin_number, txt, 64);
382 ad->pin_number[63] = '\0';
388 __WDPOP_LOG_FUNC_EXIT__;
392 * This function let the app make a change callback for password checkbox
394 * @param[in] data the pointer to the main data structure
395 * @param[in] obj the pointer to the evas object
396 * @param[in] event_info the pointer to the event information
398 static void _check_changed_cb(void *data, Evas_Object * obj, void *event_info)
400 wfd_appdata_t *ad = wfd_get_appdata();
406 Eina_Bool state = elm_check_state_get(obj);
407 elm_entry_password_set(ad->pin_entry, !state);
408 elm_entry_autocapital_type_set(ad->pin_entry, ELM_AUTOCAPITAL_TYPE_NONE);
412 * This function let the app make a callback for progressbar timer
413 * @return if stop the timer, return ECORE_CALLBACK_CANCEL, else return ECORE_CALLBACK_RENEW
414 * @param[in] data the pointer to the wps structure
416 static Eina_Bool _fn_pb_timer(void *data)
420 char time_label[32] = {0};
421 wfd_wps_display_popup_t *wps_display_popup = (wfd_wps_display_popup_t *) data;
423 if (NULL == wps_display_popup) {
424 WDPOP_LOGE( "Param is NULL.\n");
425 return ECORE_CALLBACK_CANCEL;
428 Evas_Object *progressbar = NULL;
429 Evas_Object *time = NULL;
431 progressbar = wps_display_popup->progressbar;
432 time = wps_display_popup->time;
433 value = elm_progressbar_value_get(progressbar);
436 WDPOP_LOGE( "Progress end.\n");
438 ecore_timer_del(pb_timer);
442 return ECORE_CALLBACK_CANCEL;
445 wps_display_popup->step++;
446 step = wps_display_popup->step;
447 value = ((double)step) / WFD_POP_TIMER_120;
448 elm_progressbar_value_set(progressbar, value);
449 WDPOP_LOGD( "step: %d, value: %f\n", wps_display_popup->step, value);
451 /* show the time label */
454 snprintf(time_label, 32, "00:0%d", step);
456 snprintf(time_label, 32, "00:%d", step);
460 snprintf(time_label, 32, "0%d:0%d", step/60, step%60);
462 snprintf(time_label, 32, "0%d:%d", step/60, step%60);
466 elm_object_text_set(time, time_label);
468 return ECORE_CALLBACK_RENEW;
472 * This function let the app create a edit filed
474 * @param[in] parent the parent object
475 * @param[in] title the pointer to the title of edit field
476 * @param[in] guide the pointer to the text of guide
477 * @param[in] single_line whether it can support single line
478 * @param[in] is_editable whether it is avaliable to edit
480 static Evas_Object *_add_edit_field(Evas_Object *parent, const char *title, const char *guide, Eina_Bool single_line, Eina_Bool is_editable)
482 assertm_if(NULL == parent, "parent is NULL!!");
484 Evas_Object *layout = elm_layout_add(parent);
485 assertm_if(NULL == layout, "layout is NULL!!");
487 if (title && title[0] != '\0') {
488 elm_layout_theme_set(layout, "layout", "editfield", "title");
489 elm_object_part_text_set(layout, "elm.text", title);
491 elm_layout_theme_set(layout, "layout", "editfield", "default");
494 Evas_Object *entry = elm_entry_add(parent);
495 assertm_if(NULL == entry, "entry is NULL!!");
497 elm_object_part_content_set(layout, "elm.swallow.content", entry);
498 evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
500 if (guide && guide[0] != '\0') {
501 elm_object_part_text_set(layout, "elm.guidetext", guide);
504 elm_entry_single_line_set(entry, single_line);
505 elm_entry_scrollable_set(entry, single_line);
506 elm_entry_editable_set(entry, is_editable);
507 elm_object_signal_emit(layout, "elm,state,eraser,hide", "elm");
508 evas_object_show(layout);
514 * This function let the app create a display popup
515 * @return display popup
516 * @param[in] win the window object
517 * @param[in] pop the pointer to the prepared popup
519 Evas_Object *wfd_draw_pop_type_display(Evas_Object * win, wfd_popup_t * pop)
521 __WDPOP_LOG_FUNC_ENTER__;
523 Evas_Object *popup = NULL;
524 Evas_Object *label = NULL;
525 Evas_Object *progressbar = NULL;
526 Evas_Object *time = NULL;
527 static wfd_wps_display_popup_t wps_display_popup;
529 popup = elm_popup_add(win);
530 evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, 0.0);
532 Evas_Object *box = elm_box_add(popup);
534 evas_object_del(popup);
539 evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, 0.0);
540 evas_object_size_hint_align_set(box, EVAS_HINT_FILL, 0.0);
541 elm_object_part_content_set(popup, NULL, box);
542 evas_object_show(box);
545 label = elm_label_add(box);
546 elm_object_style_set(label, "popup/default");
547 elm_label_line_wrap_set(label, ELM_WRAP_MIXED);
548 elm_object_text_set(label, pop->text);
549 evas_object_size_hint_weight_set(label, EVAS_HINT_EXPAND, 0.0);
550 evas_object_size_hint_align_set(label, EVAS_HINT_FILL, 0.0);
551 elm_box_pack_end(box, label);
552 evas_object_show(label);
554 /* add progressbar */
555 progressbar = elm_progressbar_add(box);
556 elm_object_style_set(progressbar, "list_progress");
557 elm_progressbar_horizontal_set(progressbar, EINA_TRUE);
558 evas_object_size_hint_align_set(progressbar, EVAS_HINT_FILL, 0.0);
559 evas_object_size_hint_weight_set(progressbar, EVAS_HINT_EXPAND, 0.0);
560 elm_progressbar_value_set(progressbar, 0.0);
561 elm_box_pack_end(box, progressbar);
562 evas_object_show(progressbar);
565 time = elm_label_add(box);
566 elm_object_style_set(time, "popup/default");
567 elm_object_text_set(time, "00:00");
568 evas_object_size_hint_weight_set(time, EVAS_HINT_EXPAND, 0.0);
569 evas_object_size_hint_align_set(time, EVAS_HINT_FILL, 0.0);
570 elm_box_pack_end(box, time);
571 evas_object_show(time);
573 /* start progressbar timer */
574 wps_display_popup.step = 0;
575 wps_display_popup.progressbar = progressbar;
576 wps_display_popup.time = time;
578 ecore_timer_del(pb_timer);
579 pb_timer = ecore_timer_add(1, _fn_pb_timer, &wps_display_popup);
582 if (pop->resp_data1 == WFD_POP_RESP_APRV_CONNECT_KEYPAD_YES ||
583 pop->resp_data1 == WFD_POP_RESP_APRV_CONNECT_NO) {
584 Evas_Object *btn1 = NULL;
585 btn1 = elm_button_add(popup);
586 elm_object_style_set(btn1, "popup_button/default");
587 elm_object_text_set(btn1, pop->label1);
588 elm_object_part_content_set(popup, "button1", btn1);
589 evas_object_smart_callback_add(btn1, "clicked", __popup_resp_cb,
590 (void *) pop->resp_data1);
593 if (pop->resp_data2 == WFD_POP_RESP_APRV_CONNECT_NO) {
594 Evas_Object *btn2 = NULL;
595 btn2 = elm_button_add(popup);
596 elm_object_style_set(btn2, "popup_button/default");
597 elm_object_text_set(btn2, pop->label2);
598 elm_object_part_content_set(popup, "button2", btn2);
599 evas_object_smart_callback_add(btn2, "clicked", __popup_resp_cb,
600 (void *) pop->resp_data2);
603 elm_object_content_set(popup, box);
604 evas_object_show(popup);
605 evas_object_show(win);
607 __WDPOP_LOG_FUNC_EXIT__;
612 * This function let the app create a keypad popup
613 * @return keypad popup
614 * @param[in] win the window object
615 * @param[in] pop the pointer to the prepared popup
617 Evas_Object *wfd_draw_pop_type_keypad(Evas_Object * win, wfd_popup_t * pop)
619 __WDPOP_LOG_FUNC_ENTER__;
620 wfd_appdata_t *ad = wfd_get_appdata();
622 Evas_Object *conformant = NULL;
623 Evas_Object *layout = NULL;
624 Evas_Object *pinpopup = NULL;
625 Evas_Object *label = NULL;
626 Evas_Object *btn1 = NULL, *btn2 = NULL;
628 conformant = elm_conformant_add(win);
629 assertm_if(NULL == conformant, "conformant is NULL!!");
630 elm_win_conformant_set(win, EINA_TRUE);
631 elm_win_resize_object_add(win, conformant);
632 evas_object_size_hint_weight_set(conformant, EVAS_HINT_EXPAND, 0.0);
633 evas_object_size_hint_align_set(conformant, EVAS_HINT_FILL, 0.0);
634 evas_object_show(conformant);
636 layout = elm_layout_add(conformant);
637 elm_object_content_set(conformant, layout);
639 pinpopup = elm_popup_add(layout);
640 assertm_if(NULL == pinpopup, "pinpopup is NULL!!");
641 evas_object_size_hint_weight_set(pinpopup, EVAS_HINT_EXPAND, 0.0);
642 elm_object_part_text_set(pinpopup, "title,text", _("IDS_WFD_POP_TITILE_CONNECTION"));
644 Evas_Object *box = elm_box_add(pinpopup);
646 evas_object_del(pinpopup);
651 evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, 0.0);
652 evas_object_size_hint_align_set(box, EVAS_HINT_FILL, 0.0);
653 elm_object_part_content_set(pinpopup, NULL, box);
654 evas_object_show(box);
657 label = elm_label_add(box);
658 elm_object_style_set(label, "popup/default");
659 elm_label_line_wrap_set(label, ELM_WRAP_MIXED);
660 elm_object_text_set(label, pop->text);
661 evas_object_size_hint_weight_set(label, EVAS_HINT_EXPAND, 0.0);
662 evas_object_size_hint_align_set(label, EVAS_HINT_FILL, EVAS_HINT_FILL);
663 elm_box_pack_end(box, label);
664 evas_object_show(label);
667 Evas_Object *body = elm_layout_add(box);
669 evas_object_del(pinpopup);
674 elm_layout_theme_set(body, "layout", "dialogue", "1icon");
675 evas_object_size_hint_weight_set(body, EVAS_HINT_EXPAND, 0.0);
676 evas_object_size_hint_align_set(body, EVAS_HINT_FILL, 0.0);
678 Evas_Object *editfield_pin = _add_edit_field(body, NULL, NULL, EINA_TRUE, EINA_TRUE);
679 Evas_Object *entry_pin = elm_object_part_content_get(editfield_pin, "elm.swallow.content");
680 ad->pin_entry = entry_pin;
681 evas_object_smart_callback_add(ad->pin_entry, "changed", _smart_ime_cb, NULL);
682 elm_object_part_content_set(body, "elm.icon", editfield_pin);
683 elm_box_pack_end(box, body);
684 evas_object_show(body);
686 elm_entry_password_set(ad->pin_entry, TRUE);
688 Evas_Object *check = elm_check_add(box);
689 elm_object_text_set(check, _("Show password"));
690 elm_object_focus_allow_set(check, EINA_FALSE);
691 evas_object_size_hint_weight_set(check, EVAS_HINT_EXPAND, 0.0);
692 evas_object_size_hint_align_set(check, EVAS_HINT_FILL, 0.0);
693 evas_object_smart_callback_add(check, "changed", _check_changed_cb, NULL);
694 evas_object_show(check);
695 elm_box_pack_end(box, check);
698 btn1 = elm_button_add(pinpopup);
699 elm_object_style_set(btn1, "popup_button/default");
700 elm_object_text_set(btn1, pop->label1);
701 elm_object_part_content_set(pinpopup, "button1", btn1);
702 evas_object_smart_callback_add(btn1, "clicked", __popup_resp_cb, (void *)pop->resp_data1);
704 btn2 = elm_button_add(pinpopup);
705 elm_object_style_set(btn2, "popup_button/default");
706 elm_object_text_set(btn2, pop->label2);
707 elm_object_part_content_set(pinpopup, "button2", btn2);
708 evas_object_smart_callback_add(btn2, "clicked", __popup_resp_cb, (void *)pop->resp_data2);
710 elm_object_content_set(pinpopup, box);
711 evas_object_show(pinpopup);
712 evas_object_show(win);
713 elm_object_focus_set(ad->pin_entry, EINA_TRUE);
715 __WDPOP_LOG_FUNC_EXIT__;
720 * This function let the app create a popup
722 * @param[in] type the type of popup
723 * @param[in] userdata the pointer to the data which will be used
725 void wfd_prepare_popup(int type, void *userdata)
727 __WDPOP_LOG_FUNC_ENTER__;
728 wfd_appdata_t *ad = wfd_get_appdata();
729 wfd_popup_t *pop = ad->popup_data;
733 memset(pop, 0, sizeof(wfd_popup_t));
738 case /* MT */ WFD_POP_APRV_CONNECTION_WPS_PUSHBUTTON_REQ:
739 snprintf(pop->text, sizeof(pop->text), IDS_WFD_POP_CONNECT_Q,
741 snprintf(pop->label1, sizeof(pop->label1), "%s", dgettext("sys_string", "IDS_COM_SK_YES"));
742 snprintf(pop->label2, sizeof(pop->label2), "%s", dgettext("sys_string", "IDS_COM_SK_NO"));
743 pop->resp_data1 = WFD_POP_RESP_APRV_CONNECT_PBC_YES;
744 pop->resp_data2 = WFD_POP_RESP_APRV_CONNECT_NO;
746 ad->popup = wfd_draw_pop_type_c(ad->win, pop);
749 case WFD_POP_APRV_CONNECTION_INVITATION_REQ:
750 snprintf(pop->text, sizeof(pop->text), IDS_WFD_POP_CONNECT_Q,
752 snprintf(pop->label1, sizeof(pop->label1), "%s", dgettext("sys_string", "IDS_COM_SK_YES"));
753 snprintf(pop->label2, sizeof(pop->label2), "%s", dgettext("sys_string", "IDS_COM_SK_NO"));
754 pop->resp_data1 = WFD_POP_RESP_APRV_CONNECT_INVITATION_YES;
755 pop->resp_data2 = WFD_POP_RESP_APRV_CONNECT_NO;
757 ad->popup = wfd_draw_pop_type_c(ad->win, pop);
760 case /* MT */ WFD_POP_APRV_CONNECTION_WPS_DISPLAY_REQ:
761 snprintf(pop->text, sizeof(pop->text), IDS_WFD_POP_ENTER_PIN_WITH_KEYPAD,
763 snprintf(pop->label1, sizeof(pop->label1), "%s", dgettext("sys_string", "IDS_COM_SK_OK"));
764 snprintf(pop->label2, sizeof(pop->label2), "%s", dgettext("sys_string", "IDS_COM_POP_CANCEL"));
765 pop->timeout = WFD_POP_TIMER_120;
766 pop->resp_data1 = WFD_POP_RESP_APRV_CONNECT_DISPLAY_OK;
767 pop->resp_data2 = WFD_POP_RESP_APRV_CONNECT_NO;
769 ad->popup = wfd_draw_pop_type_c(ad->win, pop);
772 case /* MT */ WFD_POP_APRV_CONNECTION_WPS_KEYPAD_REQ:
773 snprintf(pop->text, sizeof(pop->text), IDS_WFD_POP_ENTER_PIN,
774 ad->peer_name, WFD_POP_TIMER_120);
775 snprintf(pop->label1, sizeof(pop->label1), "%s", dgettext("sys_string", "IDS_COM_SK_OK"));
776 snprintf(pop->label2, sizeof(pop->label2), "%s", dgettext("sys_string", "IDS_COM_POP_CANCEL"));
777 pop->timeout = WFD_POP_TIMER_120;
778 pop->resp_data1 = WFD_POP_RESP_APRV_CONNECT_KEYPAD_YES;
779 pop->resp_data2 = WFD_POP_RESP_APRV_CONNECT_NO;
781 ad->popup = wfd_draw_pop_type_c(ad->win, pop);
784 case /* MT */ WFD_POP_PROG_CONNECT:
785 snprintf(pop->text, sizeof(pop->text), "%s", _("IDS_WFD_POP_CONNECTING"));
786 snprintf(pop->label1, sizeof(pop->label1), "%s", dgettext("sys_string", "IDS_COM_POP_CANCEL"));
787 pop->timeout = WFD_POP_TIMER_120;
788 pop->resp_data1 = WFD_POP_RESP_APRV_CONNECT_NO;
790 ad->popup = wfd_draw_pop_type_b(ad->win, pop);
793 case /* MO */ WFD_POP_PROG_CONNECT_WITH_KEYPAD:
794 snprintf(pop->text, sizeof(pop->text), IDS_WFD_POP_CONNECTING_WITH_KEYPAD,
795 ad->peer_name, WFD_POP_TIMER_120, ad->peer_name);
796 snprintf(pop->label1, sizeof(pop->label1), "%s", dgettext("sys_string", "IDS_COM_SK_OK"));
797 snprintf(pop->label2, sizeof(pop->label2), "%s", dgettext("sys_string", "IDS_COM_POP_CANCEL"));
798 pop->timeout = WFD_POP_TIMER_120;
799 pop->resp_data1 = WFD_POP_RESP_PROG_CONNECT_KEYPAD_OK;
800 pop->resp_data2 = WFD_POP_RESP_APRV_CONNECT_NO;
802 ad->popup = wfd_draw_pop_type_keypad(ad->win, pop);
805 case /* MO/MT */ WFD_POP_PROG_CONNECT_WITH_PIN:
806 snprintf(pop->text, sizeof(pop->text), IDS_WFD_POP_CONNECTING_WITH_PIN,
807 ad->peer_name, WFD_POP_TIMER_120, ad->pin_number);
808 snprintf(pop->label1, sizeof(pop->label1), "%s", dgettext("sys_string", "IDS_COM_POP_CANCEL"));
809 pop->timeout = WFD_POP_TIMER_120;
810 pop->resp_data1 = WFD_POP_RESP_APRV_CONNECT_NO;
812 ad->popup = wfd_draw_pop_type_display(ad->win, pop);
815 case WFD_POP_PROG_CONNECT_CANCEL:
816 snprintf(pop->text, sizeof(pop->text), "%s", dgettext("sys_string", "IDS_COM_POP_CANCEL"));
817 pop->timeout = WFD_POP_TIMER_120;
818 ad->popup = wfd_draw_pop_type_a(ad->win, pop);
825 __WDPOP_LOG_FUNC_EXIT__;