fix N_SE-22344, TDIS-3124
authorHyejin Kim <hyejin0906.kim@samsung.com>
Sat, 26 Jan 2013 07:27:01 +0000 (16:27 +0900)
committerHyejin Kim <hyejin0906.kim@samsung.com>
Sat, 26 Jan 2013 07:27:46 +0000 (16:27 +0900)
setting-profile/src/setting-profile-sound-main.c
setting-profile/src/setting-profile.c

index 239b5da..b70027f 100755 (executable)
@@ -1009,7 +1009,7 @@ static int setting_profile_sound_main_create(void *cb)
 
        /*  view layout */
        Evas_Object *view_layout = elm_layout_add(ad->win_main_layout);
-       elm_layout_theme_set(view_layout, "layout", "tabbar", "default");
+       elm_layout_theme_set(view_layout, "layout", "application", "default");
        evas_object_show(view_layout);
        ad->view_layout = view_layout;
 
@@ -1038,8 +1038,9 @@ static int setting_profile_sound_main_create(void *cb)
        elm_object_style_set(ug_back_btn, NAVI_BACK_BUTTON_STYLE);
        evas_object_smart_callback_add(ug_back_btn, "clicked", setting_profile_sound_main_click_softkey_cancel_cb, ad);
 
-       Elm_Object_Item *navi_it = elm_naviframe_item_push(ad->navi_bar, NULL, ug_back_btn, NULL, ad->view_layout, "tabbar");
-       elm_naviframe_item_title_visible_set(navi_it, EINA_FALSE);
+       Elm_Object_Item *navi_it = elm_naviframe_item_push(ad->navi_bar, _(KeyStr_Sounds), ug_back_btn, NULL, ad->view_layout, "tabbar");
+       elm_object_item_part_content_set(navi_it, "tabbar", tabbar);
+       //elm_naviframe_item_title_visible_set(navi_it, EINA_FALSE);
 
        setting_view_profile_sound_main.is_create = TRUE;
 
@@ -1076,6 +1077,7 @@ static int setting_profile_sound_main_destroy(void *cb)
 
 static int setting_profile_sound_main_update(void *cb)
 {
+       SETTING_TRACE_BEGIN;
        /* error check */
        retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER);
 
@@ -1085,6 +1087,13 @@ static int setting_profile_sound_main_update(void *cb)
                evas_object_show(ad->ly_main);
        }
 
+       int volume = 0;
+
+       sound_manager_get_volume(SOUND_TYPE_RINGTONE, &volume);
+       SETTING_TRACE_DEBUG("ringtone volume is %d", volume);
+       if(ad->data_call_volume && ad->data_call_volume->eo_check)
+               elm_slider_value_set(ad->data_call_volume->eo_check, (double)volume);
+
        return SETTING_RETURN_SUCCESS;
 }
 
