yakov pushed a commit to branch master. http://git.enlightenment.org/tools/erigo.git/commit/?id=4192c60e8dd84564ab6846c84d84557005d22536
commit 4192c60e8dd84564ab6846c84d84557005d22536 Author: Yakov Goldberg <[email protected]> Date: Thu Nov 5 17:24:03 2015 +0200 Call undo_redo_post() func in order to reload propview and objtree Later this must go away --- src/bin/gui/editor.c | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/src/bin/gui/editor.c b/src/bin/gui/editor.c index 4033bbf..88a7e68 100644 --- a/src/bin/gui/editor.c +++ b/src/bin/gui/editor.c @@ -2900,6 +2900,69 @@ __undo_no_update(const Gui_Context *ctx) return EINA_TRUE; } +static void +_editor_undo_redo_post(const Memento *memento) +{ + Memento_Command *cmd; + const Eina_List *cmds_list = memento_commands_get(memento), *itr; + EINA_LIST_FOREACH(cmds_list, itr, cmd) + { + Memento_Type type = memento_command_type_get(cmd); + Eid *eid = memento_command_wdg_get(cmd); + Gui_Widget *memento_wdg = wdg_get(eid); + switch (type) + { + case MEMENTO_PROPERTY: + { + break; + } + case MEMENTO_OBJ_CONTAINER_ITEM: + case MEMENTO_ITEM_CONTAINER_ITEM: + { + proplayout_view_switch(CONTENT_TYPE); + _editor_wdg_selected_set(memento_wdg); + objtree_build(); + objtree_item_selected_set(memento_wdg); + break; + } + case MEMENTO_CALLBACK: + { + break; + } + case MEMENTO_CALLBACK_ADD_DEL: + { + proplayout_view_switch(CALLBACK_TYPE); + _editor_wdg_selected_set(memento_wdg); + break; + } + case MEMENTO_WIDGET: + case MEMENTO_WIDGET_PARENT: + { + if (memento_wdg) + { + _editor_wdg_selected_set(memento_wdg); + objtree_build(); + objtree_item_selected_set(memento_wdg); + } + break; + } + case MEMENTO_NONE: + case MEMENTO_ACTION: + case MEMENTO_WIDGET_NAME: + { + break; + } + case MEMENTO_WIDGET_PUBLIC: + { + proplayout_view_switch(DESCRIPTION_TYPE); + break; + } + default: + ERR("case - default"); + } + } +} + /* Undo last action */ static Eina_Bool _editor_undo(const Gui_Context *ctx) @@ -2913,6 +2976,7 @@ _editor_undo(const Gui_Context *ctx) /* Update propview. */ context_memento_not_updated_add((Gui_Context *) ctx, head_memento, EINA_FALSE); + _editor_undo_redo_post(head_memento); context_memento_move_to_prev((Gui_Context *) ctx); eo_do(g->main_win->toolbar_redo_it, elm_wdg_item_disabled_set(context_can_redo(ctx) ? EINA_FALSE : EINA_TRUE)); @@ -3098,6 +3162,7 @@ _editor_redo(const Gui_Context *ctx) } /* Update propview. */ context_memento_not_updated_add((Gui_Context *) ctx, head_memento, EINA_TRUE); + _editor_undo_redo_post(head_memento); eo_do(g->main_win->toolbar_redo_it, elm_wdg_item_disabled_set(context_can_redo(ctx) ? EINA_FALSE : EINA_TRUE)); eo_do(g->main_win->toolbar_undo_it, elm_wdg_item_disabled_set(context_can_undo(ctx) ? EINA_FALSE : EINA_TRUE)); --
