remove Add to Calendar & remove 2nd ctx popup for Add to Contacts
authorSungbok Park <parksb@samsung.com>
Mon, 12 Nov 2012 21:42:43 +0000 (06:42 +0900)
committerSungbok Park <parksb@samsung.com>
Mon, 12 Nov 2012 21:42:43 +0000 (06:42 +0900)
Change-Id: Iccccfbf4f8cfc415ab5380ee4beecb432bc16bb6

common/include/email-common-types.h
viewer/src/email-viewer.c

index 9b358e8..4a2f185 100755 (executable)
 #define EMAIL_BUNDLE_KEY_MAILBOX_TYPE          "MAILBOX_TYPE"
 
 #define EMAIL_BUNDLE_KEY_CONTACT_TYPE                                  "type"
-#define EMAIL_BUNDLE_KEY_CALENDAR_EDIT_ACCOUNT_ID              "account_id"
-#define EMAIL_BUNDLE_KEY_CALENDAR_EDIT_MAIL_ID                 "mail_id"
-#define EMAIL_BUNDLE_KEY_CALENDAR_EDIT_SRC_BOX                 "src_box"
-#define EMAIL_BUNDLE_KEY_CALENDAR_EDIT_INDEX                   "index"
-#define EMAIL_BUNDLE_KEY_CALENDAR_EDIT_NOTE                    "note"
 #define EMAIL_BUNDLE_KEY_VIDEO_PLAYER_LAUNCH_APP               "launching_application"
 
 /* define ug name */
 #define UG_NAME_EMAIL_ACCOUNT          "email-account-efl"
 #define UG_NAME_EMAIL_DOCUMENT         "email-docsearch-efl"
 #define UG_NAME_CONTACT                        "contacts-tabui-efl"
-#define UG_NAME_CALENDAR_EDIT          "calendar-edit-efl"
 
 /* define bundle value */
-#define EMAIL_BUNDLE_VAL_CALENDAR_EDIT_INDEX   "0"
 #define EMAIL_BUNDLE_VAL_END_KEY                                       "END_KEY_EVENT"
 #define EMAIL_BUNDLE_VAL_NEXT_MSG                              "NEXT_MSG"
 #define EMAIL_BUNDLE_VAL_PREV_MSG                              "PREV_MSG"
