From e4e585a09723abaabfe70d598522a8fa5fc68bc8 Mon Sep 17 00:00:00 2001 From: Soonmin Jung Date: Fri, 7 Dec 2012 17:08:09 +0900 Subject: [PATCH] Add isEmulator to check emulator mode Change-Id: Ic67f042303aad60f85f9e0d6957e13cca88cdb29 --- composer/include/msg-ui-composer-data.h | 1 + composer/src/gadget/msg-ui-composer-gadget.c | 15 +++++++++++++++ composer/src/ui-composer/msg-ui-composer-attachment.c | 2 +- composer/src/ui-composer/msg-ui-composer-body-callback.c | 8 ++++---- composer/src/ui-composer/msg-ui-composer-body-page.c | 2 +- .../src/ui-composer/msg-ui-composer-recipient-callback.c | 4 ++-- composer/src/ui-composer/msg-ui-composer-recipient.c | 6 +++--- 7 files changed, 27 insertions(+), 11 deletions(-) diff --git a/composer/include/msg-ui-composer-data.h b/composer/include/msg-ui-composer-data.h index 3952e27..2c2d0dd 100755 --- a/composer/include/msg-ui-composer-data.h +++ b/composer/include/msg-ui-composer-data.h @@ -437,6 +437,7 @@ typedef struct _MSG_COMPOSER_DATA_S { bool isFullview; bool isMsgInternal; bool isAppControl; + bool isEmulator; bool sending_success; bool send_button_clicked; diff --git a/composer/src/gadget/msg-ui-composer-gadget.c b/composer/src/gadget/msg-ui-composer-gadget.c index 0b571ba..9a2fe8d 100755 --- a/composer/src/gadget/msg-ui-composer-gadget.c +++ b/composer/src/gadget/msg-ui-composer-gadget.c @@ -21,6 +21,7 @@ #include "msg-ui-composer-common.h" #include "msg-ui-composer-recipient.h" #include +#include #ifndef UG_MODULE_API #define UG_MODULE_API __attribute__ ((visibility("default"))) @@ -92,6 +93,20 @@ static void *__msg_ui_composer_on_create(ui_gadget_h ug, enum ug_mode mode, serv elm_object_part_content_set(cd->base, "elm.swallow.bg", cd->bg); elm_object_style_set(cd->bg, "edit_mode"); + char *cvalue = NULL; + int ret = SYSTEM_INFO_ERROR_NONE; + + ret = system_info_get_value_string(SYSTEM_INFO_KEY_MODEL, &cvalue); + if (ret == SYSTEM_INFO_ERROR_NONE && cvalue != NULL) { + if (g_strcmp0(cvalue, "Emulator") == 0) + cd->isEmulator = true; + } + + if (cvalue) { + g_free(cvalue); + cvalue = NULL; + } + if (service_get_operation(data, &operation) == SERVICE_ERROR_NONE && operation) cd->isAppControl = true; else diff --git a/composer/src/ui-composer/msg-ui-composer-attachment.c b/composer/src/ui-composer/msg-ui-composer-attachment.c index 55e4af6..72d8be6 100755 --- a/composer/src/ui-composer/msg-ui-composer-attachment.c +++ b/composer/src/ui-composer/msg-ui-composer-attachment.c @@ -275,7 +275,7 @@ static Evas_Object *__msgc_attachment_create_attach_layout(MSG_COMPOSER_VIEW_DAT evas_object_event_callback_add(del_icon, EVAS_CALLBACK_MOUSE_DOWN, __msgc_attachment_del_btn_down_cb, NULL); evas_object_event_callback_add(del_icon, EVAS_CALLBACK_MOUSE_UP, __msgc_attachment_del_btn_up_cb, NULL); - if (!cd->isAppControl) + if (!cd->isAppControl || !cd->isEmulator) evas_object_smart_callback_add(thumb_icon, "clicked", __msgc_attachment_thumb_icon_clicked_cb, cd); D_LEAVE; diff --git a/composer/src/ui-composer/msg-ui-composer-body-callback.c b/composer/src/ui-composer/msg-ui-composer-body-callback.c index 9b29467..72c0cb0 100755 --- a/composer/src/ui-composer/msg-ui-composer-body-callback.c +++ b/composer/src/ui-composer/msg-ui-composer-body-callback.c @@ -59,7 +59,7 @@ static void __add_list_popup_clicked_cb(void *data, Evas_Object *obj, void *even cd->add_menu_clicked = true; MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "label = %s", label); - if (cd->isAppControl) { + if (cd->isAppControl && cd->isEmulator) { if (!g_strcmp0(label, MSGC_STR_SUBJECT)) { msg_ui_composer_add_subject(cd); } else { @@ -123,12 +123,12 @@ static void __add_list_popup_show(void *data) Elm_Object_Item *item = NULL; - if (cd->isAppControl) { - item = elm_list_item_append(list, MSGC_STR_SUBJECT, NULL, NULL, __add_list_popup_clicked_cb, data); + if (cd->isAppControl && cd->isEmulator) { + item = elm_list_item_append(list, MSGC_STR_SUBJECT, NULL, NULL, __add_list_popup_clicked_cb, data); ++count; + if (cd->isSubject) elm_object_item_disabled_set(item, EINA_TRUE); - } else { if (!cd->isSubject) { elm_list_item_append(list, MSGC_STR_SUBJECT, NULL, NULL, __add_list_popup_clicked_cb, data); diff --git a/composer/src/ui-composer/msg-ui-composer-body-page.c b/composer/src/ui-composer/msg-ui-composer-body-page.c index 6486473..5fa1a33 100755 --- a/composer/src/ui-composer/msg-ui-composer-body-page.c +++ b/composer/src/ui-composer/msg-ui-composer-body-page.c @@ -908,7 +908,7 @@ static Evas_Object *__msg_ui_composer_body_media_layout_create(MSG_COMPOSER_VIEW evas_object_event_callback_add(del_icon, EVAS_CALLBACK_MOUSE_DOWN, msg_ui_composer_body_media_del_btn_down_cb, NULL); evas_object_event_callback_add(del_icon, EVAS_CALLBACK_MOUSE_UP, msg_ui_composer_body_media_del_btn_up_cb, NULL); - if (!cd->isAppControl) { + if (!cd->isAppControl || !cd->isEmulator) { if (media_type == COMPOSER_MEDIA_TYPE_AUDIO) { evas_object_data_set(_EDJ(layout), "layout", layout); edje_object_signal_callback_add(_EDJ(layout), "sound_clicked", "", msg_ui_composer_body_media_layout_clicked_cb, (void *)cd); diff --git a/composer/src/ui-composer/msg-ui-composer-recipient-callback.c b/composer/src/ui-composer/msg-ui-composer-recipient-callback.c index 55ed31a..60b9116 100755 --- a/composer/src/ui-composer/msg-ui-composer-recipient-callback.c +++ b/composer/src/ui-composer/msg-ui-composer-recipient-callback.c @@ -65,7 +65,7 @@ void msg_ui_recipient_multibuttonentry_focused_cb(void *data, Evas_Object *obj, elm_multibuttonentry_expanded_set(obj, EINA_TRUE); - if (!cd->isAppControl) + if (!cd->isAppControl || !cd->isEmulator) edje_object_signal_emit(_EDJ(rd->ly_to), "show.ct_button", "*"); D_LEAVE; @@ -84,7 +84,7 @@ void msg_ui_recipient_multibuttonentry_unfocused_cb(void *data, Evas_Object *obj elm_multibuttonentry_expanded_set(obj, EINA_FALSE); - if (!cd->isAppControl) + if (!cd->isAppControl || !cd->isEmulator) edje_object_signal_emit(_EDJ(rd->ly_to), "hide.ct_button", "*"); D_LEAVE; diff --git a/composer/src/ui-composer/msg-ui-composer-recipient.c b/composer/src/ui-composer/msg-ui-composer-recipient.c index 627b265..27cc876 100755 --- a/composer/src/ui-composer/msg-ui-composer-recipient.c +++ b/composer/src/ui-composer/msg-ui-composer-recipient.c @@ -380,7 +380,7 @@ static void __selected_popup_list_clicked_cb(void *data, Evas_Object *obj, void char *label = (char *)elm_object_item_text_get(item); - if (cd->isAppControl) { + if (cd->isAppControl && cd->isEmulator) { if (!strcmp(label, _SYSSTR("IDS_COM_OPT_DELETE"))) { msg_ui_composer_recipient_selected_delete(cd); } else if (!strcmp(label,_SYSSTR("IDS_COM_BODY_EDIT"))) { @@ -459,7 +459,7 @@ void msg_ui_composer_recipient_select_popup_create(void *data) elm_list_item_append(list, _SYSSTR("IDS_COM_OPT_DELETE"), NULL, NULL, __selected_popup_list_clicked_cb, cd); elm_list_item_append(list, _SYSSTR("IDS_COM_BODY_EDIT"), NULL, NULL, __selected_popup_list_clicked_cb, cd); - if (cd->isAppControl) { + if (cd->isAppControl && cd->isEmulator) { snprintf(title_str, sizeof(title_str), "%s", r_item->recipient); } else { if (r_item->index > 0) { @@ -707,7 +707,7 @@ static Evas_Object *__msg_ui_composer_recipient_to_layout_create(RECIPIENT_S *rd MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)rd->cd; - if (!cd->isAppControl) { + if (!cd->isAppControl || !cd->isEmulator) { Evas_Object *contact_btn = elm_button_add(rd->parent); elm_object_theme_set(contact_btn, cd->th); elm_object_style_set(contact_btn, "circle/contact_button"); -- 2.7.4