remove show done signal 94/45594/2
authorSoohye Shin <soohye.shin@samsung.com>
Sat, 8 Aug 2015 04:18:18 +0000 (13:18 +0900)
committerSoohye Shin <soohye.shin@samsung.com>
Sat, 8 Aug 2015 05:10:29 +0000 (14:10 +0900)
Change-Id: Ia83c8b5db3eaf3ebc7dedb05eb521732561f379d
Signed-off-by: Soohye Shin <soohye.shin@samsung.com>
edje/view/home.edc
edje/view/user.edc
src/view/view_home.c
src/view/view_user.c

index 00691df..31e80f9 100644 (file)
@@ -168,11 +168,6 @@ group {
                        transition, TRANSITION_DECEL;
                        target, "clip";
                        target, PART_HOME_MENU_BAR;
-                       after, "sig,show,done";
-               }
-               program {
-                       name, "sig,show,done";
-                       action, SIGNAL_EMIT SIG_SHOW_DONE SRC_EDJE;
                }
                program {
                        name, "sig,hide";
index 5e6f7d6..d109b5e 100644 (file)
@@ -139,11 +139,6 @@ group {
                        target, "clip";
                        target, PART_USER_BAR;
                        target, "text";
-                       after, "sig,show,done";
-               }
-               program {
-                       name, "sig,show,done";
-                       action, SIGNAL_EMIT SIG_SHOW_DONE SRC_EDJE;
                }
                program {
                        name, "sig,hide";
index e65161d..6052220 100644 (file)
@@ -298,7 +298,6 @@ static bool _add_home_menu(struct _priv *priv, Evas_Object *base)
        }
        elm_object_content_set(scr, box);
        elm_object_part_content_set(base, PART_HOME_MENU_BAR, scr);
-       priv->scr = scr;
 
        list = datamgr_get_items(priv->dm);
        if (!list) {
@@ -315,6 +314,13 @@ static bool _add_home_menu(struct _priv *priv, Evas_Object *base)
                priv->list = eina_list_append(priv->list, bi);
        }
 
+       if (!priv->list) {
+               _ERR("failed to pack item");
+               return false;
+       }
+
+       priv->scr = scr;
+
        return true;
 }
 
@@ -326,17 +332,6 @@ static void _hide_done(void *data, Evas_Object *obj, const char *emission,
        datamgr_select_item(priv->dm, priv->foc->di);
 }
 
-static void _show_done(void *data, Evas_Object *obj, const char *emission,
-               const char *source)
-{
-       struct _priv *priv = data;
-
-       if (!priv->foc)
-               priv->foc = eina_list_data_get(priv->list);
-
-       elm_object_focus_set(priv->foc->eo, EINA_TRUE);
-}
-
 static Evas_Object *_create(Evas_Object *win, void *data)
 {
        struct _priv *priv;
@@ -382,8 +377,6 @@ static Evas_Object *_create(Evas_Object *win, void *data)
        viewmgr_set_view_data(VIEW_HOME, priv);
        elm_object_signal_callback_add(base, SIG_HIDE_DONE, SRC_EDJE,
                        _hide_done, priv);
-       elm_object_signal_callback_add(base, SIG_SHOW_DONE, SRC_EDJE,
-                       _show_done, priv);
 
        return base;
 }
@@ -399,11 +392,19 @@ static void _show(void *data)
 
        priv = data;
 
-       _add_home_menu(priv, priv->base);
+       if (!_add_home_menu(priv, priv->base)) {
+               _ERR("failed to add home");
+               return;
+       }
 
        evas_object_show(priv->base);
        elm_object_signal_emit(priv->base, SIG_SHOW_NAVIGATION, SRC_PROG);
        elm_object_signal_emit(priv->base, SIG_SHOW, SRC_PROG);
+
+       if (!priv->foc)
+               priv->foc = eina_list_data_get(priv->list);
+
+       elm_object_focus_set(priv->foc->eo, EINA_TRUE);
 }
 
 static void _unload_home(struct _priv *priv)
@@ -417,6 +418,7 @@ static void _unload_home(struct _priv *priv)
        }
        evas_object_del(priv->scr);
 
+       priv->scr = NULL;
        priv->foc = NULL;
        priv->list = NULL;
 }
index 4ff15ff..7ccbff8 100644 (file)
@@ -235,17 +235,6 @@ static void _hide_done(void *data, Evas_Object *obj, const char *emission,
        viewmgr_pop_view();
 }
 
-static void _show_done(void *data, Evas_Object *obj, const char *emission,
-               const char *source)
-{
-       struct _priv *priv = data;
-
-       if (!priv->foc)
-               priv->foc = eina_list_data_get(priv->list);
-
-       elm_object_focus_set(priv->foc->eo, EINA_TRUE);
-}
-
 static Evas_Object *_create(Evas_Object *win, void *data)
 {
        struct _priv *priv;
@@ -290,8 +279,7 @@ static Evas_Object *_create(Evas_Object *win, void *data)
        inputmgr_add_callback(base, INPUT_HANDLER_TYPE_BASE, &handler, priv);
        elm_object_signal_callback_add(base, SIG_HIDE_DONE, SRC_EDJE,
                        _hide_done, NULL);
-       elm_object_signal_callback_add(base, SIG_SHOW_DONE, SRC_EDJE,
-                       _show_done, priv);
+
        return base;
 }
 
@@ -407,7 +395,7 @@ err:
        return NULL;
 }
 
-static void _add_user(struct _priv *priv)
+static bool _add_user(struct _priv *priv)
 {
        Eina_List *list, *l;
        Evas_Object *scr, *box;
@@ -418,14 +406,14 @@ static void _add_user(struct _priv *priv)
        scr = utils_add_scroller(priv->base);
        if (!scr) {
                _ERR("failed to add scroller");
-               return;
+               return false;
        }
 
        box = utils_add_box(scr, true);
        if (!box) {
                _ERR("failed to add box");
                evas_object_del(scr);
-               return;
+               return false;
        }
        elm_object_content_set(scr, box);
        elm_object_part_content_set(priv->base, PART_USER_BAR, scr);
@@ -436,7 +424,7 @@ static void _add_user(struct _priv *priv)
        if (!list) {
                _ERR("failed to load list");
                evas_object_del(scr);
-               return;
+               return false;
        }
 
        i = 0;
@@ -452,8 +440,15 @@ static void _add_user(struct _priv *priv)
                priv->list = eina_list_append(priv->list, bi);
        }
 
+       if (!priv->list) {
+               _ERR("failed to pack item");
+               return false;
+       }
+
        priv->scr = scr;
        priv->box = box;
+
+       return true;
 }
 
 static void _show(void *data)
@@ -470,7 +465,15 @@ static void _show(void *data)
        evas_object_show(priv->base);
        elm_object_signal_emit(priv->base, SIG_SHOW, SRC_PROG);
 
-       _add_user(priv);
+       if (!_add_user(priv)) {
+               _ERR("failed to add user");
+               return;
+       }
+
+       if (!priv->foc)
+               priv->foc = eina_list_data_get(priv->list);
+
+       elm_object_focus_set(priv->foc->eo, EINA_TRUE);
 }
 
 static void _unload_user(struct _priv *priv)