index 2efb70d..9d9a860 100755 (executable)
@@ -87,8 +87,6 @@ static void _destroy_down_progress_ex(void *data, Evas_Object *obj, void *event_
 static void _create_more_ctxpopup(EmailViewerUGD *ug_data);
 static void _delete_evas_objects(EmailViewerUGD *ug_data);
 
-static void _launch_vcs_editor(EmailViewerUGD *ug_data);
-
 /* callback functions */
 static void _back_cb(void *data, Evas_Object *obj, void *event_info);
 static void _prev_mail_cb(void *data, Evas_Object *obj, void *event_info);
@@ -97,7 +95,6 @@ static void _reply_cb(void *data, Evas_Object *obj, void *event_info);
 static void _reply_all_cb(void *data, Evas_Object *obj, void *event_info);
 static void _reply_option_cb(void *data, Evas_Object *obj, void *event_info);
 static void _forward_cb(void *data, Evas_Object *obj, void *event_info);
-static void _add_to_calendar_cb(void *data, Evas_Object *obj, void *event_info);
 static void _resend_cb(void *data, Evas_Object *obj, void *event_info);
 static void _delete_cb(void *data, Evas_Object *obj, void *event_info);
 static void _move_cb(void *data, Evas_Object *obj, void *event_info);
@@ -119,8 +116,6 @@ static Eina_Bool _save_email_prog_cb(void *data);
 static void _ctxpopup_detail_contact_cb(void *data, Evas_Object *obj, void *event_info);
 static void _ctxpopup_send_email_cb(void *data, Evas_Object *obj, void *event_info);
 static void _ctxpopup_add_contact_cb(void *data, Evas_Object *obj, void *event_info);
-static void _ctxpopup_cutlink_update_contact_cb(void *data, Evas_Object *obj, void *event_info);
-static void _ctxpopup_select_contact_mode_email_cb(void *data, Evas_Object *obj, void *event_info);
 static void _ctxpopup_add_block_rule_cb(void *data, Evas_Object *obj, void *event_info);
 static void _popup_waiting_response_cb(void *data, Evas_Object *obj, void *event_info);
 static void _popup_response_cb(void *data, Evas_Object *obj, void *event_info);
@@ -2522,7 +2517,6 @@ static void _create_more_ctxpopup(EmailViewerUGD *ug_data)
                elm_ctxpopup_item_append(ug_data->con_popup, dgettext("sys_string", "IDS_COM_BODY_MOVE"), NULL, _move_cb, ug_data);
                elm_ctxpopup_item_append(ug_data->con_popup, _("IDS_EMAIL_OPT_SAVE_EMAIL_ABB"), NULL, _save_email_cb, ug_data);
                elm_ctxpopup_item_append(ug_data->con_popup, _("IDS_EMAIL_OPT_VIEW_CONTACT"), NULL, _ctxpopup_detail_contact_cb, g_strdup(index));
-               elm_ctxpopup_item_append(ug_data->con_popup, _("IDS_EMAIL_OPT_ADD_TO_CALENDAR"), NULL, _add_to_calendar_cb, ug_data);
                ug_data->more_ctx_block_item = elm_ctxpopup_item_append(ug_data->con_popup, _("IDS_EMAIL_OPT_BLOCK"), NULL, _ctxpopup_add_block_rule_cb, prop->sender);
 
                _delete_contacts_list(contact_list_item);
@@ -2534,8 +2528,7 @@ static void _create_more_ctxpopup(EmailViewerUGD *ug_data)
 
                elm_ctxpopup_item_append(ug_data->con_popup, dgettext("sys_string", "IDS_COM_BODY_MOVE"), NULL, _move_cb, ug_data);
                elm_ctxpopup_item_append(ug_data->con_popup, _("IDS_EMAIL_OPT_SAVE_EMAIL_ABB"), NULL, _save_email_cb, ug_data);
-               elm_ctxpopup_item_append(ug_data->con_popup, dgettext("sys_string", "IDS_COM_OPT_ADD_TO_CONTACTS"), NULL, _ctxpopup_select_contact_mode_email_cb, prop->sender);
-               elm_ctxpopup_item_append(ug_data->con_popup, _("IDS_EMAIL_OPT_ADD_TO_CALENDAR"), NULL, _add_to_calendar_cb, ug_data);
+               elm_ctxpopup_item_append(ug_data->con_popup, dgettext("sys_string", "IDS_COM_OPT_ADD_TO_CONTACTS"), NULL, _ctxpopup_add_contact_cb, prop->sender);
                ug_data->more_ctx_block_item = elm_ctxpopup_item_append(ug_data->con_popup, _("IDS_EMAIL_OPT_BLOCK"), NULL, _ctxpopup_add_block_rule_cb, prop->sender);
        }
 
@@ -2789,50 +2782,6 @@ void _launch_composer(EmailViewerUGD *ug_data, int type)
        debug_log("service_destroy: %d", ret);
 }
 
