+++ /dev/null
-/*
- * mh_device_rename.c
- *
- * Created on: 26-May-2014
- * Author: sach.sharma
- */
-
-#include <Elementary.h>
-#include <vconf.h>
-#include <efl_extension.h>
-
-#include "mh_view_main.h"
-#include "mh_string.h"
-#include "mh_popup.h"
-
-static Eina_Bool __is_portrait_mode = EINA_TRUE;
-static int (*rotate_cb)(Eina_Bool , void*) = NULL;
-static void *rotate_cb_data = NULL;
-static void __set_rotate_cb(int (*cb)(Eina_Bool, void*) , void *data);
-
-static void __rename_popup_keyback_cb(void *data, Evas_Object *obj,
- void *event_info)
-{
- __MOBILE_AP_FUNC_ENTER__;
-
- mh_appdata_t *ad = (mh_appdata_t *)data;
-
- elm_object_focus_set(ad->rename_entry, EINA_FALSE);
-
- if (ad->rename_popup)
- evas_object_del(ad->rename_popup);
-
- ad->rename_popup = NULL;
- ad->rename_entry = NULL;
- __set_rotate_cb(NULL, NULL);
-
- __MOBILE_AP_FUNC_EXIT__;
-}
-
-static void __rename_popup_mouseup_cb(void *data,
- Evas *e, Evas_Object *obj, void *event_info)
-{
- __MOBILE_AP_FUNC_ENTER__;
-
- Evas_Event_Mouse_Up *ev = event_info;
- mh_appdata_t *ad = (mh_appdata_t *)data;
-
- if (ev->button == 3) {
- elm_object_focus_set(ad->rename_entry, EINA_FALSE);
- if (ad->rename_popup)
- evas_object_del(ad->rename_popup);
-
- ad->rename_popup = NULL;
- ad->rename_entry = NULL;
- }
- __MOBILE_AP_FUNC_EXIT__;
- return;
-}
-
-static bool __is_space_str(const char *str)
-{
- while (str) {
- if (*str != '\0' && *str != ' ')
- return FALSE;
- else if (*str == '\0')
- return TRUE;
- str++;
- }
- return TRUE;
-}
-
-static void __rename_popop_entry_changed_cb(void *data, Evas_Object *obj,
- void *event_info)
-{
- __MOBILE_AP_FUNC_ENTER__;
- mh_appdata_t *ad = (mh_appdata_t *)data;
-
- const char *entry_text = NULL;
- char *input_str = NULL;
- bool is_space_string = FALSE;
-
- entry_text = elm_entry_entry_get(obj);
- input_str = elm_entry_markup_to_utf8(entry_text);
-
- if (elm_object_part_content_get(obj, "elm.swallow.clear")) {
- if (elm_object_focus_get(obj)) {
- if (elm_entry_is_empty(obj))
- elm_object_signal_emit(obj, "elm,state,clear,hidden", "");
- else
- elm_object_signal_emit(obj, "elm,state,clear,visible", "");
- }
- }
-
-
- if (input_str == NULL || (strlen(input_str) == 0)) {
- elm_object_disabled_set(ad->rename_button, TRUE);
- elm_entry_input_panel_return_key_disabled_set(obj, TRUE);
- if (input_str)
- free(input_str);
-
- return;
- }
-
- is_space_string = __is_space_str(input_str);
- if (is_space_string) {
- elm_object_disabled_set(ad->rename_button, TRUE);
- elm_entry_input_panel_return_key_disabled_set(ad->rename_entry, TRUE);
- free(input_str);
- return;
- }
-
- if (strlen(input_str) > 0) {
- elm_object_disabled_set(ad->rename_button, FALSE);
- elm_entry_input_panel_return_key_disabled_set(ad->rename_entry, FALSE);
- }
- if (input_str)
- free(input_str);
-
- __MOBILE_AP_FUNC_EXIT__;
-}
-
-static void __device_name_maxlength_reached_cb(void *data, Evas_Object *obj,
- void *event_info)
-{
- __MOBILE_AP_FUNC_ENTER__;
-
- if (data == NULL || obj == NULL) {
- ERR("The param is NULL\n");
- return;
- }
-
- char buf[MH_LABEL_LENGTH_MAX] = { 0, };
- notification_error_e ret;
-
- snprintf(buf, sizeof(buf), STR_PW_MAX_LEN_WARN_MSG, DEVICE_NAME_LENGTH_MAX);
- ret = notification_status_message_post(buf);
- if (ret != NOTIFICATION_ERROR_NONE)
- ERR("notification_status_message_post() is failed : %d\n", ret);
-
- __MOBILE_AP_FUNC_EXIT__;
-}
-
-static void __entry_focused_cb(void *data, Evas_Object *obj, void *event_info)
-{
- __MOBILE_AP_FUNC_ENTER__;
-
- if (elm_object_part_content_get(obj, "elm.swallow.clear")) {
- if (!elm_entry_is_empty(obj))
- elm_object_signal_emit(obj, "elm,state,clear,visible", "");
- else
- elm_object_signal_emit(obj, "elm,state,clear,hidden", "");
- }
- elm_object_signal_emit(obj, "elm,state,focus,on", "");
-
- __MOBILE_AP_FUNC_EXIT__;
-}
-
-static void __entry_unfocused_cb(void *data, Evas_Object *obj, void *event_info)
-{
- __MOBILE_AP_FUNC_ENTER__;
-
- if (elm_object_part_content_get(obj, "elm.swallow.clear"))
- elm_object_signal_emit(obj, "elm,state,clear,hidden", "");
- elm_object_signal_emit(obj, "elm,state,focus,off", "");
-
- __MOBILE_AP_FUNC_EXIT__;
-}
-
-static void __eraser_btn_clicked_cb(void *data, Evas_Object *obj,
- void *event_info)
-{
- __MOBILE_AP_FUNC_ENTER__;
-
- if (data == NULL) {
- ERR("data is null\n");
- return;
- }
- mh_appdata_t *ad = (mh_appdata_t*) data;
-
- elm_entry_entry_set(ad->rename_entry, "");
- elm_object_disabled_set(ad->rename_button, TRUE);
- elm_entry_input_panel_return_key_disabled_set(ad->rename_entry, TRUE);
-
- __MOBILE_AP_FUNC_EXIT__;
-}
-
-static void __rename_popup_cancel_cb(void *data, Evas_Object *obj,
- void *event_info)
-{
- __MOBILE_AP_FUNC_ENTER__;
-
- if (data == NULL || obj == NULL) {
- ERR("data is null\n");
- return;
- }
- mh_appdata_t *ad = (mh_appdata_t*) data;
-
- if (ad->rename_popup) {
- evas_object_del(ad->rename_popup);
- ad->rename_popup = NULL;
- }
- if (ad->rename_entry) {
- evas_object_del(ad->rename_entry);
- ad->rename_entry = NULL;
- }
- __set_rotate_cb(NULL, NULL);
-
- __MOBILE_AP_FUNC_EXIT__;
- return;
-}
-
-static void __rename_popup_ok_cb(void *data, Evas_Object *obj,
- void *event_info)
-{
- __MOBILE_AP_FUNC_ENTER__;
-
- if (data == NULL || obj == NULL) {
- ERR("data is null\n");
- return;
- }
- mh_appdata_t *ad = (mh_appdata_t*) data;
- char *device_name_str = NULL;
- const char *entry_str = elm_entry_entry_get(ad->rename_entry);
-
- device_name_str = elm_entry_markup_to_utf8(entry_str);
- if (device_name_str == NULL) {
- ERR("elm_entry_utf8_to_markup is failed\n");
- return;
- }
-
- DBG("New device name:[%s]\n", device_name_str);
- __set_rotate_cb(NULL, NULL);
- if (ad->rename_popup) {
- evas_object_del(ad->rename_popup);
- ad->rename_popup = NULL;
- }
- if (ad->rename_entry) {
- evas_object_del(ad->rename_entry);
- ad->rename_entry = NULL;
- }
- if (g_strcmp0(ad->setup.device_name, device_name_str)) {
- if (vconf_set_str(VCONFKEY_SETAPPL_DEVICE_NAME_STR, device_name_str) != 0)
- DBG("Set vconf[%s] failed\n", VCONFKEY_SETAPPL_DEVICE_NAME_STR);
-
- g_strlcpy(ad->setup.device_name, entry_str,
- sizeof(ad->setup.device_name));
-
- if (ad->main.help_item != NULL) {
- if (ad->main.help_item)
- elm_genlist_item_update(ad->main.help_item);
- }
-
- if (ad->setup.name_item != NULL) {
- if (ad->setup.name_item)
- elm_genlist_item_update(ad->setup.name_item);
- }
- }
- free(device_name_str);
-
- __MOBILE_AP_FUNC_EXIT__;
- return;
-}
-
-static void __enter_key_down_cb(void *data, Evas *evas, Evas_Object *obj,
- void *event_info)
-{
- __MOBILE_AP_FUNC_ENTER__;
-
- Evas_Event_Key_Down *ev = event_info;
-
- if (g_strcmp0(ev->key, "KP_Enter") == 0 ||
- g_strcmp0(ev->key, "Return") == 0) {
- Ecore_IMF_Context *imf_context;
- elm_entry_cursor_end_set(obj);
- imf_context = (Ecore_IMF_Context*)elm_entry_imf_context_get(obj);
- if (imf_context)
- ecore_imf_context_input_panel_hide(imf_context);
- elm_object_focus_set(obj, EINA_FALSE);
- }
- __MOBILE_AP_FUNC_EXIT__;
-}
-
-static void __set_rotate_cb(int (*cb)(Eina_Bool, void*), void *data)
-{
- rotate_cb = cb;
- rotate_cb_data = data;
-}
-
-Eina_Bool __is_current_mode_portrait(void)
-{
- return __is_portrait_mode;
-}
-
-static void __set_portrait_mode(Eina_Bool is_portrait)
-{
- __is_portrait_mode = is_portrait;
-}
-
-
-void _hadnle_rename_popup_rotation(Eina_Bool is_portrait)
-{
- __MOBILE_AP_FUNC_ENTER__;
-
- __set_portrait_mode(is_portrait);
- if (rotate_cb)
- rotate_cb(is_portrait, rotate_cb_data);
-
- __MOBILE_AP_FUNC_EXIT__;
-}
-
-static Evas_Object *__rename_entry_icon_get(void *data, Evas_Object *obj, const char *part)
-{
- __MOBILE_AP_FUNC_ENTER__;
-
- Evas_Object *entry = NULL;
- Evas_Object *button = NULL;
- char *ptr = NULL;
- char *device_name_utf = NULL;
- static Elm_Entry_Filter_Limit_Size limit_filter_data;
-
- if (data == NULL) {
- ERR("data is null\n");
- return NULL;
- }
- mh_appdata_t *ad = (mh_appdata_t*) data;
-
- if (strcmp(part, "elm.icon.entry"))
- return NULL;
-
- entry = elm_entry_add(obj);
- elm_entry_single_line_set(entry, EINA_TRUE);
- elm_entry_scrollable_set(entry, EINA_TRUE);
- limit_filter_data.max_char_count = DEVICE_NAME_LENGTH_MAX;
- elm_entry_markup_filter_append(entry, elm_entry_filter_limit_size, &limit_filter_data);
-
- evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, EVAS_HINT_FILL);
- eext_entry_selection_back_event_allow_set(entry, EINA_TRUE);
- elm_object_signal_emit(entry, "elm,action,hide,search_icon", "");
- elm_object_domain_translatable_part_text_set(entry, "elm.guide", PACKAGE,
- STR_DEVICE_NAME);
-
- elm_entry_input_panel_return_key_type_set(entry,
- ELM_INPUT_PANEL_RETURN_KEY_TYPE_DONE);
- elm_entry_cnp_mode_set(entry, ELM_CNP_MODE_PLAINTEXT);
- ad->rename_entry = entry;
-
- device_name_utf = vconf_get_str(VCONFKEY_SETAPPL_DEVICE_NAME_STR);
- if (device_name_utf == NULL) {
- ERR("vconf_get_str failed \n");
- return NULL;
- }
- ptr = elm_entry_utf8_to_markup(device_name_utf);
- if (ptr == NULL) {
- ERR("elm_entry_utf8_to_markup is failed\n");
- free(device_name_utf);
- return NULL;
- } else {
- elm_entry_entry_set(entry, ptr);
- }
- free(device_name_utf);
- free(ptr);
- elm_entry_cursor_end_set(entry);
-
- evas_object_smart_callback_add(entry, "changed,user", __rename_popop_entry_changed_cb, ad);
- evas_object_smart_callback_add(entry, "changed", __rename_popop_entry_changed_cb, ad);
- evas_object_smart_callback_add(entry, "preedit,changed",
- __rename_popop_entry_changed_cb, ad);
-
- evas_object_smart_callback_add(entry, "maxlength,reached",
- __device_name_maxlength_reached_cb, ad);
- evas_object_smart_callback_add(entry, "focused", __entry_focused_cb, NULL);
- evas_object_smart_callback_add(entry, "unfocused", __entry_unfocused_cb, NULL);
- evas_object_event_callback_add(entry, EVAS_CALLBACK_KEY_DOWN,
- __enter_key_down_cb, ad);
-
- button = elm_button_add(obj);
- elm_object_style_set(button, "search_clear");
- elm_object_focus_allow_set(button, EINA_FALSE);
- elm_object_part_content_set(entry, "elm.swallow.clear", button);
- evas_object_smart_callback_add(button, "clicked", __eraser_btn_clicked_cb, ad);
- evas_object_show(entry);
- elm_object_focus_set(entry, EINA_TRUE);
- return entry;
-}
-
-static char *__rename_desc_label_get(void *data, Evas_Object *obj,
- const char *part)
-{
- if (!strcmp(part, "elm.text.multiline"))
- return g_strdup(STR_RENAME_DEVICE_MSG);
-
- return NULL;
-}
-
-void _create_rename_device_popup(void *data)
-{
- __MOBILE_AP_FUNC_ENTER__;
-
- if (data == NULL) {
- ERR("data is null\n");
- __MOBILE_AP_FUNC_EXIT__;
- return;
- }
-
- Evas_Object *popup = NULL;
- Evas_Object *button = NULL;
- Evas_Object *rename_btn = NULL;
- Evas_Object *genlist = NULL;
- Elm_Object_Item *item = NULL;
- Evas_Object *layout = NULL;
- mh_appdata_t *ad = (mh_appdata_t*) data;
-
- if (ad->rename_popup) {
- evas_object_del(ad->rename_popup);
- ad->rename_popup = NULL;
- }
-
- popup = elm_popup_add(ad->layout);
- evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- elm_object_domain_translatable_part_text_set(popup, "title,text", PACKAGE,
- "IDS_ST_HEADER_RENAME_DEVICE");
- eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK,
- __rename_popup_keyback_cb, (void *)ad);
- evas_object_event_callback_add(popup, EVAS_CALLBACK_MOUSE_UP,
- __rename_popup_mouseup_cb, (void *)ad);
-
- layout = elm_layout_add(popup);
- elm_layout_file_set(layout, FILE_PATH_OF_EDC, "rename_device_ly");
- evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-
- genlist = elm_genlist_add(layout);
- evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(genlist, EVAS_HINT_FILL, EVAS_HINT_FILL);
- elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS);
- elm_scroller_content_min_limit(genlist, EINA_FALSE, EINA_TRUE);
-
- /* Entry genlist item */
- ad->setup.rename_entry_itc = elm_genlist_item_class_new();
- if (ad->setup.rename_entry_itc == NULL) {
- ERR("elm_genlist_item_class_new failed\n");
- __MOBILE_AP_FUNC_EXIT__;
- return;
- }
- ad->setup.rename_entry_itc->item_style = "entry";
- ad->setup.rename_entry_itc->func.text_get = NULL;
- ad->setup.rename_entry_itc->func.content_get = __rename_entry_icon_get;
- ad->setup.rename_entry_itc->func.state_get = NULL;
- ad->setup.rename_entry_itc->func.del = NULL;
-
- elm_genlist_item_append(genlist, ad->setup.rename_entry_itc, ad,
- NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
-
- /* Description genlist item */
- ad->setup.rename_descp_itc = elm_genlist_item_class_new();
- if (ad->setup.rename_descp_itc == NULL) {
- ERR("elm_genlist_item_class_new failed\n");
- __MOBILE_AP_FUNC_EXIT__;
- return;
- }
- ad->setup.rename_descp_itc->item_style = "multiline_sub";
- ad->setup.rename_descp_itc->func.text_get = __rename_desc_label_get;
- ad->setup.rename_descp_itc->func.content_get = NULL;
- ad->setup.rename_descp_itc->func.state_get = NULL;
- ad->setup.rename_descp_itc->func.del = NULL;
- item = elm_genlist_item_append(genlist, ad->setup.rename_descp_itc, NULL, NULL,
- ELM_GENLIST_ITEM_NONE, NULL, NULL);
- elm_genlist_item_select_mode_set(item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
-
- button = elm_button_add(popup);
- elm_object_style_set(button, "popup");
- elm_object_text_set(button, STR_CANCEL);
- elm_object_domain_translatable_text_set(button, PACKAGE, STR_CANCEL);
- elm_object_part_content_set(popup, "button1", button);
- evas_object_smart_callback_add(button, "clicked",
- __rename_popup_cancel_cb, ad);
- evas_object_show(button);
-
- rename_btn = elm_button_add(popup);
- ad->rename_button = rename_btn;
- elm_object_style_set(rename_btn, "popup");
- elm_object_domain_translatable_text_set(rename_btn, PACKAGE, STR_RENAME_DEVICE);
- elm_object_part_content_set(popup, "button2", rename_btn);
- evas_object_smart_callback_add(rename_btn, "clicked", __rename_popup_ok_cb, ad);
- evas_object_show(rename_btn);
-
- elm_genlist_realization_mode_set(genlist, EINA_TRUE);
- evas_object_show(genlist);
- elm_object_part_content_set(layout, "elm.swallow.layout", genlist);
- evas_object_show(layout);
- elm_object_content_set(popup, layout);
-
- evas_object_show(popup);
- ad->rename_popup = popup;
- elm_object_focus_set(ad->rename_entry, EINA_TRUE);
-
- __MOBILE_AP_FUNC_EXIT__;
- return;
-}
#include "mh_popup.h"
#include "mh_string.h"
-#if 0 /* device rename not supported */
-static void __ctx_move_more_ctxpopup(Evas_Object *ctx, mh_appdata_t *ad);
-static void __ctx_delete_more_ctxpopup_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
-static Eina_Bool rotate_flag = EINA_FALSE;
-#endif
void _genlist_update_device_item(mh_appdata_t *ad);
mh_appdata_t *g_ad = NULL;
#define UPDATE_INTERVAL 1
-#if 0 /* device rename not supported */
-void _rotate_adjust_rename_popup(void)
-{
- __MOBILE_AP_FUNC_ENTER__;
-
- int change_ang = 0;
-
- change_ang = elm_win_rotation_get(g_ad->win);
- if (change_ang == 0 || change_ang == 180)
- _hadnle_rename_popup_rotation(EINA_TRUE);
- else
- _hadnle_rename_popup_rotation(EINA_FALSE);
-
- __MOBILE_AP_FUNC_EXIT__;
-}
-#endif
-
void _select_connected_dev(void *data, Evas_Object *obj, void *event_info)
{
__MOBILE_AP_FUNC_ENTER__;
static void __set_genlist_itc(mh_appdata_t *ad)
{
/* On, Off view's item class for genlist */
-#if 0 /* not used */
- ad->main.sp_itc = elm_genlist_item_class_new();
- if (ad->main.sp_itc == NULL) {
- ERR("elm_genlist_item_class_new failed\n");
- return;
- }
-
- ad->main.sp_itc->item_style = "dialogue/separator";
- ad->main.sp_itc->func.text_get = NULL;
- ad->main.sp_itc->func.content_get = NULL;
- ad->main.sp_itc->func.state_get = NULL;
- ad->main.sp_itc->func.del = NULL;
-#endif
ad->main.wifi_itc = elm_genlist_item_class_new();
if (ad->main.wifi_itc == NULL) {
ERR("elm_genlist_item_class_new failed\n");
ad->main.wifi_itc->func.state_get = NULL;
ad->main.wifi_itc->func.del = NULL;
-#if 0 /* not used */
- ad->main.sp2_itc = elm_genlist_item_class_new();
- if (ad->main.sp2_itc == NULL) {
- ERR("elm_genlist_item_class_new failed\n");
- return;
- }
-
- ad->main.sp2_itc->item_style = "dialogue/separator.2";
- ad->main.sp2_itc->func.text_get = NULL;
- ad->main.sp2_itc->func.content_get = NULL;
- ad->main.sp2_itc->func.state_get = NULL;
- ad->main.sp2_itc->func.del = NULL;
-#endif
/* End of On, Off view's item class for genlist */
/* Off view's item class for genlist */
_free_genlist_itc(&mv->bt_itc);
_free_genlist_itc(&mv->setup_itc);
_free_genlist_itc(&mv->wifi_itc);
-#if 0 /* not used */
- _free_genlist_itc(&mv->sp_itc);
- _free_genlist_itc(&mv->sp2_itc);
-#endif
__MOBILE_AP_FUNC_EXIT__;
return;
}
__MOBILE_AP_FUNC_EXIT__;
}
-#if 0 /* device rename not supported */
-static void __ctx_move_more_ctxpopup(Evas_Object *ctx, mh_appdata_t *ad)
-{
- Evas_Coord w;
- Evas_Coord h;
- int pos = -1;
- __MOBILE_AP_FUNC_ENTER__;
-
- elm_win_screen_size_get(ad->win, NULL, NULL, &w, &h);
- pos = elm_win_rotation_get(ad->win);
-
- switch (pos) {
- case 0:
- case 180:
- evas_object_move(ctx, w/2, h);
- break;
- case 90:
- evas_object_move(ctx, h/2, w);
- break;
- case 270:
- evas_object_move(ctx, h/2, w);
- break;
- }
- __MOBILE_AP_FUNC_EXIT__;
-}
-
-static void __rotate_more_ctxpopup_cb(void *data, Evas_Object *obj, void *event_info)
-{
- __MOBILE_AP_FUNC_ENTER__;
-
- mh_appdata_t *ad = (mh_appdata_t *)data;
- Evas_Object *ctx = ad->ctxpopup;
-
- __ctx_move_more_ctxpopup(ctx, ad);
- evas_object_show(ctx);
-
- __MOBILE_AP_FUNC_EXIT__;
-}
-
-static void __dismissed_more_ctxpopup_cb(void *data, Evas_Object *obj, void *event)
-{
- __MOBILE_AP_FUNC_ENTER__;
-
- mh_appdata_t *ad = (mh_appdata_t *)data;
- Evas_Object *ctx = ad->ctxpopup;
-
- if (!rotate_flag) {
- evas_object_del(ctx);
- ctx = NULL;
- } else {
- __ctx_move_more_ctxpopup(ctx, ad);
- evas_object_show(ctx);
- rotate_flag = EINA_FALSE;
- }
- __MOBILE_AP_FUNC_EXIT__;
-}
-
-static void __ctx_delete_more_ctxpopup_cb(void *data, Evas *e, Evas_Object *obj,
- void *event_info)
-{
- Evas_Object *navi = (Evas_Object *)data;
- Evas_Object *ctx = obj;
-
- if (navi == NULL) {
- ERR("data is null\n");
- return;
- }
- __MOBILE_AP_FUNC_ENTER__;
-
- evas_object_smart_callback_del(ctx, "dismissed",
- __dismissed_more_ctxpopup_cb);
- evas_object_smart_callback_del(elm_object_top_widget_get(ctx),
- "rotation,changed", __rotate_more_ctxpopup_cb);
- evas_object_event_callback_del_full(ctx, EVAS_CALLBACK_DEL,
- __ctx_delete_more_ctxpopup_cb, navi);
- __MOBILE_AP_FUNC_EXIT__;
-}
-
-static void _gl_rename_device_sel(void *data, Evas_Object *obj, void *event_info)
-{
- __MOBILE_AP_FUNC_ENTER__;
-
- mh_appdata_t *ad = (mh_appdata_t *)data;
-
- if (ad == NULL) {
- ERR("ad is null\n");
- return;
- }
- evas_object_del(ad->ctxpopup);
- ad->ctxpopup = NULL;
-
- _create_rename_device_popup((void *)ad);
- __MOBILE_AP_FUNC_EXIT__;
-}
-
-static void __create_ctxpopup_more_button(void *data, Evas_Object *obj,
- void *event_info)
-{
- mh_appdata_t *ad = (mh_appdata_t *)data;
- Evas_Object *ctxpopup = NULL;
-
- if (ad == NULL) {
- ERR("ad is null\n");
- return;
- }
- __MOBILE_AP_FUNC_ENTER__;
-
- if (ad->setup.navi_it == NULL)
- return;
-
- elm_naviframe_item_pop_cb_set(ad->setup.navi_it, _setting_back_btn_cb, (void *)ad);
- ctxpopup = elm_ctxpopup_add(ad->naviframe);
- elm_ctxpopup_auto_hide_disabled_set(ctxpopup, EINA_TRUE);
-
- eext_object_event_callback_add(ctxpopup, EEXT_CALLBACK_BACK,
- eext_ctxpopup_back_cb, ad);
- eext_object_event_callback_add(ctxpopup, EEXT_CALLBACK_MORE,
- eext_ctxpopup_back_cb, ad);
- elm_object_style_set(ctxpopup, "more/default");
- evas_object_smart_callback_add(ctxpopup, "dismissed",
- __dismissed_more_ctxpopup_cb, ad);
- evas_object_smart_callback_add(elm_object_top_widget_get(ctxpopup), "rotation,changed",
- __rotate_more_ctxpopup_cb, ad);
- evas_object_event_callback_add(ctxpopup, EVAS_CALLBACK_DEL,
- __ctx_delete_more_ctxpopup_cb, ad->naviframe);
-
- elm_ctxpopup_direction_priority_set(ctxpopup, ELM_CTXPOPUP_DIRECTION_UP,
- ELM_CTXPOPUP_DIRECTION_DOWN,
- ELM_CTXPOPUP_DIRECTION_UNKNOWN,
- ELM_CTXPOPUP_DIRECTION_UNKNOWN);
-
- __ctx_move_more_ctxpopup(ctxpopup, ad);
- elm_ctxpopup_item_append(ctxpopup, STR_RENAME_DEVICE_HEADER,
- NULL, _gl_rename_device_sel, ad);
-
- evas_object_show(ctxpopup);
-
- ad->ctxpopup = ctxpopup;
-
- __MOBILE_AP_FUNC_EXIT__;
-}
-#endif
-
void _main_draw_contents(mh_appdata_t *ad)
{
INFO("+\n");
eext_object_event_callback_add(ad->naviframe, EEXT_CALLBACK_BACK,
eext_naviframe_back_cb, NULL);
-#if 0 /* device rename not supported */
- eext_object_event_callback_add(ad->naviframe, EEXT_CALLBACK_MORE,
- __create_ctxpopup_more_button, ad);
-#endif
evas_object_smart_callback_add(ad->main.back_btn, "clicked", (Evas_Smart_Cb)__back_btn_cb, (void *)ad);
elm_object_focus_allow_set(ad->main.back_btn, EINA_FALSE);