summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@samsung.com>2014-12-22 11:59:32 +0200
committerDaniel Zaoui <daniel.zaoui@samsung.com>2014-12-23 09:54:46 +0200
commit4ff0e332bd9f655d8eaa41ef3cc7253a3ffa0bb5 (patch)
tree865c725d20cd81af7e0a9548accf45ed71deb9a7
parent1a4dd4d13cb82820fa08c1274b272ea923042eba (diff)
Fix window creation from callback.devs/jackdanielz/dev
A bad message was printed during parsing and no empty place was reserved in the hoversel to choose a NULL parent.
-rw-r--r--src/bin/egui_gui/props_helper.c2
-rw-r--r--src/lib/gui_parser.c7
-rw-r--r--src/lib/gui_widget.c3
3 files changed, 9 insertions, 3 deletions
diff --git a/src/bin/egui_gui/props_helper.c b/src/bin/egui_gui/props_helper.c
index 82ea874..f6efbf6 100644
--- a/src/bin/egui_gui/props_helper.c
+++ b/src/bin/egui_gui/props_helper.c
@@ -295,7 +295,7 @@ props_hoversel_objects_add(Eo *box, Eo *hoversel, Eo *hover_parent, const char *
295 if (!hoversel) hoversel = eo_add(ELM_HOVERSEL_CLASS, box); 295 if (!hoversel) hoversel = eo_add(ELM_HOVERSEL_CLASS, box);
296 if (hover_parent) eo_do(hoversel, elm_obj_hoversel_hover_parent_set(hover_parent)); 296 if (hover_parent) eo_do(hoversel, elm_obj_hoversel_hover_parent_set(hover_parent));
297 297
298 if ((wdg) && 298 if ((!wdg) ||
299 (!strcmp(wdg_class_name_get(wdg), DB_DEF_CTXPOPUP_CLASS) || 299 (!strcmp(wdg_class_name_get(wdg), DB_DEF_CTXPOPUP_CLASS) ||
300 !strcmp(wdg_class_name_get(wdg), DB_DEF_DISKSELECTOR_CLASS) || 300 !strcmp(wdg_class_name_get(wdg), DB_DEF_DISKSELECTOR_CLASS) ||
301 !strcmp(wdg_class_name_get(wdg), DB_DEF_NAVIFRAME_CLASS))) 301 !strcmp(wdg_class_name_get(wdg), DB_DEF_NAVIFRAME_CLASS)))
diff --git a/src/lib/gui_parser.c b/src/lib/gui_parser.c
index c0d64ea..10039bf 100644
--- a/src/lib/gui_parser.c
+++ b/src/lib/gui_parser.c
@@ -695,7 +695,12 @@ _widget_parse(Gui_Context *gui_ctx, Eid *eid, Eina_Json_Value *widget_js)
695 Eina_Json_Value *wdg_js = eina_json_array_nth_get(action_js, 1); 695 Eina_Json_Value *wdg_js = eina_json_array_nth_get(action_js, 1);
696 Eina_Json_Value *parent_js = eina_json_array_nth_get(action_js, 2); 696 Eina_Json_Value *parent_js = eina_json_array_nth_get(action_js, 2);
697 Eid *wdg_id = gui_context_eid_get_by_name(gui_ctx, eina_json_string_get(wdg_js)); 697 Eid *wdg_id = gui_context_eid_get_by_name(gui_ctx, eina_json_string_get(wdg_js));
698 Eid *parent_id = gui_context_eid_get_by_name(gui_ctx, eina_json_string_get(parent_js)); 698 Eid *parent_id = NULL;
699 if (eina_json_type_get(parent_js) == EINA_JSON_TYPE_STRING)
700 {
701 parent_name = eina_json_string_get(parent_js);
702 parent_id = gui_context_eid_get_by_name(gui_ctx, parent_name);
703 }
699 action_creation_set(action, wdg_id, parent_id); 704 action_creation_set(action, wdg_id, parent_id);
700 break; 705 break;
701 } 706 }
diff --git a/src/lib/gui_widget.c b/src/lib/gui_widget.c
index 3c9eb8e..4ea54a6 100644
--- a/src/lib/gui_widget.c
+++ b/src/lib/gui_widget.c
@@ -718,7 +718,8 @@ eid_del(Eid *eid)
718const char * 718const char *
719eid_name_get(Eid *eid) 719eid_name_get(Eid *eid)
720{ 720{
721 if (!eid) return NULL; 721 if (!IS_ID_VALID(eid)) return NULL;
722
722 Eid_Data *eid_data = _eid_data_get(eid); 723 Eid_Data *eid_data = _eid_data_get(eid);
723 if (eid_data == NULL) 724 if (eid_data == NULL)
724 { 725 {