/*
* WiFi-Direct UG
*
-* Copyright 2012 Samsung Electronics Co., Ltd
+* Copyright 2012-2013 Samsung Electronics Co., Ltd
-* Licensed under the Flora License, Version 1.0 (the "License");
+* Licensed under the Flora License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
-* http://www.tizenopensource.org/license
+* http://floralicense.org/license
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
#include <libintl.h>
#include <glib.h>
+#include <notification.h>
+
#include "wifi-direct.h"
#include "wfd-app.h"
#include "wfd-app-strings.h"
extern unsigned char g_wfd_peer_name[32];
static Ecore_Timer *pb_timer = NULL;
-void wfd_tickernoti_popup(char *msg);
/**
* This function let the ug make a callback for click the button in popup
result);
if (result == WIFI_DIRECT_ERROR_NONE) {
/* tickernoti popup */
- wfd_tickernoti_popup(_("IDS_WFD_POP_CONNECTING"));
+ notification_status_message_post(_("IDS_WFD_POP_CONNECTING"));
} else {
WDPOP_LOGE(
"wifi_direct_accept_connection() FAILED!!\n");
/* tickernoti popup */
snprintf(msg, WFD_POP_STR_MAX_LEN, IDS_WFD_POP_CONNECT_FAILED, ad->peer_name);
- wfd_tickernoti_popup(msg);
+ notification_status_message_post(msg);
}
}
break;
result);
if (result == WIFI_DIRECT_ERROR_NONE) {
/* tickernoti popup */
- wfd_tickernoti_popup(_("IDS_WFD_POP_CONNECTING"));
+ notification_status_message_post(_("IDS_WFD_POP_CONNECTING"));
} else {
WDPOP_LOGE(
"wifi_direct_connect() FAILED!!\n");
/* tickernoti popup */
snprintf(msg, WFD_POP_STR_MAX_LEN, IDS_WFD_POP_CONNECT_FAILED, ad->peer_name);
- wfd_tickernoti_popup(msg);
+ notification_status_message_post(msg);
}
break;
}
strncpy(ad->pin_number, pin, 64);
+ ad->pin_number[63] = '\0';
free(pin);
pin = NULL;
WDPOP_LOGD( "button ok: pin [%s]", ad->pin_number);
"wifi_direct_accept_connection() failed. result=[%d]\n", result);
/* tickernoti popup */
snprintf(msg, WFD_POP_STR_MAX_LEN, IDS_WFD_POP_CONNECT_FAILED, ad->peer_name);
- wfd_tickernoti_popup(msg);
+ notification_status_message_post(msg);
}
}
break;
if (len != 8) {
if (len > 8)
- wfd_tickernoti_popup(_("IDS_CST_BODY_PASSWORD_TOO_LONG"));
+ notification_status_message_post(_("IDS_CST_BODY_PASSWORD_TOO_LONG"));
else
- wfd_tickernoti_popup(_("IDS_ST_BODY_PASSWORD_TOO_SHORT"));
+ notification_status_message_post(_("IDS_ST_BODY_PASSWORD_TOO_SHORT"));
wfd_prepare_popup(WFD_POP_PROG_CONNECT_WITH_KEYPAD, (void *) NULL);
return;
}
if (result != WIFI_DIRECT_ERROR_NONE) {
/* tickernoti popup */
snprintf(msg, WFD_POP_STR_MAX_LEN, IDS_WFD_POP_CONNECT_FAILED, ad->peer_name);
- wfd_tickernoti_popup(msg);
+ notification_status_message_post(msg);
return;
}
/* tickernoti popup */
snprintf(msg, WFD_POP_STR_MAX_LEN, IDS_WFD_POP_CONNECT_FAILED, ad->peer_name);
- wfd_tickernoti_popup(msg);
+ notification_status_message_post(msg);
}
}
break;
const char *txt = elm_entry_markup_to_utf8(elm_entry_entry_get((const Evas_Object *) imf_context));
if (NULL != txt) {
WDPOP_LOGD( "* text [%s], len=[%d]", txt, strlen(txt));
- strncpy(ad->pin_number, txt, sizeof(ad->pin_number));
+ strncpy(ad->pin_number, txt, 64);
+ ad->pin_number[63] = '\0';
+ free(txt);
} else {
WDPOP_LOGD( "Err!");
}
__WDPOP_LOG_FUNC_EXIT__;
return;
-}
-
-/**
- * This function let the app create a tickernoti syspopup
- * @return void
- * @param[in] msg the pointer to message of tickernoti
- */
-void wfd_tickernoti_popup(char *msg)
-{
- __WDPOP_LOG_FUNC_ENTER__;
-
- int ret = -1;
- bundle *b = NULL;
-
- b = bundle_create();
- if (!b) {
- WDPOP_LOGD( "FAIL: bundle_create()\n");
- return;
- }
-
- /* tickernoti style */
- ret = bundle_add(b, "0", "info");
- if (ret) {
- WDPOP_LOGD( "Fail to add tickernoti style\n");
- bundle_free(b);
- return;
- }
-
- /* popup text */
- ret = bundle_add(b, "1", msg);
- if (ret) {
- WDPOP_LOGD( "Fail to add popup text\n");
- bundle_free(b);
- return;
- }
-
- /* orientation of tickernoti */
- ret = bundle_add(b, "2", "0");
- if (ret) {
- WDPOP_LOGD( "Fail to add orientation of tickernoti\n");
- bundle_free(b);
- return;
- }
-
- /* timeout(second) of tickernoti */
- ret = bundle_add(b, "3", "3");
- if (ret) {
- WDPOP_LOGD( "Fail to add timeout of tickernoti\n");
- bundle_free(b);
- return;
- }
-
- /* launch tickernoti */
- ret = syspopup_launch(TICKERNOTI_SYSPOPUP, b);
- if (ret) {
- WDPOP_LOGD( "Fail to launch syspopup\n");
- }
-
- bundle_free(b);
- __WDPOP_LOG_FUNC_EXIT__;
-}
-
+}
\ No newline at end of file