diff options
author | jinwang.an <jinwang.an@samsung.com> | 2019-10-24 11:08:22 +0900 |
---|---|---|
committer | jinwang.an <jinwang.an@samsung.com> | 2019-10-24 12:45:59 +0900 |
commit | cedce3cbf20f6409dbd11c35689ab176d266058d (patch) | |
tree | 0f49afd6be9477f7c3ebd1636cfc301a24fee908 | |
parent | 156be0def5d66a84437a574ba2e57cdb2a06370e (diff) | |
download | watch-setting-cedce3cbf20f6409dbd11c35689ab176d266058d.tar.gz watch-setting-cedce3cbf20f6409dbd11c35689ab176d266058d.tar.bz2 watch-setting-cedce3cbf20f6409dbd11c35689ab176d266058d.zip |
Apply code from updated library.submit/tizen/20191104.014533accepted/tizen/unified/20191104.115052
- apply new EFL genlist item event handle.
- apply new rotary function.
Change-Id: If9483565a645e6f25396eac7c0815330ba3f8cf7
Signed-off-by: jinwang.an <jinwang.an@samsung.com>
-rw-r--r-- | src/setting-clock.c | 14 | ||||
-rw-r--r-- | src/setting-connection.c | 98 | ||||
-rw-r--r-- | src/setting-device.c | 84 | ||||
-rw-r--r-- | src/setting-info.c | 11 | ||||
-rw-r--r-- | src/setting-sound.c | 34 | ||||
-rw-r--r-- | src/setting-volume-page.c | 17 | ||||
-rw-r--r-- | src/util.c | 2 |
7 files changed, 45 insertions, 215 deletions
diff --git a/src/setting-clock.c b/src/setting-clock.c index 7c410ec..1f3b003 100644 --- a/src/setting-clock.c +++ b/src/setting-clock.c @@ -1613,6 +1613,7 @@ void _noti_indicator_help_popup_cb(void *data, Evas_Object *obj, void *event_inf static void _clock_gl_clock_noti_indicator_check_cb(void *data, Evas_Object *obj, void *event_info) { int value = 0; + DBG("_clock_gl_clock_noti_indicator_check_cb is called!!!!!!!"); Elm_Object_Item *it = (Elm_Object_Item *)event_info; appdata *ad = data; @@ -1639,15 +1640,6 @@ static void _clock_gl_clock_noti_indicator_help_cb(void *data, Evas_Object *obj, _noti_indicator_help_popup_cb(data, obj, event_info); } -static void _clock_noti_indicator_check_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) -{ - Evas_Object *check = obj; - int nofi_indicator = 0; - nofi_indicator = !elm_check_state_get(check); - vconf_set_bool(VCONFKEY_SETAPPL_NOTIFICATION_INDICATOR, nofi_indicator); - ERR("Setting VCONFKEY_SETAPPL_NOTIFICATION_INDICATOR : %d", nofi_indicator); -} - static Evas_Object *_gl_clock_noti_indicator_check_get(void *data, Evas_Object *obj, const char *part) { Evas_Object *check = NULL; @@ -1663,7 +1655,6 @@ static Evas_Object *_gl_clock_noti_indicator_check_get(void *data, Evas_Object * ERR("notification_indicator : %d", noti_indicator); elm_check_state_set(check, (noti_indicator) ? EINA_TRUE : EINA_FALSE); - evas_object_event_callback_add(check, EVAS_CALLBACK_MOUSE_UP, _clock_noti_indicator_check_cb, (void *)check); evas_object_size_hint_align_set(check, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_size_hint_weight_set(check, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_propagate_events_set(check, EINA_FALSE); @@ -1706,7 +1697,8 @@ static void gl_realized_cb(void *data, Evas_Object *obj, void *event_info) Elm_Object_Item *first = elm_genlist_first_item_get(g_noti_indicator_genlist); if (first == item) elm_object_item_signal_emit(first, "elm,action,title,slide,start", "elm"); - + else + elm_object_item_signal_emit(item, "elm,event,pass,disabled", "elm"); } static void _show_noti_indicator_list(void *data) diff --git a/src/setting-connection.c b/src/setting-connection.c index 5656ebc..126ba8f 100644 --- a/src/setting-connection.c +++ b/src/setting-connection.c @@ -264,86 +264,6 @@ void back_key_flight_mode_popup_cb(void *data, Evas_Object *obj, void *event_inf back_button_cb_pop(); } -static void _flight_mode_check_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) -{ - appdata *ad = g_app_context; - Evas_Object *check = (Evas_Object *)data; - int is_flight_mode = 0; - - if (ad == NULL) { - DBG("%s", "_flight_mode_check_cb - appdata or check is null"); - return; - } - - DBG("_flight_mode_check_cb is called!!!!!!!"); - - vconf_get_bool(VCONFKEY_TELEPHONY_FLIGHT_MODE, &is_flight_mode); - DBG("is_flight_mode:%d ", is_flight_mode); - - if (!is_flight_mode) { - Evas_Object *popup = NULL; - Evas_Object *btn1 = NULL; - Evas_Object *btn2 = NULL; - Evas_Object *icon; - - popup = elm_popup_add(ad->nf); - elm_object_style_set(popup, "circle"); - evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - elm_win_resize_object_add(ad->nf, popup); - - ad->popup = popup; - - char buf[__SETTING_BUF_SIZE__] = {0,}; - - char *font_setting = "<text_class=tizen><align=center>%s</align></text_class>"; - snprintf(buf, sizeof(buf) - 1, font_setting, _("WDS_ST_TPOP_FLIGHT_MODE_DISABLES_CALLS_MESSAGING_AND_ALL_CONNECTIONS_TO_USE_WI_FI_AND_BLUETOOTH_GO_TO_SETTINGS")); - - Evas_Object *layout; - layout = elm_layout_add(popup); - elm_layout_theme_set(layout, "layout", "popup", "content/circle/buttons2"); - - elm_object_text_set(layout, buf); - elm_object_content_set(popup, layout); - - btn1 = elm_button_add(popup); - elm_object_style_set(btn1, "popup/circle/left"); - evas_object_size_hint_weight_set(btn1, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - elm_object_part_content_set(popup, "button1", btn1); - evas_object_smart_callback_add(btn1, "clicked", _set_flight_mode_cancel_cb, check); - - icon = elm_image_add(btn1); - elm_image_file_set(icon, IMG_DIR"tw_ic_popup_btn_delete.png", NULL); - evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - elm_object_part_content_set(btn1, "elm.swallow.content", icon); - evas_object_show(icon); - - btn2 = elm_button_add(popup); - elm_object_style_set(btn2, "popup/circle/right"); - evas_object_size_hint_weight_set(btn2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - elm_object_part_content_set(popup, "button2", btn2); - evas_object_smart_callback_add(btn2, "clicked", _set_flight_mode_ok_clicked_cb, check); - - icon = elm_image_add(btn2); - elm_image_file_set(icon, IMG_DIR"tw_ic_popup_btn_check.png", NULL); - evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - elm_object_part_content_set(btn2, "elm.swallow.content", icon); - evas_object_show(icon); - - evas_object_show(popup); - back_button_cb_push(&back_key_flight_mode_popup_cb, check, NULL, g_connection_genlist, "g_connection_genlist"); - eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, _hw_back_key_cb, NULL); - - } else { - /* disable Flight mode off with out popup */ - int flight_mode = 0; - DBG("Cancel Flight mode!"); - if (_set_flight_mode_tel(flight_mode)) - vconf_set_bool(VCONFKEY_TELEPHONY_FLIGHT_MODE, flight_mode); - - } - -} - Evas_Object *_gl_connection_check_get(void *data, Evas_Object *obj, const char *part) { Evas_Object *check = NULL; @@ -363,7 +283,6 @@ Evas_Object *_gl_connection_check_get(void *data, Evas_Object *obj, const char * case SETTING_CONNECTION_FLIGHT_MODE: g_flight_mode_check = check; vconf_get_bool(VCONFKEY_TELEPHONY_FLIGHT_MODE, &is_value); - evas_object_event_callback_add(check, EVAS_CALLBACK_MOUSE_DOWN, _flight_mode_check_cb, (void *)check); break; default: break; @@ -697,6 +616,15 @@ static int _tapi_handles_init() return 0; } +static void gl_realized_cb(void *data, Evas_Object *obj, void *event_info) +{ + Elm_Object_Item *item = (Elm_Object_Item *)event_info; + Elm_Object_Item *first = elm_genlist_first_item_get(g_connection_genlist); + if (first == item) + elm_object_item_signal_emit(first, "elm,action,title,slide,start", "elm"); + else + elm_object_item_signal_emit(item, "elm,event,pass,disabled", "elm"); +} Evas_Object *_create_connection_list(void *data) { @@ -732,12 +660,6 @@ Evas_Object *_create_connection_list(void *data) text_icon->func.content_get = _gl_connection_check_get; text_icon->func.del = _connection_gl_del; - Elm_Genlist_Item_Class *text2_icon = elm_genlist_item_class_new(); - text2_icon->item_style = "2text.1icon.1"; - text2_icon->func.text_get = _gl_connection_title_get; - text2_icon->func.content_get = _gl_connection_check_get; - text2_icon->func.del = _connection_gl_del; - Elm_Genlist_Item_Class *text1 = elm_genlist_item_class_new(); text1->item_style = "1text"; text1->func.text_get = _gl_connection_title_get; @@ -745,6 +667,7 @@ Evas_Object *_create_connection_list(void *data) genlist = elm_genlist_add(ad->nf); elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS); + evas_object_smart_callback_add(genlist, "realized", gl_realized_cb, NULL); Evas_Object *circle_genlist = eext_circle_object_genlist_add(genlist, ad->circle_surface); eext_circle_object_genlist_scroller_policy_set(circle_genlist, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO); @@ -823,7 +746,6 @@ Evas_Object *_create_connection_list(void *data) } elm_genlist_item_class_free(text1); elm_genlist_item_class_free(text_icon); - elm_genlist_item_class_free(text2_icon); elm_genlist_item_class_free(itc); Elm_Genlist_Item_Class *padding = elm_genlist_item_class_new(); diff --git a/src/setting-device.c b/src/setting-device.c index c483880..857abc8 100644 --- a/src/setting-device.c +++ b/src/setting-device.c @@ -176,85 +176,6 @@ void back_key_auto_open_app_popup_cb(void *data, Evas_Object *obj, void *event_i back_button_cb_pop(); } -static void _auto_open_apps_check_changed_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) -{ - appdata *ad = g_app_context; - Evas_Object *check = (Evas_Object *)data; - - if (ad == NULL) { - DBG("%s", "_auto_open_apps_check_cb - appdata or check is null"); - return; - } - - DBG("_auto_open_apps_check_changed_cb is called!!!!!!!"); - - int is_auto_open = 0; - vconf_get_bool(VCONFKEY_SETAPPL_AUTO_OPEN_APPS, &is_auto_open); - - - if (!is_auto_open) { - Evas_Object *popup = NULL; - Evas_Object *btn1 = NULL; - Evas_Object *btn2 = NULL; - Evas_Object *icon; - - popup = elm_popup_add(ad->nf); - elm_object_style_set(popup, "circle"); - evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - elm_win_resize_object_add(ad->nf, popup); - - ad->popup = popup; - - char buf[__SETTING_BUF_SIZE__] = {0,}; - - char *font_setting = "<text_class=tizen><align=center>%s</align></text_class>"; - snprintf(buf, sizeof(buf) - 1, font_setting, _("WDS_HS_TPOP_FOCUSING_ON_ICON_IN_APPS_SCREEN_WILL_OPEN_APP_AUTOMATICALLY")); - - Evas_Object *layout; - layout = elm_layout_add(popup); - elm_layout_theme_set(layout, "layout", "popup", "content/circle/buttons2"); - - elm_object_text_set(layout, buf); - elm_object_content_set(popup, layout); - - - btn1 = elm_button_add(popup); - elm_object_style_set(btn1, "popup/circle/left"); - evas_object_size_hint_weight_set(btn1, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - elm_object_part_content_set(popup, "button1", btn1); - evas_object_smart_callback_add(btn1, "clicked", _set_auto_open_apps_cancel_cb, check); - - icon = elm_image_add(btn1); - elm_image_file_set(icon, IMG_DIR"tw_ic_popup_btn_delete.png", NULL); - evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - elm_object_part_content_set(btn1, "elm.swallow.content", icon); - evas_object_show(icon); - - btn2 = elm_button_add(popup); - elm_object_style_set(btn2, "popup/circle/right"); - evas_object_size_hint_weight_set(btn2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - elm_object_part_content_set(popup, "button2", btn2); - evas_object_smart_callback_add(btn2, "clicked", _set_auto_open_apps_ok_clicked_cb, check); - - icon = elm_image_add(btn2); - elm_image_file_set(icon, IMG_DIR"tw_ic_popup_btn_check.png", NULL); - evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - elm_object_part_content_set(btn2, "elm.swallow.content", icon); - evas_object_show(icon); - - evas_object_show(popup); - back_button_cb_push(&back_key_auto_open_app_popup_cb, check, NULL, g_device_action_genlist, "device_action_genlist"); - eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, _hw_back_key_cb, NULL); - - } else { - bool is_auto_open = 0; - vconf_set_bool(VCONFKEY_SETAPPL_AUTO_OPEN_APPS, is_auto_open); - - } - -} - - void _clear_device_action_resource() { if (device_action_timer) { @@ -288,7 +209,6 @@ Evas_Object *_gl_device_action_check_get(void *data, Evas_Object *obj, const cha } elm_check_state_set(check, (is_auto_open_apps) ? EINA_TRUE : EINA_FALSE); /*default */ - evas_object_event_callback_add(check, EVAS_CALLBACK_MOUSE_DOWN, _auto_open_apps_check_changed_cb, (void *)check); elm_object_style_set(check, "on&off"); evas_object_size_hint_align_set(check, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_size_hint_weight_set(check, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); @@ -361,7 +281,8 @@ static void gl_realized_cb(void *data, Evas_Object *obj, void *event_info) Elm_Object_Item *first = elm_genlist_first_item_get(g_double_press_home_key_genlist); if (first == item) elm_object_item_signal_emit(first, "elm,action,title,slide,start", "elm"); - + else + elm_object_item_signal_emit(item, "elm,event,pass,disabled", "elm"); } void _double_press_home_key_cb(void *data, Evas_Object *obj, void *event_info) @@ -572,6 +493,7 @@ Evas_Object *_create_device_action_list(void *data) genlist = elm_genlist_add(ad->nf); elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS); + evas_object_smart_callback_add(genlist, "realized", gl_realized_cb, NULL); Evas_Object *circle_genlist = eext_circle_object_genlist_add(genlist, ad->circle_surface); eext_circle_object_genlist_scroller_policy_set(circle_genlist, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO); diff --git a/src/setting-info.c b/src/setting-info.c index 0c9876a..18fc38f 100644 --- a/src/setting-info.c +++ b/src/setting-info.c @@ -447,6 +447,16 @@ Evas_Object *_gl_info_check_get(void *data, Evas_Object *obj, const char *part) return check; } +static void gl_realized_cb(void *data, Evas_Object *obj, void *event_info) +{ + Elm_Object_Item *item = (Elm_Object_Item *)event_info; + Elm_Object_Item *first = elm_genlist_first_item_get(g_info_genlist); + if (first == item) + elm_object_item_signal_emit(first, "elm,action,title,slide,start", "elm"); + else + elm_object_item_signal_emit(item, "elm,event,pass,disabled", "elm"); +} + Evas_Object *_create_info_list(void *data) { appdata *ad = data; @@ -477,6 +487,7 @@ Evas_Object *_create_info_list(void *data) elm_genlist_block_count_set(genlist, 14); elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS); connect_to_wheel_with_genlist(genlist, ad); + evas_object_smart_callback_add(genlist, "realized", gl_realized_cb, NULL); Elm_Genlist_Item_Class *title_item = elm_genlist_item_class_new(); title_item->func.text_get = _gl_menu_title_text_get; diff --git a/src/setting-sound.c b/src/setting-sound.c index 17f76be..6c9a694 100644 --- a/src/setting-sound.c +++ b/src/setting-sound.c @@ -468,28 +468,6 @@ char *_gl_Sound_title_get(void *data, Evas_Object *obj, const char *part) return strdup(buf); } -void _sound_chk_changed_cb(void *data, Evas_Object *obj, void *event_info) -{ - int ret = 0; - DBG("Setting - _sound_chk_changed_cb() is called!!"); - - appdata *ad = g_app_context; - if (ad == NULL) { - DBG("%s", "_create_sound_list - appdata is null"); - return; - } - - ret = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_SOUND_TOUCH, &ad->is_enable_touch_sound); - if (ret != SYSTEM_SETTINGS_ERROR_NONE) - DBG("failed! set SYSTEM_SETTINGS_KEY_SOUND_TOUCH"); - - ad->is_enable_touch_sound = !ad->is_enable_touch_sound; - - /* Update touch sound enable state */ - system_settings_set_value_bool(SYSTEM_SETTINGS_KEY_SOUND_TOUCH, ad->is_enable_touch_sound); - vconf_set_bool(VCONFKEY_SETAPPL_BUTTON_SOUNDS_BOOL, ad->is_enable_touch_sound); -} - static void _sound_gl_del(void *data, Evas_Object *obj) { Sound_Item_Data *id = data; @@ -517,7 +495,6 @@ Evas_Object *_gl_sound_check_get(void *data, Evas_Object *obj, const char *part) } elm_object_style_set(check, "on&off"); elm_check_state_set(check, (ad->is_enable_touch_sound) ? EINA_TRUE : EINA_FALSE); - evas_object_smart_callback_add(check, "changed", _sound_chk_changed_cb, (void *)1); evas_object_size_hint_align_set(check, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_size_hint_weight_set(check, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_propagate_events_set(check, EINA_FALSE); @@ -534,6 +511,16 @@ Evas_Object *_gl_sound_check_get(void *data, Evas_Object *obj, const char *part) return check; } +static void gl_realized_cb(void *data, Evas_Object *obj, void *event_info) +{ + Elm_Object_Item *item = (Elm_Object_Item *)event_info; + Elm_Object_Item *first = elm_genlist_first_item_get(g_sound_genlist); + if (first == item) + elm_object_item_signal_emit(first, "elm,action,title,slide,start", "elm"); + else + elm_object_item_signal_emit(item, "elm,event,pass,disabled", "elm"); +} + Evas_Object *_create_sound_list(void *data) { appdata *ad = data; @@ -568,6 +555,7 @@ Evas_Object *_create_sound_list(void *data) genlist = elm_genlist_add(ad->nf); elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS); + evas_object_smart_callback_add(genlist, "realized", gl_realized_cb, NULL); int menu_its_size = sizeof(sound_menu_its) / sizeof(struct _sound_menu_item); menu_its = sound_menu_its; diff --git a/src/setting-volume-page.c b/src/setting-volume-page.c index de972dc..40c4385 100644 --- a/src/setting-volume-page.c +++ b/src/setting-volume-page.c @@ -512,7 +512,6 @@ _value_changed_rotary_drag_tap(void *data, Evas_Object *obj, void *event_info) if (pd->slider_value[cur_page] == MIN_VOLUME_VALUE) { _change_btn_img(data, pd->minus_btn[cur_page], "b_slider_icon_minus_disable.png", "btn1"); _change_btn_img(pd->page_layout[cur_page], pd->center_img[cur_page], setting_volume_img_mute_names[is_telephony_enable() ? cur_page : cur_page+1], "elm.icon"); - vconf_set_int(vconf_name_backup[is_telephony_enable() ? cur_page : cur_page+1], pd->slider_value[cur_page]); } snprintf(buf, sizeof(buf), "%02d", pd->slider_value[cur_page]); @@ -816,18 +815,14 @@ Evas_Object *_create_volume_page(void *data) vconf_get_int(vconf_name[is_telephony_enable() ? i : i+1], &pd->slider_value[i]); ERR("vconf_name : %s = %d", vconf_name[is_telephony_enable() ? i : i+1], pd->slider_value[i]); - if (is_telephony_enable() && i == 0) { - int mode = get_sound_mode(); - if (mode == SOUND_MODE_VIBRATE || mode == SOUND_MODE_MUTE) { - vconf_set_int(vconf_name_backup[i], pd->slider_value[i]); - pd->slider_value[i] = 0; - } else if (mode == SOUND_MODE_SOUND && pd->slider_value[i] == 0) { - vconf_get_int(vconf_name_backup[i], &pd->slider_value[i]); - } + int mode = get_sound_mode(); + if (mode == SOUND_MODE_VIBRATE || mode == SOUND_MODE_MUTE) { + vconf_set_int(vconf_name_backup[i], pd->slider_value[i]); + pd->slider_value[i] = 0; + } else if (mode == SOUND_MODE_SOUND && pd->slider_value[i] == 0) { + vconf_get_int(vconf_name_backup[i], &pd->slider_value[i]); } - - char buf[__SETTING_BUF_SIZE__] = {0,}; snprintf(buf, sizeof(buf)-1, "%02d", pd->slider_value[i]); elm_object_part_text_set(page_layout, "elm.text.slider", buf); @@ -329,8 +329,8 @@ int is_telephony_enable(void) if (first) { ret = is_supported(SETTING_TELEPHONY_PATH); first = false; + DBG("TELEPHONY = %d", ret); } - DBG("TELEPHONY = %d", ret); if (ret > 1 || ret < 0) { DBG("Cannot decide telephony type!"); ret = 0; |