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.
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);
133 WDPOP_LOGD( "button ok: pin [%s]", ad->pin_number);
135 result = wifi_direct_accept_connection(ad->peer_mac);
136 if (result == WIFI_DIRECT_ERROR_NONE) {
137 wfd_prepare_popup(WFD_POP_PROG_CONNECT_WITH_PIN, NULL);
140 "wifi_direct_accept_connection() failed. result=[%d]\n", result);
141 /* tickernoti popup */
142 snprintf(msg, WFD_POP_STR_MAX_LEN, IDS_WFD_POP_CONNECT_FAILED, ad->peer_name);
143 notification_status_message_post(msg);
148 case /* MO */ WFD_POP_RESP_PROG_CONNECT_KEYPAD_OK:
151 "WFD_POP_RESP_PROG_CONNECT_KEYPAD_OK\n");
155 int len = strlen(ad->pin_number);
156 WDPOP_LOGD( "button ok: pin [%s]", ad->pin_number);
160 notification_status_message_post(_("IDS_CST_BODY_PASSWORD_TOO_LONG"));
162 notification_status_message_post(_("IDS_ST_BODY_PASSWORD_TOO_SHORT"));
163 wfd_prepare_popup(WFD_POP_PROG_CONNECT_WITH_KEYPAD, (void *) NULL);
168 WDPOP_LOGD( "pin=[%s]\n", ad->pin_number);
170 result = wifi_direct_set_wps_pin(ad->pin_number);
171 if (result != WIFI_DIRECT_ERROR_NONE) {
172 /* tickernoti popup */
173 snprintf(msg, WFD_POP_STR_MAX_LEN, IDS_WFD_POP_CONNECT_FAILED, ad->peer_name);
174 notification_status_message_post(msg);
178 //result = wifi_direct_activate_pushbutton();
179 result = wifi_direct_accept_connection(ad->peer_mac);
181 "wifi_direct_accept_connection(%s) result=[%d]\n",
182 ad->peer_mac, result);
183 if (result != WIFI_DIRECT_ERROR_NONE) {
185 "wifi_direct_accept_connection() FAILED!!\n");
186 evas_object_hide(ad->win);
188 /* tickernoti popup */
189 snprintf(msg, WFD_POP_STR_MAX_LEN, IDS_WFD_POP_CONNECT_FAILED, ad->peer_name);
190 notification_status_message_post(msg);
195 case /* MT */ WFD_POP_RESP_APRV_CONNECT_KEYPAD_YES:
198 "WFD_POP_RESP_APRV_CONNECT_KEYPAD_YES\n");
201 ecore_timer_del(pb_timer);
205 wfd_prepare_popup(WFD_POP_PROG_CONNECT_WITH_KEYPAD, (void *) NULL);
209 case /* MT */ WFD_POP_RESP_APRV_CONNECT_NO:
212 "WFD_POP_RESP_APRV_CONNECT_NO: destroy_popup...\n");
216 ecore_timer_del(pb_timer);
220 result = wifi_direct_disconnect(ad->peer_mac);
222 "wifi_direct_disconnect[%s] result=[%d]\n",
223 ad->peer_mac, result);
229 WDPOP_LOGE( "Unknown respone\n");
230 evas_object_hide(ad->win);
235 __WDPOP_LOG_FUNC_EXIT__;
239 * This function let the app destroy the popup
243 void wfd_destroy_popup()
245 __WDPOP_LOG_FUNC_ENTER__;
246 wfd_appdata_t *ad = wfd_get_appdata();
249 WDPOP_LOGE( "ad is NULL\n");
254 evas_object_del(ad->popup);
258 if (ad->popup_timeout_handle > 0) {
259 g_source_remove(ad->popup_timeout_handle);
260 ad->popup_timeout_handle = 0;
263 evas_object_hide(ad->win);
265 __WDPOP_LOG_FUNC_EXIT__;
270 * This function let the app create a popup which includes no button
272 * @param[in] win the window object
273 * @param[in] pop the pointer to the prepared popup
275 static Evas_Object *wfd_draw_pop_type_a(Evas_Object * win, wfd_popup_t * pop)
277 __WDPOP_LOG_FUNC_ENTER__;
280 popup = elm_popup_add(win);
281 evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
282 elm_object_text_set(popup, pop->text);
283 elm_popup_timeout_set(popup, pop->timeout);
284 evas_object_show(popup);
285 evas_object_show(win);
287 __WDPOP_LOG_FUNC_EXIT__;
292 * This function let the app create a popup which includes one button
294 * @param[in] win the window object
295 * @param[in] pop the pointer to the prepared popup
297 static Evas_Object *wfd_draw_pop_type_b(Evas_Object * win, wfd_popup_t * pop)
299 __WDPOP_LOG_FUNC_ENTER__;
300 Evas_Object *popup = NULL;
301 Evas_Object *btn = NULL;
303 popup = elm_popup_add(win);
304 evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
305 elm_object_text_set(popup, pop->text);
307 btn = elm_button_add(popup);
308 elm_object_style_set(btn, "popup_button/default");
309 elm_object_text_set(btn, pop->label1);
310 elm_object_part_content_set(popup, "button1", btn);
311 evas_object_smart_callback_add(btn, "clicked", __popup_resp_cb, (void *) pop->resp_data1);
313 evas_object_show(popup);
314 evas_object_show(win);
316 __WDPOP_LOG_FUNC_EXIT__;
321 * This function let the app create a popup which includes two buttons
323 * @param[in] win the window object
324 * @param[in] pop the pointer to the prepared popup
326 static Evas_Object *wfd_draw_pop_type_c(Evas_Object * win, wfd_popup_t * pop)
328 __WDPOP_LOG_FUNC_ENTER__;
329 Evas_Object *popup = NULL;
330 Evas_Object *btn1 = NULL, *btn2 = NULL;
332 popup = elm_popup_add(win);
333 evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
334 elm_object_text_set(popup, pop->text);
336 btn1 = elm_button_add(popup);
337 elm_object_style_set(btn1, "popup_button/default");
338 elm_object_text_set(btn1, pop->label1);
339 elm_object_part_content_set(popup, "button1", btn1);
340 evas_object_smart_callback_add(btn1, "clicked", __popup_resp_cb,
341 (void *) pop->resp_data1);
343 btn2 = elm_button_add(popup);
344 elm_object_style_set(btn2, "popup_button/default");
345 elm_object_text_set(btn2, pop->label2);
346 elm_object_part_content_set(popup, "button2", btn2);
347 evas_object_smart_callback_add(btn2, "clicked", __popup_resp_cb,
348 (void *) pop->resp_data2);
350 evas_object_show(popup);
351 evas_object_show(win);
353 __WDPOP_LOG_FUNC_EXIT__;
358 * This function let the ug make a change callback for password input
360 * @param[in] data the pointer to the main data structure
361 * @param[in] obj the pointer to the evas object
362 * @param[in] event_info the pointer to the event information
364 static void _smart_ime_cb(void *data, Evas_Object * obj, void *event_info)
366 __WDPOP_LOG_FUNC_ENTER__;
367 wfd_appdata_t *ad = wfd_get_appdata();
369 Ecore_IMF_Context *imf_context = NULL;
370 imf_context = (Ecore_IMF_Context *) ad->pin_entry;
372 if (NULL == imf_context) {
373 WDPOP_LOGE( "Error!!! Ecore_IMF_Context is NULL!!");
377 const char *txt = elm_entry_markup_to_utf8(elm_entry_entry_get((const Evas_Object *) imf_context));
379 WDPOP_LOGD( "* text [%s], len=[%d]", txt, strlen(txt));
380 strncpy(ad->pin_number, txt, sizeof(ad->pin_number));
385 __WDPOP_LOG_FUNC_EXIT__;
389 * This function let the app make a change callback for password checkbox
391 * @param[in] data the pointer to the main data structure
392 * @param[in] obj the pointer to the evas object
393 * @param[in] event_info the pointer to the event information
395 static void _check_changed_cb(void *data, Evas_Object * obj, void *event_info)
397 wfd_appdata_t *ad = wfd_get_appdata();
403 Eina_Bool state = elm_check_state_get(obj);
404 elm_entry_password_set(ad->pin_entry, !state);
405 elm_entry_autocapital_type_set(ad->pin_entry, ELM_AUTOCAPITAL_TYPE_NONE);
409 * This function let the app make a callback for progressbar timer
410 * @return if stop the timer, return ECORE_CALLBACK_CANCEL, else return ECORE_CALLBACK_RENEW
411 * @param[in] data the pointer to the wps structure
413 static Eina_Bool _fn_pb_timer(void *data)
417 char time_label[32] = {0};
418 wfd_wps_display_popup_t *wps_display_popup = (wfd_wps_display_popup_t *) data;
420 if (NULL == wps_display_popup) {
421 WDPOP_LOGE( "Param is NULL.\n");
422 return ECORE_CALLBACK_CANCEL;
425 Evas_Object *progressbar = NULL;
426 Evas_Object *time = NULL;
428 progressbar = wps_display_popup->progressbar;
429 time = wps_display_popup->time;
430 value = elm_progressbar_value_get(progressbar);
433 WDPOP_LOGE( "Progress end.\n");
435 ecore_timer_del(pb_timer);
439 return ECORE_CALLBACK_CANCEL;
442 wps_display_popup->step++;
443 step = wps_display_popup->step;
444 value = ((double)step) / WFD_POP_TIMER_120;
445 elm_progressbar_value_set(progressbar, value);
446 WDPOP_LOGD( "step: %d, value: %f\n", wps_display_popup->step, value);
448 /* show the time label */
451 snprintf(time_label, 32, "00:0%d", step);
453 snprintf(time_label, 32, "00:%d", step);
457 snprintf(time_label, 32, "0%d:0%d", step/60, step%60);
459 snprintf(time_label, 32, "0%d:%d", step/60, step%60);
463 elm_object_text_set(time, time_label);
465 return ECORE_CALLBACK_RENEW;
469 * This function let the app create a edit filed
471 * @param[in] parent the parent object
472 * @param[in] title the pointer to the title of edit field
473 * @param[in] guide the pointer to the text of guide
474 * @param[in] single_line whether it can support single line
475 * @param[in] is_editable whether it is avaliable to edit
477 static Evas_Object *_add_edit_field(Evas_Object *parent, const char *title, const char *guide, Eina_Bool single_line, Eina_Bool is_editable)
479 assertm_if(NULL == parent, "parent is NULL!!");
481 Evas_Object *layout = elm_layout_add(parent);
482 assertm_if(NULL == layout, "layout is NULL!!");
484 if (title && title[0] != '\0') {
485 elm_layout_theme_set(layout, "layout", "editfield", "title");
486 elm_object_part_text_set(layout, "elm.text", title);
488 elm_layout_theme_set(layout, "layout", "editfield", "default");
491 Evas_Object *entry = elm_entry_add(parent);
492 assertm_if(NULL == entry, "entry is NULL!!");
494 elm_object_part_content_set(layout, "elm.swallow.content", entry);
495 evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
497 if (guide && guide[0] != '\0') {
498 elm_object_part_text_set(layout, "elm.guidetext", guide);
501 elm_entry_single_line_set(entry, single_line);
502 elm_entry_scrollable_set(entry, single_line);
503 elm_entry_editable_set(entry, is_editable);
504 elm_object_signal_emit(layout, "elm,state,eraser,hide", "elm");
505 evas_object_show(layout);
511 * This function let the app create a display popup
512 * @return display popup
513 * @param[in] win the window object
514 * @param[in] pop the pointer to the prepared popup
516 Evas_Object *wfd_draw_pop_type_display(Evas_Object * win, wfd_popup_t * pop)
518 __WDPOP_LOG_FUNC_ENTER__;
520 Evas_Object *popup = NULL;
521 Evas_Object *label = NULL;
522 Evas_Object *progressbar = NULL;
523 Evas_Object *time = NULL;
524 static wfd_wps_display_popup_t wps_display_popup;
526 popup = elm_popup_add(win);
527 evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, 0.0);
529 Evas_Object *box = elm_box_add(popup);
531 evas_object_del(popup);
536 evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, 0.0);
537 evas_object_size_hint_align_set(box, EVAS_HINT_FILL, 0.0);
538 elm_object_part_content_set(popup, NULL, box);
539 evas_object_show(box);
542 label = elm_label_add(box);
543 elm_object_style_set(label, "popup/default");
544 elm_label_line_wrap_set(label, ELM_WRAP_MIXED);
545 elm_object_text_set(label, pop->text);
546 evas_object_size_hint_weight_set(label, EVAS_HINT_EXPAND, 0.0);
547 evas_object_size_hint_align_set(label, EVAS_HINT_FILL, 0.0);
548 elm_box_pack_end(box, label);
549 evas_object_show(label);
551 /* add progressbar */
552 progressbar = elm_progressbar_add(box);
553 elm_object_style_set(progressbar, "list_progress");
554 elm_progressbar_horizontal_set(progressbar, EINA_TRUE);
555 evas_object_size_hint_align_set(progressbar, EVAS_HINT_FILL, 0.0);
556 evas_object_size_hint_weight_set(progressbar, EVAS_HINT_EXPAND, 0.0);
557 elm_progressbar_value_set(progressbar, 0.0);
558 elm_box_pack_end(box, progressbar);
559 evas_object_show(progressbar);
562 time = elm_label_add(box);
563 elm_object_style_set(time, "popup/default");
564 elm_object_text_set(time, "00:00");
565 evas_object_size_hint_weight_set(time, EVAS_HINT_EXPAND, 0.0);
566 evas_object_size_hint_align_set(time, EVAS_HINT_FILL, 0.0);
567 elm_box_pack_end(box, time);
568 evas_object_show(time);
570 /* start progressbar timer */
571 wps_display_popup.step = 0;
572 wps_display_popup.progressbar = progressbar;
573 wps_display_popup.time = time;
575 ecore_timer_del(pb_timer);
576 pb_timer = ecore_timer_add(1, _fn_pb_timer, &wps_display_popup);
579 if (pop->resp_data1 == WFD_POP_RESP_APRV_CONNECT_KEYPAD_YES ||
580 pop->resp_data1 == WFD_POP_RESP_APRV_CONNECT_NO) {
581 Evas_Object *btn1 = NULL;
582 btn1 = elm_button_add(popup);
583 elm_object_style_set(btn1, "popup_button/default");
584 elm_object_text_set(btn1, pop->label1);
585 elm_object_part_content_set(popup, "button1", btn1);
586 evas_object_smart_callback_add(btn1, "clicked", __popup_resp_cb,
587 (void *) pop->resp_data1);
590 if (pop->resp_data2 == WFD_POP_RESP_APRV_CONNECT_NO) {
591 Evas_Object *btn2 = NULL;
592 btn2 = elm_button_add(popup);
593 elm_object_style_set(btn2, "popup_button/default");
594 elm_object_text_set(btn2, pop->label2);
595 elm_object_part_content_set(popup, "button2", btn2);
596 evas_object_smart_callback_add(btn2, "clicked", __popup_resp_cb,
597 (void *) pop->resp_data2);
600 elm_object_content_set(popup, box);
601 evas_object_show(popup);
602 evas_object_show(win);
604 __WDPOP_LOG_FUNC_EXIT__;
609 * This function let the app create a keypad popup
610 * @return keypad popup
611 * @param[in] win the window object
612 * @param[in] pop the pointer to the prepared popup
614 Evas_Object *wfd_draw_pop_type_keypad(Evas_Object * win, wfd_popup_t * pop)
616 __WDPOP_LOG_FUNC_ENTER__;
617 wfd_appdata_t *ad = wfd_get_appdata();
619 Evas_Object *conformant = NULL;
620 Evas_Object *layout = NULL;
621 Evas_Object *pinpopup = NULL;
622 Evas_Object *label = NULL;
623 Evas_Object *btn1 = NULL, *btn2 = NULL;
625 conformant = elm_conformant_add(win);
626 assertm_if(NULL == conformant, "conformant is NULL!!");
627 elm_win_conformant_set(win, EINA_TRUE);
628 elm_win_resize_object_add(win, conformant);
629 evas_object_size_hint_weight_set(conformant, EVAS_HINT_EXPAND, 0.0);
630 evas_object_size_hint_align_set(conformant, EVAS_HINT_FILL, 0.0);
631 evas_object_show(conformant);
633 layout = elm_layout_add(conformant);
634 elm_object_content_set(conformant, layout);
636 pinpopup = elm_popup_add(layout);
637 assertm_if(NULL == pinpopup, "pinpopup is NULL!!");
638 evas_object_size_hint_weight_set(pinpopup, EVAS_HINT_EXPAND, 0.0);
639 elm_object_part_text_set(pinpopup, "title,text", _("IDS_WFD_POP_TITILE_CONNECTION"));
641 Evas_Object *box = elm_box_add(pinpopup);
643 evas_object_del(pinpopup);
648 evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, 0.0);
649 evas_object_size_hint_align_set(box, EVAS_HINT_FILL, 0.0);
650 elm_object_part_content_set(pinpopup, NULL, box);
651 evas_object_show(box);
654 label = elm_label_add(box);
655 elm_object_style_set(label, "popup/default");
656 elm_label_line_wrap_set(label, ELM_WRAP_MIXED);
657 elm_object_text_set(label, pop->text);
658 evas_object_size_hint_weight_set(label, EVAS_HINT_EXPAND, 0.0);
659 evas_object_size_hint_align_set(label, EVAS_HINT_FILL, EVAS_HINT_FILL);
660 elm_box_pack_end(box, label);
661 evas_object_show(label);
664 Evas_Object *body = elm_layout_add(box);
666 evas_object_del(pinpopup);
671 elm_layout_theme_set(body, "layout", "dialogue", "1icon");
672 evas_object_size_hint_weight_set(body, EVAS_HINT_EXPAND, 0.0);
673 evas_object_size_hint_align_set(body, EVAS_HINT_FILL, 0.0);
675 Evas_Object *editfield_pin = _add_edit_field(body, NULL, NULL, EINA_TRUE, EINA_TRUE);
676 Evas_Object *entry_pin = elm_object_part_content_get(editfield_pin, "elm.swallow.content");
677 ad->pin_entry = entry_pin;
678 evas_object_smart_callback_add(ad->pin_entry, "changed", _smart_ime_cb, NULL);
679 elm_object_part_content_set(body, "elm.icon", editfield_pin);
680 elm_box_pack_end(box, body);
681 evas_object_show(body);
683 elm_entry_password_set(ad->pin_entry, TRUE);
685 Evas_Object *check = elm_check_add(box);
686 elm_object_text_set(check, _("Show password"));
687 elm_object_focus_allow_set(check, EINA_FALSE);
688 evas_object_size_hint_weight_set(check, EVAS_HINT_EXPAND, 0.0);
689 evas_object_size_hint_align_set(check, EVAS_HINT_FILL, 0.0);
690 evas_object_smart_callback_add(check, "changed", _check_changed_cb, NULL);
691 evas_object_show(check);
692 elm_box_pack_end(box, check);
695 btn1 = elm_button_add(pinpopup);
696 elm_object_style_set(btn1, "popup_button/default");
697 elm_object_text_set(btn1, pop->label1);
698 elm_object_part_content_set(pinpopup, "button1", btn1);
699 evas_object_smart_callback_add(btn1, "clicked", __popup_resp_cb, (void *)pop->resp_data1);
701 btn2 = elm_button_add(pinpopup);
702 elm_object_style_set(btn2, "popup_button/default");
703 elm_object_text_set(btn2, pop->label2);
704 elm_object_part_content_set(pinpopup, "button2", btn2);
705 evas_object_smart_callback_add(btn2, "clicked", __popup_resp_cb, (void *)pop->resp_data2);
707 elm_object_content_set(pinpopup, box);
708 evas_object_show(pinpopup);
709 evas_object_show(win);
710 elm_object_focus_set(ad->pin_entry, EINA_TRUE);
712 __WDPOP_LOG_FUNC_EXIT__;
717 * This function let the app create a popup
719 * @param[in] type the type of popup
720 * @param[in] userdata the pointer to the data which will be used
722 void wfd_prepare_popup(int type, void *userdata)
724 __WDPOP_LOG_FUNC_ENTER__;
725 wfd_appdata_t *ad = wfd_get_appdata();
726 wfd_popup_t *pop = ad->popup_data;
730 memset(pop, 0, sizeof(wfd_popup_t));
735 case /* MT */ WFD_POP_APRV_CONNECTION_WPS_PUSHBUTTON_REQ:
736 snprintf(pop->text, sizeof(pop->text), IDS_WFD_POP_CONNECT_Q,
738 snprintf(pop->label1, sizeof(pop->label1), "%s", dgettext("sys_string", "IDS_COM_SK_YES"));
739 snprintf(pop->label2, sizeof(pop->label2), "%s", dgettext("sys_string", "IDS_COM_SK_NO"));
740 pop->resp_data1 = WFD_POP_RESP_APRV_CONNECT_PBC_YES;
741 pop->resp_data2 = WFD_POP_RESP_APRV_CONNECT_NO;
743 ad->popup = wfd_draw_pop_type_c(ad->win, pop);
746 case WFD_POP_APRV_CONNECTION_INVITATION_REQ:
747 snprintf(pop->text, sizeof(pop->text), IDS_WFD_POP_CONNECT_Q,
749 snprintf(pop->label1, sizeof(pop->label1), "%s", dgettext("sys_string", "IDS_COM_SK_YES"));
750 snprintf(pop->label2, sizeof(pop->label2), "%s", dgettext("sys_string", "IDS_COM_SK_NO"));
751 pop->resp_data1 = WFD_POP_RESP_APRV_CONNECT_INVITATION_YES;
752 pop->resp_data2 = WFD_POP_RESP_APRV_CONNECT_NO;
754 ad->popup = wfd_draw_pop_type_c(ad->win, pop);
757 case /* MT */ WFD_POP_APRV_CONNECTION_WPS_DISPLAY_REQ:
758 snprintf(pop->text, sizeof(pop->text), IDS_WFD_POP_ENTER_PIN_WITH_KEYPAD,
760 snprintf(pop->label1, sizeof(pop->label1), "%s", dgettext("sys_string", "IDS_COM_SK_OK"));
761 snprintf(pop->label2, sizeof(pop->label2), "%s", dgettext("sys_string", "IDS_COM_POP_CANCEL"));
762 pop->timeout = WFD_POP_TIMER_120;
763 pop->resp_data1 = WFD_POP_RESP_APRV_CONNECT_DISPLAY_OK;
764 pop->resp_data2 = WFD_POP_RESP_APRV_CONNECT_NO;
766 ad->popup = wfd_draw_pop_type_c(ad->win, pop);
769 case /* MT */ WFD_POP_APRV_CONNECTION_WPS_KEYPAD_REQ:
770 snprintf(pop->text, sizeof(pop->text), IDS_WFD_POP_ENTER_PIN,
771 ad->peer_name, WFD_POP_TIMER_120);
772 snprintf(pop->label1, sizeof(pop->label1), "%s", dgettext("sys_string", "IDS_COM_SK_OK"));
773 snprintf(pop->label2, sizeof(pop->label2), "%s", dgettext("sys_string", "IDS_COM_POP_CANCEL"));
774 pop->timeout = WFD_POP_TIMER_120;
775 pop->resp_data1 = WFD_POP_RESP_APRV_CONNECT_KEYPAD_YES;
776 pop->resp_data2 = WFD_POP_RESP_APRV_CONNECT_NO;
778 ad->popup = wfd_draw_pop_type_c(ad->win, pop);
781 case /* MT */ WFD_POP_PROG_CONNECT:
782 snprintf(pop->text, sizeof(pop->text), "%s", _("IDS_WFD_POP_CONNECTING"));
783 snprintf(pop->label1, sizeof(pop->label1), "%s", dgettext("sys_string", "IDS_COM_POP_CANCEL"));
784 pop->timeout = WFD_POP_TIMER_120;
785 pop->resp_data1 = WFD_POP_RESP_APRV_CONNECT_NO;
787 ad->popup = wfd_draw_pop_type_b(ad->win, pop);
790 case /* MO */ WFD_POP_PROG_CONNECT_WITH_KEYPAD:
791 snprintf(pop->text, sizeof(pop->text), IDS_WFD_POP_CONNECTING_WITH_KEYPAD,
792 ad->peer_name, WFD_POP_TIMER_120, ad->peer_name);
793 snprintf(pop->label1, sizeof(pop->label1), "%s", dgettext("sys_string", "IDS_COM_SK_OK"));
794 snprintf(pop->label2, sizeof(pop->label2), "%s", dgettext("sys_string", "IDS_COM_POP_CANCEL"));
795 pop->timeout = WFD_POP_TIMER_120;
796 pop->resp_data1 = WFD_POP_RESP_PROG_CONNECT_KEYPAD_OK;
797 pop->resp_data2 = WFD_POP_RESP_APRV_CONNECT_NO;
799 ad->popup = wfd_draw_pop_type_keypad(ad->win, pop);
802 case /* MO/MT */ WFD_POP_PROG_CONNECT_WITH_PIN:
803 snprintf(pop->text, sizeof(pop->text), IDS_WFD_POP_CONNECTING_WITH_PIN,
804 ad->peer_name, WFD_POP_TIMER_120, ad->pin_number);
805 snprintf(pop->label1, sizeof(pop->label1), "%s", dgettext("sys_string", "IDS_COM_POP_CANCEL"));
806 pop->timeout = WFD_POP_TIMER_120;
807 pop->resp_data1 = WFD_POP_RESP_APRV_CONNECT_NO;
809 ad->popup = wfd_draw_pop_type_display(ad->win, pop);
812 case WFD_POP_PROG_CONNECT_CANCEL:
813 snprintf(pop->text, sizeof(pop->text), "%s", dgettext("sys_string", "IDS_COM_POP_CANCEL"));
814 pop->timeout = WFD_POP_TIMER_120;
815 ad->popup = wfd_draw_pop_type_a(ad->win, pop);
822 __WDPOP_LOG_FUNC_EXIT__;