diff options
author | kj7.sung <kj7.sung@samsung.com> | 2017-10-13 14:06:16 +0900 |
---|---|---|
committer | kj7.sung <kj7.sung@samsung.com> | 2017-10-13 14:06:16 +0900 |
commit | b0c1acf4fde541cf23e1d3e0ee09e03a006bead1 (patch) | |
tree | ae426deea3de4e0a496e0b810469bb9f297b0259 | |
parent | 2bbbf3d7cf3fdb1a0017509a8e33af83e2d4b588 (diff) | |
download | lbs-setting-b0c1acf4fde541cf23e1d3e0ee09e03a006bead1.tar.gz lbs-setting-b0c1acf4fde541cf23e1d3e0ee09e03a006bead1.tar.bz2 lbs-setting-b0c1acf4fde541cf23e1d3e0ee09e03a006bead1.zip |
update to latest lbs-settingsubmit/tizen/20171013.054557
Change-Id: I0eec9b2dec0a92bdcf2317470ea498a54099e350
Signed-off-by: kj7.sung <kj7.sung@samsung.com>
-rw-r--r-- | src/lbs-setting-common.h | 7 | ||||
-rw-r--r-- | src/lbs-setting-window.c | 84 |
2 files changed, 65 insertions, 26 deletions
diff --git a/src/lbs-setting-common.h b/src/lbs-setting-common.h index 57dde78..6318761 100644 --- a/src/lbs-setting-common.h +++ b/src/lbs-setting-common.h @@ -142,13 +142,6 @@ typedef enum { MENU_GPS, } loc_setting_type_e; -typedef enum { - SETTING_IS_SHOW_OFF = 0, - SETTING_IS_SHOW_GPS, - SETTING_IS_SHOW_WIFI, - SETTING_IS_SHOW_ALL, -} loc_popup_type_e; - typedef struct appdata { Evas_Object *ug; Evas_Object *wizard_layout; 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); |