hermet pushed a commit to branch master.

http://git.enlightenment.org/tools/enventor.git/commit/?id=9ac6faaa9e8200acc9cf39cf48335bf82509dd33

commit 9ac6faaa9e8200acc9cf39cf48335bf82509dd33
Author: Mykyta Biliavskyi <m.biliavs...@samsung.com>
Date:   Thu May 28 09:23:11 2015 +0000

    edj viewer: update live view for different groups.
    
    This happens, because edj file is rewrited and
    descriptor lost. Reload all groups each time when
    edj file rewrited.
    
    @fix T2162
---
 src/lib/edj_mgr.c          | 12 ++++++++++++
 src/lib/edj_viewer.c       |  6 ++++++
 src/lib/enventor_private.h |  2 ++
 src/lib/enventor_smart.c   |  4 +++-
 4 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/src/lib/edj_mgr.c b/src/lib/edj_mgr.c
index 9059c5c..055eb38 100644
--- a/src/lib/edj_mgr.c
+++ b/src/lib/edj_mgr.c
@@ -238,3 +238,15 @@ edj_mgr_view_scale_get(void)
    return em->view_scale;
 }
 
+void
+edj_mgr_all_views_reload(void)
+{
+   edj_mgr *em = g_em;
+   if (!em) return;
+   Eina_List *l = NULL;
+   edj_data *edj = NULL;
+
+   EINA_LIST_FOREACH(em->edjs, l, edj)
+     view_obj_need_reload_set(edj->vd);
+}
+
diff --git a/src/lib/edj_viewer.c b/src/lib/edj_viewer.c
index c9c8ad7..def547e 100644
--- a/src/lib/edj_viewer.c
+++ b/src/lib/edj_viewer.c
@@ -389,6 +389,12 @@ view_obj_get(view_data *vd)
 }
 
 void
+view_obj_need_reload_set(view_data *vd)
+{
+   vd->edj_reload_need = EINA_TRUE;
+}
+
+void
 view_program_run(view_data *vd, const char *program)
 {
    if (!vd) return;
diff --git a/src/lib/enventor_private.h b/src/lib/enventor_private.h
index f030e4a..34fa7ac 100644
--- a/src/lib/enventor_private.h
+++ b/src/lib/enventor_private.h
@@ -160,6 +160,7 @@ Eina_Bool edj_mgr_reload_need_get(void);
 void edj_mgr_clear(void);
 void edj_mgr_view_scale_set(double scale);
 double edj_mgr_view_scale_get(void);
+void edj_mgr_all_views_reload(void);
 
 
 /* redoundo */
@@ -193,6 +194,7 @@ Eina_List *view_part_states_list_get(view_data *vd, const 
char *part);
 Eina_List *view_program_targets_get(view_data *vd, const char *prog);
 void view_string_list_free(Eina_List *list);
 void view_part_state_set(view_data *vd, const char *part, const char 
*description, const double state);
+void view_obj_need_reload_set(view_data *vd);
 
 
 /* template */
diff --git a/src/lib/enventor_smart.c b/src/lib/enventor_smart.c
index a23dc97..43a92dc 100644
--- a/src/lib/enventor_smart.c
+++ b/src/lib/enventor_smart.c
@@ -81,7 +81,9 @@ edit_view_sync_cb(void *data, Eina_Stringshare *state_name, 
double state_value,
 {
    Enventor_Object_Data *pd = data;
    static Eina_Stringshare *prev_part_name = NULL;
-   
+
+   edj_mgr_all_views_reload();
+
    if (pd->group_name != group_name)
      {
         view_data *vd = edj_mgr_view_get(group_name);

-- 


Reply via email to