INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
INCLUDE(FindPkgConfig)
-pkg_check_modules(pkgs REQUIRED elementary appcore-efl ui-gadget-1 x11 dlog vconf edbus evas edje ecore eina aul syspopup-caller gobject-2.0 capi-network-bluetooth capi-network-connection capi-appfw-application notification efl-assist glib-2.0 gio-2.0)
+pkg_check_modules(pkgs REQUIRED elementary appcore-efl ui-gadget-1 x11 dlog vconf edbus evas edje ecore eina aul syspopup-caller gobject-2.0 capi-network-bluetooth capi-network-connection capi-appfw-application notification efl-assist glib-2.0 gio-2.0 capi-system-info)
FOREACH(flag ${pkgs_CFLAGS})
SET(EXTRA_CXXFLAGS "${EXTRA_CXXFLAGS} ${flag}")
void _bt_main_create_information_popup(bt_ug_data *ugd, char *msg);
+void _bt_main_create_error_destroy_popup(bt_ug_data *ugd, char *msg);
+
void _bt_main_add_searched_title(bt_ug_data *ugd);
void _bt_update_paired_item_style(bt_ug_data *ugd);
/* We need to change this design ID */
#define BT_STR_INTERNET_ACCESS _("IDS_BT_BODY_INTERNET_ACCESS_ABB2")
+/* Emulator not support */
+#define BT_STR_NOT_SUPPORT_IN_EMUL _("Not Support in Emulator")
+
/* System string */
#define BT_STR_SEARCH dgettext("sys_string", "IDS_COM_SK_SEARCH")
#define BT_STR_STOP dgettext("sys_string", "IDS_COM_SK_STOP")
#define BT_SEARCH_SERVICE_TIMEOUT 5
#define BT_SELECTED_TIMEOUT 5
#define BT_DELETED_TIMEOUT 2
+#define BT_EXIT_TIMEOUT 2100
#define BT_VISIBILITY_TIMEOUT 1000
/* Define Error type */
#define BT_DEFAULT_PHONE_NAME "Fraser"
+#define BT_EMULATOR_KEYSTR "Emulator"
+
#define BT_SYSPOPUP_REQUEST_NAME "app-confirm-request"
#define BT_SYSPOPUP_TWO_BUTTON_TYPE "twobtn"
#define BT_SYSPOPUP_ONE_BUTTON_TYPE "onebtn"
gboolean _bt_util_is_flight_mode(void);
+gboolean _bt_util_is_emulator(void);
+
void _bt_util_addr_type_to_addr_string(char *address,
unsigned char *addr);
BuildRequires: pkgconfig(capi-network-connection)
BuildRequires: pkgconfig(dbus-glib-1)
BuildRequires: pkgconfig(capi-appfw-application)
+BuildRequires: pkgconfig(capi-system-info)
BuildRequires: pkgconfig(notification)
BuildRequires : pkgconfig(glib-2.0)
BuildRequires : pkgconfig(gio-2.0)
#include <bluetooth.h>
#include <vconf.h>
#include <aul.h>
+#include <system_info.h>
#include "bt-main-ug.h"
#include "bt-util.h"
return mode ? TRUE : FALSE;
}
+gboolean _bt_util_is_emulator(void)
+{
+ FN_START;
+
+ gboolean mode = FALSE;
+ char *model_str = NULL;
+ int ret = system_info_get_value_string(SYSTEM_INFO_KEY_MODEL, &model_str);
+
+ if (ret != SYSTEM_INFO_ERROR_NONE) {
+ BT_ERR("fail to call system_info_get_value_string");
+ g_free(model_str);
+ return FALSE;
+ }
+
+ if (g_strcmp0(BT_EMULATOR_KEYSTR, model_str) == 0)
+ mode = TRUE;
+ else
+ mode = FALSE;
+
+ g_free(model_str);
+
+ FN_END;
+ return mode;
+}
+
void _bt_util_addr_type_to_addr_string(char *address,
unsigned char *addr)
{
ugd->ug_status = BT_UG_CREATE;
+ if (_bt_util_is_emulator() == TRUE)
+ _bt_main_create_error_destroy_popup(ugd, BT_STR_NOT_SUPPORT_IN_EMUL);
+
+
FN_END;
return ugd->base;
}
FN_END;
}
+void _bt_main_popup_del_destroy_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ FN_START;
+ retm_if(data == NULL, "Invalid argument: struct bt_appdata is NULL\n");
+
+ bt_ug_data *ugd = (bt_ug_data *)data;
+
+ if (ugd->popup) {
+ BT_DBG("delete popup\n");
+ evas_object_del(ugd->popup);
+ ugd->popup = NULL;
+ }
+
+ ugd->back_cb = NULL;
+
+ __bt_main_quit_btn_cb(ugd, NULL);
+
+ FN_END;
+}
+
+static gboolean __bt_main_error_popup_timer_cb(gpointer user_data)
+{
+ FN_START;
+
+ bt_ug_data *ugd;
+
+ ugd = (bt_ug_data *)user_data;
+
+ _bt_main_popup_del_destroy_cb((void *)ugd, NULL, NULL);
+
+ FN_END;
+ return FALSE;
+}
+
Elm_Object_Item *_bt_main_add_paired_device(bt_ug_data *ugd, bt_dev_t *dev)
{
FN_START;
FN_END;
}
+void _bt_main_create_error_destroy_popup(bt_ug_data *ugd, char *msg)
+{
+ FN_START;
+ ret_if(ugd == NULL);
+
+ if (ugd->popup) {
+ evas_object_del(ugd->popup);
+ ugd->popup = NULL;
+ }
+ ugd->popup = _bt_create_popup(ugd->win_main,
+ BT_STR_ERROR,
+ msg, _bt_main_popup_del_destroy_cb, ugd, 2);
+
+ ugd->popup_timer =
+ g_timeout_add(BT_EXIT_TIMEOUT,
+ (GSourceFunc) __bt_main_error_popup_timer_cb,
+ ugd);
+
+ FN_END;
+}
+
void _bt_main_add_searched_title(bt_ug_data *ugd)
{
Elm_Object_Item *git;