*
* Copyright 2012 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
int ret = APP_CONTROL_ERROR_NONE;
app_control_h app_control;
- app_control_create(&app_control);
+ ret = app_control_create(&app_control);
if (ret != APP_CONTROL_ERROR_NONE) {
ERR("app_control_create failed");
return;
if (state)
_set_checkbox_status(TETHERING_TYPE_USB, 1);
- if (_get_vconf_usb_state() != VCONFKEY_SYSMAN_USB_AVAILABLE) {
+ if (_get_vconf_usb_state() == VCONFKEY_SYSMAN_USB_DISCONNECTED) {
_update_tethering_item(ad, MH_STATE_NONE);
break;
}
__MOBILE_AP_FUNC_EXIT__;
}
+#ifdef TIZEN_FEATURE_EMULATOR
+static void __handle_emul_popup_resp(void *data, bool response)
+{
+ __MOBILE_AP_FUNC_ENTER__;
+
+ if (data == NULL) {
+ ERR("The param is NULL\n");
+ return;
+ }
+
+ mh_appdata_t *ad = (mh_appdata_t *)data;
+ Eina_Bool state = 0;
+
+ if (ad->popup_checkbox) {
+ state = elm_check_state_get(ad->popup_checkbox);
+ evas_object_del(ad->popup_checkbox);
+ ad->popup_checkbox = NULL;
+ DBG("Checkbox status is = %d\n", state);
+ }
+ if (ad->popup) {
+ evas_object_del(ad->popup);
+ ad->popup = NULL;
+ }
+
+ if (response == true) {
+ switch (popup_type) {
+ case MH_POPUP_WIFI_ON_CHECKBOX:
+ if (state)
+ _set_checkbox_status(TETHERING_TYPE_WIFI, 1);
+ ad->is_wifi_teth_enabling = false;
+ break;
+
+ case MH_POPUP_BT_ON_CHECKBOX:
+ if (state)
+ _set_checkbox_status(TETHERING_TYPE_BT, 1);
+ ad->is_bt_teth_enabling = false;
+ break;
+
+ default:
+ ERR("Unknown popup_type : %d\n", popup_type);
+ break;
+ }
+ } else {
+ switch (popup_type) {
+ case MH_POPUP_WIFI_ON_CHECKBOX:
+ _update_tethering_enabling_item(ad, TETHERING_TYPE_WIFI, MH_STATE_NONE);
+ _wifi_tethering_checkbox_popup_status_set(false);
+ break;
+
+ case MH_POPUP_BT_ON_CHECKBOX:
+ _update_tethering_enabling_item(ad, TETHERING_TYPE_BT, MH_STATE_NONE);
+ break;
+
+ default:
+ ERR("Unknown popup_type : %d\n", popup_type);
+ break;
+ }
+ }
+
+ __MOBILE_AP_FUNC_EXIT__;
+}
+#endif
+
void _teth_on(mh_appdata_t *ad)
{
+#ifndef TIZEN_FEATURE_EMULATOR
__handle_popup_resp(ad, true);
+#else
+ __handle_emul_popup_resp(ad, true);
+#endif
}
static void __popup_yes_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
return;
}
+#ifndef TIZEN_FEATURE_EMULATOR
__handle_popup_resp(data, true);
+#else
+ mh_appdata_t *ad = (mh_appdata_t *)data;
+
+ __handle_emul_popup_resp(data, true);
+ _update_emul_main_view(ad, _get_selected_type(), _get_selected_state());
+#endif
}
static void __popup_no_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
return;
}
+#ifndef TIZEN_FEATURE_EMULATOR
__handle_popup_resp(data, false);
+#else
+ __handle_emul_popup_resp(data, false);
+#endif
}
static void __popup_no_btn_mouse_event_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info)
Evas_Event_Mouse_Up *ev = event_info;
if (ev->button == 3)
+#ifndef TIZEN_FEATURE_EMULATOR
__handle_popup_resp(data, false);
+#else
+ __handle_emul_popup_resp(data, false);
+#endif
}
static void __popup_block_clicked_cb(void *data, Evas_Object *obj, void *event_info)
return;
}
+#ifndef TIZEN_FEAUTRE_EMULATOR
__handle_popup_resp(data, false);
+#else
+ __handle_emul_popup_resp(data, false);
+#endif
}
void _prepare_popup_with_content(int type, Evas_Object *obj)
switch (ad->type) {
case TETHERING_TYPE_WIFI:
- wifi_is_activated(&wifi_state);
+ wifi_manager_is_activated(ad->wifi_handle, &wifi_state);
_set_vconf_prev_wifi_state(wifi_state);
if (wifi_state == true || _is_wifi_direct_on() == true)
fmt = STR_TETH_ON_DESC_1;
case MH_POPUP_WIFI_OFF:
popup = elm_popup_add(ad->win);
+ elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 1.0);
ad->popup = popup;
elm_object_domain_translatable_part_text_set(popup, "title,text", PACKAGE,
case MH_POPUP_FLIGHT_MODE:
case MH_POPUP_NETWORK_OUT_OF_RANGE:
popup = elm_popup_add(ad->win);
+ elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 1.0);
ad->popup = popup;
evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND,
EVAS_HINT_EXPAND);
case MH_POPUP_MOBILE_DATA_OFF:
popup = elm_popup_add(ad->win);
+ elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 1.0);
ad->popup = popup;
evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND,
EVAS_HINT_EXPAND);
case MH_POPUP_WIFI_AP_OFF:
popup = elm_popup_add(ad->win);
+ elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 1.0);
ad->popup = popup;
evas_object_size_hint_weight_set(popup,
EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
int ret;
switch (type) {
- case TETHERING_TYPE_WIFI:
- g_strlcpy(restricted_type, "wifi tethering", MAX_BUF_SIZE - 1);
- break;
- case TETHERING_TYPE_USB:
- g_strlcpy(restricted_type, "usb tethering", MAX_BUF_SIZE - 1);
- break;
- case TETHERING_TYPE_BT:
- g_strlcpy(restricted_type, "bt tethering", MAX_BUF_SIZE - 1);
- break;
- default:
- ERR("Invalid type.\n");
- return;
+ case TETHERING_TYPE_WIFI:
+ g_strlcpy(restricted_type, "wifi tethering", MAX_BUF_SIZE - 1);
+ break;
+ case TETHERING_TYPE_USB:
+ g_strlcpy(restricted_type, "usb tethering", MAX_BUF_SIZE - 1);
+ break;
+ case TETHERING_TYPE_BT:
+ g_strlcpy(restricted_type, "bt tethering", MAX_BUF_SIZE - 1);
+ break;
+ default:
+ ERR("Invalid type.\n");
+ return;
}
b = bundle_create();