diff options
author | jinwang.an <jinwang.an@samsung.com> | 2019-12-26 18:20:17 +0900 |
---|---|---|
committer | jinwang.an <jinwang.an@samsung.com> | 2019-12-26 18:20:17 +0900 |
commit | 67424f7d01403431de08c0f078e25c28ef7d81f0 (patch) | |
tree | 885a63f5290db393c19af1267889359d1c2060fc | |
parent | cc5f8e5545bb81b340036caff50754f585538c1e (diff) | |
download | watch-setting-67424f7d01403431de08c0f078e25c28ef7d81f0.tar.gz watch-setting-67424f7d01403431de08c0f078e25c28ef7d81f0.tar.bz2 watch-setting-67424f7d01403431de08c0f078e25c28ef7d81f0.zip |
Change-Id: I8299f0cbd3f31964facbc66500f3c2b98d6c5e60
Signed-off-by: jinwang.an <jinwang.an@samsung.com>
-rw-r--r-- | include/util.h | 4 | ||||
-rw-r--r-- | src/setting.c | 208 |
2 files changed, 41 insertions, 171 deletions
diff --git a/include/util.h b/include/util.h index 8db36c3..8dea008 100644 --- a/include/util.h +++ b/include/util.h @@ -117,7 +117,6 @@ typedef struct _appdata { Evas_Object *layout_main; Evas_Object *nf; Evas_Object *datetime; - Evas_Object *alert_rdg; Evas_Object *sound_mode_rdg; Evas_Object *ringtone_type_rdg; Evas_Object *notification_rdg; @@ -154,9 +153,6 @@ typedef struct _appdata { char *device_name; - int is_motion_smart_relay_on; - int is_motion_wake_up_on; - int is_show_ringtone_toast; int is_show_noti_toast; int is_direct_brightness_setting; diff --git a/src/setting.c b/src/setting.c index 5fec3ae..0403272 100644 --- a/src/setting.c +++ b/src/setting.c @@ -646,14 +646,6 @@ static void _lang_changed(app_event_info_h event_info, void *data) FREE(locale); } -static void init_values(appdata *ad) -{ - setting_ret_if(!ad); - - ad->is_motion_smart_relay_on = 1; - ad->is_motion_wake_up_on = 1; -} - static int init_watch_setting(appdata *ad) { DBG("init_watch_setting() is called!"); @@ -674,11 +666,6 @@ static int init_watch_setting(appdata *ad) /* Naviframe */ ad->nf = _create_naviframe_layout(ad->layout_main); - /* Naviframe Content */ - /* _create_view_layout(ad); */ - - init_values(ad); - int vibration_level = 0; vconf_get_int(VCONFKEY_SETAPPL_NOTI_VIBRATION_LEVEL_INT, &vibration_level); @@ -713,19 +700,6 @@ static char *_gl_text_get(void *data, Evas_Object *obj, const char *part) setting_retv_if(!data, NULL); - /* - char expression[32]; - - if( index == LANGUAGE_MENU_INDEX ) { - if( is_connected_GM() ) { - strcpy(expression, "<font color=#515151>%s</font>"); - } else { - strcpy(expression, "%s"); - } - } else { - strcpy(expression, "%s"); - }*/ - snprintf(buf, sizeof(buf) - 1, "%s", _(setting_menu_its[index].name)); return strdup(buf); @@ -872,8 +846,6 @@ static void _create_view_layout(appdata *ad) elm_naviframe_item_pop_cb_set(nf_it, _pop_cb, ad); /* ad->win_main */ eext_object_event_callback_add(ad->nf, EEXT_CALLBACK_BACK, _hw_back_key_cb, NULL); - - /*register_vconf_changing(VCONFKEY_WMS_WMANAGER_CONNECTED, change_language_enabling, NULL); */ } static Evas_Object *create_win(const char *name) @@ -956,9 +928,7 @@ bool app_create(void *data) DBG("[TIME] 4. setting_main_app_create taked %d msec ", appcore_measure_time()); /*appcore_measure_start(); */ - /*int ret = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_LOCALE_TIMEZONE, _time_cb, NULL); */ - /*DBG("ret = %d", ret); */ - DBG("app_create finish. with skip locale"); + DBG("app_create finish."); back_button_cb_push(&_exit_app, NULL, NULL, NULL, "EXIT!! NO genlist"); /*ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, _hw_back_key_cb, NULL);*/ @@ -976,9 +946,6 @@ void app_terminate(void *data) feedback_deinitialize(); - if (ad->alert_rdg) { - ad->alert_rdg = NULL; - } if (ad->datetime) { ad->datetime = NULL; } @@ -1036,13 +1003,7 @@ void app_terminate(void *data) __FREE_SERVICE(ad->service_bt); __FREE_SERVICE(ad->service_input); - /* unregister motion vconf changed callback */ - /*unregister_vconf_changing(VCONFKEY_WMS_WMANAGER_CONNECTED, change_language_enabling); */ - eext_circle_surface_del(ad->circle_surface); - - /*int ret = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_LOCALE_TIMEZONE); */ - /*DBG("locale tzone unset cb ret = %s", get_error_message(ret)); */ } void app_pause(void *data) @@ -1074,105 +1035,21 @@ void app_resume(void *data) running = false; } -void load_brightness_setting(void *data) -{ - Evas_Object *brightness_ly = NULL; - Elm_Object_Item *nf_it = NULL; - appdata *ad = data; - - setting_ret_if(!ad); - setting_ret_if(!ad->nf); - - brightness_ly = _show_brightness_popup(ad, NULL, NULL); - ad->main_brightness_ly = nf_it = elm_naviframe_item_push(ad->nf, NULL, NULL, NULL, brightness_ly, NULL); - elm_naviframe_item_title_enabled_set(nf_it, EINA_FALSE, EINA_FALSE); - - elm_naviframe_item_pop_cb_set(nf_it, _pop_cb_moment_bar, ad); /* ad->win_main */ -} - -void load_volume_setting(void *data) -{ - Evas_Object *volume_ly = NULL; - Elm_Object_Item *nf_it = NULL; - appdata *ad = data; - - setting_ret_if(!ad); - setting_ret_if(!ad->nf); - - _initialize_volume(); - volume_ly = _create_volume_page(data); - ad->main_volume_ly = nf_it = elm_naviframe_item_push(ad->nf, NULL, NULL, NULL, volume_ly, NULL); - elm_naviframe_item_title_enabled_set(nf_it, EINA_FALSE, EINA_FALSE); - - elm_naviframe_item_pop_cb_set(nf_it, _pop_cb_moment_bar, ad); /* ad->win_main */ -} - -void load_media_volume_setting(void *data) -{ - Evas_Object *volume_ly = NULL; - Elm_Object_Item *nf_it = NULL; - appdata *ad = data; - - setting_ret_if(!ad); - setting_ret_if(!ad->nf); - - _initialize_volume(); - volume_ly = _media_create_volume_page(data); - ad->main_media_volume_ly = nf_it = elm_naviframe_item_push(ad->nf, NULL, NULL, NULL, volume_ly, NULL); - elm_naviframe_item_title_enabled_set(nf_it, EINA_FALSE, EINA_FALSE); - - elm_naviframe_item_pop_cb_set(nf_it, _pop_cb_moment_bar, ad); /* ad->win_main */ -} - -void load_watch_face_setting(void *data) -{ - Evas_Object *watch_face_ly = NULL; - Elm_Object_Item *nf_it = NULL; - appdata *ad = data; - - setting_ret_if(!ad); - setting_ret_if(!ad->nf); - - initialize_clock(data); - - watch_face_ly = _clock_type_cb(data); - ad->main_watch_face_ly = nf_it = elm_naviframe_item_push(ad->nf, NULL, NULL, NULL, watch_face_ly, NULL); - elm_naviframe_item_title_enabled_set(nf_it, EINA_FALSE, EINA_FALSE); - - elm_naviframe_item_pop_cb_set(nf_it, _pop_cb_moment_bar, ad); /* ad->win_main */ -} -void load_connections_setting(void *data) +Elm_Object_Item *push_naviframe(appdata *ad, Evas_Object *layer) { - Evas_Object *connections_ly = NULL; Elm_Object_Item *nf_it = NULL; - appdata *ad = data; - setting_ret_if(!ad); - setting_ret_if(!ad->nf); + setting_retv_if(!ad, NULL); + setting_retv_if(!ad->nf, NULL); - connections_ly = _create_connection_list(data); - ad->main_connections_ly = nf_it = elm_naviframe_item_push(ad->nf, NULL, NULL, NULL, connections_ly, NULL); + nf_it = elm_naviframe_item_push(ad->nf, NULL, NULL, NULL, layer, NULL); elm_naviframe_item_title_enabled_set(nf_it, EINA_FALSE, EINA_FALSE); elm_naviframe_item_pop_cb_set(nf_it, _pop_cb_moment_bar, ad); /* ad->win_main */ + return nf_it; } -void load_data_usage_setting(void *data) -{ - Evas_Object *data_usage_ly = NULL; - Elm_Object_Item *nf_it = NULL; - appdata *ad = data; - - setting_ret_if(!ad); - setting_ret_if(!ad->nf); - - data_usage_ly = _create_data_usage_list(data); - ad->main_data_usage_ly = nf_it = elm_naviframe_item_push(ad->nf, NULL, NULL, NULL, data_usage_ly, NULL); - elm_naviframe_item_title_enabled_set(nf_it, EINA_FALSE, EINA_FALSE); - - elm_naviframe_item_pop_cb_set(nf_it, _pop_cb_moment_bar, ad); /* ad->win_main */ -} void clear_popup_naviframe(appdata *ad) { @@ -1198,7 +1075,7 @@ void clear_popup_naviframe(appdata *ad) } -int check_direct_momentbar_setting(void *data, app_control_h service) +int process_extra_data(void *data, app_control_h service) { char *param = NULL; appdata *ad = data; @@ -1215,17 +1092,26 @@ int check_direct_momentbar_setting(void *data, app_control_h service) } if (param && !strcmp(param, "brightness")) { - load_brightness_setting(data); + Evas_Object *brightness_ly = _show_brightness_popup(ad, NULL, NULL); + ad->main_brightness_ly = push_naviframe(ad, brightness_ly); } else if (param && !strcmp(param, "volume")) { - load_volume_setting(data); + _initialize_volume(); + Evas_Object *volume_ly = _create_volume_page(ad); + ad->main_volume_ly = push_naviframe(ad, volume_ly); } else if (param && !strcmp(param, "media_volume")) { - load_media_volume_setting(data); + _initialize_volume(); + Evas_Object *volume_ly = _media_create_volume_page(ad); + ad->main_media_volume_ly = push_naviframe(ad, volume_ly); } else if (param && !strcmp(param, "watchface")) { - load_watch_face_setting(data); + initialize_clock(data); + Evas_Object *watch_face_ly = _clock_type_cb(ad); + ad->main_watch_face_ly = push_naviframe(ad, watch_face_ly); } else if (param && !strcmp(param, "connections")) { - load_connections_setting(data); + Evas_Object *connections_ly = _create_connection_list(ad); + ad->main_connections_ly = push_naviframe(ad, connections_ly); } else if (param && !strcmp(param, "data_usage")) { - load_data_usage_setting(data); + Evas_Object *data_usage_ly = _create_data_usage_list(ad); + ad->main_data_usage_ly = push_naviframe(ad, data_usage_ly); } if (ad->win_main) { evas_object_show(ad->win_main); @@ -1241,45 +1127,37 @@ int check_direct_momentbar_setting(void *data, app_control_h service) return 0; } -void app_reset(app_control_h service, void *data) +void app_ctrl(app_control_h service, void *data) { - DBG("Setting - app_reset()"); + DBG("Setting - app_ctrl()"); appdata *ad = data; setting_ret_if(!data); - char *operation = NULL; - app_control_get_operation(service, &operation); - - if (check_direct_momentbar_setting(data, service)) + if (process_extra_data(data, service)) return; - DBG("operation : %s, ad->is_first_launch :%d ", operation, (ad) ? ad->is_first_launch : -1); if (!ad->is_first_launch) { - if (operation && (!strcmp(operation, "http://tizen.org/appcontrol/operation/default") - || !strcmp(operation, "http://tizen.org/appcontrol/operation/main")) - ) { - clear_popup_naviframe(ad); + clear_popup_naviframe(ad); - /*reset back button callback stack*/ - clear_back_button_list(); - back_button_cb_push(&_exit_app, NULL, NULL, NULL, "EXIT!! NO genlist"); + /*reset back button callback stack*/ + clear_back_button_list(); + back_button_cb_push(&_exit_app, NULL, NULL, NULL, "EXIT!! NO genlist"); - if (ad->main_genlist) { - elm_genlist_item_show(elm_genlist_first_item_get(ad->main_genlist), - ELM_GENLIST_ITEM_SCROLLTO_TOP); - elm_layout_signal_emit(ad->main_genlist, "do-show-vbar", ""); - - if (scrl_timer) { - ecore_timer_del(scrl_timer); - scrl_timer = NULL; - } - scrl_timer = ecore_timer_add(1, (Ecore_Task_Cb)_scroller_timer_cb, ad->main_genlist); - connect_to_wheel_with_genlist(ad->main_genlist, ad); - } + if (ad->main_genlist) { + elm_genlist_item_show(elm_genlist_first_item_get(ad->main_genlist), + ELM_GENLIST_ITEM_SCROLLTO_TOP); + elm_layout_signal_emit(ad->main_genlist, "do-show-vbar", ""); + if (scrl_timer) { + ecore_timer_del(scrl_timer); + scrl_timer = NULL; + } + scrl_timer = ecore_timer_add(1, (Ecore_Task_Cb)_scroller_timer_cb, ad->main_genlist); + connect_to_wheel_with_genlist(ad->main_genlist, ad); } + } else { ad->is_first_launch = 0; } @@ -1290,10 +1168,6 @@ void app_reset(app_control_h service, void *data) } ad->MENU_TYPE = SETTING_MAIN; - - /* Register language change vconf */ - /*register_vconf_changing(VCONFKEY_WMS_WMANAGER_CONNECTED, change_language_enabling, NULL); */ - /*return TRUE; */ } int main(int argc, char *argv[]) @@ -1310,7 +1184,7 @@ int main(int argc, char *argv[]) event_callback.terminate = app_terminate; event_callback.pause = app_pause; event_callback.resume = app_resume; - event_callback.app_control = app_reset; + event_callback.app_control = app_ctrl; ui_app_add_event_handler(&handlers[APP_EVENT_LOW_MEMORY], APP_EVENT_LOW_MEMORY, NULL, NULL); ui_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], APP_EVENT_LANGUAGE_CHANGED, _lang_changed, NULL); |