#include <dbus/dbus-glib-lowlevel.h>
#include <syspopup_caller.h>
#include <dd-display.h>
+#include <bundle.h>
+#include <bundle_internal.h>
+#include <app_control_internal.h>
#define COLOR_TABLE "/usr/apps/org.tizen.bt-syspopup/shared/res/tables/com.samsung.bt-syspopup_ChangeableColorTable.xml"
#define FONT_TABLE "/usr/apps/org.tizen.bt-syspopup/shared/res/tables/com.samsung.bt-syspopup_FontInfoTable.xml"
-static void __bluetooth_delete_input_view(struct bt_popup_appdata *ad);
static void __bluetooth_win_del(void *data);
static void __bluetooth_set_win_level(Evas_Object *parent);
static void __bluetooth_terminate(void *data);
-static int __bluetooth_error_toast_timeout_cb(void *data);
-
-static void __bluetooth_draw_error_toast_popup(struct bt_popup_appdata *ad, char *toast_text);
-
static void __bluetooth_draw_toast_popup(struct bt_popup_appdata *ad, char *toast_text);
static void __bluetooth_remove_all_event(struct bt_popup_appdata *ad);
Evas_Object *layout = NULL;
char *text1 = NULL;
char *text2 = NULL;
+ char *smtp_str = NULL;
ret_if(!ad);
elm_layout_file_set(layout, CUSTOM_POPUP_PATH, "no_button_passkey_confirm_popup");
elm_object_content_set(ad->popup, layout);
- text1 = g_strdup_printf(BT_STR_GEAR_WILL_CONNECT_WITH_PS, device_name);
+ smtp_str = BT_STR_GEAR_WILL_CONNECT_WITH_PS;
+
+ text1 = g_strdup_printf(smtp_str, device_name);
text2 = g_strdup_printf("%s %s", BT_STR_PASSKEY, passkey);
elm_object_part_text_set(layout, "elm.text1", text1);
retv_if(!data, NULL);
char *dev_name = (char *)data;
char temp[100] = {'\0',};
-
+ char *stms_str = NULL;
+
if (!strcmp(part, "elm.text")) {
- snprintf(temp, sizeof(temp) - 1, BT_STR_ENTER_PIN_TO_PAIR_WITH_PS, dev_name);
+ stms_str = BT_STR_ENTER_PIN_TO_PAIR_WITH_PS;
+ snprintf(temp, sizeof(temp) - 1, stms_str, dev_name);
return g_strdup_printf("<align=center>%s</align>", temp);
}
return NULL;
FN_END;
}
-static void __bluetooth_delete_input_view(struct bt_popup_appdata *ad)
-{
- __bluetooth_ime_hide();
-}
-
static DBusGProxy* __bluetooth_create_agent_proxy(DBusGConnection *conn,
const char *path)
{
const char *passkey = NULL;
const char *agent_path;
char *conv_str = NULL;
+ char *stms_str = NULL;
if (!kb) {
BT_ERR("Bundle is NULL");
if (device_name && passkey) {
conv_str = elm_entry_utf8_to_markup(device_name);
- snprintf(view_title, BT_TITLE_STR_MAX_LEN,
- BT_STR_CONFIRM_PASSKEY_PS_TO_PAIR_WITH_PS,
+ stms_str = BT_STR_CONFIRM_PASSKEY_PS_TO_PAIR_WITH_PS;
+ snprintf(view_title, BT_TITLE_STR_MAX_LEN, stms_str,
conv_str, passkey);
if (conv_str)
free(conv_str);
snprintf(view_title, BT_TITLE_STR_MAX_LEN,
"%s", BT_STR_PAIRING_REQUEST);
+ stms_str = BT_STR_ENTER_PIN_TO_PAIR;
snprintf(text, BT_GLOBALIZATION_STR_LENGTH,
- BT_STR_ENTER_PIN_TO_PAIR, conv_str);
+ stms_str, conv_str);
/* Request user inputted Passkey for basic pairing */
__bluetooth_draw_input_view(ad, view_title, conv_str);
if (device_name && passkey) {
conv_str = elm_entry_utf8_to_markup(device_name);
+ stms_str = BT_STR_ENTER_PS_ON_PS_TO_PAIR;
snprintf(view_title, BT_TITLE_STR_MAX_LEN,
- BT_STR_ENTER_PS_ON_PS_TO_PAIR, passkey, conv_str);
+ stms_str, passkey, conv_str);
if (conv_str)
free(conv_str);
if (device_name)
conv_str = elm_entry_utf8_to_markup(device_name);
+ stms_str = BT_STR_ALLOW_PS_TO_CONNECT_Q;
snprintf(view_title, BT_TITLE_STR_MAX_LEN,
- BT_STR_ALLOW_PS_TO_CONNECT_Q, conv_str);
+ stms_str, conv_str);
if (conv_str)
free(conv_str);
if (device_name && passkey) {
conv_str = elm_entry_utf8_to_markup(device_name);
+ stms_str = BT_STR_ENTER_PS_ON_PS_TO_PAIR;
snprintf(view_title, BT_TITLE_STR_MAX_LEN,
- BT_STR_ENTER_PS_ON_PS_TO_PAIR, passkey, conv_str);
+ stms_str, passkey, conv_str);
if (conv_str)
free(conv_str);
return -1;
if (device_name) {
+ stms_str = BT_STR_RESET;
snprintf(view_title, BT_TITLE_STR_MAX_LEN,
- BT_STR_RESET, device_name, device_name);
+ stms_str, device_name, device_name);
__bluetooth_draw_reset_popup(ad, view_title,
__bluetooth_reset_cb);
} else {
return 0;
}
-static void __bluetooth_timeout_cb(void *data, Evas_Object *obj, void *event_info)
-{
- evas_object_del(obj);
-}
-
static void __bluetooth_draw_toast_popup(struct bt_popup_appdata *ad, char *toast_text)
{
- Evas_Object *ao = NULL;
-
ad->popup = elm_popup_add(ad->win_main);
elm_object_style_set(ad->popup, "toast/circle");
elm_popup_orient_set(ad->popup, ELM_POPUP_ORIENT_BOTTOM);
evas_object_show(ad->popup);
evas_object_show(ad->win_main);
elm_object_focus_set(ad->popup, EINA_TRUE);
-
-#if 0
- ao = elm_object_part_access_object_get(ad->popup, "access.outline");
- if (ao != NULL)
- elm_access_info_set(ao, ELM_ACCESS_INFO, toast_text);
-#endif
-}
-
-static void __bluetooth_draw_error_toast_popup(struct bt_popup_appdata *ad, char *toast_text)
-{
- Evas_Object *ao = NULL;
-
- ad->popup = elm_popup_add(ad->win_main);
- elm_object_style_set(ad->popup, "toast/circle");
- elm_object_text_set(ad->popup, toast_text);
- elm_popup_timeout_set(ad->popup, 2.0);
- evas_object_smart_callback_add(ad->popup, "timeout", __bluetooth_timeout_cb, NULL);
-
- __bluetooth_set_win_level(ad->popup);
-
- evas_object_show(ad->popup);
- evas_object_show(ad->win_main);
- elm_object_focus_set(ad->popup, EINA_TRUE);
-
-#if 0
- ao = elm_object_part_access_object_get(ad->popup, "access.outline");
- if (ao != NULL)
- elm_access_info_set(ao, ELM_ACCESS_INFO, toast_text);
-#endif
}
static Eina_Bool __exit_idler_cb(void *data)
__popup_terminate();
}
-static int __bluetooth_error_toast_timeout_cb(void *data)
-{
- struct bt_popup_appdata *ad;
-
- if (data == NULL)
- return 0;
-
- ad = (struct bt_popup_appdata *)data;
-
- BT_DBG("Toast Popup timeout");
-
- /* Destory toast popup and timer */
- if (ad->timer) {
- ecore_timer_del(ad->timer);
- ad->timer = NULL;
- }
-
- if (ad->popup) {
- elm_access_object_unregister(ad->popup);
- evas_object_del(ad->popup);
- ad->popup = NULL;
- }
- return 0;
-}
static Evas_Object *__bluetooth_create_win(const char *name, void *data)
{
Evas_Object *eo;
DBusGConnection *conn = NULL;
GError *err = NULL;
- g_type_init();
-
conn = dbus_g_bus_get(DBUS_BUS_SYSTEM, &err);
if (!conn) {
void __bluetooth_set_color_table(void *data)
{
FN_START;
- struct bt_popup_appdata *ad = (struct bt_popup_appdata *)data;
-#if 0
- /* Set color table */
- ea_theme_changeable_ui_enabled_set(EINA_TRUE);
- ad->color_table = ea_theme_color_table_new(COLOR_TABLE);
- if (ad->color_table == NULL)
- BT_ERR("ea_theme_color_table_new failed!");
- else if (EINA_TRUE != ea_theme_colors_set(ad->color_table, EA_THEME_STYLE_DEFAULT))
- BT_ERR("ea_theme_colors_set failed!");
-
- ad->font_table = ea_theme_font_table_new(FONT_TABLE);
- if (ad->font_table == NULL)
- BT_ERR("ea_theme_color_table_new failed!");
- else if (EINA_TRUE != ea_theme_fonts_set(ad->font_table))
- BT_ERR("ea_theme_fonts_set failed!");
-#endif
FN_END;
}
callback.resume = __bluetooth_resume;
callback.app_control = __bluetooth_reset;
- return ui_app_main(&argc, &argv, &callback, &ad);
+ return ui_app_main(argc, argv, &callback, &ad);
}