+++ /dev/null
-/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <Elementary.h>
-#include <viewmgr.h>
-#include <inputmgr.h>
-#include <gridmgr.h>
-#include <app_define.h>
-#include <app_debug.h>
-
-#include "define.h"
-#include "utils.h"
-#include "view.h"
-#include "data/app.h"
-#include "grid.h"
-
-enum button_type {
- BTN_LIVETV = 0,
- BTN_FAVORITE,
- BTN_UNINSTALL,
- BTN_OK,
- BTN_CANCEL,
- BTN_MORE,
-};
-
-struct _priv {
- struct app_data *adata;
- Evas_Object *win;
- Evas_Object *base;
- Evas_Object *scroller;
- Evas_Object *box;
- Evas_Object *grid;
- Evas_Object *contents_ly;
- Evas_Object *live_btn;
- Evas_Object *menu[ACTION_MENU_COUNT];
- Evas_Object *more_btn;
- Evas_Object *popup;
- struct gridmgr *gmgr;
- Eina_List *fav_list;
-};
-
-struct _action_info {
- int id;
- const char *title;
- const char *style;
- Eina_Bool disable;
-};
-
-static struct _action_info action_info[] = {
- {
- .id = BTN_FAVORITE,
- .title = STR_FAVORITE,
- .style = STYLE_ACTION_MENU_FAV_BTN,
- .disable = EINA_FALSE
- },
- {
- .id = BTN_UNINSTALL,
- .title = STR_UNINSTALL,
- .style = STYLE_ACTION_MENU_UNINSTALL_BTN
- }
-};
-
-static void _mouse_move_cb(int id, void *data, Evas *e, Evas_Object *obj,
- Evas_Event_Mouse_Move *ev)
-{
- if (!obj) {
- _ERR("Invalid argument.");
- return;
- }
-
- if (!elm_object_focus_get(obj))
- elm_object_focus_set(obj, EINA_TRUE);
-}
-
-static void _livetv_selected(struct _priv *priv)
-{
- if (!utils_launch_app(APP_ID_LIVETV, NULL, NULL)) {
- _ERR("Launch live tv failed.");
- return;
- }
-
- elm_object_signal_emit(priv->base, SIG_HIDE, SIG_SOURCE_EDC);
-}
-
-static void _favorite_selected(struct _priv *priv)
-{
- bool isfavorite;
-
- if (!get_app_favorite(priv->adata, &isfavorite)) {
- _ERR("Get favorite value failed.");
- return;
- }
-
- if (!set_app_favorite(priv->adata, !isfavorite)) {
- _ERR("Set favorite value faild.");
- return;
- }
-
- viewmgr_update_view(VIEW_BASE, UPDATE_FAVORITE, priv->adata);
-
- if (isfavorite)
- viewmgr_update_view(VIEW_BASE, UPDATE_SHOW_TOAST,
- STR_REMOVE_FAVORITE);
- else
- viewmgr_update_view(VIEW_BASE, UPDATE_SHOW_TOAST,
- STR_ADD_FAVORITE);
-
- elm_object_signal_emit(priv->base, SIG_HIDE, SIG_SOURCE_EDC);
-}
-
-static void _uninstall_selected(struct _priv *priv)
-{
- struct app_data *adata;
- bool isfavorite;
-
- adata = priv->adata;
-
- if (!utils_uninstall_app(get_pkg_id(adata), get_pkg_type(adata))) {
- _ERR("Uninstall failed.");
- return;
- }
-
- if (get_app_favorite(adata, &isfavorite) && isfavorite)
- set_app_favorite(adata, false);
-
- viewmgr_update_view(VIEW_BASE, UPDATE_GRID, adata);
- elm_object_signal_emit(priv->base, SIG_HIDE, SIG_SOURCE_EDC);
-}
-
-static void _popup_clicked_cb(int id, void *data, Evas_Object *obj)
-{
- struct _priv *priv;
-
- if (!data)
- return;
-
- priv = data;
-
- evas_object_del(priv->popup);
-
- if (id == BTN_OK)
- _uninstall_selected(priv);
-}
-
-static void _popup_key_down_cb(int id, void *data, Evas *e, Evas_Object *obj,
- Evas_Event_Key_Down *ev)
-{
- struct _priv *priv;
-
- if (!ev || !data) {
- _ERR("Invalid argument.");
- return;
- }
- priv = data;
-
- if (!strcmp(ev->keyname, KEY_BACK)
- || !strcmp(ev->keyname, KEY_ESC))
- evas_object_del(priv->popup);
-}
-
-static input_handler _popup_input_handler = {
- .mouse_move = _mouse_move_cb,
- .clicked = _popup_clicked_cb,
- .key_down = _popup_key_down_cb
-};
-
-static void _draw_uninstall_popup(struct _priv *priv)
-{
- Evas_Object *popup, *btn1, *btn2;
- char str[SIZE_STR];
- char *name;
-
- name = get_app_name(priv->adata);
- if (!name)
- return;
-
- snprintf(str, sizeof(str), "%s %s?", STR_UNINSTALL, name);
-
- popup = utils_add_popup(priv->base, NULL, STR_UNINSTALL, str);
- if (!popup) {
- _ERR("Add popup failed.");
- return;
- }
-
- btn1 = utils_add_button(popup, PART_BUTTON1, STR_CANCEL, NULL);
- if (!btn1) {
- _ERR("Add button failed.");
- evas_object_del(popup);
- return;
- }
-
- btn2 = utils_add_button(popup, PART_BUTTON2, STR_OK, NULL);
- if (!btn2) {
- _ERR("Add button failed.");
- evas_object_del(popup);
- return;
- }
-
- elm_object_focus_set(btn1, EINA_TRUE);
-
- priv->popup = popup;
-
- inputmgr_add_callback(btn1, BTN_CANCEL, &_popup_input_handler, priv);
- inputmgr_add_callback(btn2, BTN_OK, &_popup_input_handler, priv);
-}
-
-static void _clicked_cb(int id, void *data, Evas_Object *obj)
-{
- struct _priv *priv;
-
- if (!data)
- return;
-
- priv = data;
-
- switch (id) {
- case BTN_LIVETV:
- _livetv_selected(priv);
- break;
-
- case BTN_FAVORITE:
- _favorite_selected(priv);
- break;
-
- case BTN_UNINSTALL:
- _draw_uninstall_popup(priv);
- break;
-
- case BTN_MORE:
- if (!utils_launch_app(APP_ID_FAVORITE,
- PARAM_CATEGORY, STR_APPS))
- _ERR("Favorite launch failed.");
-
- break;
-
- default:
- _ERR("Unhandled button type.");
- }
-}
-
-static void _key_down_cb(int id, void *data, Evas *e, Evas_Object *obj,
- Evas_Event_Key_Down *ev)
-{
- struct _priv *priv;
-
- if (!data || !ev) {
- _ERR("Invalid argument.");
- return;
- }
- priv = data;
-
- if (!strcmp(ev->keyname, KEY_BACK)
- || !strcmp(ev->keyname, KEY_ESC))
- elm_object_signal_emit(priv->base, SIG_HIDE, SIG_SOURCE_EDC);
-}
-
-static void _grid_mouse_move_cb(int id, void *data, Evas *e, Evas_Object *obj,
- Evas_Event_Mouse_Move *ev)
-{
- Elm_Object_Item *it;
-
- if (!obj || !ev) {
- _ERR("Invalid argument.");
- return;
- }
-
- it = elm_gengrid_at_xy_item_get(obj, ev->cur.canvas.x,
- ev->cur.canvas.y, NULL, NULL);
- if (!it)
- return;
-
- if (!elm_object_item_focus_get(it))
- elm_object_item_focus_set(it, EINA_TRUE);
-}
-
-static void _grid_selected_cb(int id, void *data, Evas_Object *obj,
- Elm_Object_Item *item)
-{
- struct app_data *adata;
-
- if (!item) {
- _ERR("Invalid argument.");
- return;
- }
- adata = elm_object_item_data_get(item);
-
- if (!utils_launch_app(get_app_id(adata), NULL, NULL))
- _ERR("Launch app failed.");
-}
-
-static input_handler _btn_input_handler = {
- .mouse_move = _mouse_move_cb,
- .clicked = _clicked_cb,
- .key_down = _key_down_cb
-};
-
-static input_handler _grid_input_handler = {
- .mouse_move = _grid_mouse_move_cb,
- .selected = _grid_selected_cb,
- .key_down = _key_down_cb
-};
-
-static bool _add_livetv_button(struct _priv *priv)
-{
- Evas_Object *btn;
-
- btn = utils_add_button(priv->contents_ly, PART_TOP_BTN,
- STR_LIVETV, STYLE_LIVETV_BTN);
- if (!btn) {
- _ERR("Add button failed.");
- return false;
- }
-
- inputmgr_add_callback(btn, BTN_LIVETV, &_btn_input_handler, priv);
-
- priv->live_btn = btn;
-
- return true;
-}
-
-static bool _add_grid(struct _priv *priv)
-{
- struct grid_class *gclass;
- Evas_Object *grid;
-
- grid = utils_add_gengrid(priv->contents_ly, EINA_FALSE,
- SIZE_FAVORITE_GRID_WIDTH, SIZE_FAVORITE_GRID_HEIGHT);
- if (!grid) {
- _ERR("Add gengrid failed.");
- return false;
- }
-
- inputmgr_add_callback(grid, 0, &_grid_input_handler, priv);
-
- gclass = get_favorite_grid_class();
- if (!gclass) {
- _ERR("Get favorite grid class failed.");
- evas_object_del(grid);
- return false;
- }
-
- if (!gridmgr_add_grid(priv->gmgr, STR_FAVORITE, grid, gclass)) {
- _ERR("Gridmgr add grid failed.");
- evas_object_del(grid);
- return false;
- }
-
- elm_object_focus_region_show_mode_set(grid, ELM_FOCUS_REGION_SHOW_ITEM);
-
- priv->grid = grid;
-
- return true;
-}
-
-static bool _add_more_button(struct _priv *priv)
-{
- Evas_Object *btn;
-
- btn = utils_add_button(priv->box, NULL, STR_MORE, STYLE_MORE_BTN);
- if (!btn) {
- _ERR("Add button failed.");
- return false;
- }
-
- inputmgr_add_callback(btn, BTN_MORE, &_btn_input_handler, priv);
-
- elm_box_pack_end(priv->box, btn);
-
- priv->more_btn = btn;
-
- return true;
-}
-
-static void _add_view_contents(struct _priv *priv)
-{
- priv->contents_ly = utils_add_layout(priv->box,
- GRP_ACTION_MENU_CONTENTS, EINA_FALSE);
- if (!priv->contents_ly) {
- _ERR("Add layout failed.");
- return;
- }
-
- evas_object_show(priv->contents_ly);
- elm_box_pack_end(priv->box, priv->contents_ly);
-
- if (!_add_livetv_button(priv)) {
- _ERR("Add livetv button failed.");
- return;
- }
-
- if (!_add_grid(priv)) {
- _ERR("Add grid failed.");
- return;
- }
-
- if (!_add_more_button(priv))
- _ERR("Add more button failed.");
-}
-
-static void _hide_done_cb(void *data, Evas_Object *obj,
- const char *emission, const char *source)
-{
- viewmgr_hide_view(VIEW_ACTION_MENU);
-}
-
-static void _set_action_state(int idx, Evas_Object *btn, struct _priv *priv)
-{
- char *pkgtype;
- bool isfavorite;
-
- if (action_info[idx].id == BTN_FAVORITE) {
- if (get_app_favorite(priv->adata, &isfavorite) && isfavorite)
- elm_object_signal_emit(btn, SIG_TOGGLE, SRC_ACTION_BTN);
- } else if (action_info[idx].id == BTN_UNINSTALL) {
- /* The 'rpm' type package uninstallation is not supported */
- pkgtype = get_pkg_type(priv->adata);
- if (pkgtype && (!strcmp(pkgtype, STR_WGT)
- || !strcmp(pkgtype, STR_TPK)))
- action_info[idx].disable = EINA_FALSE;
- else
- action_info[idx].disable = EINA_TRUE;
- }
-
- if (action_info[idx].disable)
- elm_object_disabled_set(btn, EINA_TRUE);
-}
-
-static bool _update_action_area(struct _priv *priv)
-{
- Evas_Object *table, *btn;
- int i, row = 0, col = 0;
-
- table = utils_add_table(priv->contents_ly, PART_MENU,
- SIZE_ACTION_TABLE_BORDER, SIZE_ACTION_TABLE_BORDER);
- if (!table) {
- _ERR("Add table failed.");
- return false;
- }
-
- for (i = 0; i < ACTION_MENU_COUNT; i++) {
- btn = utils_add_button(table, NULL, action_info[i].title,
- action_info[i].style);
- if (!btn) {
- _ERR("Add button failed.");
- evas_object_del(table);
- return false;
- }
-
- inputmgr_add_callback(btn, action_info[i].id,
- &_btn_input_handler, priv);
-
- _set_action_state(i, btn, priv);
-
- col = i % SIZE_COL_MAX;
- row = i / SIZE_COL_MAX;
-
- elm_table_pack(table, btn, col, row, 1, 1);
-
- priv->menu[i] = btn;
- }
-
- return true;
-}
-
-static void _draw_no_contents(struct _priv *priv)
-{
- Evas_Object *ly;
-
- ly = utils_add_layout(priv->contents_ly, GRP_ACTION_MENU_NO_FAVORITE,
- EINA_FALSE);
- if (!ly) {
- _ERR("Add layout failed.");
- return;
- }
-
- elm_object_focus_allow_set(priv->contents_ly, EINA_FALSE);
- elm_object_part_content_set(priv->contents_ly, PART_NO_FAVORITE, ly);
-}
-
-static int _get_favorite_grid_height(int cnt)
-{
- int height, col;
-
- if (cnt % SIZE_FAVORITE_COL_MAX == 0)
- col = cnt / SIZE_FAVORITE_COL_MAX;
- else
- col = cnt / SIZE_FAVORITE_COL_MAX + 1;
-
- height = SIZE_FAVORITE_GRID_HEIGHT * col;
-
- return height;
-}
-
-static bool _update_favorite_area(struct _priv *priv)
-{
- int cnt;
-
- if (!priv->fav_list) {
- elm_gengrid_clear(priv->grid);
- _draw_no_contents(priv);
- return true;
- }
-
- elm_object_part_content_unset(priv->contents_ly, PART_NO_FAVORITE);
-
- if (!gridmgr_append_list(priv->gmgr, STR_FAVORITE, priv->fav_list)) {
- _ERR("Gridmgr append list failed.");
- return false;
- }
-
- cnt = eina_list_count(priv->fav_list);
-
- evas_object_size_hint_min_set(priv->grid,
- ELM_SCALE_SIZE(SIZE_FAVORITE_GRID_WIDTH
- * SIZE_FAVORITE_COL_MAX),
- ELM_SCALE_SIZE(_get_favorite_grid_height(cnt)));
-
- elm_object_part_content_set(priv->contents_ly,
- PART_FAVORITE, priv->grid);
-
- return true;
-}
-
-static void _set_focus_policy(struct _priv *priv)
-{
- int i;
-
- elm_object_focus_next_object_set(priv->live_btn, priv->live_btn,
- ELM_FOCUS_LEFT);
- elm_object_focus_next_object_set(priv->live_btn, priv->menu[0],
- ELM_FOCUS_DOWN);
-
- for (i = 0; i < ACTION_MENU_COUNT; i++) {
- if (priv->fav_list)
- elm_object_focus_next_object_set(priv->menu[i],
- priv->grid, ELM_FOCUS_DOWN);
- else
- elm_object_focus_next_object_set(priv->menu[i],
- priv->more_btn, ELM_FOCUS_DOWN);
- }
-
- elm_object_focus_next_object_set(priv->menu[0], priv->menu[0],
- ELM_FOCUS_LEFT);
- elm_object_focus_next_object_set(priv->menu[ACTION_MENU_COUNT - 1],
- priv->menu[ACTION_MENU_COUNT - 1], ELM_FOCUS_RIGHT);
-
- elm_object_focus_next_object_set(priv->grid, priv->menu[0],
- ELM_FOCUS_UP);
- elm_object_focus_next_object_set(priv->grid, priv->grid,
- ELM_FOCUS_LEFT);
-
- if (!priv->fav_list)
- elm_object_focus_next_object_set(priv->more_btn, priv->menu[0],
- ELM_FOCUS_UP);
- else
- elm_object_focus_next_object_set(priv->more_btn, priv->grid,
- ELM_FOCUS_UP);
-
- elm_object_focus_next_object_set(priv->more_btn, priv->more_btn,
- ELM_FOCUS_LEFT);
-}
-
-static Evas_Object *_create(Evas_Object *win, void *data)
-{
- struct _priv *priv;
- struct gridmgr *gmgr;
- Evas_Object *base, *scr, *box;
-
- if (!win) {
- _ERR("Get window object failed.");
- return NULL;
- }
-
- priv = calloc(1, sizeof(*priv));
- if (!priv) {
- _ERR("Calloc failed.");
- return NULL;
- }
-
- base = utils_add_layout(win, GRP_VIEW_ACTION_MENU, EINA_TRUE);
- if (!base) {
- _ERR("Add layout failed.");
- free(priv);
- return NULL;
- }
-
- scr = utils_add_scroller(base, PART_ACTION_MENU, NULL);
- if (!scr) {
- _ERR("Add scroller failed.");
- goto end;
- }
-
- elm_scroller_step_size_set(scr, 0, ELM_SCALE_SIZE(SIZE_SCROLLER_STEP));
-
- box = utils_add_box(scr, NULL, EINA_FALSE, 0.0, 0.0);
- if (!box) {
- _ERR("Add box failed.");
- goto end;
- }
-
- elm_box_align_set(box, 0.5, 0.0);
-
- gmgr = gridmgr_create();
- if (!gmgr) {
- _ERR("Create gridmgr failed.");
- goto end;
- }
-
- priv->win = win;
- priv->base = base;
- priv->scroller = scr;
- priv->box = box;
- priv->gmgr = gmgr;
-
- _add_view_contents(priv);
-
- if (!viewmgr_set_view_data(VIEW_ACTION_MENU, priv)) {
- _ERR("Set view data failed.");
- gridmgr_destroy(gmgr);
- goto end;
- }
-
- elm_object_signal_callback_add(base, SIG_HIDE_DONE, SIG_SOURCE_EDC,
- _hide_done_cb, NULL);
-
- return base;
-
-end:
- evas_object_del(base);
- free(priv);
-
- return NULL;
-}
-
-static void _show(void *data)
-{
- struct _priv *priv;
-
- if (!data) {
- _ERR("Get data failed.");
- return;
- }
- priv = data;
-
- elm_scroller_region_show(priv->scroller, 0, 0, 0, 0);
-
- if (!_update_action_area(priv)) {
- _ERR("Update action area failed.");
- return;
- }
-
- if (!_update_favorite_area(priv)) {
- _ERR("Update favorite area failed.");
- return;
- }
-
- _set_focus_policy(priv);
-
- if (priv->base)
- evas_object_show(priv->base);
-
- elm_object_signal_emit(priv->base, SIG_SHOW, SIG_SOURCE_EDC);
- elm_object_focus_set(priv->live_btn, EINA_TRUE);
-}
-
-static void _hide(void *data)
-{
- struct _priv *priv;
-
- if (!data) {
- _ERR("Get data failed.");
- return;
- }
- priv = data;
-
- if (priv->base)
- evas_object_hide(priv->base);
-}
-
-static void _update(void *view_data, int update_type, void *data)
-{
- struct _priv *priv;
-
- if (!view_data) {
- _ERR("Get data failed.");
- return;
- }
- priv = view_data;
-
- if (update_type == UPDATE_ID) {
- if (!data)
- return;
-
- priv->adata = data;
- } else if (update_type == UPDATE_FAVORITE) {
- priv->fav_list = data;
- }
-}
-
-static void _destroy(void *data)
-{
- struct _priv *priv;
-
- if (!data) {
- _ERR("Get data failed.");
- return;
- }
- priv = data;
-
- if (priv->gmgr)
- gridmgr_destroy(priv->gmgr);
-
- if (priv->base)
- evas_object_del(priv->base);
-
- if (priv->fav_list)
- free_app_list(priv->fav_list);
-
- free(priv);
-}
-
-static view_class _vclass = {
- .view_id = VIEW_ACTION_MENU,
- .create = _create,
- .show = _show,
- .hide = _hide,
- .update = _update,
- .destroy = _destroy,
-};
-
-view_class *view_action_menu_get_vclass(void)
-{
- return &_vclass;
-}
STR_Z_TO_A,
};
+enum button_type {
+ BTN_LIVETV = 0,
+ BTN_FAVORITE,
+ BTN_UNINSTALL,
+ BTN_OK,
+ BTN_CANCEL,
+ BTN_MORE,
+};
+
struct _priv {
Evas_Object *win;
Evas_Object *base;
Evas_Object *focused_menu;
Evas_Object *sort_btn;
Evas_Object *sort_popup;
+ Evas_Object *uninstall_popup;
Evas_Object *grid;
Evas_Object *notify;
Elm_Object_Item *focused_item;
enum sort_type sort_type;
};
+/* Uninstallation - begin */
+static void _mouse_move_cb(int id, void *data, Evas *e, Evas_Object *obj, Evas_Event_Mouse_Move *ev);
+
+static void _uninstall_selected(struct _priv *priv)
+{
+ struct app_data *adata = NULL;
+
+ adata = elm_object_item_data_get(priv->focused_item);
+ if (!adata) {
+ _DBG("No app is selected");
+ return;
+ }
+
+ if (!utils_uninstall_app(get_pkg_id(adata), get_pkg_type(adata))) {
+ _ERR("Uninstall failed.");
+ return;
+ }
+
+ viewmgr_update_view(VIEW_BASE, UPDATE_GRID, adata);
+}
+
+static void _popup_clicked_cb(int id, void *data, Evas_Object *obj)
+{
+ struct _priv *priv;
+
+ if (!data)
+ return;
+
+ priv = data;
+
+ evas_object_del(priv->uninstall_popup);
+
+ if (id == BTN_OK)
+ _uninstall_selected(priv);
+}
+
+static void _popup_key_down_cb(int id, void *data, Evas *e, Evas_Object *obj,
+ Evas_Event_Key_Down *ev)
+{
+ struct _priv *priv;
+
+ if (!ev || !data) {
+ _ERR("Invalid argument.");
+ return;
+ }
+ priv = data;
+
+ if (!strcmp(ev->keyname, KEY_BACK)
+ || !strcmp(ev->keyname, KEY_ESC))
+ evas_object_del(priv->uninstall_popup);
+}
+
+static input_handler _popup_input_handler = {
+ .mouse_move = _mouse_move_cb,
+ .clicked = _popup_clicked_cb,
+ .key_down = _popup_key_down_cb
+};
+
+static void _draw_uninstall_popup(struct _priv *priv)
+{
+ Evas_Object *popup = NULL;
+ Evas_Object *btn1 = NULL;
+ Evas_Object *btn2 = NULL;
+ char str[SIZE_STR] = { 0, };
+ char *name = NULL;
+ struct app_data *adata = NULL;
+
+ if (!priv) {
+ _DBG("Invalid parameter");
+ return;
+ }
+
+ adata = elm_object_item_data_get(priv->focused_item);
+ if (!adata) {
+ _DBG("No app is selected");
+ return;
+ }
+
+ name = get_app_name(adata);
+ if (!name)
+ return;
+
+ snprintf(str, sizeof(str), "%s %s?", STR_UNINSTALL, name);
+
+ popup = utils_add_popup(priv->base, NULL, STR_UNINSTALL, str);
+ if (!popup) {
+ _ERR("Add popup failed.");
+ return;
+ }
+
+ btn1 = utils_add_button(popup, PART_BUTTON1, STR_CANCEL, NULL);
+ if (!btn1) {
+ _ERR("Add button failed.");
+ evas_object_del(popup);
+ return;
+ }
+
+ btn2 = utils_add_button(popup, PART_BUTTON2, STR_OK, NULL);
+ if (!btn2) {
+ _ERR("Add button failed.");
+ evas_object_del(popup);
+ return;
+ }
+
+ elm_object_focus_set(btn1, EINA_TRUE);
+
+ priv->uninstall_popup = popup;
+
+ inputmgr_add_callback(btn1, BTN_CANCEL, &_popup_input_handler, priv);
+ inputmgr_add_callback(btn2, BTN_OK, &_popup_input_handler, priv);
+}
+
+/* Uninstallation - end */
+
static void _mouse_move_cb(int id, void *data, Evas *e, Evas_Object *obj,
Evas_Event_Mouse_Move *ev)
{
priv = data;
if (!strcmp(ev->keyname, KEY_BACK)
- || !strcmp(ev->keyname, KEY_ESC))
+ || !strcmp(ev->keyname, KEY_ESC)) {
elm_object_focus_set(priv->focused_menu, EINA_TRUE);
+ }
+ else if (!strcmp(ev->keyname, KEY_MENU)) {
+ _draw_uninstall_popup(priv);
+ }
else if (!strcmp(ev->keyname, KEY_ENTER)) {
struct app_data *adata;
adata = elm_object_item_data_get(priv->focused_item);