#include <setting-helper.h>
#include <wifi.h>
-/*#include <nfc.h> */
#include <bluetooth.h>
+#include <bluetooth_internal.h>
#include <dbus/dbus.h>
+#include <app_control_internal.h>
-static Setting_GenGroupItem_Data *__flightmode_handler(void *data, char *keyStr, char *icon_path, char *ug_name, Evas_Object *genlist, Elm_Object_Item *parent)
-{
- /*SETTING_TRACE_BEGIN; */
- /* NOT UG --> it's just UI drawing */
-
- setting_main_appdata *ad = (setting_main_appdata *)data;
- int value, err;
- setting_get_bool_slp_key(BOOL_SLP_SETTING_FLIGHT_MODE, &value, &err);
-
- /* create flight_mode */
- ad->data_flight = setting_create_Gendial_field_groupitem(genlist,
- &(ad->itc[GENDIAL_Type_1text_1icon_2]),
- parent,
- setting_main_click_Gendial_list_flight_mode_cb,
- ad,
- SWALLOW_Type_1ICON_1RADIO,
- icon_path,
- NULL,
- value,
- keyStr,
- NULL,
- setting_main_click_list_flight_mode_cb);
- __BACK_POINTER_SET(ad->data_flight);
-
- return ad->data_flight;
-}
-
-static Setting_GenGroupItem_Data *__netrestrictionmode_handler(void *data, char *keyStr, char *icon_path, char *ug_name, Evas_Object *genlist, Elm_Object_Item *parent)
-{
- /*SETTING_TRACE_BEGIN; */
- /* NOT UG --> it's just UI drawing */
-
- setting_main_appdata *ad = (setting_main_appdata *)data;
- int value, err;
-
- setting_get_bool_slp_key(BOOL_SLP_SETTING_NET_RESTRICTION_MODE, &value, &err);
-
- /* create restriction mode */
- ad->data_netrestrictionmode = setting_create_Gendial_field_groupitem(genlist,
- &(ad->itc[GENDIAL_Type_1text_2icon]),
- parent,
- setting_main_click_list_net_restriction_mode_cb,
- ad,
- SWALLOW_Type_1ICON_1RADIO,
- IMG_NetRestrictionMode,
- NULL,
- value,
- keyStr,
- NULL,
- setting_main_click_list_check_net_restriction_mode_cb);
- __BACK_POINTER_SET(ad->data_netrestrictionmode);
-
- if (ad->data_wifi) {
- if (value == 1)
- setting_disable_genlist_item(ad->data_wifi->item);
- }
-
- return ad->data_netrestrictionmode;
-}
-
-static Setting_GenGroupItem_Data *__wifi_handler(void *data, char *keyStr, char *icon_path, char *ug_args, Evas_Object *genlist, Elm_Object_Item *parent)
-{
- /*SETTING_TRACE_BEGIN; */
- setting_main_appdata *ad = (setting_main_appdata *)data;
-
- int err;
- int value = -1;
- setting_get_int_slp_key(INT_SLP_SETTING_WIFI_STATUS, &value, &err);
-
- preference_set_boolean(WIFI_LAST_ON_OFF_STATE, (value ? 1 : 0));
- ad->data_wifi = setting_create_Gendial_field_groupitem(genlist,
-
- /*&(ad->itc[GENDIAL_Type_1text_2icon_divider]), */
- & (ad->itc[GENDIAL_Type_1text_1icon_2]),
- parent,
- setting_main_click_list_ex_ug_cb,
- ug_args,
- SWALLOW_Type_1ICON_1RADIO,
- icon_path,
- NULL,
- value,
- keyStr,
- NULL,
- setting_main_click_list_wifi_mode_cb);
- __BACK_POINTER_SET(ad->data_wifi);
- if (ad->data_wifi) {
- ad->data_wifi->userdata = ad;
- }
-
- return ad->data_wifi;
-}
-
-static Setting_GenGroupItem_Data *__bluetooth_handler(void *data, char *keyStr, char *icon_path, char *ug_args, Evas_Object *genlist, Elm_Object_Item *parent)
-{
- /*SETTING_TRACE_BEGIN; */
- setting_main_appdata *ad = (setting_main_appdata *)data;
- int value, err;
- setting_get_int_slp_key(INT_SLP_SETTING_BT_STATUS, &value, &err);
-
- ad->data_bt = setting_create_Gendial_field_groupitem(genlist,
- /*&(ad->itc[GENDIAL_Type_1text_2icon_divider]), */
- & (ad->itc[GENDIAL_Type_1text_1icon_2]),
- parent,
- setting_main_click_list_ex_ug_cb,
- ug_args,
- SWALLOW_Type_1ICON_1RADIO,
- icon_path,
- NULL,
- value,
- keyStr,
- NULL,
- setting_main_click_list_bt_mode_cb);
- __BACK_POINTER_SET(ad->data_bt);
- if (ad->data_bt) {
- ad->data_bt->userdata = ad;
- }
-
- return ad->data_bt;
-}
static Setting_GenGroupItem_Data *__mobileap_handler(void *data, char *keyStr, char *icon_path, char *ug_args, Evas_Object *genlist, Elm_Object_Item *parent)
{
/*SETTING_TRACE_BEGIN; */
setting_main_appdata *ad = (setting_main_appdata *)data;
-
- ad->data_mobileApp = setting_create_Gendial_field_groupitem(genlist,
- &(ad->itc[GENDIAL_Type_1text_1icon_2]),
- parent,
- setting_main_click_list_ex_ug_cb,
- ug_args,
- SWALLOW_Type_INVALID,
- icon_path,
- NULL,
- 0,
- keyStr,
- NULL,
- NULL);
- __BACK_POINTER_SET(ad->data_mobileApp);
- if (ad->data_mobileApp) {
- ad->data_mobileApp->userdata = ad;
- }
-
- return ad->data_mobileApp;
-}
-
-static Setting_GenGroupItem_Data *__allshare_handler(void *data, char *keyStr, char *icon_path, char *ug_args, Evas_Object *genlist, Elm_Object_Item *parent)
-{
- /*SETTING_TRACE_BEGIN; */
- setting_main_appdata *ad = (setting_main_appdata *)data;
-
- Setting_GenGroupItem_Data *obj = setting_create_Gendial_field_groupitem(genlist,
- &(ad->itc[GENDIAL_Type_1text_1icon_2]),
- parent,
- setting_main_click_list_default_ug_cb,
- ad,
- SWALLOW_Type_INVALID,
- icon_path,
- NULL, 0,
- keyStr,
- NULL,
- NULL);
- return obj;
-}
-
-static Setting_GenGroupItem_Data *__network_handler(void *data, char *keyStr, char *icon_path, char *ug_args, Evas_Object *genlist, Elm_Object_Item *parent)
-{
- /*SETTING_TRACE_BEGIN; */
- setting_main_appdata *ad = (setting_main_appdata *)data;
-
- ad->data_network = setting_create_Gendial_field_groupitem(genlist,
- &(ad->itc[GENDIAL_Type_1text_1icon_2]),
- parent,
- setting_main_click_list_network_ug_cb,
- ad,
- SWALLOW_Type_INVALID,
- icon_path,
- NULL, 0,
- keyStr,
- NULL,
- NULL);
-
- int flight_mode = 0;
- vconf_get_bool(VCONFKEY_TELEPHONY_FLIGHT_MODE, &flight_mode);
- if (flight_mode) {
- if (ad->data_network) setting_disable_genlist_item(ad->data_network->item);
- }
-
- __BACK_POINTER_SET(ad->data_network);
- return ad->data_network;
-}
-
-#if SUPPORT_NFC
-static Setting_GenGroupItem_Data *__nfc_handler(void *data, char *keyStr, char *icon_path, char *ug_args, Evas_Object *genlist, Elm_Object_Item *parent)
-{
- /*SETTING_TRACE_BEGIN; */
- if (!is_NFC_feature_supported()) {
- SETTING_TRACE("!is_NFC_feature_supported");
- return NULL;
- }
- setting_main_appdata *ad = (setting_main_appdata *)data;
-
- int value, err;
- setting_get_bool_slp_key(BOOL_SLP_SETTING_NFC_STATUS, &value, &err);
-
- ad->data_nfc = setting_create_Gendial_field_groupitem(genlist,
- &(ad->itc[GENDIAL_Type_1text_2icon_divider]),
- /*&(ad->itc[GENDIAL_Type_1text_2icon]), */
- parent,
- setting_main_click_list_ex_ug_cb,
- ug_args,
- SWALLOW_Type_1ICON_1RADIO,
- icon_path,
- NULL,
- value,
- keyStr,
- NULL,
- setting_main_click_list_nfc_mode_cb);
- __BACK_POINTER_SET(ad->data_nfc);
- if (ad->data_nfc) {
- ad->data_nfc->userdata = ad;
- }
-
- return ad->data_nfc;
-}
-#endif
-
-static Setting_GenGroupItem_Data *__adjust_screen_tone_handler(void *data, char *keyStr, char *icon_path, char *ug_args, Evas_Object *genlist, Elm_Object_Item *parent)
-{
- SETTING_TRACE_BEGIN;
- setting_main_appdata *ad = (setting_main_appdata *)data;
- Setting_GenGroupItem_Data *obj = NULL;
-
- int value = 0;
- vconf_get_bool(VCONFKEY_SETAPPL_BOOL_AUTO_ADJUST_SCREEN_TONE, &value);
- obj = setting_create_Gendial_field_groupitem(genlist,
- &(ad->itc[GENDIAL_Type_1text_2icon]),
- parent,
- setting_main_display_list_cb,
- ad,
- SWALLOW_Type_1ICON_1RADIO,
- icon_path,
- NULL,
- value,
- keyStr,
- NULL,
- setting_main_display_auto_adjust_chk_btn_cb);
-
- if (obj) {
- __BACK_POINTER_SET(obj);
- obj->userdata = ad;
- ad->data_screentone = obj;
- }
- return obj;
-}
-
-static Setting_GenGroupItem_Data *__landscape_handler(void *data, char *keyStr, char *icon_path, char *ug_args, Evas_Object *genlist, Elm_Object_Item *parent)
-{
- SETTING_TRACE_BEGIN;
- setting_main_appdata *ad = (setting_main_appdata *)data;
- Setting_GenGroupItem_Data *obj = NULL;
-
- int value = 0;
- vconf_get_bool(VCONFKEY_SETAPPL_AUTO_ROTATE_SCREEN_BOOL, &value);
- obj = setting_create_Gendial_field_groupitem(genlist,
- &(ad->itc[GENDIAL_Type_1text_2icon]),
- parent,
- setting_main_display_list_cb,
- ad,
- SWALLOW_Type_1ICON_1RADIO,
- icon_path,
- NULL,
- value,
- keyStr,
- NULL,
- setting_main_display_auto_rotate_chk_btn_cb);
-
- if (obj) {
- __BACK_POINTER_SET(obj);
- obj->userdata = ad;
- ad->data_landscape = obj;
- }
- return obj;
-
-
-
-}
-
-
-static Setting_GenGroupItem_Data *__multiwindow_mode_handler(void *data, char *keyStr, char *icon_path, char *ug_args, Evas_Object *genlist, Elm_Object_Item *parent)
-{
- SETTING_TRACE_BEGIN;
- setting_main_appdata *ad = (setting_main_appdata *)data;
- Setting_GenGroupItem_Data *obj = NULL;
-
- int value;
- int ret = vconf_get_bool(VCONFKEY_QUICKSETTING_MULTIWINDOW_ENABLED, &value);
- if (ret != 0) {
- SETTING_TRACE_ERROR("get multi-window vconf failed");
- value = 0;
- }
- SETTING_TRACE("multi-window vconf value=%d\n", value);
- obj =
- setting_create_Gendial_field_groupitem(genlist,
- &(ad->itc[GENDIAL_Type_1text_2icon_divider]),
- parent,
- setting_main_click_list_ex_ug_cb,
- ug_args,
- SWALLOW_Type_1ICON_1RADIO,
- icon_path,
- NULL,
- value,
- keyStr,
- NULL,
- setting_main_list_mouse_up_cb);
-
- if (obj) {
- __BACK_POINTER_SET(obj);
- obj->userdata = ad;
- ad->data_multi_window = obj;
- }
- return obj;
-}
-
-
-static Setting_GenGroupItem_Data *__brightness_handler(void *data, char *keyStr, char *icon_path, char *ug_args, Evas_Object *genlist, Elm_Object_Item *parent)
-{
- SETTING_TRACE_BEGIN;
- setting_main_appdata *ad = (setting_main_appdata *)data;
- Setting_GenGroupItem_Data *obj = NULL;
-
- char *pa_bright = get_brightness_mode_str();
- obj =
- setting_create_Gendial_field_groupitem(genlist,
- &(ad->itc[GENDIAL_Type_1icon_2text]),
- parent,
- setting_main_click_list_ex_ug_cb,
- ug_args,
- SWALLOW_Type_INVALID,
- icon_path,
- NULL,
- 0,
- keyStr,
- pa_bright,
- NULL);
-
- if (obj) {
- __BACK_POINTER_SET(obj);
- obj->userdata = ad;
- ad->data_bright = obj;
- }
- return obj;
-}
-
-#if SUPPORT_BLOCKINGMODE
-static Setting_GenGroupItem_Data *__blocking_mode_handler(void *data, char *keyStr, char *icon_path, char *ug_args, Evas_Object *genlist, Elm_Object_Item *parent)
-{
- SETTING_TRACE_BEGIN;
- setting_main_appdata *ad = (setting_main_appdata *)data;
- Setting_GenGroupItem_Data *obj = NULL;
-
- int value;
- int ret = vconf_get_bool(VCONFKEY_SETAPPL_BLOCKINGMODE_BLOCKINGMODE, &value);
- if (ret != 0) {
- SETTING_TRACE_ERROR("get vconf failed");
- value = 1;
- }
- obj = setting_create_Gendial_field_groupitem(genlist,
- &(ad->itc[GENDIAL_Type_1text_2icon_divider]),
- /*&(ad->itc[GENDIAL_Type_1text_2icon]), */
- parent,
- setting_main_click_list_ex_ug_cb,
- ug_args,
- SWALLOW_Type_1ICON_1RADIO,
- icon_path,
- NULL,
- value,
- keyStr,
- NULL,
- setting_main_list_mouse_up_cb);
- if (obj) {
- __BACK_POINTER_SET(obj);
- obj->userdata = ad;
- ad->data_blocking = obj;
- }
- return obj;
-
-}
-#endif
-
-static Setting_GenGroupItem_Data *__personal_mode_handler(void *data, char *keyStr, char *icon_path, char *ug_args, Evas_Object *genlist, Elm_Object_Item *parent)
-{
- SETTING_TRACE_BEGIN;
- setting_main_appdata *ad = (setting_main_appdata *)data;
- Setting_GenGroupItem_Data *obj = NULL;
-
- int value;
- int ret = vconf_get_bool(VCONFKEY_SETAPPL_PERSONAL_MODE_STATUS_BOOL, &value);
- if (ret != 0) {
- SETTING_TRACE_ERROR("get vconf failed");
- value = 0;
- }
- obj = setting_create_Gendial_field_groupitem(genlist,
- &(ad->itc[GENDIAL_Type_1text_2icon_divider]),
- /*&(ad->itc[GENDIAL_Type_1text_2icon]), */
- parent,
- setting_main_click_list_ex_personal_mode_cb,
- ug_args,
- SWALLOW_Type_1ICON_1RADIO,
- icon_path,
- NULL,
- value,
- keyStr,
- NULL,
- setting_main_list_mouse_up_cb);
- if (obj) {
- __BACK_POINTER_SET(obj);
- obj->userdata = ad;
- ad->data_personalpage = obj;
- }
- return obj;
-}
-
-
-
-static Setting_GenGroupItem_Data *__hightouch_sens_handler(void *data, char *keyStr, char *icon_path, char *ug_args, Evas_Object *genlist, Elm_Object_Item *parent)
-{
- SETTING_TRACE_BEGIN;
- setting_main_appdata *ad = (setting_main_appdata *)data;
- Setting_GenGroupItem_Data *obj = NULL;
-
- int value = 0;
- int entouch = display_get_enhanced_touch();
- if (1 == entouch) {
- /*enhanced status ON */
- value = 1;
- } else {
- value = 0;
- }
- vconf_set_bool(VCONFKEY_SETAPPL_ENHANCED_TOUCH, value); /*sync to vconf */
-
- /* create high touch sensitivity */
- obj = setting_create_Gendial_field_groupitem(genlist,
- &(ad->itc[GENDIAL_Type_1text_2icon]),
- parent,
- setting_main_mouse_up_Gendial_list_sensitivity_cb,
- ad,
- SWALLOW_Type_1ICON_1RADIO,
- icon_path,
- NULL,
- value,
- KeyStr_HighTouchSens,
- NULL,
- setting_main_high_touch_sens_chk_btn_cb);
-
- if (obj) {
- __BACK_POINTER_SET(obj);
- obj->userdata = ad;
- ad->data_high_touch_sensitivity = obj;
- }
-
- return obj;
-}
-
-/*__screen_mode_handler */
-static Setting_GenGroupItem_Data *__screen_mode_handler(void *data, char *keyStr, char *icon_path, char *ug_args, Evas_Object *genlist, Elm_Object_Item *parent)
-{
- SETTING_TRACE_BEGIN;
- setting_main_appdata *ad = (setting_main_appdata *)data;
-
- mainlist_entry *entry = settinig_drawer_hash_find(ad, keyStr);
-
- Setting_GenGroupItem_Data *item_data = NULL;
- if (entry) {
- item_data = entry->ui_handler(ad, keyStr, icon_path, ug_args, genlist, parent);
- entry->item_data = item_data;
- }
-
- char *pa_screenmode = get_pa_screen_mode_str();
-
- Setting_GenGroupItem_Data *obj = NULL;
- obj =
- setting_create_Gendial_field_groupitem(genlist,
- &(ad->itc[GENDIAL_Type_1icon_2text]),
- parent,
- setting_main_click_list_ex_ug_cb,
- ug_args,
- SWALLOW_Type_INVALID,
- icon_path,
- NULL,
- 0,
- keyStr,
- pa_screenmode,
- NULL);
- G_FREE(pa_screenmode);
- __BACK_POINTER_SET(obj);
- if (obj) {
- obj->userdata = ad;
- ad->data_screenmode = obj;
- }
-
- return obj;
-}
-
-
-
-
-static Setting_GenGroupItem_Data *__battery_percent_handler(void *data, char *keyStr, char *icon_path, char *ug_args, Evas_Object *genlist, Elm_Object_Item *parent)
-{
- SETTING_TRACE_BEGIN;
- setting_main_appdata *ad = (setting_main_appdata *)data;
Setting_GenGroupItem_Data *obj = NULL;
- int value = 0;
- vconf_get_bool(VCONFKEY_SETAPPL_BATTERY_PERCENTAGE_BOOL, &value);
- obj = setting_create_Gendial_field_groupitem(genlist,
- &(ad->itc[GENDIAL_Type_1text_2icon]),
- parent,
- setting_main_display_list_cb,
- ad,
- SWALLOW_Type_1ICON_1RADIO,
- icon_path,
- NULL,
- value,
- keyStr,
- NULL,
- setting_main_display_battery_chk_btn_cb);
+ obj = setting_create_Gendial_field_def(genlist,
+ &(ad->itc_table[GENDIAL_Type_1text_1icon_2]),
+ setting_main_click_list_ex_ug_cb,
+ ug_args,
+ SWALLOW_Type_INVALID,
+ icon_path,
+ NULL,
+ 0,
+ keyStr,
+ NULL,
+ NULL);
__BACK_POINTER_SET(obj);
if (obj) {
obj->userdata = ad;
- ad->data_battery = obj;
}
return obj;
Setting_GenGroupItem_Data *obj = NULL;
char *pa_backlight = get_pa_backlight_time_str();
- obj = setting_create_Gendial_field_groupitem(genlist,
- &(ad->itc[GENDIAL_Type_1icon_2text]),
- parent,
+ obj = setting_create_Gendial_field_def(genlist,
+ &(ad->itc_table[GENDIAL_Type_1icon_2text]),
setting_main_click_list_ex_ug_cb,
ug_args,
SWALLOW_Type_INVALID,
__BACK_POINTER_SET(obj);
if (obj) {
obj->userdata = ad;
- ad->data_backlight = obj;
- }
-
- return obj;
-}
-
-static Setting_GenGroupItem_Data *__nearby_device_handler(void *data, char *keyStr, char *icon_path, char *ug_args, Evas_Object *genlist, Elm_Object_Item *parent)
-{
- SETTING_TRACE_BEGIN;
- setting_main_appdata *ad = (setting_main_appdata *)data;
- Setting_GenGroupItem_Data *obj = NULL;
-
- Cfg_Item_State state = Cfg_Item_Error;
- Setting_Cfg_Node_T *pnode = get_cfg_node_by_keystr(_(keyStr));
- if (pnode && pnode->tfunc && pnode->tfunc->get_item_state) {
- pnode->tfunc->get_item_state(&state, NULL);
- }
-
- obj = setting_create_Gendial_field_groupitem(genlist,
- &(ad->itc[GENDIAL_Type_1text_2icon_divider]),
- /*&(ad->itc[GENDIAL_Type_1text_2icon]), */
- parent,
- setting_main_click_list_ex_ug_cb,
- ug_args,
- SWALLOW_Type_1ICON_1RADIO,
- icon_path,
- NULL,
- state,
- keyStr,
- NULL,
- setting_main_click_list_nearby_devices_cb);
- __BACK_POINTER_SET(obj);
- if (obj) {
- obj->userdata = ad;
-
- ad->data_nearby_devices = obj;
+// ad->data_backlight = obj;
}
return obj;
Setting_GenGroupItem_Data *obj = NULL;
#ifdef BINARY_RELEASE_TYPE_ENG
/*for eng binary: always show <developer option>*/
- obj = setting_create_Gendial_field_groupitem(genlist,
- &(ad->itc[GENDIAL_Type_1text_1icon_2]),
- parent,
+ obj = setting_create_Gendial_field_def(genlist,
+ &(ad->itc_table[GENDIAL_Type_1text_1icon_2]),
setting_main_click_list_ex_ug_cb,
ug_args,
SWALLOW_Type_INVALID,
SETTING_TRACE_ERROR("Failed to ger vconf value %d", ret);
}
if (dev_op_state) {
- obj = setting_create_Gendial_field_groupitem(genlist,
- &(ad->itc[GENDIAL_Type_1text_1icon_2]),
- parent,
+ obj = setting_create_Gendial_field_def(genlist,
+ &(ad->itc_table[GENDIAL_Type_1text_1icon_2]),
setting_main_click_list_ex_ug_cb,
ug_args,
SWALLOW_Type_INVALID,
return obj;
}
-
-static Setting_GenGroupItem_Data *__joyn_handler(void *data, char *keyStr, char *icon_path, char *ug_args, Evas_Object *genlist, Elm_Object_Item *parent)
-{
- SETTING_TRACE_BEGIN;
- setting_main_appdata *ad = (setting_main_appdata *)data;
- if (vcui_doc_rcs_get_install_status() == EINA_TRUE) {
- ad->data_joyn = setting_create_Gendial_field_groupitem(genlist,
- &(ad->itc[GENDIAL_Type_1text_1icon_2]),
- parent,
- setting_main_click_list_ex_ug_cb,
- ug_args,
- SWALLOW_Type_INVALID,
- icon_path,
- NULL, 0,
- keyStr,
- NULL,
- NULL);
- __BACK_POINTER_SET(ad->data_joyn);
- if (ad->data_joyn) {
- ad->data_joyn->userdata = ad;
- }
- return ad->data_joyn;
- } else {
- SETTING_TRACE("Joyn account is NOT available");
- }
- return NULL;
-}
-
-#if SUPPORT_NFC
-static Setting_GenGroupItem_Data *__sbeam_handler(void *data, char *keyStr, char *icon_path, char *ug_args, Evas_Object *genlist, Elm_Object_Item *parent)
-{
- /*SETTING_TRACE_BEGIN; */
- if (!is_NFC_feature_supported()) {
- SETTING_TRACE("!is_NFC_feature_supported");
- return NULL;
- }
- setting_main_appdata *ad = (setting_main_appdata *)data;
-
-
- int value, err;
- setting_get_bool_slp_key(BOOL_SLP_SETTING_NFC_SBEAM, &value, &err);
-
- ad->data_sbeam = setting_create_Gendial_field_groupitem(genlist,
- &(ad->itc[GENDIAL_Type_1text_2icon_divider]),
- /*&(ad->itc[GENDIAL_Type_1text_2icon]), */
- parent,
- setting_main_click_list_ex_ug_cb,
- ug_args,
- SWALLOW_Type_1ICON_1RADIO,
- icon_path,
- NULL,
- value,
- keyStr,
- NULL,
- setting_main_click_list_sbeam_mode_cb);
- __BACK_POINTER_SET(ad->data_sbeam);
- if (ad->data_sbeam) {
- ad->data_sbeam->userdata = ad;
- }
-
- return ad->data_sbeam;
-}
-#endif
-
static Setting_GenGroupItem_Data *__default_handler(void *data, char *keyStr, char *icon_path, char *ug_args, Evas_Object *genlist, Elm_Object_Item *parent)
{
/*SETTING_TRACE_BEGIN; */
setting_main_appdata *ad = (setting_main_appdata *)data;
- Setting_GenGroupItem_Data *obj = setting_create_Gendial_field_groupitem(genlist,
- &(ad->itc[GENDIAL_Type_1text_1icon_2]),
- parent,
+ Setting_GenGroupItem_Data *obj = setting_create_Gendial_field_def(genlist,
+ &(ad->itc_table[GENDIAL_Type_1text_1icon_2]),
setting_main_click_list_ex_ug_cb,
ug_args,
SWALLOW_Type_INVALID,
return obj;
}
-static Setting_GenGroupItem_Data *__powersaving_handler(void *data, char *keyStr, char *icon_path, char *ug_name, Evas_Object *genlist, Elm_Object_Item *parent)
-{
- /* NOT UG --> it's just UI drawing */
- setting_main_appdata *ad = (setting_main_appdata *)data;
-
- Setting_GenGroupItem_Data *item_data = NULL;
-
-#if SUPPORT_POWERSAVING
- int value;
- int ret = vconf_get_bool(VCONFKEY_SETAPPL_PWRSV_SYSMODE_STATUS, &value);
- if (ret != 0) {
- SETTING_TRACE_ERROR("get vconf failed");
- value = 1;
- }
- ad->data_powersaving = setting_create_Gendial_field_groupitem(genlist,
- &(ad->itc[GENDIAL_Type_1text_2icon_divider]),
- /*&(ad->itc[GENDIAL_Type_1text_2icon]), */
- parent,
- setting_main_click_list_ex_ug_cb,
- ug_name,
- SWALLOW_Type_1ICON_1RADIO,
- icon_path,
- NULL,
- value,
- keyStr,
- NULL,
- setting_main_list_mouse_up_cb);
- __BACK_POINTER_SET(ad->data_powersaving);
- item_data = ad->data_powersaving;
-#endif
-
-#if SUPPORT_PSMODE
- ad->data_powersaving = setting_create_Gendial_field_groupitem(genlist,
- &(ad->itc[GENDIAL_Type_1text_1icon_2]),
- parent,
- setting_main_click_list_ex_ug_cb,
- ug_name,
- SWALLOW_Type_INVALID,
- icon_path,
- NULL,
- 0,
- keyStr,
- NULL,
- NULL);
- __BACK_POINTER_SET(ad->data_powersaving);
- item_data = ad->data_powersaving;
- int flight_key;
- int ret = vconf_get_bool(VCONFKEY_TELEPHONY_FLIGHT_MODE, &flight_key);
- if (ret != 0) {
- SETTING_TRACE_ERROR("get vconf failed");
- flight_key = 1;
- }
-
- if (ad->data_powersaving) {
- if (flight_key) {
- setting_disable_genlist_item(ad->data_powersaving->item);
- }
- }
-#endif
- return item_data;
-}
-
-static Setting_GenGroupItem_Data *__driving_handler(void *data, char *keyStr, char *icon_path, char *ug_name, Evas_Object *genlist, Elm_Object_Item *parent)
-{
- /* NOT UG --> it's just UI drawing */
-
- setting_main_appdata *ad = (setting_main_appdata *)data;
- int value;
- int ret = vconf_get_bool(VCONFKEY_SETAPPL_DM_DRIVING_MODE, &value);
- if (ret != 0) {
- SETTING_TRACE_ERROR("get vconf failed");
- value = 1;
- }
- ad->data_driving = setting_create_Gendial_field_groupitem(genlist,
- &(ad->itc[GENDIAL_Type_1text_2icon_divider]),
- /*&(ad->itc[GENDIAL_Type_1text_2icon]), */
- parent,
- setting_main_click_list_ex_ug_cb,
- ug_name,
- SWALLOW_Type_1ICON_1RADIO,
- icon_path,
- NULL,
- value,
- keyStr,
- NULL,
- setting_main_list_mouse_up_cb);
- __BACK_POINTER_SET(ad->data_driving);
- return ad->data_driving;
-}
-
/*//////////////////////////////////////////////////////////////////////////////////////////// */
/* list handler */
static mainlist_entry mainlist_table[] = {
{KeyStr_FlightMode, __default_handler, UG_HANDLE, NULL}, /* 0 --> NOT UG */
- {KeyStr_NetRestrictionMode, __netrestrictionmode_handler, UI_PROC, NULL}, /* 0 --> NOT UG */
{KeyStr_WiFi, __default_handler, UI_PROC, NULL}, /* 1 --> UG */
{KeyStr_Bluetooth, __default_handler, UI_PROC, NULL},
{KeyStr_MobileAP, __mobileap_handler, UG_HANDLE, NULL}, /* 1 --> UG */
- {KeyStr_AllShare, __allshare_handler, UI_PROC, NULL}, /* NOT UG */
{KeyStr_Location, __default_handler, UI_PROC, NULL}, /* 1 --> UG */
{KeyStr_Network, __default_handler, UG_HANDLE, NULL}, /* 1 --> UG */
-#if SUPPORT_NFC
- {KeyStr_NFC, __nfc_handler, UG_HANDLE, NULL}, /* 1 --> UG */
- {KeyStr_SBeam, __sbeam_handler, UG_HANDLE, NULL}, /* 1 --> UG */
-#endif
- {KeyStr_Powersaving, __powersaving_handler, UI_PROC, NULL}, /* 1 --> UG */
- {keystr_Drivingmode, __driving_handler, UI_PROC, NULL}, /* 1 --> UG */
- {KeyStr_Joyn, __joyn_handler, UI_PROC, NULL},
{KeyStr_DeveloperOption, __developer_option_handler, UI_PROC, NULL},
{KeyStr_BacklightTime, __backlight_time_handler, UI_PROC, NULL},
- {KeyStr_BatteryPercent, __battery_percent_handler, UG_HANDLE, NULL},
- {Keystr_ScreenMode, __screen_mode_handler, UG_HANDLE, NULL},
- {KeyStr_HighTouchSens, __default_handler, UI_PROC, NULL},
- /*{KeyStr_Guestmode, __guest_mode_handler,UI_PROC, NULL}, */
- {keystr_Personalmode, __personal_mode_handler, UI_PROC, NULL},
-#if SUPPORT_BLOCKINGMODE
- {keystr_Blockingmode, __blocking_mode_handler, UI_PROC, NULL},
-#endif
- {KeyStr_Brightness, __brightness_handler, UI_PROC, NULL},
- {KeyStr_MultiWindowMode, __multiwindow_mode_handler, UI_PROC, NULL},
- {KeyStr_Landscape, __landscape_handler, UG_HANDLE, NULL},
- {KeyStr_AdjustScreenTone, __adjust_screen_tone_handler, UI_PROC, NULL},
{"Default", __default_handler, DEFAULT_UI, NULL}, /* 1 --> UG */
-
/*-------------------------------------------------------------- */
{NULL, NULL, ERROR_STATE, NULL},
};
SETTING_TRACE_BEGIN;
setting_main_appdata *ad = (setting_main_appdata *) data;
if (!ug_to_load) {
- setting_create_simple_popup(ad, ad->win_main, NULL, NO_UG_FOUND_MSG);
+ setting_create_popup(ad, ad->win_main, NULL, NO_UG_FOUND_MSG, NULL, 0, false, false, 0);
return;
}
SETTING_TRACE("to create libug-%s.so", ug_to_load);
/*SETTING_TRACE_ERROR("errno:%d", errno); */
/*SETTING_TRACE_ERROR("Failed to load /usr/ug/lib/libug-%s.so", ug_to_load); */
/*SETTING_TRACE_ERROR("Failed to load lib-%s.so", ug_to_load); */
- setting_create_simple_popup(ad, ad->win_main, NULL, NO_UG_FOUND_MSG);
- }
-}
-
-void /* obj is the layout clicked */
-setting_main_click_grid_item_ug_cb(void *data, Evas_Object *obj,
- char *ug_to_load, app_control_h svc,
- struct ug_cbs *cbs)
-{
- SETTING_TRACE_BEGIN;
- setting_main_appdata *ad = (setting_main_appdata *) data;
- if (!ug_to_load) {
- setting_create_simple_popup(ad, ad->win_main, NULL, NO_UG_FOUND_MSG);
- return;
- }
-
- SETTING_TRACE("to create libug-%s.so", ug_to_load);
- elm_object_tree_focus_allow_set(ad->ly_main, EINA_FALSE);
-
- /*setting_conformant_keypad_state(ad->win_main, TRUE); */
- ad->ug = setting_ug_create(NULL, ug_to_load, UG_MODE_FULLVIEW, svc, cbs);
- if (ad->ug) {
- ad->isInUGMode = TRUE;
- } else {
- elm_object_tree_focus_allow_set(ad->ly_main, EINA_TRUE);
- evas_object_show(ad->ly_main);
-
- SETTING_TRACE_ERROR("errno:%d", errno);
- }
- /*SETTING_TRACE_END; */
-}
-
-void setting_main_click_list_default_ug_cb(void *data, Evas_Object *obj, void *event_info)
-{
- setting_main_appdata *ad = data;
- setting_create_simple_popup(ad, ad->win_main, NULL,
- NO_UG_FOUND_MSG);
-}
-
-void setting_main_click_list_usb_cb(void *data, Evas_Object *obj, void *event_info)
-{
- SETTING_TRACE_BEGIN;
- retm_if(event_info == NULL, "Invalid argument: event info is NULL");
-
- int err;
- int value = -1;
- char *str_text = USB_NEED_OFF;
-
- Elm_Object_Item *item = (Elm_Object_Item *) event_info;
-
- setting_get_int_slp_key(INT_SLP_SETTING_MOBILE_AP_STATUS, &value, &err);
- if (err != 0) {
- SETTING_TRACE_ERROR("FAIL: VCONFKEY_MOBILE_HOTSPOT_MODE may not exist\n");
- setting_main_click_list_ex_ug_cb(data, obj, item);
- return;
- }
-
- /* If mobile hotspot is on, going USB utilties is blocked by a popup*/
- if (value & VCONFKEY_MOBILE_HOTSPOT_MODE_USB) {
- elm_genlist_item_selected_set(item, EINA_FALSE);
- setting_create_simple_popup(g_main_ad, g_main_ad->win_main, NULL, str_text);
- } else {
- setting_main_click_list_ex_ug_cb(data, obj, item);
- }
-}
-
-void setting_main_kies_via_wifi_care_resp_cb(void *data, Evas_Object *obj,
- void *event_info)
-{
- SETTING_TRACE_BEGIN;
- setting_retm_if(NULL == data, "NULL == data");
- setting_main_appdata *ad = g_main_ad;
- int response_type = btn_type(obj);
-
- if (POPUP_RESPONSE_OK == response_type) {
- /* do nothing.. */
- struct ug_cbs *cbs = (struct ug_cbs *)calloc(1, sizeof(struct ug_cbs));
- setting_retm_if(!cbs, "calloc failed");
- cbs->layout_cb = setting_main_layout_ug_cb;
- cbs->result_cb = setting_main_result_ug_cb;
- cbs->destroy_cb = setting_main_destroy_ug_cb;
- cbs->priv = (void *)ad;
-
- char *path = get_ug_path_from_ug_args(data);
- app_control_h svc = get_bundle_from_ug_args(data);
- setting_main_click_list_item_ug_cb(ad, obj, path, svc, cbs);
- if (path) {
- FREE(path);
- }
- if (cbs) {
- FREE(cbs);
- }
- path = NULL;
- cbs = NULL;
- app_control_destroy(svc);
- } else if (POPUP_RESPONSE_CANCEL == response_type) {
- SETTING_TRACE(" cancel - do nothing ");
- } else {
- SETTING_TRACE(" NOT REACHABLE -- response_type : %d", response_type);
- }
- evas_object_del(ad->popup_kies_via_wifi);
- ad->popup_kies_via_wifi = NULL;
-}
-void setting_main_kies_via_wifi_warn_resp_cb(void *data, Evas_Object *obj,
- void *event_info)
-{
- setting_retm_if(NULL == data, "NULL == data");
- setting_main_appdata *ad = g_main_ad;
- evas_object_del(ad->popup_kies_via_wifi);
- ad->popup_kies_via_wifi = NULL;
-}
-
-
-
-
-void setting_main_click_list_ex_personal_mode_cb(void *data, Evas_Object *obj,
- void *event_info)
-{
- SETTING_TRACE_BEGIN;
- retm_if(event_info == NULL, "Invalid argument: event info is NULL");
- Elm_Object_Item *item = (Elm_Object_Item *) event_info;
-
- elm_genlist_item_selected_set(item, EINA_FALSE);
-
- bool is_running = FALSE;
- app_manager_is_running("org.tizen.setting.personal", &is_running);
- if (!is_running) {
- elm_object_tree_focus_allow_set(g_main_ad->ly_main, EINA_FALSE);
- app_control_h svc;
- if (app_control_create(&svc)) {
- /*FREE(cbs); */
- return;
- }
- app_control_set_app_id(svc, "org.tizen.setting.personal");
- app_control_set_window(svc, elm_win_xwindow_get(g_main_ad->win_main));
- app_control_set_operation(svc, APP_CONTROL_OPERATION_DEFAULT);
- app_control_send_launch_request(svc, NULL, NULL);
- app_control_destroy(svc);
+ setting_create_popup(ad, ad->win_main, NULL, NO_UG_FOUND_MSG, NULL, 0, false, false, 0);
}
}
if (ad->isInUGMode) {
SETTING_TRACE("isInUGMode : TRUE - another UG is running now.");
ad->isInUGMode = FALSE;
- /*SETTING_TRACE_END; */
return;
} else {
- SETTING_TRACE
- ("isInUGMode : FALSE - another UG is NOT running now.")
+ SETTING_TRACE ("isInUGMode : FALSE - another UG is NOT running now.")
}
Setting_GenGroupItem_Data *selected_item_data =
(Setting_GenGroupItem_Data *) elm_object_item_data_get(item);
+ setting_retm_if(NULL == selected_item_data, "selected_item_data is NULL");
setting_main_click_list_item_reset_data(ad, obj);
const char *item_name = _(selected_item_data->keyStr);
SETTING_TRACE("item_name:%s", item_name);
ret_if(!item_name);
- if (!safeStrCmp(KeyStr_KeisOverWifi, selected_item_data->keyStr)) {
- int status = VCONFKEY_MOBEX_ENGINE_STATUS_NOT_CONNECT;
- int methord = VCONFKEY_MOBEX_ENGIN_NONE;
- vconf_get_int(VCONFKEY_MOBEX_ENGINE_STATUS_INT, &status);
- vconf_get_int(VCONFKEY_MOBEX_ENGINE_CONNECTION_METHOD_INT, &methord);
-
- if (status != VCONFKEY_MOBEX_ENGINE_STATUS_NOT_CONNECT
- && methord == VCONFKEY_MOBEX_ENGIN_USB) {
- ad->popup_kies_via_wifi =
- setting_create_popup_with_btn(data, ad->win_main,
- NULL, Kies_Warrning_Str,
- setting_main_kies_via_wifi_warn_resp_cb,
- 0, 1, "IDS_COM_SK_OK");
- } else {
- ad->popup_kies_via_wifi = setting_create_popup_with_btn(data,
- ad->win_main,
- NULL, _(Kies_Caring_Str),
- setting_main_kies_via_wifi_care_resp_cb,
- 0, 2, "IDS_COM_SK_OK", "IDS_COM_SK_CANCEL");
- }
- return;
- }
-
-
- if (safeStrCmp(selected_item_data->keyStr, KeyStr_MoreDisplay) == 0) {
+ /* if current selection is for App control lauching style */
+ Setting_Cfg_Node_T *pnode = get_cfg_node_by_keystr(selected_item_data->keyStr);
+ if (pnode == NULL) {
+ SETTING_TRACE_ERROR (" *** pnode is NULL *** ");
return;
}
-
- if (!safeStrCmp(selected_item_data->keyStr, KeyStr_Call)
- || !safeStrCmp(selected_item_data->keyStr, keystr_Blockingmode)
- || !safeStrCmp(selected_item_data->keyStr, keystr_Drivingmode)
- || !safeStrCmp(selected_item_data->keyStr, KeyStr_SimMgr)
- || !safeStrCmp(selected_item_data->keyStr, KeyStr_WiFi)
- || !safeStrCmp(selected_item_data->keyStr, KeyStr_Location)
- || !safeStrCmp(selected_item_data->keyStr, KeyStr_Bluetooth)
- || !safeStrCmp(selected_item_data->keyStr, KeyStr_MobileAP)
- || !safeStrCmp(selected_item_data->keyStr, KeyStr_WiFiDirect)
- || !safeStrCmp(selected_item_data->keyStr, KeyStr_Wallpaper)
- ) {
+ if (pnode && pnode->item_type == Cfg_Item_AppLauncher_Node) {
if (app_launcher(data) == 0) {
ad->event_freeze_timer = ecore_timer_add(1, setting_main_freeze_event_timer_cb, ad);
evas_object_freeze_events_set(ad->navibar_main, EINA_TRUE);
return;
}
- /*special checking: */
- /*1.powersaving cannot work when Flightmode on */
- if (safeStrCmp(selected_item_data->keyStr, KeyStr_Powersaving) == 0) {
- int status = 0;
- vconf_get_bool(VCONFKEY_TELEPHONY_FLIGHT_MODE, &status);
- if (status) {
- setting_create_simple_popup(NULL, ad->win_main,
- NULL, "IDS_IM_POP_THIS_FEATURE_IS_NOT_AVAILABLE_WHILE_FLIGHT_MODE_IS_ON");
- return;
- }
- }
-
- /*2.Quick command cannot work when TTS on */
- int tts_state = 0;
- vconf_get_bool(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, &tts_state);
- if (tts_state) {
- if (!safeStrCmp(selected_item_data->keyStr, KeyStr_QUICK_CMD)) {
- char noti_str[MAX_SPECIALIZITION_LEN + 1] = { 0, };
- snprintf(noti_str, sizeof(noti_str), _(FEATURE_UNAVALIABLE_WHILE_TTS_ON), _(KeyStr_QUICK_CMD));
- setting_create_popup_without_btn(NULL, ad->win_main, NULL, _(noti_str),
- NULL, 0.0, TRUE, FALSE);
- return;
- }
- }
-
+ /* handling of UG style */
struct ug_cbs *cbs = (struct ug_cbs *)calloc(1, sizeof(struct ug_cbs));
setting_retm_if(!cbs, "calloc failed");
cbs->layout_cb = setting_main_layout_ug_cb;
path = NULL;
cbs = NULL;
app_control_destroy(svc);
-
-}
-
-#if SUPPORT_BLOCKINGMODE
-static void
-___blocking_mode_resp_cb(void *data, Evas_Object *obj, void *event_info)
-{
- SETTING_TRACE_BEGIN;
- setting_retm_if(obj == NULL, "obj parameter is NULL");
- setting_retm_if(data == NULL, "Data parameter is NULL");
- int reposnse_type = btn_type(obj);
- if (g_main_ad->popup_blocking_mode) {
- evas_object_del(g_main_ad->popup_blocking_mode);
- g_main_ad->popup_blocking_mode = NULL;
- }
- switch (reposnse_type) {
- case POPUP_RESPONSE_OK: {
- if (g_main_ad->isInUGMode && g_main_ad->ug) {
- SETTING_TRACE("[ad->ug non-NULL]skip genlist click event!!");
-
- return;
- }
-
- setting_main_appdata *ad = g_main_ad;
-
- /* if UG is created by Setting app, setting_main_click_list_ex_ug_cb is diabled. */
- if (ad->isInUGMode) {
- SETTING_TRACE("isInUGMode : TRUE - another UG is running now.");
- ad->isInUGMode = FALSE;
- return;
- } else {
- SETTING_TRACE
- ("isInUGMode : FALSE - another UG is NOT running now.")
- }
-
- Setting_GenGroupItem_Data *list_item = (Setting_GenGroupItem_Data *) data;
- SETTING_TRACE("process item [%s]", list_item->keyStr);
- list_item->chk_status = elm_check_state_get(obj); /* for update new state */
-
- if (!list_item->chk_status) {
- vconf_set_bool(VCONFKEY_SETAPPL_BLOCKINGMODE_BLOCKINGMODE, !list_item->chk_status);
- }
-
- struct ug_cbs *cbs = (struct ug_cbs *)calloc(1, sizeof(struct ug_cbs));
- setting_retm_if(!cbs, "calloc failed");
- cbs->layout_cb = setting_main_layout_ug_cb;
- cbs->result_cb = setting_main_result_ug_cb;
- cbs->destroy_cb = setting_main_destroy_ug_cb;
- cbs->priv = (void *)ad;
- char *ug_args = NULL;
-
- char *keyStr = NULL;
- int i, j;
-
- for (i = 0; i < setting_cfg_get_category_length(); i++) {
- for (j = 0; j < setting_cfg_get_menu_length(i); j++) {
- keyStr = setting_cfg_get_keyname_idx(i, j);
- if (!safeStrCmp(keystr_Blockingmode, keyStr)) {
- ug_args = setting_cfg_get_ug_args_idx(i, j);
- break;
- }
- }
- }
-
- if (ug_args) {
- setting_create_quickpannel_notification("setting-blockingmode-efl",
- NOTIFICATION_TYPE_ONGOING,
- NOTIFICATION_LY_ONGOING_EVENT,
- "IDS_ST_BODY_BLOCKING_MODE",
- "IDS_ST_BODY_BLOCKING_MODE_IS_ENABLED",
- IMG_BlockingMode, &ad->noti_id);
- char *path = get_ug_path_from_ug_args(ug_args);
- app_control_h svc = get_bundle_from_ug_args(ug_args);
- setting_main_click_list_item_ug_cb(ad, obj, path, svc, cbs);
- FREE(path);
- app_control_destroy(svc);
- } else {
- SETTING_TRACE("blocking mode not found");
- }
- FREE(cbs);
-
- }
- default:
- break;
- }
-}
-#endif
-
-#if SUPPORT_DRIVINGMODE
-static void
-___driving_mode_resp_cb(void *data, Evas_Object *obj, void *event_info)
-{
- SETTING_TRACE_BEGIN;
- setting_retm_if(obj == NULL, "obj parameter is NULL");
- setting_retm_if(data == NULL, "Data parameter is NULL");
- int reposnse_type = btn_type(obj);
- if (g_main_ad->driving_mode_popup) {
- evas_object_del(g_main_ad->driving_mode_popup);
- g_main_ad->driving_mode_popup = NULL;
- }
- switch (reposnse_type) {
- case POPUP_RESPONSE_OK: {
- if (g_main_ad->isInUGMode && g_main_ad->ug) {
- SETTING_TRACE("[ad->ug non-NULL]skip genlist click event!!");
-
- return;
- }
-
- setting_main_appdata *ad = g_main_ad;
-
- /* if UG is created by Setting app, setting_main_click_list_ex_ug_cb is diabled. */
- if (ad->isInUGMode) {
- SETTING_TRACE("isInUGMode : TRUE - another UG is running now.");
- ad->isInUGMode = FALSE;
- return;
- } else {
- SETTING_TRACE
- ("isInUGMode : FALSE - another UG is NOT running now.");
- }
-
- Setting_GenGroupItem_Data *list_item = (Setting_GenGroupItem_Data *) data;
- if (list_item && list_item->keyStr) {
- SETTING_TRACE("process item [%s]", list_item->keyStr);
- }
- list_item->chk_status = elm_check_state_get(obj); /* for update new state */
-
- if (!list_item->chk_status) {
- vconf_set_bool(VCONFKEY_SETAPPL_DRIVINGMODE_DRIVINGMODE, !list_item->chk_status);
- }
-
- struct ug_cbs *cbs = (struct ug_cbs *)calloc(1, sizeof(struct ug_cbs));
- setting_retm_if(!cbs, "calloc failed");
- cbs->layout_cb = setting_main_layout_ug_cb;
- cbs->result_cb = setting_main_result_ug_cb;
- cbs->destroy_cb = setting_main_destroy_ug_cb;
- cbs->priv = (void *)ad;
- char *ug_args = NULL;
-
- char *keyStr = NULL;
- int i, j;
-
- for (i = 0; i < setting_cfg_get_category_length(); i++) {
- for (j = 0; j < setting_cfg_get_menu_length(i); j++) {
- keyStr = setting_cfg_get_keyname_idx(i, j);
- if (!safeStrCmp(keystr_Drivingmode, keyStr)) {
- ug_args = setting_cfg_get_ug_args_idx(i, j);
- break;
- }
- }
- }
-
- if (ug_args) {
- /*__driving_mode_create_noti(ad,"IDS_ST_BODY_INCOMING_CALLS_AND_NEW_NOTIFICATIONS_WILL_BE_READ_OUT_AUTOMATICALLY"); */
- setting_create_quickpannel_notification("setting-drivingmode-efl",
- NOTIFICATION_TYPE_ONGOING,
- NOTIFICATION_LY_ONGOING_EVENT,
- keystr_Drivingmode,
- "IDS_ST_BODY_INCOMING_CALLS_AND_NEW_NOTIFICATIONS_WILL_BE_READ_OUT_AUTOMATICALLY",
- IMG_DrivingMode, &ad->noti_id);
-
- char *path = get_ug_path_from_ug_args(ug_args);
- app_control_h svc = get_bundle_from_ug_args(ug_args);
- setting_main_click_list_item_ug_cb(ad, obj, path, svc, cbs);
- FREE(path);
- app_control_destroy(svc);
- } else {
- SETTING_TRACE("driving mode not found");
- }
- FREE(cbs);
-
- }
- default:
- break;
- }
-}
-#endif
-
-
-/**
- * toggle cb
- */
-static void __personal_mode_cb(app_control_h request, app_control_h reply, app_control_result_e result, void *user_data)
-{
- SETTING_TRACE_BEGIN;
- ret_if(!user_data);
-
- Setting_GenGroupItem_Data *item = (Setting_GenGroupItem_Data *)user_data;
-
- /* Rollback toggle before applying */
- int status = 0;
- vconf_get_bool(VCONFKEY_SETAPPL_PERSONAL_MODE_STATUS_BOOL, &status);
- item->chk_status = status;
- elm_check_state_set(item->eo_check, item->chk_status);
-}
-
-void setting_main_list_mouse_up_cb(void *data, Evas_Object *eo,
- void *event_info)
-{
- /*SETTING_TRACE_BEGIN; */
- retm_if(data == NULL, "Data parameter is NULL");
- Setting_GenGroupItem_Data *list_item =
- (Setting_GenGroupItem_Data *) data;
- SETTING_TRACE("process item [%s]", list_item->keyStr);
- list_item->chk_status = elm_check_state_get(eo); /* for update new state */
-
- SETTING_TRACE("change radio[%s], status is:%d", _(list_item->keyStr),
- list_item->chk_status);
- setting_main_appdata *ad = g_main_ad;
-
- if (!safeStrCmp(KeyStr_UsePacketData, list_item->keyStr)) {
- int err;
- if (elm_check_state_get(eo)) {
- setting_set_bool_slp_key
- (BOOL_SLP_SETTING_USE_PACKET_DATA,
- SETTING_ON_OFF_BTN_ON, &err);
- } else {
- setting_set_bool_slp_key
- (BOOL_SLP_SETTING_USE_PACKET_DATA,
- SETTING_ON_OFF_BTN_OFF, &err);
- }
-#if SUPPORT_DRIVINGMODE
- } else if (!safeStrCmp(keystr_Drivingmode, list_item->keyStr)) {
- /*if set on, need to add popup */
- if (list_item->chk_status) {
- if (!check_drivingmode_sub_item()) {
- g_main_ad->driving_mode_popup = setting_create_popup_with_btn(list_item, ad->win_main,
- NULL, "IDS_ST_POP_TO_ENABLE_HANDS_FREE_MODE_ENABLE_AT_LEAST_ONE_RELEVANT_FUNCTION",
- ___driving_mode_resp_cb, 0,
- 2, "IDS_COM_SK_OK", "IDS_COM_SK_CANCEL");
- list_item->chk_status = !list_item->chk_status;
- elm_genlist_item_update(list_item->item);
- return;
- }
- } else {
- /* */
- }
- vconf_set_bool(VCONFKEY_SETAPPL_DRIVINGMODE_DRIVINGMODE, list_item->chk_status);
-
- /* call the set_state */
- Setting_Cfg_Node_T *pnode = get_cfg_node_by_keystr(_(list_item->keyStr));
- if (pnode && pnode->tfunc && pnode->tfunc->set_item_state) {
- pnode->tfunc->set_item_state(list_item->chk_status, NULL, ad);
- }
-#endif
-#if SUPPORT_BLOCKINGMODE
- } else if (!safeStrCmp(keystr_Blockingmode, list_item->keyStr)) {
-
- if (list_item->chk_status) {
- if (!check_blockingmode_sub_item()) {
- g_main_ad->popup_blocking_mode = setting_create_popup_with_btn(ad, ad->win_main,
- NULL, "IDS_ST_BODY_TO_ENABLE_BLOCKING_MODE_ENABLE_AT_LEAST_ONE_OPTION",
- ___blocking_mode_resp_cb, 0,
- 2, "IDS_COM_SK_OK", "IDS_COM_SK_CANCEL");
- list_item->chk_status = !list_item->chk_status;
- elm_genlist_item_update(list_item->item);
- return;
- }
- } else {
- vconf_set_bool(VCONFKEY_SETAPPL_BLOCKINGMODE_INCOMINGCALL, FALSE);
- vconf_set_bool(VCONFKEY_SETAPPL_BLOCKINGMODE_NOTIFICATIONS, FALSE);
- vconf_set_bool(VCONFKEY_SETAPPL_BLOCKINGMODE_ALARM_AND_TIMER, FALSE);
- vconf_set_bool(VCONFKEY_SETAPPL_BLOCKINGMODE_LED_INDICATOR, FALSE);
- }
- vconf_set_bool(VCONFKEY_SETAPPL_BLOCKINGMODE_BLOCKINGMODE, list_item->chk_status);
-
- Setting_Cfg_Node_T *pnode = get_cfg_node_by_keystr(_(list_item->keyStr));
-
- if (pnode && pnode->tfunc && pnode->tfunc->set_item_state) {
- pnode->tfunc->set_item_state(list_item->chk_status, NULL, ad);
- }
-#endif
-#if SUPPORT_PERSONALPAGE
- } else if (!safeStrCmp(keystr_Personalmode, list_item->keyStr)) {
- /*personalmode_toggle_set_state(list_item->chk_status, NULL, ad); */
- if (Cfg_Item_Error == list_item->chk_status) return;
-
- bool is_running = FALSE;
- app_manager_is_running("org.tizen.setting.personal", &is_running);
- if (!is_running) {
- elm_object_tree_focus_allow_set(ad->ly_main, EINA_FALSE);
- app_control_h svc;
- if (app_control_create(&svc)) {
- return;
- }
- /* verify current key */
- app_control_add_extra_data(svc, "viewtype", "unlock_method");
- app_control_set_app_id(svc, "org.tizen.setting.personal");
- app_control_set_window(svc, elm_win_xwindow_get(ad->win_main));
- app_control_set_operation(svc, APP_CONTROL_OPERATION_DEFAULT);
- app_control_send_launch_request(svc, __personal_mode_cb, ad->data_temp);
- app_control_destroy(svc);
- }
-#endif
-
-#if SUPPORT_GUESTMODE
- } else if (!safeStrCmp(KeyStr_Guestmode, list_item->keyStr)) {
- vconf_set_bool(VCONFKEY_SETAPPL_GM_GUEST_MODE, list_item->chk_status);
-#endif
-
-#if SUPPORT_POWERSAVING
- } else if (!safeStrCmp(KeyStr_Powersaving, list_item->keyStr)) {
- if (list_item->chk_status) {
- if (!check_powersaving_sub_item()) {
- setting_create_popup_without_btn(ad, ad->win_main, NULL,
- "IDS_ST_BODY_TO_ENABLE_POWER_SAVING_MODE_ENABLE_AT_LEAST_ONE_FUNCTION",
- NULL, POPUP_INTERVAL, FALSE, FALSE);
- list_item->chk_status = !list_item->chk_status;
- }
- }
- vconf_set_bool(VCONFKEY_SETAPPL_PWRSV_SYSMODE_STATUS, list_item->chk_status);
- vconf_set_int(VCONFKEY_SETAPPL_PSMODE, list_item->chk_status);
- } else if (!safeStrCmp(KeyStr_MultiWindowMode, list_item->keyStr)) {
- /*Multi window toggle action */
- /*elm_genlist_item_update(list_item->item); */
- int ret = vconf_set_bool(VCONFKEY_QUICKSETTING_MULTIWINDOW_ENABLED, list_item->chk_status);
- if (ret != 0) {
- SETTING_TRACE_ERROR("Set multi window vconf failed.");
- }
-#endif
- }
- return;
-}
-
-
-
-
-static void ___wifi_activated_cb(wifi_error_e result, void *user_data)
-{
- SETTING_TRACE_BEGIN;
- if (result == WIFI_ERROR_NONE) {
- SETTING_TRACE("Wi-Fi Activation Succeeded");
- } else {
- SETTING_TRACE("Wi-Fi Activation Failed! error : %d", result);
- }
-
- (void)wifi_deinitialize();
-}
-
-#if SUPPORT_TETHERING
-static void __tethering_disabled_cb(tethering_error_e error, tethering_type_e type, tethering_disabled_cause_e code, void *data)
-{
- int ret;
-
- if (data) {
- tethering_h th = (tethering_h)data;
- tethering_destroy(th);
- }
-
- ret = wifi_initialize();
- setting_retm_if(ret < 0, "*** [ERR] wifi_initialize() ***");
-
- ret = wifi_activate(___wifi_activated_cb, NULL);
- if (ret < 0) {
- SETTING_TRACE_ERROR("*** [ERR] wifi_activate() ***");
- (void)wifi_deinitialize();
- return;
- }
-}
-#endif
-
-static Eina_Bool __wifi_timeout(void *data)
-{
- /*SETTING_TRACE_BEGIN; */
- retvm_if(!data, ECORE_CALLBACK_CANCEL, "Invalid argument: data is NULL");
- Setting_GenGroupItem_Data *list_item = data;
- int status, err;
- setting_get_int_slp_key(INT_SLP_SETTING_WIFI_STATUS, &status, &err);
- SETTING_TRACE("value:%d", status);
-
- int i;
- for (i = VIEW_All_List; i < VIEW_Max; i++) {
- list_item = g_main_ad->gl_data_item[i][GL_WiFi];
- if (list_item) {
- list_item->chk_status = status;
- list_item->swallow_type = SWALLOW_Type_1ICON_1RADIO;
- elm_object_item_data_set(list_item->item, list_item);
- elm_genlist_item_update(list_item->item);
- setting_main_appdata *ad = list_item->userdata;
- ad->wifi_timer = NULL;
- }
- }
-
- return ECORE_CALLBACK_CANCEL;
-}
-
-static void __tethering_turn_off_resp_cb(void *data, Evas_Object *obj, void *event_info)
-{
- setting_retm_if(NULL == obj, "NULL == obj");
- int response_type = btn_type(obj);
- Setting_GenGroupItem_Data *list_item = (Setting_GenGroupItem_Data *)data;
-
- if (g_main_ad) {
- evas_object_del(g_main_ad->popup_wifi_mode);
- g_main_ad->popup_wifi_mode = NULL;
- }
-
- int i = 0;
- Setting_GenGroupItem_Data *update_item = NULL;
- if (POPUP_RESPONSE_OK == response_type) {
- /*add timeout strategy.. */
- ret_if(!list_item->userdata);
- setting_main_appdata *ad = list_item->userdata;
- if (ad->wifi_timer) {
- ecore_timer_del(ad->wifi_timer);
- ad->wifi_timer = NULL;
- }
- ad->wifi_timer = ecore_timer_add(5.0, (Ecore_Task_Cb) __wifi_timeout, list_item);
-
-#if SUPPORT_TETHERING
- int type = tethering_is_enabled(NULL, TETHERING_TYPE_WIFI) ? TETHERING_TYPE_WIFI : TETHERING_TYPE_WIFI_AP;
-
- tethering_h th = NULL;
- tethering_error_e ret = TETHERING_ERROR_NONE;
-
- ret = tethering_create(&th);
- if (ret != TETHERING_ERROR_NONE) {
- for (i = VIEW_All_List; i < VIEW_Max; i++) {
- update_item = ad->gl_data_item[i][GL_WiFi];
- if (update_item) {
- update_item->chk_status = EINA_FALSE;
- update_item->swallow_type = SWALLOW_Type_1ICON_1RADIO;
- elm_object_item_data_set(update_item->item, update_item);
- elm_genlist_item_update(update_item->item);
- }
- }
- }
-
- ret = tethering_set_disabled_cb(th, type, __tethering_disabled_cb, th);
- if (ret != TETHERING_ERROR_NONE) {
- for (i = VIEW_All_List; i < VIEW_Max; i++) {
- update_item = ad->gl_data_item[i][GL_WiFi];
- if (update_item) {
- update_item->chk_status = EINA_FALSE;
- update_item->swallow_type = SWALLOW_Type_1ICON_1RADIO;
- elm_object_item_data_set(update_item->item, update_item);
- elm_genlist_item_update(update_item->item);
- }
- }
-
- tethering_destroy(th);
- return;
- }
-
- (void) tethering_disable(th, type);
-#endif
- } else if (POPUP_RESPONSE_CANCEL == response_type) {
- for (i = VIEW_All_List; i < VIEW_Max; i++) {
- update_item = g_main_ad->gl_data_item[i][GL_WiFi];
- if (update_item) {
- update_item->chk_status = EINA_FALSE;
- update_item->swallow_type = SWALLOW_Type_1ICON_1RADIO;
- elm_object_item_data_set(update_item->item, update_item);
- elm_genlist_item_update(update_item->item);
- }
- }
- }
-}
-
-
-void __alternate_wifi_mode(Setting_GenGroupItem_Data *list_item, Evas_Object *check)
-{
- /*SETTING_TRACE_BEGIN; */
- /*int ret; */
- Eina_Bool status = elm_check_state_get(check);
- SETTING_TRACE("wifi mode status : %d", status);
-
- /*int value, err; */
- int i = 0;
- Setting_GenGroupItem_Data *item_to_update = NULL;
-
-#if SUPPORT_TETHERING
- if (tethering_is_enabled(NULL, TETHERING_TYPE_WIFI)
- || tethering_is_enabled(NULL, TETHERING_TYPE_WIFI_AP)) {
- for (i = VIEW_All_List; i < VIEW_Max; i++) {
- item_to_update = g_main_ad->gl_data_item[i][GL_WiFi];
- if (item_to_update) {
- item_to_update->swallow_type = SWALLOW_Type_1ICON_1PROCESS;
- elm_object_item_data_set(item_to_update->item, item_to_update);
- elm_genlist_item_fields_update(item_to_update->item, "elm.icon.2", ELM_GENLIST_ITEM_FIELD_CONTENT);
- }
- }
-
- g_main_ad->popup_wifi_mode = setting_create_popup_with_btn(list_item,
- g_main_ad->win_main, NULL,
- "IDS_MOBILEAP_POP_TURNING_ON_WI_FI_WILL_DISABLE_MOBILE_HOTSPOT_CONTINUE_Q_VZW",
- __tethering_turn_off_resp_cb,
- 0, 2, "IDS_COM_SK_OK", "IDS_COM_SK_CANCEL");
- } else
-#endif
- {
- int wifi_state = VCONFKEY_WIFI_OFF;
- vconf_get_int(VCONFKEY_WIFI_STATE, &wifi_state);
- DBusMessageIter iter;
- DBusMessage *message = NULL;
- DBusConnection *connection = NULL;
- SETTING_TRACE("status:%d", status);
- if (status) {
- if (wifi_state != VCONFKEY_WIFI_OFF) {
- /* Wi-Fi is enabled */
- SETTING_TRACE("Wi-Fi is already enabled");
- return ;
- }
- connection = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
- if (connection == NULL) {
- SETTING_TRACE_ERROR("Failed to get system bus");
- return;
- }
-
- message = dbus_message_new_method_call(NETCONFIG_SERVICE, NETCONFIG_WIFI_PATH,
- NETCONFIG_WIFI_INTERFACE, "LoadDriver");
- if (message == NULL) {
- SETTING_TRACE_ERROR("Failed DBus method call");
- dbus_connection_unref(connection);
- return ;
- }
-
- g_main_ad->wifi_op = OP_WIFI_TURNING_ON;
-
- dbus_message_iter_init_append(message, &iter);
- dbus_bool_t val = FALSE;
- dbus_message_iter_append_basic(&iter, DBUS_TYPE_BOOLEAN, &val);
-
- dbus_connection_send_with_reply(connection, message, NULL, 10000);
-
- dbus_message_unref(message);
- dbus_connection_unref(connection);
-
- } else {
- if (wifi_state == VCONFKEY_WIFI_OFF) {
- /* Wi-Fi is disabled */
- SETTING_TRACE("Wi-Fi is already disabled");
- return ;
- }
-
- connection = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
- if (connection == NULL) {
- SETTING_TRACE_ERROR("Failed to get system bus");
- return;
- }
-
- message = dbus_message_new_method_call(NETCONFIG_SERVICE, NETCONFIG_WIFI_PATH,
- NETCONFIG_WIFI_INTERFACE, "RemoveDriver");
- if (message == NULL) {
- SETTING_TRACE_ERROR("Failed DBus method call");
- dbus_connection_unref(connection);
- return;
- }
- g_main_ad->wifi_op = OP_WIFI_TURNING_OFF;
-
- dbus_connection_send_with_reply(connection, message, NULL, 10000);
-
- dbus_message_unref(message);
- dbus_connection_unref(connection);
-
- }
-
- for (i = VIEW_All_List; i < VIEW_Max; i++) {
- item_to_update = g_main_ad->gl_data_item[i][GL_WiFi];
- if (item_to_update) {
- item_to_update->swallow_type = SWALLOW_Type_1ICON_1PROCESS;
- elm_object_item_data_set(item_to_update->item, item_to_update);
- elm_genlist_item_fields_update(item_to_update->item, "elm.icon.2", ELM_GENLIST_ITEM_FIELD_CONTENT);
-
- }
- }
-
- /*add timeout strategy.. */
- ret_if(!list_item->userdata);
- setting_main_appdata *ad = list_item->userdata;
- if (ad->wifi_timer) {
- ecore_timer_del(ad->wifi_timer);
- ad->wifi_timer = NULL;
- }
- ad->wifi_timer = ecore_timer_add(5.0, (Ecore_Task_Cb) __wifi_timeout, list_item);
- }
}
-
-static Eina_Bool __bt_timeout(void *data)
-{
- /*SETTING_TRACE_BEGIN; */
- retvm_if(!data, ECORE_CALLBACK_CANCEL, "Invalid argument: data is NULL");
- int status, err;
- setting_get_bool_slp_key(INT_SLP_SETTING_BT_STATUS, &status, &err);
- SETTING_TRACE("value:%d", status);
-
- setting_main_appdata *ad = data;
- Setting_GenGroupItem_Data *item_to_update;
- int i;
- for (i = VIEW_All_List; i < VIEW_Max; i++) {
- item_to_update = ad->gl_data_item[i][GL_BT];
- SETTING_TRACE("[%d]item_to_update:%p", i, item_to_update);
- if (item_to_update) {
- item_to_update->chk_status = status;
- item_to_update->swallow_type = SWALLOW_Type_1ICON_1RADIO;
- elm_object_item_data_set(item_to_update->item, item_to_update);
- /*elm_genlist_item_fields_update(item_to_update->item, "*", ELM_GENLIST_ITEM_FIELD_STATE); */
- elm_genlist_item_update(item_to_update->item);
- }
- }
-
-
- ad->bt_timer = NULL;
- return ECORE_CALLBACK_CANCEL;
-}
-
-void __alternate_bt_mode(Setting_GenGroupItem_Data *list_item, Evas_Object *check)
-{
- /*SETTING_TRACE_BEGIN; */
- int ret;
- Eina_Bool status = elm_check_state_get(check);
- SETTING_TRACE("bt mode status : %d", status);
-
- bt_adapter_state_e value;
- ret = bt_initialize();
- if (bt_adapter_get_state(&value) != BT_ERROR_NONE) {
- SETTING_TRACE_ERROR("bt_adapter_get_state() failed ");
- return;
- }
-
- setting_main_appdata *ad = g_main_ad;
-
- if (status == value) {
- SETTING_TRACE("status == value");
- int i;
- for (i = VIEW_All_List; i < VIEW_Max; i++) {
- setting_force_update_gl_item_chk_status(ad->gl_data_item[i][GL_BT], value);
- }
- return;
- }
- do {
- /*add timeout strategy.. */
- Setting_GenGroupItem_Data *item_to_update;
- int i;
- for (i = VIEW_All_List; i < VIEW_Max; i++) {
- item_to_update = ad->gl_data_item[i][GL_BT];
- SETTING_TRACE("[%d]item_to_update:%p", i, item_to_update);
- if (item_to_update) {
- item_to_update->swallow_type = SWALLOW_Type_1ICON_1PROCESS;
- elm_object_item_data_set(item_to_update->item, item_to_update);
- /*elm_genlist_item_update(list_item->item); */
- elm_genlist_item_fields_update(item_to_update->item, "elm.icon.2", ELM_GENLIST_ITEM_FIELD_CONTENT);
- }
- }
- SETTING_TRACE("1111");
- if (ad->bt_timer) {
- ecore_timer_del(ad->bt_timer);
- ad->bt_timer = NULL;
- }
- ad->bt_timer = ecore_timer_add(5.0, (Ecore_Task_Cb) __bt_timeout, ad);
-
- if (ret < 0) {
- break;
- }
- status ? (ret = bt_adapter_enable()) : (ret = bt_adapter_disable());
- if (ret < 0) {
- break;
- }
- ret = bt_deinitialize();
- if (ret < 0) {
- break;
- }
-
- return;
- } while (0);
-
- int err;
- int val = 0;
- setting_get_int_slp_key(INT_SLP_SETTING_BT_STATUS, &val, &err);
- setting_force_update_gl_item_chk_status(list_item, val);
-}
-
-static Eina_Bool __nfc_timeout(void *data)
-{
- /*SETTING_TRACE_BEGIN; */
- retvm_if(!data, ECORE_CALLBACK_CANCEL, "Invalid argument: data is NULL");
- setting_main_appdata *ad = data;
- Setting_GenGroupItem_Data *list_item = NULL;
- int status, err;
- setting_get_bool_slp_key(BOOL_SLP_SETTING_NFC_STATUS, &status, &err);
- SETTING_TRACE("value:%d", status);
-
-
- int i;
- for (i = VIEW_All_List; i < VIEW_Max; i++) {
- list_item = ad->gl_data_item[i][GL_NFC];
- if (list_item) {
- list_item->chk_status = status;
- list_item->swallow_type = SWALLOW_Type_1ICON_1RADIO;
- elm_object_item_data_set(list_item->item, list_item);
- elm_genlist_item_update(list_item->item);
- }
- /* disable sbeam */
- list_item = ad->gl_data_item[i][GL_SBeam];
- setting_genlist_item_disabled_set(list_item, 0);
- }
-
-
- ad->nfc_timer = NULL;
- return ECORE_CALLBACK_CANCEL;
-}
-
-#if SUPPORT_NFC
-static void __nfc_activation_completed_cb(nfc_error_e error, void *data)
-{
- SETTING_TRACE_BEGIN;
- setting_main_appdata *ad = data;
- if (error == NFC_ERROR_NONE) {
- Setting_GenGroupItem_Data *list_item;
- int status;
- vconf_get_bool(VCONFKEY_NFC_STATE, &status);
- SETTING_TRACE("value:%d", status);
-
- int i;
- for (i = VIEW_All_List; i < VIEW_Max; i++) {
- list_item = ad->gl_data_item[i][GL_NFC];
- if (list_item) {
- list_item->chk_status = status;
- list_item->swallow_type = SWALLOW_Type_1ICON_1RADIO;
- elm_object_item_data_set(list_item->item, list_item);
- elm_genlist_item_fields_update(list_item->item, "elm.icon.2", ELM_GENLIST_ITEM_FIELD_CONTENT);
- }
- }
-
-
- if (nfc_manager_deinitialize() != NFC_ERROR_NONE) {
- SETTING_TRACE_ERROR("failed on nfc_manager_deinitialize");
- }
- /* error - none */
- ad->nfc_try_activate_running = EINA_FALSE;
- /*SETTING_TRACE("nfc_try_activate_running - FALSE"); */
-
- Evas_Object *old_list = elm_object_part_content_get(ad->ly_topview, "content");
- if (old_list == ad->search_genlist) {
- SETTING_TRACE("Already be in search mode");
- elm_genlist_realized_items_update(ad->search_genlist);
- }
-
- /* enable sbeam */
- Setting_GenGroupItem_Data *item_to_update;
- for (i = VIEW_All_List; i < VIEW_Max; i++) {
- item_to_update = ad->gl_data_item[i][GL_SBeam];
- setting_genlist_item_disabled_set(item_to_update, 0);
- }
- }
-
-}
-
-void setting_alternate_nfc_mode(Setting_GenGroupItem_Data *list_item, Eina_Bool status)
-{
- SETTING_TRACE_BEGIN;
- setting_main_appdata *ad = g_main_ad;
- int ret = 0;
- SETTING_TRACE(".......nfc mode status : %d", status);
- SETTING_TRACE("nfc_manager_is_activated:%d", nfc_manager_is_activated());
-
- if (status == nfc_manager_is_activated()) {
- return;
- }
-
- ad->nfc_try_activate_running = EINA_TRUE;
- /*SETTING_TRACE("nfc_try_activate_running - TRUE"); */
-
- /* disable sbeam */
- Setting_GenGroupItem_Data *item_to_update;
- int i;
- /* disable sbeam */
- for (i = VIEW_All_List; i < VIEW_Max; i++) {
- item_to_update = ad->gl_data_item[i][GL_SBeam];
- setting_genlist_item_disabled_set(item_to_update, 1);
- }
-
- ret = nfc_manager_initialize(NULL, NULL);
- if (ret != NFC_ERROR_NONE) {
- /*init error */
- SETTING_TRACE_ERROR("failed on nfc_manager_initialize");
- goto error_handle;
- }
- ret = nfc_manager_set_activation(status, __nfc_activation_completed_cb, ad);
- if (ret != NFC_ERROR_NONE) {
- /*active error */
- SETTING_TRACE_ERROR("failed on nfc_manager_set_activation");
- goto error_handle;
- }
-
- for (i = 0; i < VIEW_Max; i++) {
- item_to_update = ad->gl_data_item[i][GL_NFC];
- if (item_to_update) {
- item_to_update->swallow_type = SWALLOW_Type_1ICON_1PROCESS;
- elm_object_item_data_set(item_to_update->item, item_to_update);
- elm_genlist_item_fields_update(item_to_update->item, "elm.icon.2", ELM_GENLIST_ITEM_FIELD_CONTENT);
-
- }
- }
- /*add timeout strategy.. */
- if (ad->nfc_timer) {
- ecore_timer_del(ad->nfc_timer);
- ad->nfc_timer = NULL;
- }
- ad->nfc_timer = ecore_timer_add(5.0, (Ecore_Task_Cb) __nfc_timeout, ad);
- return;
-
-error_handle:
- ad->nfc_try_activate_running = EINA_TRUE;
- int state, err;
- setting_get_bool_slp_key(BOOL_SLP_SETTING_NFC_STATUS, &state, &err);
- SETTING_TRACE("value:%d", state);
- for (i = VIEW_All_List; i < VIEW_Max; i++) {
- /* disable sbeam */
- item_to_update = ad->gl_data_item[i][GL_SBeam];
- setting_genlist_item_disabled_set(item_to_update, 0);
-
- item_to_update = ad->gl_data_item[i][GL_NFC];
- if (item_to_update) {
- item_to_update->chk_status = state;
- item_to_update->swallow_type = SWALLOW_Type_1ICON_1RADIO;
- elm_object_item_data_set(item_to_update->item, item_to_update);
- elm_genlist_item_update(item_to_update->item);
- }
- }
-}
-
-static void __nfc_activation_completed_cb_when_enbale_sbeam(nfc_error_e error, void *data)
-{
- SETTING_TRACE_BEGIN;
- setting_main_appdata *ad = g_main_ad;
- int ret;
- if (error == NFC_ERROR_NONE) {
- Setting_GenGroupItem_Data *list_item;
- int status;
- vconf_get_bool(VCONFKEY_NFC_STATE, &status);
- SETTING_TRACE("value:%d", status);
-
-
- Evas_Object *old_list = elm_object_part_content_get(ad->ly_topview, "content");
- if (old_list == ad->search_genlist) {
- SETTING_TRACE("Already be in search mode");
- elm_genlist_realized_items_update(ad->search_genlist);
- }
-
-
- ret = nfc_manager_deinitialize();
- if (ret < 0) {
- vconf_get_bool(VCONFKEY_NFC_STATE, &status);
- SETTING_TRACE_DEBUG("nfc status : %d", status);
- if (!status) {
- vconf_set_bool(VCONFKEY_NFC_SBEAM, !status);
- }
- }
- int i;
- for (i = VIEW_All_List; i < VIEW_Max; i++) {
- list_item = ad->gl_data_item[i][GL_NFC];
- if (list_item) {
- list_item->chk_status = status;
- list_item->swallow_type = SWALLOW_Type_1ICON_1RADIO;
- elm_object_item_data_set(list_item->item, list_item);
- elm_genlist_item_fields_update(list_item->item, "elm.icon.2", ELM_GENLIST_ITEM_FIELD_CONTENT);
- }
- /* enable sbeam */
- setting_genlist_item_disabled_set(list_item, 0);
- }
- } else {
- SETTING_TRACE("error code %d", error);
- }
-
-}
-
-void setting_alternate_sbeam_mode(Setting_GenGroupItem_Data *list_item, Eina_Bool status)
-{
- /*SETTING_TRACE_BEGIN; */
- setting_main_appdata *ad = g_main_ad;
- /*Eina_Bool status = elm_check_state_get(check); */
- SETTING_TRACE("wifi mode status : %d", status);
-
- vconf_set_bool(VCONFKEY_NFC_SBEAM, status);
-
- if (status) {
- int nfc_status = 0;
- vconf_get_bool(VCONFKEY_NFC_STATE, &nfc_status);
- if (!nfc_status) {
- bool is_nfc_exist = FALSE;
- Setting_GenGroupItem_Data *item_to_update;
- int i;
- for (i = VIEW_All_List; i < VIEW_Max; i++) {
- item_to_update = ad->gl_data_item[i][GL_NFC];
- if (!item_to_update) continue;
- setting_genlist_item_disabled_set(item_to_update, 1);
-
- is_nfc_exist = TRUE;
- }
- if (is_nfc_exist) {
- /*try to open nfc */
- int ret;
- ret = nfc_manager_initialize(NULL, NULL);
- if (ret < 0) {
- vconf_get_bool(VCONFKEY_NFC_STATE, &nfc_status);
- SETTING_TRACE_DEBUG("nfc status : %d", nfc_status);
- if (!nfc_status) {
- vconf_set_bool(VCONFKEY_NFC_SBEAM, !status);
- }
- }
- setting_retm_if(ret < 0, "*** [ERR] nfc_manager_initialize() ***");
-
- ret = nfc_manager_set_activation(!nfc_status, __nfc_activation_completed_cb_when_enbale_sbeam, ad);
- if (ret < 0) {
- vconf_get_bool(VCONFKEY_NFC_STATE, &nfc_status);
- SETTING_TRACE_DEBUG("nfc status : %d", nfc_status);
- if (!nfc_status) {
- vconf_set_bool(VCONFKEY_NFC_SBEAM, !status);
- }
- }
- setting_retm_if(ret < 0, "*** [ERR] nfc_manager_set_activation() ***");
-
- for (i = VIEW_All_List; i < VIEW_Max; i++) {
- item_to_update = ad->gl_data_item[i][GL_NFC];
- if (item_to_update && item_to_update->item) {
- item_to_update->swallow_type = SWALLOW_Type_1ICON_1PROCESS;
- elm_object_item_data_set(item_to_update->item, item_to_update);
- elm_genlist_item_fields_update(item_to_update->item, "elm.icon.2", ELM_GENLIST_ITEM_FIELD_CONTENT);
- }
- }
- /*add timeout strategy.. */
- if (ad->nfc_timer) {
- ecore_timer_del(ad->nfc_timer);
- ad->nfc_timer = NULL;
- }
- ad->nfc_timer = ecore_timer_add(5.0, (Ecore_Task_Cb) __nfc_timeout, ad);
-
- }
-
- }
- }
-}
-#endif
-
-void setting_main_click_list_network_ug_cb(void *data, Evas_Object *obj, void *event_info)
-{
- SETTING_TRACE_BEGIN;
- retm_if(event_info == NULL, "Invalid argument: event info is NULL");
- Elm_Object_Item *item = (Elm_Object_Item *) event_info;
-
- elm_genlist_item_selected_set(item, EINA_FALSE);
-
- if (g_main_ad->isInUGMode && g_main_ad->ug) {
- SETTING_TRACE
- ("[ad->ug non-NULL]skip genlist click event!!");
-
- /*SETTING_TRACE_END; */
- return;
- }
-
- int flight_mode = 0;
- vconf_get_bool(VCONFKEY_TELEPHONY_FLIGHT_MODE, &flight_mode);
- if (flight_mode) {
- setting_create_simple_popup(NULL, g_main_ad->win_main,
- NULL, "IDS_IM_POP_THIS_FEATURE_IS_NOT_AVAILABLE_WHILE_FLIGHT_MODE_IS_ON");
- return;
- }
-
- setting_main_appdata *ad = g_main_ad;
- setting_main_click_list_item_reset_data(ad, obj);
-
- int err = 0;
- int value;
- setting_get_int_slp_key(INT_SLP_SETTING_SIM_SLOT, &value, &err);
- SETTING_TRACE("value:%d", value);
- switch (value) {
- case VCONFKEY_TELEPHONY_SIM_INSERTED: {
- struct ug_cbs *cbs =
- (struct ug_cbs *)calloc(1, sizeof(struct ug_cbs));
- setting_retm_if(!cbs, "calloc failed");
- cbs->layout_cb = setting_main_layout_ug_cb;
- cbs->result_cb = setting_main_result_ug_cb;
- cbs->destroy_cb = setting_main_destroy_ug_cb;
- cbs->priv = (void *)ad;
- setting_main_click_list_item_ug_cb(ad, obj,
- "setting-network-efl",
- NULL, cbs);
- FREE(cbs);
- break;
- }
- case VCONFKEY_TELEPHONY_SIM_NOT_PRESENT:
- setting_create_simple_popup(NULL, ad->win_main,
- NULL, "IDS_ST_POP_INSERT_SIM_CARD_TO_ACCESS_NETWORK_SERVICES");
- SETTING_TRACE("%s*** [ERR] No SIM. sim_slot_type=%d ***%s",
- SETTING_FONT_RED, value, SETTING_FONT_BLACK);
- return;
- break;
- case VCONFKEY_TELEPHONY_SIM_CARD_ERROR:
- case VCONFKEY_TELEPHONY_SIM_UNKNOWN:
- setting_create_simple_popup(NULL, ad->win_main,
- NULL, "IDS_ST_POP_INSERT_SIM_CARD_TO_ACCESS_NETWORK_SERVICES");
- SETTING_TRACE("%s*** [ERR] Invalid SIM. sim_slot_type=%d ***%s",
- SETTING_FONT_RED, value, SETTING_FONT_BLACK);
- return;
- break;
- default:
- break;
- }
-
-}
-
-
-void setting_main_tapi_event_cb(TapiHandle *handle, int result, void *data, void *user_data)
-{
- SETTING_TRACE_BEGIN;
- ret_if(!user_data);
- setting_main_appdata *ad = user_data;
- ad->b_fm_requesting = FALSE;
- SETTING_TRACE("result:%d", result);
-
- int err = 0;
- switch (result) {
- case TAPI_POWER_FLIGHT_MODE_RESP_ON:
-
- setting_set_bool_slp_key(BOOL_SLP_SETTING_FLIGHT_MODE,
- SETTING_ON_OFF_BTN_ON, &err);
-
- /*If Setting has validate operation (fm_waiting_op == FM_LEAVE) to process, process it. */
- /*Otherwise, do nothing */
- if (FM_LEAVE == ad->fm_waiting_op) {
- /*Send the latest operation */
- ad->fm_waiting_op = FM_INVALID;
- err = tel_set_flight_mode(ad->handle, TAPI_POWER_FLIGHT_MODE_LEAVE, setting_main_tapi_event_cb, ad);
- setting_retm_if(err != TAPI_API_SUCCESS,
- "*** [ERR] tel_set_flight_mode(TAPI_POWER_FLIGHT_MODE_LEAVE) ***");
-
- /*sucessfully sent, */
- ad->b_fm_requesting = TRUE;
-
- }
- break;
-
- case TAPI_POWER_FLIGHT_MODE_RESP_OFF:
-
- setting_set_bool_slp_key(BOOL_SLP_SETTING_FLIGHT_MODE,
- SETTING_ON_OFF_BTN_OFF, &err);
-
- /*If Setting has validate operation (here, fm_waiting_op == FM_ENTER) to process,process it. */
- /*Otherwise, do nothing */
- if (FM_ENTER == ad->fm_waiting_op) {
- /*Send the latest operation */
- ad->fm_waiting_op = FM_INVALID;
- err = tel_set_flight_mode(ad->handle, TAPI_POWER_FLIGHT_MODE_ENTER, setting_main_tapi_event_cb, ad);
- setting_retm_if(err != TAPI_API_SUCCESS,
- "*** [ERR] tel_set_flight_mode(TAPI_POWER_FLIGHT_MODE_ENTER) ***");
-
- /*sucessfully sent, */
- ad->b_fm_requesting = TRUE;
- }
-
- break;
-
- case TAPI_POWER_FLIGHT_MODE_RESP_FAIL:
- /*Setting has a validate operation to process, Send the operation request */
- if (FM_ENTER == ad->fm_waiting_op) {
- ad->fm_waiting_op = FM_INVALID;
- err = tel_set_flight_mode(ad->handle, TAPI_POWER_FLIGHT_MODE_ENTER, setting_main_tapi_event_cb, ad);
-
- setting_retm_if(err != TAPI_API_SUCCESS,
- "*** [ERR] tel_set_flight_mode(TAPI_POWER_FLIGHT_MODE_ENTER) ***");
- ad->b_fm_requesting = TRUE;
- } else if (FM_LEAVE == ad->fm_waiting_op) {
- ad->fm_waiting_op = FM_INVALID;
- err = tel_set_flight_mode(ad->handle, TAPI_POWER_FLIGHT_MODE_LEAVE, setting_main_tapi_event_cb, ad);
-
- setting_retm_if(err != TAPI_API_SUCCESS,
- "*** [ERR] tel_set_flight_mode(TAPI_POWER_FLIGHT_MODE_LEAVE) ***");
- ad->b_fm_requesting = TRUE;
- } else { /*Current requset is the last one, Setting needs to notify user */
- setting_create_popup_without_btn(ad, ad->win_main,
- "IDS_COM_POP_ERROR",
- "IDS_ST_POP_UNABLE_TO_TURN_ON_FLIGHT_MODE_VODA",
- NULL, POPUP_INTERVAL,
- FALSE, FALSE);
-
- /*It is need to rollback the status, */
- Setting_GenGroupItem_Data *item_to_update;
- int i;
- for (i = VIEW_All_List; i < VIEW_Max; i++) {
- item_to_update = ad->gl_data_item[i][GL_FlightMode];
- if (item_to_update) {
- setting_update_gl_item_chk_status(item_to_update, !(item_to_update->chk_status));
- }
- }
-
- return;
- }
-
- /*sucessfully sent, */
- ad->b_fm_requesting = TRUE;
-
- break;
-
- case TAPI_POWER_FLIGHT_MODE_RESP_MAX:
- setting_create_popup_without_btn(ad, ad->win_main,
- "IDS_COM_POP_ERROR",
- "IDS_COM_POP_UNEXPECTED_ERROR",
- NULL, POPUP_INTERVAL, FALSE, FALSE);
-
- /*It is need to rollback the status, */
- Setting_GenGroupItem_Data *item_to_update;
- int i;
- for (i = VIEW_All_List; i < VIEW_Max; i++) {
- item_to_update = ad->gl_data_item[i][GL_FlightMode];
- if (item_to_update) {
- setting_update_gl_item_chk_status(item_to_update, !(item_to_update->chk_status));
- }
- }
- break;
- default:
- /* do nothing */
- break;
- }
- return;
-}
-
-void setting_main_alternate_flight_mode(int status)
-{
- SETTING_TRACE_BEGIN;
- setting_main_appdata *ad = g_main_ad;
- int ret;
- /*Check whether some requestion is processing by TAPI */
- if (ad->b_fm_requesting) {
- /*Do nothing, just mark the lastest operation.. */
- SETTING_TRACE("Some requestion is processing by TAPI, wait to process");
- ad->fm_waiting_op = status ? FM_ENTER : FM_LEAVE;
- return;
- }
-
- /*otherwise, invalid waiting operation and send requsetion to TAPI: */
- ad->fm_waiting_op = FM_INVALID;
- if (status) {
- ret = tel_set_flight_mode(ad->handle, TAPI_POWER_FLIGHT_MODE_ENTER, setting_main_tapi_event_cb, ad);
- setting_retm_if(ret != TAPI_API_SUCCESS,
- "*** [ERR] tel_set_flight_mode(TAPI_POWER_FLIGHT_MODE_ENTER) ***");
- } else {
- ret = tel_set_flight_mode(ad->handle, TAPI_POWER_FLIGHT_MODE_LEAVE, setting_main_tapi_event_cb, ad);
- setting_retm_if(ret != TAPI_API_SUCCESS,
- "*** [ERR] tel_set_flight_mode(TAPI_POWER_FLIGHT_MODE_LEAVE) ***");
- }
-
- /*sucessfully sent, */
- ad->b_fm_requesting = TRUE;
-}
-
-
-void setting_flightmode_turn_on_resp_cb(void *data, Evas_Object *obj, void *event_info)
-{
- setting_retm_if(NULL == obj, "NULL == obj");
- /*setting_retm_if(NULL == data, "NULL == data"); */
- SETTING_TRACE_BEGIN;
- int response_type = btn_type(obj);
- /*Setting_GenGroupItem_Data *list_item = (Setting_GenGroupItem_Data *)data; */
-
- if (g_main_ad) {
- evas_object_del(g_main_ad->popup_flight_mode);
- g_main_ad->popup_flight_mode = NULL;
-
- if (POPUP_RESPONSE_OK == response_type) {
- setting_update_gl_item_chk_status(g_main_ad->data_flight, EINA_TRUE);
- setting_update_gl_item_chk_status(g_main_ad->gl_data_item[VIEW_All_List][GL_FlightMode], EINA_TRUE);
- setting_update_gl_item_chk_status(g_main_ad->gl_data_item[VIEW_Common][GL_FlightMode], EINA_TRUE);
- setting_main_alternate_flight_mode(1);
-
- int firewall_state;
- vconf_get_bool(VCONFKEY_SETAPPL_FIREWALL_KEY, &firewall_state);
- if (firewall_state) {
- setting_remove_quickpannel_notification("setting-firewall-efl", NOTIFICATION_TYPE_ONGOING, &g_main_ad->noti_id);
- }
- } else if (POPUP_RESPONSE_CANCEL == response_type) {
- setting_update_gl_item_chk_status(g_main_ad->data_flight, EINA_FALSE);
- setting_update_gl_item_chk_status(g_main_ad->gl_data_item[VIEW_All_List][GL_FlightMode], EINA_FALSE);
- setting_update_gl_item_chk_status(g_main_ad->gl_data_item[VIEW_Common][GL_FlightMode], EINA_FALSE);
- }
- }
-}
-
-void setting_flightmode_turn_off_resp_cb(void *data, Evas_Object *obj, void *event_info)
-{
- setting_retm_if(NULL == obj, "NULL == obj");
- /*setting_retm_if(NULL == data, "NULL == data"); */
- SETTING_TRACE_BEGIN;
- int response_type = btn_type(obj);
- /*Setting_GenGroupItem_Data *list_item = (Setting_GenGroupItem_Data *)data; */
-
- if (g_main_ad) {
- evas_object_del(g_main_ad->popup_flight_mode);
- g_main_ad->popup_flight_mode = NULL;
- }
-
- if (POPUP_RESPONSE_OK == response_type) {
- setting_update_gl_item_chk_status(g_main_ad->data_flight, EINA_FALSE);
- setting_update_gl_item_chk_status(g_main_ad->gl_data_item[VIEW_All_List][GL_FlightMode], EINA_FALSE);
- setting_update_gl_item_chk_status(g_main_ad->gl_data_item[VIEW_Common][GL_FlightMode], EINA_FALSE);
- setting_main_alternate_flight_mode(0);
-
- int firewall_state;
- vconf_get_bool(VCONFKEY_SETAPPL_FIREWALL_KEY, &firewall_state);
- if (firewall_state) {
- setting_create_quickpannel_notification("setting-firewall-efl",
- NOTIFICATION_TYPE_ONGOING,
- NOTIFICATION_LY_ONGOING_EVENT,
- "IDS_ST_BODY_FIREWALL_ENABLED_ABB",
- "IDS_ST_BODY_CONFIGURE_FIREWALL_SETTINGS",
- IMG_Firewall, &g_main_ad->noti_id);
- }
-
- /*remove quickpannel warning */
- /*setting_remove_quickpannel_notification("setting-flightmode-efl", NOTIFICATION_TYPE_ONGOING, &g_main_ad->flight_noti_id); */
- } else if (POPUP_RESPONSE_CANCEL == response_type) {
- setting_update_gl_item_chk_status(g_main_ad->data_flight, EINA_TRUE);
- setting_update_gl_item_chk_status(g_main_ad->gl_data_item[VIEW_All_List][GL_FlightMode], EINA_TRUE);
- setting_update_gl_item_chk_status(g_main_ad->gl_data_item[VIEW_Common][GL_FlightMode], EINA_TRUE);
- }
-}
-
-
-/**
- * genlist touch cb
- */
-void setting_main_click_Gendial_list_flight_mode_cb(void *data, Evas_Object *obj, void *event_info)
-{
- /* error check */
- setting_retm_if(data == NULL, "Data parameter is NULL");
-
- retm_if(event_info == NULL, "Invalid argument: event info is NULL");
- Elm_Object_Item *item = (Elm_Object_Item *) event_info;
- elm_genlist_item_selected_set(item, 0);
- Setting_GenGroupItem_Data *list_item =
- (Setting_GenGroupItem_Data *) elm_object_item_data_get(item);
- int old_status = list_item->chk_status;/*elm_check_state_get(list_item->eo_check); */
-
- if (!g_main_ad) {
- return;
- }
-
- /* new status */
- if (!old_status) {
- g_main_ad->popup_flight_mode = setting_create_popup_with_btn(list_item,
- g_main_ad->win_main, "IDS_ST_POP_ENABLE_FLIGHT_MODE"/*KeyStr_FlightMode*/,
- ENABLE_FLIGHT_MODE_MSG,
- setting_flightmode_turn_on_resp_cb,
- 0, 2, "IDS_ST_BUTTON_ENABLE", "IDS_COM_SK_CANCEL");
- } else {
- g_main_ad->popup_flight_mode = setting_create_popup_with_btn(list_item,
- g_main_ad->win_main, KeyStr_FlightMode,
- "IDS_COM_POP_FLIGHT_MODE_WILL_BE_DISABLED",
- setting_flightmode_turn_off_resp_cb,
- 0, 2, "IDS_COM_SK_OK", "IDS_COM_SK_CANCEL");
- }
-}
-
-void setting_main_click_Gendial_list_multi_window_mode_cb(void *data, Evas_Object *obj, void *event_info)
-{
- SETTING_TRACE_BEGIN;
- setting_retm_if(data == NULL, "Data parameter is NULL");
-
- retm_if(event_info == NULL, "Invalid argument: event info is NULL");
- Elm_Object_Item *item = (Elm_Object_Item *) event_info;
- elm_genlist_item_selected_set(item, 0);
- Setting_GenGroupItem_Data *list_item =
- (Setting_GenGroupItem_Data *) elm_object_item_data_get(item);
- int new_status = !list_item->chk_status;
- setting_update_gl_item_chk_status(list_item, new_status);
- int ret = vconf_set_bool(VCONFKEY_QUICKSETTING_MULTIWINDOW_ENABLED, new_status);
- if (ret != 0) {
- SETTING_TRACE_ERROR("Set multi window vconf failed.");
- }
-}
-
-void
-setting_main_mouse_up_Gendial_list_sensitivity_cb(void *data, Evas_Object *obj,
- void *event_info)
-{
- /* error check */
- setting_retm_if(data == NULL, "Data parameter is NULL");
-
- retm_if(event_info == NULL, "Invalid argument: event info is NULL");
- Elm_Object_Item *item = (Elm_Object_Item *) event_info;
- elm_genlist_item_selected_set(item, 0);
- Setting_GenGroupItem_Data *list_item =
- (Setting_GenGroupItem_Data *) elm_object_item_data_get(item);
-
- if (!safeStrCmp(KeyStr_HighTouchSens, list_item->keyStr)) {
- display_set_enhanced_touch(!list_item->chk_status);
-
- int status = display_get_enhanced_touch();
- SETTING_TRACE("display_get_enhanced_touch():%d", status);
- if (status >= 0) {
- vconf_set_bool(VCONFKEY_SETAPPL_ENHANCED_TOUCH, (1 == status)); /*sync to vconf */
- } else {
- setting_create_simple_popup(NULL, g_main_ad->win_main,
- NULL, "IDS_COM_POP_UNEXPECTED_ERROR");
- }
- }
-
-}
-
-void setting_main_high_touch_sens_chk_btn_cb(void *data, Evas_Object *obj, void *event_info)
-{
- /*SETTING_TRACE_BEGIN; */
- /* error check */
- retm_if(data == NULL, "Data parameter is NULL");
- Setting_GenGroupItem_Data *list_item = (Setting_GenGroupItem_Data *) data;
-
- list_item->chk_status = elm_check_state_get(obj); /* for genlist update status */
- display_set_enhanced_touch(list_item->chk_status);
-
- int status = display_get_enhanced_touch();
- SETTING_TRACE("display_get_enhanced_touch():%d", status);
- if (status >= 0) {
- vconf_set_bool(VCONFKEY_SETAPPL_ENHANCED_TOUCH, (1 == status)); /*sync to vconf */
- } else {
- setting_create_simple_popup(NULL, g_main_ad->win_main,
- NULL, "IDS_COM_POP_UNEXPECTED_ERROR");
- /*rollback status */
- int i;
- for (i = VIEW_All_List; i < VIEW_Max; i++) {
- setting_force_update_gl_item_chk_status(g_main_ad->gl_data_item[i][GL_TouchSens], !(list_item->chk_status));
- }
- }
-
-}
-
-/**
- * toggle cb for flight-mode
- */
-void setting_main_click_list_flight_mode_cb(void *data, Evas_Object *obj,
- void *event_info)
-{
- /*SETTING_TRACE_BEGIN; */
- retm_if(data == NULL, "Data parameter is NULL");
- Setting_GenGroupItem_Data *list_item =
- (Setting_GenGroupItem_Data *) data;
- list_item->chk_status = elm_check_state_get(obj); /* for update new state */
- SETTING_TRACE("process item [%s], status:%d", _(list_item->keyStr),
- list_item->chk_status);
-
- if (g_main_ad) {
- if (list_item->chk_status) {
- g_main_ad->popup_flight_mode = setting_create_popup_with_btn(list_item,
- g_main_ad->win_main, "IDS_ST_POP_ENABLE_FLIGHT_MODE"/*KeyStr_FlightMode*/,
- ENABLE_FLIGHT_MODE_MSG,
- setting_flightmode_turn_on_resp_cb,
- 0, 2, "IDS_ST_BUTTON_ENABLE", "IDS_COM_SK_CANCEL");
- } else {
- /*setting_main_alternate_flight_mode(list_item->chk_status); */
- g_main_ad->popup_flight_mode = setting_create_popup_with_btn(list_item,
- g_main_ad->win_main, KeyStr_FlightMode,
- "IDS_COM_POP_FLIGHT_MODE_WILL_BE_DISABLED",
- setting_flightmode_turn_off_resp_cb,
- 0, 2, "IDS_COM_SK_OK", "IDS_COM_SK_CANCEL");
- }
- }
-}
-
-/**
- * genlist touch cb for network restriction mode
- */
-void
-setting_main_click_list_net_restriction_mode_cb(void *data, Evas_Object *obj, void *event_info)
-{
- /* error check */
- setting_retm_if(data == NULL, "Data parameter is NULL");
- retm_if(event_info == NULL, "Invalid argument: event info is NULL");
- setting_main_appdata *ad = g_main_ad;
-
- Elm_Object_Item *item = (Elm_Object_Item *)event_info;
- elm_genlist_item_selected_set(item, 0);
- Setting_GenGroupItem_Data *list_item = (Setting_GenGroupItem_Data *)elm_object_item_data_get(item);
- int old_status = list_item->chk_status;
-
- if (!old_status) {
- /* Off -> On */
- ad->popup_net_restriction_mode = setting_create_popup_with_btn(NULL,
- ad->win_main,
- "IDS_ST_HEADER_NETWORK_RESTRICTION_MODE_ABB_JPN",
- "IDS_QP_POP_IN_NETWORK_RESTRICTION_MODE_YOU_CAN_USE_ALL_YOUR_APPLICATIONS_WITHOUT_CONNECTING_TO_THE_NETWORK_YOU_CAN_ALSO_RECEIVE_CALLS_AND_SMS_MESSAGES_MSG_JPN" ,
- setting_main_net_restriction_mode_turn_on_resp_cb,
- 0, /* timer */
- 2, /* button count */
- "IDS_COM_SK_OK",
- "IDS_COM_SK_CANCEL");
- } else {
- /* On -> Off */
- ad->popup_net_restriction_mode = setting_create_popup_with_btn(NULL,
- ad->win_main,
- "IDS_ST_HEADER_NETWORK_RESTRICTION_MODE_ABB_JPN",
- "IDS_QP_POP_NETWORK_RESTRICTION_MODE_WILL_BE_DISABLED_JPN",
- setting_main_net_restriction_mode_turn_off_resp_cb,
- 0, /* timer */
- 2, /* button count */
- "IDS_COM_SK_OK",
- "IDS_COM_SK_CANCEL");
- }
-
- return;
-}
-
-/**
- * check(on/off) cb for network restriction mode
- */
-void
-setting_main_click_list_check_net_restriction_mode_cb(void *data, Evas_Object *obj, void *event_info)
-{
- retm_if(data == NULL, "Data parameter is NULL");
-
- Setting_GenGroupItem_Data *list_item = (Setting_GenGroupItem_Data *)data;
- setting_main_appdata *ad = g_main_ad;
-
- list_item->chk_status = elm_check_state_get(obj); /* for update new state */
- SETTING_TRACE("process item [%s], status:%d", _(list_item->keyStr), list_item->chk_status);
-
- if (list_item->chk_status) {
- /* Off -> On */
- ad->popup_net_restriction_mode = setting_create_popup_with_btn(NULL,
- ad->win_main,
- "IDS_ST_HEADER_NETWORK_RESTRICTION_MODE_ABB_JPN",
- "IDS_QP_POP_IN_NETWORK_RESTRICTION_MODE_YOU_CAN_USE_ALL_YOUR_APPLICATIONS_WITHOUT_CONNECTING_TO_THE_NETWORK_YOU_CAN_ALSO_RECEIVE_CALLS_AND_SMS_MESSAGES_MSG_JPN",
- setting_main_net_restriction_mode_turn_on_resp_cb,
- 0, /* timer */
- 2, /* button count */
- "IDS_COM_SK_OK",
- "IDS_COM_SK_CANCEL");
- } else {
- /* On -> Off */
- ad->popup_net_restriction_mode = setting_create_popup_with_btn(NULL,
- ad->win_main,
- "IDS_ST_HEADER_NETWORK_RESTRICTION_MODE_ABB_JPN",
- "IDS_QP_POP_NETWORK_RESTRICTION_MODE_WILL_BE_DISABLED_JPN",
- setting_main_net_restriction_mode_turn_off_resp_cb,
- 0, /* timer */
- 2, /* button count */
- "IDS_COM_SK_OK",
- "IDS_COM_SK_CANCEL");
- }
- return;
-}
-
-/**
- * turn on popup cb for network restriction mode
- */
-void
-setting_main_net_restriction_mode_turn_on_resp_cb(void *data, Evas_Object *obj, void *event_info)
-{
- SETTING_TRACE_BEGIN;
-
- /* error check */
- setting_retm_if(NULL == obj, "NULL == obj");
- int response_type = btn_type(obj);
- setting_main_appdata *ad = g_main_ad;
- int status, err = 0;
-
- if (ad == NULL)
- return;
-
- if (ad->popup_net_restriction_mode) {
- evas_object_del(ad->popup_net_restriction_mode);
- ad->popup_net_restriction_mode = NULL;
- }
-
-
- if (response_type == POPUP_RESPONSE_OK) {
- status = EINA_TRUE;
- setting_set_bool_slp_key(BOOL_SLP_SETTING_NET_RESTRICTION_MODE, SETTING_ON_OFF_BTN_ON, &err);
- } else if (response_type == POPUP_RESPONSE_CANCEL) {
- setting_get_bool_slp_key(BOOL_SLP_SETTING_NET_RESTRICTION_MODE, &status, &err);
- }
-
- Setting_GenGroupItem_Data *item_to_update;
- int i;
- for (i = VIEW_All_List; i < VIEW_Max; i++) {
- item_to_update = ad->gl_data_item[i][GL_NetRestriction];
- setting_update_gl_item_chk_status(item_to_update, status);
- }
-
- Evas_Object *old_list = elm_object_part_content_get(ad->ly_topview, "content");
- if (old_list == ad->search_genlist) {
- SETTING_TRACE("Already be in search mode");
- elm_genlist_realized_items_update(ad->search_genlist);
- }
-
- return;
-}
-
-/**
- * turn off popup cb for network restriction mode
- */
-void
-setting_main_net_restriction_mode_turn_off_resp_cb(void *data, Evas_Object *obj, void *event_info)
-{
- SETTING_TRACE_BEGIN;
-
- /* error check */
- setting_retm_if(NULL == obj, "NULL == obj");
-
- int response_type = btn_type(obj);
- setting_main_appdata *ad = g_main_ad;
- int status, err = 0;
-
- if (ad == NULL)
- return;
-
- if (ad->popup_net_restriction_mode) {
- evas_object_del(ad->popup_net_restriction_mode);
- ad->popup_net_restriction_mode = NULL;
- }
-
- if (response_type == POPUP_RESPONSE_OK) {
- status = EINA_FALSE;
- setting_set_bool_slp_key(BOOL_SLP_SETTING_NET_RESTRICTION_MODE, SETTING_ON_OFF_BTN_OFF, &err);
- SETTING_TRACE("BOOL_SLP_SETTING_NET_RESTRICTION_MODE - off");
- } else if (response_type == POPUP_RESPONSE_CANCEL) {
- setting_get_bool_slp_key(BOOL_SLP_SETTING_NET_RESTRICTION_MODE, &status, &err);
-
- SETTING_TRACE("BOOL_SLP_SETTING_NET_RESTRICTION_MODE - update UI by getting vconf");
- }
- Setting_GenGroupItem_Data *item_to_update;
- int i;
- for (i = VIEW_All_List; i < VIEW_Max; i++) {
- item_to_update = ad->gl_data_item[i][GL_NetRestriction];
- setting_update_gl_item_chk_status(item_to_update, status);
- }
-
- Evas_Object *old_list = elm_object_part_content_get(ad->ly_topview, "content");
- if (old_list == ad->search_genlist) {
- SETTING_TRACE("Already be in search mode");
- elm_genlist_realized_items_update(ad->search_genlist);
- }
-
- return;
-}
-
-/**
- * toggle cb
- */
-void setting_main_click_list_wifi_mode_cb(void *data, Evas_Object *obj,
- void *event_info)
-{
- /*SETTING_TRACE_BEGIN; */
- retm_if(data == NULL, "Data parameter is NULL");
- Setting_GenGroupItem_Data *list_item =
- (Setting_GenGroupItem_Data *) data;
- list_item->chk_status = elm_check_state_get(obj); /* for update new state */
- SETTING_TRACE("process item [%s], status:%d", _(list_item->keyStr),
- list_item->chk_status);
-
- __alternate_wifi_mode(list_item, obj);
-}
-
-void setting_main_click_list_motion_cb(void *data, Evas_Object *obj,
- void *event_info)
-{
- /*SETTING_TRACE_BEGIN; */
- retm_if(data == NULL, "Data parameter is NULL");
- Setting_GenGroupItem_Data *list_item = (Setting_GenGroupItem_Data *) data;
- list_item->chk_status = elm_check_state_get(obj); /* for update new state */
- SETTING_TRACE("process item [%s], status:%d", _(list_item->keyStr),
- list_item->chk_status);
-
- int err = 0;
- int ret = setting_set_bool_slp_key(BOOL_SLP_SETTING_MOTION_ACTIVATION, list_item->chk_status, &err);
- if (0 != ret) { /*rollback */
- setting_update_gl_item_chk_status(list_item, !(list_item->chk_status));
- return;
- }
-
- /* If motion activation changes to OFF when screen lock type is motion unlock, screen lock type should be set SWIPE automatically */
- if (!list_item->chk_status) {
- int screen_lock_type = 0;
- vconf_get_int(VCONFKEY_SETAPPL_SCREEN_LOCK_TYPE_INT, &screen_lock_type);
- if (screen_lock_type == SETTING_SCREEN_LOCK_TYPE_MOTION)
- vconf_set_int(VCONFKEY_SETAPPL_SCREEN_LOCK_TYPE_INT, SETTING_SCREEN_LOCK_TYPE_SWIPE);
- }
-}
-
-void setting_main_click_list_nearby_devices_cb(void *data, Evas_Object *obj,
- void *event_info)
-{
- /*SETTING_TRACE_BEGIN; */
- retm_if(data == NULL, "Data parameter is NULL");
- Setting_GenGroupItem_Data *list_item = (Setting_GenGroupItem_Data *) data;
- list_item->chk_status = elm_check_state_get(obj); /* for update new state */
- SETTING_TRACE("process item [%s], status:%d", _(list_item->keyStr), list_item->chk_status);
-
- int chk_status = list_item->chk_status;
-
- if (chk_status) {
- /*to turn on */
- /*app_launcher("setting-allshare-efl|mode:on"); */
- /*rollback first */
- setting_update_gl_item_chk_status(list_item, VCONFKEY_ALLSHARE_DISABLE);
-
- struct ug_cbs *cbs = (struct ug_cbs *)calloc(1, sizeof(struct ug_cbs));
- setting_retm_if(!cbs, "calloc failed");
- cbs->layout_cb = setting_main_layout_ug_cb;
- cbs->result_cb = setting_main_result_ug_cb;
- cbs->destroy_cb = setting_main_destroy_ug_cb;
- cbs->priv = (void *)g_main_ad;
-
- app_control_h svc = NULL;
- app_control_create(&svc);
- app_control_add_extra_data(svc, "mode", "on");
- setting_main_click_list_item_ug_cb(g_main_ad, obj, "setting-allshare-efl", svc, cbs);
- if (cbs) {
- FREE(cbs);
- }
- cbs = NULL;
- app_control_destroy(svc);
- } else {
- /*to turn off */
- int ret = 0;
- ret = vconf_set_int(VCONFKEY_ALLSHARE_STATUS, VCONFKEY_ALLSHARE_DISABLE);
- if (0 != ret) { /*rollback */
- setting_update_gl_item_chk_status(list_item, VCONFKEY_ALLSHARE_ENABLE);
- return;
- }
- }
-}
-
-/**
- * toggle cb
- */
-void setting_main_click_list_bt_mode_cb(void *data, Evas_Object *obj,
- void *event_info)
-{
- retm_if(data == NULL, "Data parameter is NULL");
- Setting_GenGroupItem_Data *list_item =
- (Setting_GenGroupItem_Data *) data;
- list_item->chk_status = elm_check_state_get(obj); /* for update new state */
- SETTING_TRACE("process item [%s], status:%d", _(list_item->keyStr),
- list_item->chk_status);
-
- __alternate_bt_mode(list_item, obj);
-}
-
-#if SUPPORT_NFC
-/**
- * toggle cb
- */
-void setting_main_click_list_nfc_mode_cb(void *data, Evas_Object *obj,
- void *event_info)
-{
- retm_if(data == NULL, "Data parameter is NULL");
- Setting_GenGroupItem_Data *list_item =
- (Setting_GenGroupItem_Data *) data;
- list_item->chk_status = elm_check_state_get(obj); /* for update new state */
- SETTING_TRACE("process item [%s], status:%d", _(list_item->keyStr),
- list_item->chk_status);
-
- Eina_Bool status = elm_check_state_get(obj);
- setting_alternate_nfc_mode(list_item, status);
-}
-
-/**
- * toggle cb
- */
-void setting_main_click_list_sbeam_mode_cb(void *data, Evas_Object *obj,
- void *event_info)
-{
- retm_if(data == NULL, "Data parameter is NULL");
- setting_main_appdata *ad = g_main_ad;
- Setting_GenGroupItem_Data *list_item =
- (Setting_GenGroupItem_Data *) data;
- list_item->chk_status = elm_check_state_get(obj); /* for update new state */
- SETTING_TRACE("process item [%s], status:%d", _(list_item->keyStr),
- list_item->chk_status);
-
- if (ad->nfc_try_activate_running) {
- SETTING_TRACE("CHECK : nfc state update is in progress. DON'T DO ANY MORE !!!!!!!!!!!!!!!!!!!!!!!");
- elm_check_state_set(obj, !list_item->chk_status);
- /* roll back */
- return;
- } else {
- SETTING_TRACE("CHECK : nfc state update is NOT in progress. - GO AHEAD !!!");
- Eina_Bool status = elm_check_state_get(obj);
- setting_alternate_sbeam_mode(list_item, status);
- }
-}
-#endif
-
-void setting_main_display_auto_adjust_chk_btn_cb(void *data, Evas_Object *obj, void *event_info)
-{
- SETTING_TRACE_BEGIN;
- /* error check */
- retm_if(data == NULL, "Data parameter is NULL");
- Setting_GenGroupItem_Data *list_item = (Setting_GenGroupItem_Data *) data;
-
- list_item->chk_status = elm_check_state_get(obj); /* for genlist update status */
- vconf_set_bool(VCONFKEY_SETAPPL_LCD_AUTO_DISPLAY_ADJUSTMENT, list_item->chk_status);
- /*setting_display_set_auto_adjust_tone(list_item->chk_status); //todo:copy it from display */
-}
-
-void setting_main_display_auto_rotate_chk_btn_cb(void *data, Evas_Object *obj, void *event_info)
-{
- SETTING_TRACE_BEGIN;
- /* error check */
- retm_if(data == NULL, "Data parameter is NULL");
- Setting_GenGroupItem_Data *list_item = (Setting_GenGroupItem_Data *) data;
- setting_main_appdata *ad = g_main_ad;
-
- list_item->chk_status = elm_check_state_get(obj); /* for genlist update status */
-
- if (list_item->chk_status == 1) {
- int angle = elm_win_rotation_get(ad->win_main);
- elm_win_rotation_with_resize_set(ad->win_main, angle);
- } else {
- elm_win_rotation_with_resize_set(ad->win_main, 0);
- }
-
- vconf_set_bool(VCONFKEY_SETAPPL_AUTO_ROTATE_SCREEN_BOOL, list_item->chk_status);
-}
-
-
-void setting_main_display_battery_chk_btn_cb(void *data, Evas_Object *obj,
- void *event_info)
-{
- SETTING_TRACE_BEGIN;
- /* error check */
- retm_if(data == NULL, "Data parameter is NULL");
- Setting_GenGroupItem_Data *list_item = (Setting_GenGroupItem_Data *) data;
-
- list_item->chk_status = elm_check_state_get(obj); /* for genlist update status */
- vconf_set_bool(VCONFKEY_SETAPPL_BATTERY_PERCENTAGE_BOOL, list_item->chk_status);
-}
-
-void setting_main_display_list_cb(void *data, Evas_Object *obj, void *event_info)
-{
- /* error check */
- setting_retm_if(data == NULL, "Data parameter is NULL");
-
- retm_if(event_info == NULL, "Invalid argument: event info is NULL");
- Elm_Object_Item *item = (Elm_Object_Item *) event_info;
- elm_genlist_item_selected_set(item, 0);
- Setting_GenGroupItem_Data *list_item =
- (Setting_GenGroupItem_Data *) elm_object_item_data_get(item);
-
- setting_main_appdata *ad = data;
-
- SETTING_TRACE("clicking item[%s]", _(list_item->keyStr));
- if (!safeStrCmp(KeyStr_BatteryPercent, list_item->keyStr)) {
- setting_update_gl_item_chk_status(list_item, !list_item->chk_status);
- vconf_set_bool(VCONFKEY_SETAPPL_BATTERY_PERCENTAGE_BOOL, list_item->chk_status);
- }
-#if SUPPORT_AUTO_ADJUST_SCREEN_TONE
- else if (!safeStrCmp(KeyStr_AdjustScreenTone, list_item->keyStr)) {
- setting_update_gl_item_chk_status(list_item, !list_item->chk_status);
- vconf_set_bool(VCONFKEY_SETAPPL_LCD_AUTO_DISPLAY_ADJUSTMENT, list_item->chk_status);
-
- }
-#endif
- else if (!safeStrCmp(KeyStr_Landscape, list_item->keyStr)) {
- setting_update_gl_item_chk_status(list_item, !list_item->chk_status);
- if (list_item->chk_status == 1) {
- int angle = elm_win_rotation_get(ad->win_main);
- elm_win_rotation_with_resize_set(ad->win_main, angle);
- } else {
- elm_win_rotation_with_resize_set(ad->win_main, 0);
- }
-
- vconf_set_bool(VCONFKEY_SETAPPL_AUTO_ROTATE_SCREEN_BOOL, list_item->chk_status);
- }
-}
-