diff options
author | Soohye Shin <soohye.shin@samsung.com> | 2016-01-06 19:20:22 +0900 |
---|---|---|
committer | Soohye Shin <soohye.shin@samsung.com> | 2016-01-06 19:23:08 +0900 |
commit | c4f54497b7efd52f5a336b8d0663e9933db8dd29 (patch) | |
tree | 6f397febbc14ed32a2eb0c9f937fa6c8c1d07e0f | |
parent | 79979ec5781ae6003c94117819c295523c9e320e (diff) | |
download | air_home-c4f54497b7efd52f5a336b8d0663e9933db8dd29.tar.gz air_home-c4f54497b7efd52f5a336b8d0663e9933db8dd29.tar.bz2 air_home-c4f54497b7efd52f5a336b8d0663e9933db8dd29.zip |
modify to add and edit the profile for admin usersubmit/tizen/20160106.104556accepted/tizen/tv/20160106.122523
Change-Id: Ic5b74b62d223338d589de040afc6110015a2b36b
Signed-off-by: Soohye Shin <soohye.shin@samsung.com>
-rw-r--r-- | src/view/view_user.c | 38 |
1 files changed, 9 insertions, 29 deletions
diff --git a/src/view/view_user.c b/src/view/view_user.c index 77552e2..19fddcd 100644 --- a/src/view/view_user.c +++ b/src/view/view_user.c @@ -63,27 +63,6 @@ struct _bar_item { struct _priv *priv; }; -static bool _check_editable_user(struct _priv *priv) -{ - struct _bar_item *bi; - bool r = false; - - switch (priv->user_type) { - case USER_ITEM_NORMAL: - bi = eina_list_data_get(priv->list); - if (priv->foc == bi) - r = true; - break; - case USER_ITEM_ADMIN: - r = true; - break; - default: - break; - } - - return r; -} - static void _focused(int id, void *data, Evas_Object *obj, Elm_Object_Item *item) { @@ -99,7 +78,7 @@ static void _focused(int id, void *data, Evas_Object *obj, elm_object_signal_emit(obj, SIG_FOCUS, SRC_PROG); - if (_check_editable_user(priv)) + if (priv->user_type == USER_ITEM_ADMIN) elm_object_signal_emit(obj, SIG_SHOW_ARROW, SRC_PROG); } @@ -225,7 +204,7 @@ static void _key_down(int id, void *data, Evas *e, Evas_Object *obj, elm_object_signal_emit(priv->base, SIG_HIDE, SRC_PROG); } else if (!strcmp(ev->keyname, KEY_DOWN)) { if (priv->foc->di->action == ITEM_SELECT_ACTION_PUSH || - !_check_editable_user(priv)) + priv->user_type != USER_ITEM_ADMIN) return; viewmgr_update_view(VIEW_USER_EDIT, UPDATE_TYPE_USER, @@ -432,7 +411,6 @@ static bool _add_user(struct _priv *priv) Evas_Object *scr, *box; struct _bar_item *bi; struct datamgr_item *di; - int i; scr = utils_add_scroller(priv->base); if (!scr) { @@ -458,16 +436,18 @@ static bool _add_user(struct _priv *priv) return false; } - i = 0; + di = eina_list_data_get(list); + priv->user_type = di->type; + EINA_LIST_FOREACH(list, l, di) { + if (priv->user_type == USER_ITEM_NORMAL && + di->type == USER_ITEM_ADD) + continue; + bi = _pack_bar_item(priv, box, di); if (!bi) continue; - if (i == 0) { - priv->user_type = di->type; - i++; - } priv->list = eina_list_append(priv->list, bi); } |