rimmed pushed a commit to branch master. http://git.enlightenment.org/tools/eflete.git/commit/?id=16fdfe7e969bcf8eaba4074d97c17edcbeb296ed
commit 16fdfe7e969bcf8eaba4074d97c17edcbeb296ed Author: Vyacheslav Reutskiy <v.reuts...@samsung.com> Date: Tue Jan 26 14:35:48 2016 +0200 sound_editor: make property empty if sound is unselected Change-Id: I8b607fb28e1ab12b5cad367af8a8f71343375dca --- src/bin/common/signals.h | 9 ++++++++- src/bin/ui/editors/sound_editor.c | 15 +++++++++++++-- src/bin/ui/property_sound.c | 28 ++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 3 deletions(-) diff --git a/src/bin/common/signals.h b/src/bin/common/signals.h index e82846e..c26a9e6 100644 --- a/src/bin/common/signals.h +++ b/src/bin/common/signals.h @@ -330,7 +330,7 @@ typedef struct { */ #define SIGNAL_SOUND_EDITOR_TAB_CLICKED "SIGNAL_SOUND_EDITOR_TAB_CLICKED" - /** +/** * emited when sound/sounds in sound editor is/are added/selected. * eventinfo - NULL * @@ -338,6 +338,13 @@ typedef struct { */ #define SIGNAL_SOUND_SELECT "SIGNAL_SOUND_SELECT" +/** + * emited when sound in sound editor ise unselected. + * eventinfo - NULL + * + * @ingroup Window + */ +#define SIGNAL_SOUND_UNSELECTED "SIGNAL_SOUND_UNSELECTED" /** * emited when sound/sounds in sound editor is/are deleted. * eventinfo - NULL diff --git a/src/bin/ui/editors/sound_editor.c b/src/bin/ui/editors/sound_editor.c index 62833c4..5b5f7e3 100644 --- a/src/bin/ui/editors/sound_editor.c +++ b/src/bin/ui/editors/sound_editor.c @@ -195,8 +195,18 @@ _gengrid_content_fill(Sound_Editor *edit) } static void -_create_gengrid(Evas_Object *parent, - Sound_Editor *editor) +_grid_sel(void *data, + Evas_Object *obj __UNUSED__, + void *event_info __UNUSED__) +{ + Sound_Editor *editor = (Sound_Editor *)data; + + elm_object_disabled_set(editor->btn_del, true); + evas_object_smart_callback_call(ap.win, SIGNAL_SOUND_UNSELECTED, NULL); +} + +static void +_create_gengrid(Evas_Object *parent, Sound_Editor *editor) { assert(parent != NULL); assert(editor != NULL); @@ -205,6 +215,7 @@ _create_gengrid(Evas_Object *parent, elm_gengrid_item_size_set(editor->gengrid, ITEM_WIDTH, ITEM_HEIGHT); elm_gengrid_group_item_size_set(editor->gengrid, ITEM_HEIGHT/5, ITEM_HEIGHT/5); elm_gengrid_align_set(editor->gengrid, 0.0, 0.0); + evas_object_smart_callback_add(editor->gengrid, "unselected", _grid_sel, editor); elm_scroller_policy_set(editor->gengrid, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF); elm_gengrid_multi_select_set(editor->gengrid, false); diff --git a/src/bin/ui/property_sound.c b/src/bin/ui/property_sound.c index fe38b96..bf22d07 100644 --- a/src/bin/ui/property_sound.c +++ b/src/bin/ui/property_sound.c @@ -1002,6 +1002,33 @@ _on_grid_clicked(void *data, } } +static void +_sound_unselected(void *data, + Evas_Object *obj __UNUSED__, + void *event_info __UNUSED__) +{ + Evas_Object *item; + Sound_Prop_Data *pd = (Sound_Prop_Data *)data; + + item = elm_object_part_content_get(pd->snd_data.file_name, "elm.swallow.content"); + elm_object_text_set(item, _("-")); + + item = elm_object_part_content_get(pd->snd_data.duration, "elm.swallow.content"); + elm_object_text_set(item, _("-")); + + item = elm_object_part_content_get(pd->snd_data.type, "elm.swallow.content"); + elm_object_text_set(item, _("-")); + + item = elm_object_part_content_get(pd->snd_data.size, "elm.swallow.content"); + elm_object_text_set(item, _("-")); + + item = elm_object_part_content_get(pd->snd_data.tone_name, "elm.swallow.content"); + elm_object_text_set(item, _("-")); + + item = elm_object_part_content_get(pd->snd_data.duration, "swallow.content1"); + elm_object_text_set(item, _("-")); +} + Evas_Object * ui_property_sound_add(Evas_Object *parent) { @@ -1026,6 +1053,7 @@ ui_property_sound_add(Evas_Object *parent) _sound_info_create(parent, pd); evas_object_smart_callback_add(ap.win, SIGNAL_SOUND_SELECT, _on_grid_clicked, pd); + evas_object_smart_callback_add(ap.win, SIGNAL_SOUND_UNSELECTED, _sound_unselected, pd); return pd->box; } --