return strdup(_(items[index]));
}
-static void _popup_hide_cb(void *data, Evas_Object *obj, void *event_info)
-{
- evas_object_del(obj);
-}
-
-static void _popup_hide_finished_cb(void *data, Evas_Object *obj, void *event_info)
-{
- evas_object_del(obj);
-}
-
static void gl_sel_cb(void *data, Evas_Object *obj, void *event_info)
{
Evas_Object *popup = data;
elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 1.0);
evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, _popup_hide_cb, NULL);
- evas_object_smart_callback_add(popup, "dismissed", _popup_hide_finished_cb, NULL);
-
/* box */
box = elm_box_add(popup);
evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
static void event_back_key_up(void *data, Evas_Object *obj, void *event_info)
{
const struct popup_ops *ops = data;
- remove_popup(ops);
+
+ if (ops)
+ remove_popup(ops);
+ terminate_if_no_popup();
}
static void register_handlers(const struct popup_ops *ops)
eext_object_event_callback_del(win, EEXT_CALLBACK_BACK, event_back_key_up);
}
+powerkey_list_launch(bundle *b, const struct popup_ops *ops)
+{
+ register_handlers(ops);
+ return 0;
+}
+
static int poweroff_launch(bundle *b, const struct popup_ops *ops)
{
register_handlers(ops);
static const struct popup_ops powerkey_ops = {
.name = "powerkey",
.show = powerkey_list,
+ .pre = powerkey_list_launch,
.terminate = powerkey_terminate,
};