rimmed pushed a commit to branch master.

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

commit 634a8b0bb1bbdac70ff6a2675a1b09bb1e80f5e0
Author: Vitalii Vorobiov <vi.vorob...@samsung.com>
Date:   Wed Jan 20 12:26:10 2016 +0000

    group_manager: set up currently selected program
---
 src/bin/project_manager/group_manager.c | 2 ++
 src/bin/project_manager/group_manager.h | 1 +
 src/bin/ui/group_navigator.c            | 8 ++++++++
 src/bin/ui/tabs.c                       | 5 +++++
 4 files changed, 16 insertions(+)

diff --git a/src/bin/project_manager/group_manager.c 
b/src/bin/project_manager/group_manager.c
index 076edc3..93dd384 100644
--- a/src/bin/project_manager/group_manager.c
+++ b/src/bin/project_manager/group_manager.c
@@ -391,6 +391,8 @@ gm_group_del(Project *pro, Group *group)
    /* delete group name after call signal, because the group name need in the
     * callbacks */
    eina_stringshare_del(group->name);
+   if (group->current_program)
+     eina_stringshare_del(group->current_program);
    free(group);
 }
 
diff --git a/src/bin/project_manager/group_manager.h 
b/src/bin/project_manager/group_manager.h
index f5cffed..1fe712e 100644
--- a/src/bin/project_manager/group_manager.h
+++ b/src/bin/project_manager/group_manager.h
@@ -61,6 +61,7 @@ struct _Group
 
    Evas_Object *edit_object;  /**< object needed to access group with 
edje_edit functions. Should be NULL if group is not open */
    Part *current_part;        /**< pointer to selected part */
+   Eina_Stringshare *current_program; /**< pointer to selected program */
 
    History *history;          /**< history of changes in the group */
 };
diff --git a/src/bin/ui/group_navigator.c b/src/bin/ui/group_navigator.c
index bd43965..bf21358 100644
--- a/src/bin/ui/group_navigator.c
+++ b/src/bin/ui/group_navigator.c
@@ -479,6 +479,11 @@ _selected_cb(void *data,
    itc = elm_genlist_item_item_class_get(glit);
 
    TODO("REFACTOR")
+   if (pl->group->current_program)
+     {
+        eina_stringshare_del(pl->group->current_program);
+        pl->group->current_program = NULL;
+     }
    if (itc == pl->itc_program)
      {
         if (pl->selected_part_item)
@@ -486,6 +491,7 @@ _selected_cb(void *data,
 
         elm_object_disabled_set(pl->btn_del, false);
         res = elm_object_item_data_get(glit);
+        pl->group->current_program = eina_stringshare_add(res->name);
         evas_object_smart_callback_call(ap.win, SIGNAL_PROGRAM_SELECTED, (void 
*)res);
      }
    else
@@ -1149,6 +1155,8 @@ _program_del(Part_List *pl,
    eina_stringshare_ref(program->name);
    editor_program_del(pl->group->edit_object, change, false, program->name);
    eina_stringshare_del(program->name);
+   if (pl->group->current_program)
+     eina_stringshare_del(pl->group->current_program);
 
    history_change_add(pl->group->history, change);
 }
diff --git a/src/bin/ui/tabs.c b/src/bin/ui/tabs.c
index f19651d..24a697f 100644
--- a/src/bin/ui/tabs.c
+++ b/src/bin/ui/tabs.c
@@ -184,6 +184,11 @@ _del_tab(Tabs_Item *item)
    if (item->group->current_part)
      item->group->current_part->current_item_name = NULL;
    item->group->current_part = NULL;
+   if (item->group->current_program)
+     {
+        eina_stringshare_del(item->group->current_program);
+        item->group->current_program = NULL;
+     }
    evas_object_smart_callback_call(ap.win, SIGNAL_TAB_CLOSE, item->group);
    free(item);
 }

-- 


Reply via email to