-static void _launch_vcs_editor(EmailViewerUGD *ug_data)
-{
-       debug_log("");
-
-       if (!ug_data) {
-               debug_log("ug_data is NULL");
-               return;
-       }
-
-       char account_id[MAX_STR_LEN] = { 0, };
-       char mail_id[MAX_STR_LEN] = { 0, };
-
-       EmailViewerProp *prop = ug_data->property;
-
-       int ret;
-       service_h service = NULL;
-
-       ret = service_create(&service);
-       debug_log("service_create: %d", ret);
-       if (!service) {
-               debug_log("service create failed");
-               return;
-       }
-
-       snprintf(account_id, sizeof(account_id), "%d", prop->account_id);
-       snprintf(mail_id, sizeof(mail_id), "%d", prop->mail_id);
-
-       ret = service_add_extra_data(service, EMAIL_BUNDLE_KEY_CALENDAR_EDIT_ACCOUNT_ID, account_id);
-       debug_log("service_add_extra_data: %d", ret);
-       ret = service_add_extra_data(service, EMAIL_BUNDLE_KEY_CALENDAR_EDIT_MAIL_ID, mail_id);
-       debug_log("service_add_extra_data: %d", ret);
-       ret = service_add_extra_data(service, EMAIL_BUNDLE_KEY_CALENDAR_EDIT_SRC_BOX, prop->src_box);
-       debug_log("service_add_extra_data: %d", ret);
-       ret = service_add_extra_data(service, EMAIL_BUNDLE_KEY_CALENDAR_EDIT_INDEX, EMAIL_BUNDLE_VAL_CALENDAR_EDIT_INDEX);
-       debug_log("service_add_extra_data: %d", ret);
-       ret = service_add_extra_data(service, EMAIL_BUNDLE_KEY_CALENDAR_EDIT_NOTE, prop->subject);
-       debug_log("service_add_extra_data: %d", ret);
-
-       ug_data->ug_calendar_edit = create_ug(UG_NAME_CALENDAR_EDIT, service, ug_data);
-
-       ret = service_destroy(service);
-       debug_log("service_destroy: %d", ret);
-}
-
 static void _back_cb(void *data, Evas_Object *obj, void *event_info)
 {
        debug_log("");
@@ -3005,23 +2954,6 @@ static void _forward_cb(void *data, Evas_Object *obj, void *event_info)
        _launch_composer(ug_data, RUN_COMPOSER_FORWARD);
 }
 