index 7c6fdbe..542338e 100755 (executable)
@@ -48,45 +48,59 @@ static void setting_profile_ug_cb_resize(void *data, Evas *e,
 
 void __sound_volume_changed_cb(sound_type_e type, unsigned int volume, void *user_data)
 {
+       SETTING_TRACE_BEGIN;
        ret_if(!user_data);
        SettingProfileUG *ad = user_data;
+       Setting_GenGroupItem_Data *item_data = NULL;
 
        Evas_Object *slider = NULL;
        switch (type)
        {
                case SOUND_TYPE_SYSTEM:
+                       SETTING_TRACE_DEBUG("system");
                        if (ad->data_touch_volume)
-                               slider = ad->data_touch_volume->eo_check;
+                               item_data = ad->data_touch_volume;
+                               //slider = ad->data_touch_volume->eo_check;
                        break;
                case SOUND_TYPE_NOTIFICATION:
+                       SETTING_TRACE_DEBUG("notification");
                        if (ad->data_noti_volume)
-                               slider = ad->data_noti_volume->eo_check;
+                               item_data = ad->data_noti_volume;
+                               //slider = ad->data_noti_volume->eo_check;
                        break;
                case SOUND_TYPE_RINGTONE:
+                       SETTING_TRACE_DEBUG("ringtone");
                        if (ad->data_call_volume)
-                               slider = ad->data_call_volume->eo_check;
+                               item_data = ad->data_call_volume;
+                               //slider = ad->data_call_volume->eo_check;
                        break;
                case SOUND_TYPE_MEDIA:
+                       SETTING_TRACE_DEBUG("media");
                        if (ad->data_media_volume)
-                               slider = ad->data_media_volume->eo_check;
+                               item_data = ad->data_media_volume;
+                               //slider = ad->data_media_volume->eo_check;
                        break;
                //At present, there are only 4 types supported:RINGTONE,NOTIFICATION,SYSTEM,MEDIA
-               case SOUND_TYPE_CALL:
-               case SOUND_TYPE_ALARM:
                default:
                        SETTING_TRACE_ERROR("Invalid sound type:%d", type);
                        return;
        }
 
-       if (slider)
+       if (item_data && item_data->eo_check)
        {
+               SETTING_TRACE_DEBUG("update slider value");
                int volume = 0;
                double old_volume = 0;
                sound_manager_get_volume(type, &volume);        /* system */
+               SETTING_TRACE_DEBUG("get_volume is %d", volume);
 
-               old_volume = elm_slider_value_get(slider);
+               old_volume = elm_slider_value_get(item_data->eo_check);
+               SETTING_TRACE_DEBUG("slider volume is %d", old_volume);
                if ((int)volume != (int)(old_volume + 0.5)) {   /* reset again */
-                               elm_slider_value_set(slider, volume);
+                       elm_slider_value_set(item_data->eo_check, (double)volume);
+                       SETTING_TRACE_DEBUG("update to new value %d", volume);
+                       item_data->chk_status = volume;
+                       elm_genlist_item_update(item_data->item);
                }
        }
 }
@@ -531,6 +545,43 @@ static void setting_profile_ug_on_resume(ui_gadget_h ug, service_h service, void
        /* update path of tones */
        char *pa_tone_path = NULL;
 
+       if(profileUG->data_call_volume)
+       {
+               int volume;
+               SETTING_TRACE_DEBUG("ringtone volume %x", profileUG->data_call_volume);
+               sound_manager_get_volume(SOUND_TYPE_RINGTONE, &volume); /* system */
+               SETTING_TRACE_DEBUG("get_volume is %d", volume);
+               elm_slider_value_set(profileUG->data_call_volume->eo_check, (double)volume);
+               SETTING_TRACE_DEBUG("update to new value %d", volume);
+       }
+       if(profileUG->data_noti_volume)
+       {
+               int volume;
+               SETTING_TRACE_DEBUG("noti volume %x", profileUG->data_noti_volume);
+               sound_manager_get_volume(SOUND_TYPE_NOTIFICATION, &volume);     /* system */
+               SETTING_TRACE_DEBUG("get_volume is %d", volume);
+               elm_slider_value_set(profileUG->data_noti_volume->eo_check, (double)volume);
+               SETTING_TRACE_DEBUG("update to new value %d", volume);
+       }
+       if(profileUG->data_media_volume)
+       {
+               int volume;
+               SETTING_TRACE_DEBUG("media volume %x", profileUG->data_media_volume);
+               sound_manager_get_volume(SOUND_TYPE_MEDIA, &volume);    /* system */
+               SETTING_TRACE_DEBUG("get_volume is %d", volume);
+               elm_slider_value_set(profileUG->data_media_volume->eo_check, (double)volume);
+               SETTING_TRACE_DEBUG("update to new value %d", volume);
+       }
+       if(profileUG->data_touch_volume)
+       {
+               int volume;
+               SETTING_TRACE_DEBUG("system volume %x", profileUG->data_touch_volume);
+               sound_manager_get_volume(SOUND_TYPE_SYSTEM, &volume);   /* system */
+               SETTING_TRACE_DEBUG("get_volume is %d", volume);
+               elm_slider_value_set(profileUG->data_touch_volume->eo_check, (double)volume);
+               SETTING_TRACE_DEBUG("update to new value %d", volume);
+       }
+
        /* 1. incoming call ringtone */
        if(profileUG->data_call_alert_tone)
        {