rimmed pushed a commit to branch master. http://git.enlightenment.org/tools/eflete.git/commit/?id=e6201fc6ceec3a7038e79a2361433bc27eb23108
commit e6201fc6ceec3a7038e79a2361433bc27eb23108 Author: Vitalii Vorobiov <vi.vorob...@samsung.com> Date: Wed Sep 21 17:47:22 2016 +0300 editor_group: on group delete or add make two signals because of Resource Manager --- src/bin/editor/editor_group.c | 5 ++++- src/bin/resource_manager/resource_manager_free.c | 2 +- src/bin/resource_manager/resource_manager_react.c | 3 +++ src/bin/ui/project_navigator.c | 19 +++---------------- 4 files changed, 11 insertions(+), 18 deletions(-) diff --git a/src/bin/editor/editor_group.c b/src/bin/editor/editor_group.c index 93a2893..9e599e5 100644 --- a/src/bin/editor/editor_group.c +++ b/src/bin/editor/editor_group.c @@ -82,7 +82,10 @@ editor_group_del(Evas_Object *obj, const char *name, Eina_Bool notify) /* for deleting and cleaning up dependencies, for groups it is important to delete after cleaning up */ if (notify) - evas_object_smart_callback_call(ap.win, SIGNAL_EDITOR_GROUP_DELETED, (void *)name); + { + evas_object_smart_callback_call(ap.win, SIGNAL_GROUP_DELETED, (void *)name); + evas_object_smart_callback_call(ap.win, SIGNAL_EDITOR_GROUP_DELETED, (void *)name); + } if (!edje_edit_group_del(obj, name)) return false; diff --git a/src/bin/resource_manager/resource_manager_free.c b/src/bin/resource_manager/resource_manager_free.c index f26fa99..917ff7c 100644 --- a/src/bin/resource_manager/resource_manager_free.c +++ b/src/bin/resource_manager/resource_manager_free.c @@ -740,7 +740,7 @@ _resource_group_del(Project *pro, Group2 *group) every aliased group. */ EINA_LIST_FOREACH(group->aliases, l, alias_group) { - _resource_group_del(pro, alias_group); + CRIT_ON_FAIL(editor_group_del(ap.project->global_object, alias_group->common.name, true)); } EINA_LIST_FOREACH(group->common.used_in, l, res) diff --git a/src/bin/resource_manager/resource_manager_react.c b/src/bin/resource_manager/resource_manager_react.c index 84c4fa4..c63364c 100644 --- a/src/bin/resource_manager/resource_manager_react.c +++ b/src/bin/resource_manager/resource_manager_react.c @@ -889,6 +889,9 @@ _editor_group_add_cb(void *data, group = _group_add(pro, group_name); _group_load(pro, group); _group_dependency_load(pro, group); + + /* to send info that group was succesfully added and UI need to update */ + evas_object_smart_callback_call(ap.win, SIGNAL_GROUP_ADDED, group); } static void diff --git a/src/bin/ui/project_navigator.c b/src/bin/ui/project_navigator.c index fc51741..81e1c6c 100644 --- a/src/bin/ui/project_navigator.c +++ b/src/bin/ui/project_navigator.c @@ -495,9 +495,9 @@ _btn_add_group_cb(void *data __UNUSED__, static void _folder_del(const char *prefix) { - Eina_List *folders = NULL, *groups = NULL, *l; + Eina_List *folders = NULL, *groups = NULL; Eina_Stringshare *tmp, *msg; - Group2 *group, *alias; + Group2 *group; widget_tree_items_get(ap.project->RM.groups, prefix, &folders, &groups); EINA_LIST_FREE(folders, tmp) @@ -507,19 +507,6 @@ _folder_del(const char *prefix) EINA_LIST_FREE(groups, group) { - if (group->main_group) continue; - EINA_LIST_FOREACH(group->aliases, l, alias) - { - if (!editor_group_del(ap.project->global_object, tmp, true)) - { - msg = eina_stringshare_printf(_("Can't delete alias layout \"%s\""), - alias->common.name); - TODO("Check if it's correct to ignore error"); - popup_add(_("Error"), msg, BTN_OK, NULL, NULL); - eina_stringshare_del(msg); - } - } - tmp = eina_stringshare_add(group->common.name); if (!editor_group_del(ap.project->global_object, tmp, true)) { @@ -614,6 +601,7 @@ _group_del_popup_close_cb(void *data, if (BTN_CANCEL == btn_res) return; tmp = eina_stringshare_add(group->common.name); + if (!editor_group_del(ap.project->global_object, tmp, true)) { msg = eina_stringshare_printf(_("Can't delete layout \"%s\""), group->common.name); @@ -621,7 +609,6 @@ _group_del_popup_close_cb(void *data, popup_add(_("Error"), msg, BTN_OK, NULL, NULL); eina_stringshare_del(msg); } - elm_object_disabled_set(project_navigator.btn_del, true); } --