rimmed pushed a commit to branch eflete-1.18.

http://git.enlightenment.org/tools/eflete.git/commit/?id=e2b0d33d47c66a16f5ec39481b496c4a1a7a87ef

commit e2b0d33d47c66a16f5ec39481b496c4a1a7a87ef
Author: Mykyta Biliavskyi <m.biliavs...@samsung.com>
Date:   Thu Sep 1 18:06:06 2016 +0300

    Properties: update lists for top resources.
    
    Combobox, that contains lists of top resources (colorclasses,
    textblock styles, sounds, tones) will be updated at the same time
    when resource added or deleted.
    @fix
---
 src/bin/ui/colorclass_manager.c | 4 ++++
 src/bin/ui/sound_manager.c      | 8 ++++++++
 src/bin/ui/style_manager.c      | 4 ++++
 3 files changed, 16 insertions(+)

diff --git a/src/bin/ui/colorclass_manager.c b/src/bin/ui/colorclass_manager.c
index 55bf7fd..35185b0 100644
--- a/src/bin/ui/colorclass_manager.c
+++ b/src/bin/ui/colorclass_manager.c
@@ -98,6 +98,7 @@ _colorclass_add_cb(void *data __UNUSED__,
                    Evas_Object *obj __UNUSED__,
                    void *event_info __UNUSED__)
 {
+   Attribute attribute = ATTRIBUTE_STATE_COLOR_CLASS;
    Colorclasses_Manager *edit = (Colorclasses_Manager *)data;
    Colorclass_Item *it = NULL;
    Elm_Object_Item *glit_ccl = NULL;
@@ -131,6 +132,7 @@ _colorclass_add_cb(void *data __UNUSED__,
    CRIT_ON_FAIL(editor_save(ap.project->global_object));
    TODO("Remove this line once edje_edit_colorclass API would be added into 
Editor Module and saving would work properly")
    ap.project->changed = true;
+   evas_object_smart_callback_call(ap.win, SIGNAL_EDITOR_ATTRIBUTE_CHANGED, 
&attribute);
 
 end:
    resource_name_validator_free(mng.name_validator);
@@ -144,6 +146,7 @@ _colorclass_del_cb(void *data __UNUSED__,
 {
    Resource *res;
    Resource request;
+   Attribute attribute = ATTRIBUTE_STATE_COLOR_CLASS;
 
    Elm_Object_Item *it = elm_genlist_selected_item_get(mng.genlist);
    Elm_Object_Item *next = elm_genlist_item_next_get(it);
@@ -156,6 +159,7 @@ _colorclass_del_cb(void *data __UNUSED__,
    resource_remove(&ap.project->colorclasses, res);
    resource_free(res);
    elm_object_item_del(it);
+   evas_object_smart_callback_call(ap.win, SIGNAL_EDITOR_ATTRIBUTE_CHANGED, 
&attribute);
 
 #if 0
    State *state;
diff --git a/src/bin/ui/sound_manager.c b/src/bin/ui/sound_manager.c
index e46c79a..96dfb59 100644
--- a/src/bin/ui/sound_manager.c
+++ b/src/bin/ui/sound_manager.c
@@ -210,6 +210,7 @@ _add_sample_done(void *data __UNUSED__,
                  void *event_info)
 {
    Sound_Data *snd;
+   Attribute attribute = ATTRIBUTE_PROGRAM_SAMPLE_NAME;
    Eina_Stringshare *sound_name;
    Eina_List *samples_list, *l;
    Eina_Bool exist = false;
@@ -277,6 +278,7 @@ _add_sample_done(void *data __UNUSED__,
    CRIT_ON_FAIL(editor_save(ap.project->global_object));
    TODO("Remove this line once edje_edit_sound_sample_add would be added into 
Editor Module and saving would work properly")
    ap.project->changed = true;
+   evas_object_smart_callback_call(ap.win, SIGNAL_EDITOR_ATTRIBUTE_CHANGED, 
&attribute);
 
    return true;
 }
@@ -285,6 +287,7 @@ static void
 _tone_add(void)
 {
    Sound_Data *snd;
+   Attribute attribute = ATTRIBUTE_PROGRAM_TONE_NAME;
    Eina_Stringshare *tone_name;
    int frq;
    Tone_Resource *tone;
@@ -307,6 +310,7 @@ _tone_add(void)
    CRIT_ON_FAIL(editor_save(ap.project->global_object));
    TODO("Remove this line once edje_edit_image_add would be added into Editor 
Module and saving would work properly")
    ap.project->changed = true;
+   evas_object_smart_callback_call(ap.win, SIGNAL_EDITOR_ATTRIBUTE_CHANGED, 
&attribute);
 }
 
 static void
@@ -435,6 +439,7 @@ _sound_del_cb(void *data __UNUSED__,
    Eina_List *list, *l, *l_next;
    External_Resource *res;
    Resource request;
+   Attribute attribute;
 
    list = (Eina_List *)elm_gengrid_selected_items_get(mng.gengrid);
    EINA_LIST_FOREACH_SAFE(list, l, l_next, grid_it)
@@ -444,6 +449,7 @@ _sound_del_cb(void *data __UNUSED__,
         switch (snd->type)
           {
            case SOUND_TYPE_SAMPLE:
+              attribute = ATTRIBUTE_PROGRAM_SAMPLE_NAME;
               request.name = snd->name;
               request.resource_type = RESOURCE_TYPE_SOUND;
               res = (External_Resource *)resource_get(ap.project->sounds, 
&request);
@@ -454,6 +460,7 @@ _sound_del_cb(void *data __UNUSED__,
               elm_object_item_del(grid_it);
               break;
            case SOUND_TYPE_TONE:
+              attribute = ATTRIBUTE_PROGRAM_TONE_NAME;
               request.name = snd->name;
               request.resource_type = RESOURCE_TYPE_TONE;
               res = (External_Resource *)resource_get(ap.project->tones, 
&request);
@@ -471,6 +478,7 @@ _sound_del_cb(void *data __UNUSED__,
 
    elm_object_disabled_set(mng.btn_del, true);
    evas_object_smart_callback_call(ap.win, SIGNAL_SOUND_UNSELECTED, NULL);
+   evas_object_smart_callback_call(ap.win, SIGNAL_EDITOR_ATTRIBUTE_CHANGED, 
&attribute);
 }
 
 ITEM_SEARCH_FUNC(gengrid, ELM_GENGRID_ITEM_SCROLLTO_MIDDLE, "elm.text")
diff --git a/src/bin/ui/style_manager.c b/src/bin/ui/style_manager.c
index 8e44955..49164f0 100644
--- a/src/bin/ui/style_manager.c
+++ b/src/bin/ui/style_manager.c
@@ -178,6 +178,7 @@ _style_add_cb(void *data __UNUSED__,
               Evas_Object *obj __UNUSED__,
               void *event_info __UNUSED__)
 {
+   Attribute attribute = ATTRIBUTE_STATE_TEXT_STYLE;
    Resource *res;
    Popup_Button btn_res;
    const char *style_name;
@@ -215,6 +216,7 @@ _style_add_cb(void *data __UNUSED__,
    CRIT_ON_FAIL(editor_save(ap.project->global_object));
    TODO("Remove this line once edje_edit API would be added into Editor Module 
and saving would work properly")
    ap.project->changed = true;
+   evas_object_smart_callback_call(ap.win, SIGNAL_EDITOR_ATTRIBUTE_CHANGED, 
&attribute);
 
 close:
    resource_name_validator_free(mng.popup.validator);
@@ -319,6 +321,7 @@ _btn_del_cb(void *data __UNUSED__,
    const char *style_name, *tag;
    Resource *res;
    Resource request;
+   Attribute attribute = ATTRIBUTE_STATE_TEXT_STYLE;
 
    Elm_Object_Item *glit = elm_genlist_selected_item_get(mng.genlist);
    if (!glit) return;
@@ -333,6 +336,7 @@ _btn_del_cb(void *data __UNUSED__,
         res = resource_get(ap.project->styles, &request);
         edje_edit_style_del(edje_edit_obj, style_name);
         resource_remove(&ap.project->styles, res);
+        evas_object_smart_callback_call(ap.win, 
SIGNAL_EDITOR_ATTRIBUTE_CHANGED, &attribute);
      }
    else
      {

-- 


Reply via email to