diff options
Diffstat (limited to 'src/lbs-setting-window.c')
-rw-r--r-- | src/lbs-setting-window.c | 84 |
1 files changed, 65 insertions, 19 deletions
diff --git a/src/lbs-setting-window.c b/src/lbs-setting-window.c index afd213f..7a92d9e 100644 --- a/src/lbs-setting-window.c +++ b/src/lbs-setting-window.c @@ -131,6 +131,7 @@ Evas_Object *create_win(const char *name) static int __setting_location_set_int(const char *path, int val) { + LS_FUNC_ENTER int enabled = 0; int ret = vconf_get_int(path, &enabled); if (ret != VCONF_OK) { @@ -200,6 +201,7 @@ static Eina_Bool __setting_location_pop_cb(void *data, Elm_Object_Item *item) static void __setting_location_help_cb(void *data, Evas_Object *obj, void *event_info) { + LS_FUNC_ENTER LS_RETURN_IF_FAILED(data); lbs_setting_app_data *ad = (lbs_setting_app_data *)data; @@ -211,6 +213,7 @@ static void __setting_location_help_cb(void *data, Evas_Object *obj, void *event void _mouseup_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) { + LS_FUNC_ENTER LS_RETURN_IF_FAILED(event_info); Evas_Event_Mouse_Up *ev = event_info; if (ev->button == 3) {/* if mouse right button is up */ @@ -308,6 +311,11 @@ static void __setting_location_update_radio_values(void *data) else __set_radio_values(MENU_LOCATION, ad); + elm_genlist_item_item_class_update(ad->gi_gps, ad->itc_gps); + if (ad->wps_feature) { + elm_genlist_item_item_class_update(ad->gi_hybrid, ad->itc_hybrid); + elm_genlist_item_item_class_update(ad->gi_wifi, ad->itc_wifi); + } } static void __set_consent_popup_disable(loc_setting_type_e ask_type, void *data) @@ -324,18 +332,18 @@ static void __set_consent_popup_disable(loc_setting_type_e ask_type, void *data) if (ask_type == MENU_GPS) { ad->consent_gps = false; - if (isShow == SETTING_IS_SHOW_GPS) - value = SETTING_IS_SHOW_OFF; - else if (isShow == SETTING_IS_SHOW_ALL) - value = SETTING_IS_SHOW_WIFI; + if (isShow == VCONFKEY_LOCATION_POPUP_SHOW_GPS) + value = VCONFKEY_LOCATION_POPUP_OFF; + else if (isShow == VCONFKEY_LOCATION_POPUP_SHOW_ALL) + value = VCONFKEY_LOCATION_POPUP_SHOW_WPS; } else if (ask_type == MENU_WIFI) { ad->consent_wifi = false; - if (isShow == SETTING_IS_SHOW_WIFI) - value = SETTING_IS_SHOW_OFF; - else if (isShow == SETTING_IS_SHOW_ALL) - value = SETTING_IS_SHOW_GPS; + if (isShow == VCONFKEY_LOCATION_POPUP_SHOW_WPS) + value = VCONFKEY_LOCATION_POPUP_OFF; + else if (isShow == VCONFKEY_LOCATION_POPUP_SHOW_ALL) + value = VCONFKEY_LOCATION_POPUP_SHOW_GPS; } else { return ; @@ -357,13 +365,13 @@ static void __get_consent_popup_state(void *data) if (ret != VCONF_OK) LS_LOGE("vconf_get error:%d", ret); - if (value == SETTING_IS_SHOW_ALL) { + if (value == VCONFKEY_LOCATION_POPUP_SHOW_ALL) { ad->consent_gps = true; ad->consent_wifi = true; - } else if (value == SETTING_IS_SHOW_GPS) { + } else if (value == VCONFKEY_LOCATION_POPUP_SHOW_GPS) { ad->consent_gps = true; ad->consent_wifi = false; - } else if (value == SETTING_IS_SHOW_WIFI) { + } else if (value == VCONFKEY_LOCATION_POPUP_SHOW_WPS) { ad->consent_gps = false; ad->consent_wifi = true; } else { @@ -979,6 +987,7 @@ void __setting_location_padding_sel(void *data, Evas_Object *obj, void *event_in static Evas_Object *__setting_location_create_navibar(Evas_Object *parent) { + LS_FUNC_ENTER Evas_Object *naviframe = NULL; naviframe = elm_naviframe_add(parent); @@ -1022,6 +1031,7 @@ static void __setting_myplace_sel(void *data, Evas_Object *obj, void *event_info static void item_cleanup(void *data) { + LS_FUNC_ENTER lbs_setting_app_data *ad = (lbs_setting_app_data *) data; if (ad->itc_menu) @@ -1356,8 +1366,25 @@ void _location_key_changed_cb(keynode_t *key, void *data) LS_RETURN_IF_FAILED(data); lbs_setting_app_data *ad = (lbs_setting_app_data *)data; int enabled = 0; - vconf_get_int(VCONFKEY_LOCATION_USE_MY_LOCATION, &enabled); - ad->is_myloc = enabled; + int ret = vconf_get_int(VCONFKEY_LOCATION_USE_MY_LOCATION, &enabled); + if (ret != VCONF_OK) + LOGD("fail to get gps vconf key!"); + + if (enabled == VCONFKEY_LOCATION_SETTING_ON) { + if (ad->is_myloc) { + ad->called_by_internal_menu = false; + return ; + } else { + ad->is_myloc = true; + } + } else { + if (ad->is_myloc) { + ad->is_myloc = false; + } else { + ad->called_by_internal_menu = false; + return ; + } + } if (ad->called_by_internal_menu == false) __setting_location_item_disabled_update(ad); @@ -1376,18 +1403,27 @@ void _gps_key_changed_cb(keynode_t *key, void *data) if (ret != VCONF_OK) LOGD("fail to get gps vconf key!"); - if (enabled) { + bool refresh_ignore = false; + if (enabled == VCONFKEY_LOCATION_SETTING_ON) { + if (ad->is_gps) + refresh_ignore = true; + ad->is_gps = true; ad->is_myloc = true; } else { + if (ad->is_gps == false) + refresh_ignore = true; + ad->is_gps = false; if (!ad->is_wifi) ad->is_myloc = false; } if (ad->called_by_internal_menu == false) { - __setting_location_loc_on_off(ad); - __setting_location_update_radio_values(ad); + if (refresh_ignore == false) { + __setting_location_loc_on_off(ad); + __setting_location_update_radio_values(ad); + } } ad->called_by_internal_menu = false; @@ -1404,18 +1440,27 @@ void _wifi_key_changed_cb(keynode_t *key, void *data) if (ret != VCONF_OK) LS_LOGD("fail to get wps vconf key!"); - if (enabled) { + bool refresh_ignore = false; + if (enabled == VCONFKEY_LOCATION_SETTING_ON) { + if (ad->is_wifi) + refresh_ignore = true; + ad->is_wifi = true; ad->is_myloc = true; } else { + if (ad->is_wifi == false) + refresh_ignore = true; + ad->is_wifi = false; if (!ad->is_gps) ad->is_myloc = false; } if (ad->called_by_internal_menu == false) { - __setting_location_loc_on_off(ad); - __setting_location_update_radio_values(ad); + if (refresh_ignore == false) { + __setting_location_loc_on_off(ad); + __setting_location_update_radio_values(ad); + } } ad->called_by_internal_menu = false; @@ -1542,6 +1587,7 @@ int __setting_location_init(lbs_setting_app_data *ad) int _setting_location_deinit(lbs_setting_app_data *ad) { + LS_FUNC_ENTER int ret = 0; ret = vconf_ignore_key_changed(VCONFKEY_LOCATION_USE_MY_LOCATION, _location_key_changed_cb); |