-static void _add_to_calendar_cb(void *data, Evas_Object *obj, void *event_info)
-{
-       debug_log("");
-
-       if (data == NULL)
-               return;
-
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-
-       if (ug_data->con_popup) {
-               evas_object_del(ug_data->con_popup);
-               ug_data->con_popup = NULL;
-       }
-
-       _launch_vcs_editor(ug_data);
-}
-
 static void _resend_cb(void *data, Evas_Object *obj, void *event_info)
 {
        debug_log("");
@@ -3874,98 +3806,6 @@ static void _ctxpopup_add_contact_cb(void *data, Evas_Object *obj, void *event_i
        debug_log("service_destroy: %d", ret);
 }
 
-static void _ctxpopup_cutlink_update_contact_cb(void *data, Evas_Object *obj, void *event_info)
-{
-       debug_log("");
-       if (!data || !_g_ug_data) {
-               debug_log("data is NULL");
-               return;
-       }
-
-       char tmp[MAX_STR_LEN] = { 0, };
-       EmailViewerUGD *ug_data = _g_ug_data;
-
-       if (ug_data->con_popup == NULL) {
-               debug_log("con_popup is NULL");
-               return;
-       }
-
-       if (ug_data->con_popup) {
-               evas_object_del(ug_data->con_popup);
-               ug_data->con_popup = NULL;
-       }
-
-       int ret;
-       service_h service = NULL;
-
-       ret = service_create(&service);
-       debug_log("service_create: %d", ret);
-       if (!service) {
-               debug_log("service create failed");
-               return;
-       }
-
-       if (ug_data->create_contact_arg == CONTACTUI_REQ_ADD_PHONE_NUMBER) {
-               snprintf(tmp, sizeof(tmp), "%d", CT_UG_REQUEST_ADD_WITH_NUM);
-               ret = service_add_extra_data(service, CT_UG_BUNDLE_TYPE, tmp);
-               debug_log("service_add_extra_data: %d", ret);
-               ret = service_add_extra_data(service, CT_UG_BUNDLE_NUM, (char *)data);
-               debug_log("service_add_extra_data: %d", ret);
-       }
-       if (ug_data->create_contact_arg == CONTACTUI_REQ_ADD_EMAIL) {
-               snprintf(tmp, sizeof(tmp), "%d", CT_UG_REQUEST_ADD_WITH_EMAIL);
-               ret = service_add_extra_data(service, CT_UG_BUNDLE_TYPE, tmp);
-               debug_log("service_add_extra_data: %d", ret);
-               ret = service_add_extra_data(service, CT_UG_BUNDLE_EMAIL, (char *)data);
-               debug_log("service_add_extra_data: %d", ret);
-       }
-       if (ug_data->create_contact_arg == CONTACTUI_REQ_ADD_URL) {
-               snprintf(tmp, sizeof(tmp), "%d", CT_UG_REQUEST_ADD_WITH_WEB);
-               ret = service_add_extra_data(service, CT_UG_BUNDLE_TYPE, tmp);
-               debug_log("service_add_extra_data: %d", ret);
-               ret = service_add_extra_data(service, CT_UG_BUNDLE_WEB, (char *)data);
-               debug_log("service_add_extra_data: %d", ret);
-       }
-
-       ug_data->ug_contacts_search = create_ug(UG_CONTACTS_LIST, service, ug_data);
-
-       ret = service_destroy(service);
-       debug_log("service_destroy: %d", ret);
-}
-
-static void _ctxpopup_select_contact_mode_email_cb(void *data, Evas_Object *obj, void *event_info)
-{
-       debug_log("");
-       if (!data || !_g_ug_data) {
-               debug_log("data is NULL");
-               return;
-       }
-
-       EmailViewerUGD *ug_data = _g_ug_data;
-       Evas_Coord x, y;
-
-       if (ug_data->con_popup) {
-               evas_object_del(ug_data->con_popup);
-               ug_data->con_popup = NULL;
-       }
-
-       ug_data->con_popup = elm_ctxpopup_add(ug_data->navi_bar);
-       if (ug_data->con_popup == NULL) {
-               debug_log("cannot create context popup");
-               return;
-       }
-
-       ug_data->create_contact_arg = CONTACTUI_REQ_ADD_EMAIL;
-       ug_data->update_contact_type = CONTACTUI_REQ_ADD_EMAIL;
-
-       elm_ctxpopup_item_append(ug_data->con_popup, dgettext("sys_string", "IDS_COM_OPT_CREATE_CONTACT"), NULL, _ctxpopup_add_contact_cb, data);
-       elm_ctxpopup_item_append(ug_data->con_popup, _("IDS_EMAIL_OPT_UPDATE_EXISTING"), NULL, _ctxpopup_cutlink_update_contact_cb, data);
-
-       evas_pointer_canvas_xy_get(ug_data->evas, &x, &y);
-       evas_object_move(ug_data->con_popup, x, y);
-       evas_object_show(ug_data->con_popup);
-}
-
 static void _ctxpopup_add_block_rule_cb(void *data, Evas_Object *obj, void *event_info)
 {
        debug_log("");
@@ -4405,7 +4245,7 @@ static void _mbe_selected_cb(void *data, Evas_Object *obj, void *event_info)
                ug_data->ctx_block_item = elm_ctxpopup_item_append(ug_data->con_popup, _("IDS_EMAIL_OPT_BLOCK"), NULL, _ctxpopup_add_block_rule_cb, addrs_info->address);
                _delete_contacts_list(contact_list_item);
        } else {
-               elm_ctxpopup_item_append(ug_data->con_popup, dgettext("sys_string", "IDS_COM_OPT_ADD_TO_CONTACTS"), NULL, _ctxpopup_select_contact_mode_email_cb, addrs_info->address);
+               elm_ctxpopup_item_append(ug_data->con_popup, dgettext("sys_string", "IDS_COM_OPT_ADD_TO_CONTACTS"), NULL, _ctxpopup_add_contact_cb, addrs_info->address);
                elm_ctxpopup_item_append(ug_data->con_popup, _("IDS_EMAIL_OPT_SEND_EMAIL"), NULL, _ctxpopup_send_email_cb, addrs_info->address);
                ug_data->ctx_block_item = elm_ctxpopup_item_append(ug_data->con_popup, _("IDS_EMAIL_OPT_BLOCK"), NULL, _ctxpopup_add_block_rule_cb, addrs_info->address);
        }