From: Kim Jinho Date: Thu, 10 Jan 2013 06:10:50 +0000 (+0900) Subject: Merge with latest code(Mailbox/Account/Setting) X-Git-Tag: 2.1b_release~3^2~58 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=88fbc44dd06c7dc19c9660861afbbdc829cb5415;p=apps%2Fcore%2Fpreloaded%2Femail.git Merge with latest code(Mailbox/Account/Setting) --- diff --git a/account/CMakeLists.txt b/account/CMakeLists.txt index 7466f16..54d2ea8 100755 --- a/account/CMakeLists.txt +++ b/account/CMakeLists.txt @@ -55,7 +55,7 @@ ADD_CUSTOM_TARGET(email-effect-layout.edj ) ADD_DEPENDENCIES(${PROJECT_NAME} email-effect-layout.edj) -INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${UGDIR}) +INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIBDIR}) INSTALL(FILES ${CMAKE_ACCOUNT_BINARY_DIR}/email-account-theme.edj DESTINATION ${EDJDIR}) INSTALL(FILES ${CMAKE_ACCOUNT_BINARY_DIR}/email-effect-layout.edj DESTINATION ${EDJDIR}) diff --git a/account/include/email-account.h b/account/include/email-account.h index 6a655c4..e87a430 100755 --- a/account/include/email-account.h +++ b/account/include/email-account.h @@ -57,7 +57,7 @@ #define CONTROLBAR_ICON_DELETE IMGDIR"/M02_controlbar_icon_delete.png" #define ACCOUNT_ICON_ADDACCOUNT IMGDIR"/M02_email_list_icon_addaccount.png" -#define ACCOUNT_ICON_ALLACCOUNT IMGDIR"/M02_email_list_icon_allaccount.png" +#define ACCOUNT_ICON_ALLACCOUNT IMGDIR"/M02_list_icon_all_accounts.png" #define _EDJ(o) elm_layout_edje_get(o) diff --git a/account/src/email-account-folder.c b/account/src/email-account-folder.c index d44b488..cebe64b 100755 --- a/account/src/email-account-folder.c +++ b/account/src/email-account-folder.c @@ -44,6 +44,7 @@ static void _refresh_account_list(void *data); static gboolean _check_duplicated_node(GNode *node, gpointer data); static void _make_folder_tree(email_account_list *alist, EmailAccountUGD *ug_data); +static gboolean _folder_item_dim_state_get(email_mailbox_t *mlist, int folder_mode); static void _update_all_account_cb(void *data, Evas_Object *obj, void *event_info); static Eina_Bool _gl_state_get(void *data, Evas_Object *obj, const char *part); @@ -137,7 +138,7 @@ static struct _menu_item folder_menu_its[] = { { "IDS_EMAIL_BODY_INBOX", ACC_MAILBOX_TYPE_INBOX, _gl_label_get_for_all_acc_inbox }, { "IDS_EMAIL_BODY_FAVOURITES", ACC_MAILBOX_TYPE_FLAGGED, _gl_label_get_for_all_acc_favorite }, { "IDS_EMAIL_BODY_DRAFTS", ACC_MAILBOX_TYPE_DRAFT, _gl_label_get_for_all_acc_draft }, - { N_("Outbox"), ACC_MAILBOX_TYPE_OUTBOX, _gl_label_get_for_all_acc_outbox }, + { "IDS_EMAIL_HEADER_OUTBOX", ACC_MAILBOX_TYPE_OUTBOX, _gl_label_get_for_all_acc_outbox }, { "IDS_EMAIL_BODY_SENTBOX", ACC_MAILBOX_TYPE_SENTBOX, _gl_label_get_for_all_acc_sentbox }, { "IDS_EMAIL_BODY_SPAMBOX", ACC_MAILBOX_TYPE_SPAMBOX, _gl_label_get_for_all_acc_spambox }, { "IDS_EMAIL_BODY_TRASH", ACC_MAILBOX_TYPE_TRASH, _gl_label_get_for_all_acc_trash }, @@ -385,13 +386,22 @@ static void _more_toolbar_clicked_cb(void *data, Evas_Object *obj, void *event_i { debug_log(""); EmailAccountUGD *ug_data = (EmailAccountUGD *)data; + Evas_Object* icon; ug_data->ctxpopup = elm_ctxpopup_add(ug_data->navi_bar); evas_object_smart_callback_add(ug_data->ctxpopup, "dismissed", _dismissed_cb, ug_data); - elm_ctxpopup_item_append(ug_data->ctxpopup, dgettext("sys_string", "IDS_COM_SK_DELETE"), NULL, _folder_delete_cb, ug_data); - elm_ctxpopup_item_append(ug_data->ctxpopup, _("IDS_EMAIL_SK_MOVE"), NULL, _folder_move_cb, ug_data); - elm_ctxpopup_item_append(ug_data->ctxpopup, dgettext("sys_string", "IDS_COM_SK_RENAME"), NULL, _folder_rename_cb, ug_data); + icon = elm_icon_add(ug_data->ctxpopup); + elm_image_file_set(icon, IMGDIR "/M02_popup_icon_delete_all.png", NULL); + elm_ctxpopup_item_append(ug_data->ctxpopup, dgettext("sys_string", "IDS_COM_SK_DELETE"), icon, _folder_delete_cb, ug_data); + + icon = elm_icon_add(ug_data->ctxpopup); + elm_image_file_set(icon, IMGDIR "/M02_popup_icon_move.png", NULL); + elm_ctxpopup_item_append(ug_data->ctxpopup, _("IDS_EMAIL_SK_MOVE"), icon, _folder_move_cb, ug_data); + + icon = elm_icon_add(ug_data->ctxpopup); + elm_image_file_set(icon, IMGDIR "/M02_popup_icon_rename.png", NULL); + elm_ctxpopup_item_append(ug_data->ctxpopup, dgettext("sys_string", "IDS_COM_SK_RENAME"), icon, _folder_rename_cb, ug_data); _move_ctxpopup(ug_data->ctxpopup, obj); evas_object_show(ug_data->ctxpopup); @@ -1156,6 +1166,10 @@ static void _gl_exp(void *data, Evas_Object *obj, void *event_info) tree_item_data->child = child; sub_it = tree_item_data->it = elm_genlist_item_append(gl, &itc_subtree, tree_item_data, it, ELM_GENLIST_ITEM_TREE, _gl_exp_sel, alist); + + if(_folder_item_dim_state_get((email_mailbox_t *)(child->data), tree_item_data->ug_data->folder_mode)) { + elm_object_item_disabled_set(tree_item_data->it, EINA_TRUE); + } //debug_log("alist: %p, tree_item_data:%p, tree_item_data->it : %p, it: %p, child: %p", alist, tree_item_data, tree_item_data->it, it, child); } else { tree_item_data = calloc(1, sizeof(Item_Data)); @@ -1164,6 +1178,9 @@ static void _gl_exp(void *data, Evas_Object *obj, void *event_info) tree_item_data->child = child; tree_item_data->it = elm_genlist_item_append(gl, &itc_subtree2, tree_item_data, it, ELM_GENLIST_ITEM_NONE, _gl_sel, alist); + if(_folder_item_dim_state_get((email_mailbox_t *)(child->data), tree_item_data->ug_data->folder_mode)) { + elm_object_item_disabled_set(tree_item_data->it, EINA_TRUE); + } //debug_log("alist: %p, tree_item_data:%p, tree_item_data->it : %p, it: %p, child: %p", alist, tree_item_data, tree_item_data->it, it, child); } } @@ -1201,6 +1218,9 @@ static void _gl_exp(void *data, Evas_Object *obj, void *event_info) tree_item_data->child = child; sub_it = tree_item_data->it = elm_genlist_item_append(gl, &itc_subtree, tree_item_data, it, ELM_GENLIST_ITEM_TREE, _gl_exp_sel, alist); + if(_folder_item_dim_state_get((email_mailbox_t *)(child->data), tree_item_data->ug_data->folder_mode)) { + elm_object_item_disabled_set(tree_item_data->it, EINA_TRUE); + } //debug_log("alist: %p, tree_item_data:%p, tree_item_data->it : %p, it: %p, child: %p", alist, tree_item_data, tree_item_data->it, it, child); } else { tree_item_data = calloc(1, sizeof(Item_Data)); @@ -1209,6 +1229,9 @@ static void _gl_exp(void *data, Evas_Object *obj, void *event_info) tree_item_data->child = child; tree_item_data->it = elm_genlist_item_append(gl, &itc_subtree2, tree_item_data, it, ELM_GENLIST_ITEM_NONE, _gl_sel, alist); + if(_folder_item_dim_state_get((email_mailbox_t *)(child->data), tree_item_data->ug_data->folder_mode)) { + elm_object_item_disabled_set(tree_item_data->it, EINA_TRUE); + } //debug_log("alist: %p, tree_item_data:%p, tree_item_data->it : %p, it: %p, child: %p", alist, tree_item_data, tree_item_data->it, it, child); } } @@ -1332,7 +1355,7 @@ static void _gl_sel(void *data, Evas_Object *obj, void *event_info) service_add_extra_data(service, EMAIL_BUNDLE_KEY_ACCOUNT_TYPE, EMAIL_BUNDLE_VAL_SINGLE_ACCOUNT); service_add_extra_data(service, EMAIL_BUNDLE_KEY_ACCOUNT_ID, id); service_add_extra_data(service, EMAIL_BUNDLE_KEY_MAILBOX, mailbox_id); - service_add_extra_data(service, EMAIL_BUNDLE_KEY_USER_EMAIL, alist->account_info->user_email_address); + service_add_extra_data(service, EMAIL_BUNDLE_KEY_ACCOUNT_NAME, alist->account_info->account_name); service_add_extra_data(service, EMAIL_BUNDLE_KEY_MAILBOX_ALIAS, mlist->alias); ug_send_result(alist->ug_data->ug, service); @@ -1478,7 +1501,7 @@ static void _gl_exp_sel(void *data, Evas_Object *obj, void *event_info) service_add_extra_data(service, EMAIL_BUNDLE_KEY_ACCOUNT_TYPE, EMAIL_BUNDLE_VAL_SINGLE_ACCOUNT); service_add_extra_data(service, EMAIL_BUNDLE_KEY_ACCOUNT_ID, id); service_add_extra_data(service, EMAIL_BUNDLE_KEY_MAILBOX, mailbox_id); - service_add_extra_data(service, EMAIL_BUNDLE_KEY_USER_EMAIL, alist->account_info->user_email_address); + service_add_extra_data(service, EMAIL_BUNDLE_KEY_ACCOUNT_NAME, alist->account_info->account_name); service_add_extra_data(service, EMAIL_BUNDLE_KEY_MAILBOX_ALIAS, mlist->alias); ug_send_result(alist->ug_data->ug, service); @@ -1717,7 +1740,7 @@ static char *_gl_label_get_for_all_acc_outbox(void *data, Evas_Object *obj, cons char tmp[MAX_STR_LEN] = { 0, }; if (!strcmp(part, "elm.text.1")) { - snprintf(tmp, sizeof(tmp), "%s", N_("Outbox")); + snprintf(tmp, sizeof(tmp), "%s", _("IDS_EMAIL_HEADER_OUTBOX")); return g_strdup(tmp); } else if (!strcmp(part, "elm.text.2")) { snprintf(tmp, sizeof(tmp), "[%d/%d]", ug_data->all_acc_unread_count[ACC_MAILBOX_TYPE_OUTBOX], ug_data->all_acc_read_count[ACC_MAILBOX_TYPE_OUTBOX]); @@ -1966,15 +1989,14 @@ static void _folder_edit_cb(void *data, Evas_Object *obj, void *event_info) elm_object_item_part_content_unset(ug_data->navibar_item, "controlbar"); evas_object_hide(ug_data->control_bar); - /* Set reorder and edit mode */ - elm_genlist_reorder_mode_set(genlist, EINA_TRUE); + /* Set edit mode */ elm_genlist_decorate_mode_set(genlist, EINA_TRUE); /* This means even if selected, every click will make the selected callbacks be called. */ elm_genlist_select_mode_set(genlist, ELM_OBJECT_SELECT_MODE_ALWAYS); elm_object_item_disabled_set(ug_data->root_item, EINA_TRUE); - elm_object_part_text_set(ug_data->navi_title_ly, "txt_title", N_("Select folder to edit")); + elm_object_part_text_set(ug_data->navi_title_ly, "txt_title", _("IDS_EMAIL_HEADER_SELECT_FOLDER")); elm_genlist_tree_effect_enabled_set(ug_data->gl, EINA_FALSE); @@ -1995,7 +2017,6 @@ static void _folder_edit_cb(void *data, Evas_Object *obj, void *event_info) /* Unset edit mode */ elm_genlist_decorate_mode_set(genlist, EINA_FALSE); - elm_genlist_reorder_mode_set(genlist, EINA_FALSE); elm_genlist_select_mode_set(genlist, ELM_OBJECT_SELECT_MODE_DEFAULT); elm_object_item_disabled_set(ug_data->root_item, EINA_FALSE); @@ -2090,9 +2111,8 @@ static void _folder_create_cb(void *data, Evas_Object *obj, void *event_info) { debug_log(""); EmailAccountUGD *ug_data = (EmailAccountUGD *)data; - Evas_Object *genlist = ug_data->gl; - if (!elm_genlist_decorate_mode_get(genlist)) { + if (!elm_genlist_decorate_mode_get(ug_data->gl)) { ug_data->folder_mode = ACC_FOLDER_CREATE; if(ug_data->emf_handle != EMAIL_HANDLE_INVALID && ug_data->b_foldersync) { @@ -2100,34 +2120,33 @@ static void _folder_create_cb(void *data, Evas_Object *obj, void *event_info) ug_data->no_refresh = true; } + _refresh_folder_view(data); edje_object_signal_emit(_EDJ(ug_data->ly), "elm,bg,show,edit_mode", "elm"); _unset_controlbar_content(ug_data); - /* Set reorder and edit mode */ - elm_genlist_reorder_mode_set(genlist, EINA_TRUE); - elm_genlist_decorate_mode_set(genlist, EINA_TRUE); + /* Set edit mode */ + elm_genlist_decorate_mode_set(ug_data->gl, EINA_TRUE); /* This means even if selected, every click will make the selected callbacks be called. */ - elm_genlist_select_mode_set(genlist, ELM_OBJECT_SELECT_MODE_ALWAYS); + elm_genlist_select_mode_set(ug_data->gl, ELM_OBJECT_SELECT_MODE_ALWAYS); elm_genlist_item_select_mode_set(ug_data->root_item, ELM_OBJECT_SELECT_MODE_ALWAYS); - //elm_object_part_text_set(ug_data->navi_title_ly, "txt_title", _("IDS_EMAIL_HEADER_SELECT_FOLDER_ABB")); - elm_object_item_text_set(ug_data->navibar_item, _("IDS_EMAIL_HEADER_SELECT_FOLDER_ABB")); + elm_object_item_text_set(ug_data->navibar_item, _("IDS_EMAIL_HEADER_CREATE_FOLDER_IN")); elm_genlist_tree_effect_enabled_set(ug_data->gl, EINA_FALSE); } else { ug_data->folder_mode = ACC_FOLDER_NONE; + _refresh_folder_view(data); /* Change layout background color to default background color */ edje_object_signal_emit(_EDJ(ug_data->ly), "elm,bg,show,default", "elm"); /* Unset edit mode */ - elm_genlist_decorate_mode_set(genlist, EINA_FALSE); - elm_genlist_reorder_mode_set(genlist, EINA_FALSE); + elm_genlist_decorate_mode_set(ug_data->gl, EINA_FALSE); - elm_genlist_select_mode_set(genlist, ELM_OBJECT_SELECT_MODE_DEFAULT); + elm_genlist_select_mode_set(ug_data->gl, ELM_OBJECT_SELECT_MODE_DEFAULT); elm_genlist_item_select_mode_set(ug_data->root_item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY); /* Set the navigation bar title */ @@ -2145,7 +2164,6 @@ static void _folder_delete_cb(void *data, Evas_Object *obj, void *event_info) debug_log(""); EmailAccountUGD *ug_data = (EmailAccountUGD *)data; //int account_id = ug_data->account_id; - Evas_Object *genlist = ug_data->gl; if (ug_data->ctxpopup) { evas_object_del(ug_data->ctxpopup); @@ -2153,41 +2171,39 @@ static void _folder_delete_cb(void *data, Evas_Object *obj, void *event_info) } - if (!elm_genlist_decorate_mode_get(genlist)) { + if (!elm_genlist_decorate_mode_get(ug_data->gl)) { ug_data->folder_mode = ACC_FOLDER_DELETE; if(ug_data->emf_handle != EMAIL_HANDLE_INVALID && ug_data->b_foldersync) { _stop_emf_job(ug_data, ug_data->emf_handle); ug_data->no_refresh = true; } - + _refresh_folder_view(data); edje_object_signal_emit(_EDJ(ug_data->ly), "elm,bg,show,edit_mode", "elm"); _unset_controlbar_content(ug_data); - /* Set reorder and edit mode */ - elm_genlist_reorder_mode_set(genlist, EINA_TRUE); - elm_genlist_decorate_mode_set(genlist, EINA_TRUE); + /* Set edit mode */ + elm_genlist_decorate_mode_set(ug_data->gl, EINA_TRUE); /* This means even if selected, every click will make the selected callbacks be called. */ - elm_genlist_select_mode_set(genlist, ELM_OBJECT_SELECT_MODE_ALWAYS); + elm_genlist_select_mode_set(ug_data->gl, ELM_OBJECT_SELECT_MODE_ALWAYS); elm_object_item_disabled_set(ug_data->root_item, EINA_TRUE); - //elm_object_part_text_set(ug_data->navi_title_ly, "txt_title", N_("Select delete folder")); - elm_object_item_text_set(ug_data->navibar_item, N_("Select delete folder")); + elm_object_item_text_set(ug_data->navibar_item, _("IDS_EMAIL_HEADER_SELECT_FOLDER")); elm_genlist_tree_effect_enabled_set(ug_data->gl, EINA_FALSE); } else { ug_data->folder_mode = ACC_FOLDER_NONE; + _refresh_folder_view(data); /* Change layout background color to default background color */ edje_object_signal_emit(_EDJ(ug_data->ly), "elm,bg,show,default", "elm"); /* Unset edit mode */ - elm_genlist_decorate_mode_set(genlist, EINA_FALSE); - elm_genlist_reorder_mode_set(genlist, EINA_FALSE); + elm_genlist_decorate_mode_set(ug_data->gl, EINA_FALSE); - elm_genlist_select_mode_set(genlist, ELM_OBJECT_SELECT_MODE_DEFAULT); + elm_genlist_select_mode_set(ug_data->gl, ELM_OBJECT_SELECT_MODE_DEFAULT); elm_object_item_disabled_set(ug_data->root_item, EINA_FALSE); /* Set the navigation bar title */ @@ -2206,14 +2222,13 @@ static void _folder_move_cb(void *data, Evas_Object *obj, void *event_info) debug_log(""); EmailAccountUGD *ug_data = (EmailAccountUGD *)data; //int account_id = ug_data->account_id; - Evas_Object *genlist = ug_data->gl; if (ug_data->ctxpopup) { evas_object_del(ug_data->ctxpopup); ug_data->ctxpopup = NULL; } - if (!elm_genlist_decorate_mode_get(genlist)) { + if (!elm_genlist_decorate_mode_get(ug_data->gl)) { ug_data->folder_mode = ACC_FOLDER_MOVE_FROM; if(ug_data->emf_handle != EMAIL_HANDLE_INVALID && ug_data->b_foldersync) { @@ -2225,16 +2240,14 @@ static void _folder_move_cb(void *data, Evas_Object *obj, void *event_info) _unset_controlbar_content(ug_data); - /* Set reorder and edit mode */ - elm_genlist_reorder_mode_set(genlist, EINA_TRUE); - elm_genlist_decorate_mode_set(genlist, EINA_TRUE); + /* Set edit mode */ + elm_genlist_decorate_mode_set(ug_data->gl, EINA_TRUE); /* This means even if selected, every click will make the selected callbacks be called. */ - elm_genlist_select_mode_set(genlist, ELM_OBJECT_SELECT_MODE_ALWAYS); + elm_genlist_select_mode_set(ug_data->gl, ELM_OBJECT_SELECT_MODE_ALWAYS); elm_object_item_disabled_set(ug_data->root_item, EINA_TRUE); - //elm_object_part_text_set(ug_data->navi_title_ly, "txt_title", N_("Select move folder")); - elm_object_item_text_set(ug_data->navibar_item, N_("Select move folder")); + elm_object_item_text_set(ug_data->navibar_item, _("IDS_EMAIL_HEADER_SELECT_FOLDER")); elm_genlist_tree_effect_enabled_set(ug_data->gl, EINA_FALSE); } @@ -2265,8 +2278,7 @@ static void _folder_move_cb(void *data, Evas_Object *obj, void *event_info) elm_object_item_disabled_set(ug_data->root_item, EINA_FALSE); elm_genlist_item_select_mode_set(ug_data->root_item, ELM_OBJECT_SELECT_MODE_ALWAYS); - //elm_object_part_text_set(ug_data->navi_title_ly, "txt_title", N_("Select location folder")); - elm_object_item_text_set(ug_data->navibar_item, N_("Select location folder")); + elm_object_item_text_set(ug_data->navibar_item, _("IDS_EMAIL_HEADER_MOVE_TO")); } } else @@ -2277,10 +2289,9 @@ static void _folder_move_cb(void *data, Evas_Object *obj, void *event_info) edje_object_signal_emit(_EDJ(ug_data->ly), "elm,bg,show,default", "elm"); /* Unset edit mode */ - elm_genlist_decorate_mode_set(genlist, EINA_FALSE); - elm_genlist_reorder_mode_set(genlist, EINA_FALSE); + elm_genlist_decorate_mode_set(ug_data->gl, EINA_FALSE); - elm_genlist_select_mode_set(genlist, ELM_OBJECT_SELECT_MODE_DEFAULT); + elm_genlist_select_mode_set(ug_data->gl, ELM_OBJECT_SELECT_MODE_DEFAULT); elm_object_item_disabled_set(ug_data->root_item, EINA_FALSE); elm_genlist_item_select_mode_set(ug_data->root_item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY); @@ -2304,14 +2315,13 @@ static void _folder_rename_cb(void *data, Evas_Object *obj, void *event_info) debug_log(""); EmailAccountUGD *ug_data = (EmailAccountUGD *)data; //int account_id = ug_data->account_id; - Evas_Object *genlist = ug_data->gl; if (ug_data->ctxpopup) { evas_object_del(ug_data->ctxpopup); ug_data->ctxpopup = NULL; } - if (!elm_genlist_decorate_mode_get(genlist)) { + if (!elm_genlist_decorate_mode_get(ug_data->gl)) { debug_log(""); ug_data->folder_mode = ACC_FOLDER_RENAME; @@ -2322,18 +2332,17 @@ static void _folder_rename_cb(void *data, Evas_Object *obj, void *event_info) _stop_emf_job(ug_data, ug_data->emf_handle); ug_data->no_refresh = true; } - + _refresh_folder_view(data); edje_object_signal_emit(_EDJ(ug_data->ly), "elm,bg,show,edit_mode", "elm"); - /* Set reorder and edit mode */ - elm_genlist_reorder_mode_set(genlist, EINA_TRUE); - elm_genlist_decorate_mode_set(genlist, EINA_TRUE); + + /* Set edit mode */ + elm_genlist_decorate_mode_set(ug_data->gl, EINA_TRUE); /* This means even if selected, every click will make the selected callbacks be called. */ - elm_genlist_select_mode_set(genlist, ELM_OBJECT_SELECT_MODE_ALWAYS); + elm_genlist_select_mode_set(ug_data->gl, ELM_OBJECT_SELECT_MODE_ALWAYS); elm_object_item_disabled_set(ug_data->root_item, EINA_TRUE); - //elm_object_part_text_set(ug_data->navi_title_ly, "txt_title", N_("Select rename folder")); - elm_object_item_text_set(ug_data->navibar_item, _("IDS_EMAIL_HEADER_SELECT_FOLDER_ABB")); + elm_object_item_text_set(ug_data->navibar_item, _("IDS_EMAIL_HEADER_SELECT_FOLDER")); elm_genlist_tree_effect_enabled_set(ug_data->gl, EINA_FALSE); @@ -2344,14 +2353,18 @@ static void _folder_rename_cb(void *data, Evas_Object *obj, void *event_info) debug_log(""); ug_data->folder_mode = ACC_FOLDER_NONE; - + _refresh_folder_view(data); /* Change layout background color to default background color */ edje_object_signal_emit(_EDJ(ug_data->ly), "elm,bg,show,default", "elm"); +/* + elm_object_item_part_content_unset(ug_data->navibar_item, "controlbar"); + elm_object_item_part_content_set(ug_data->navibar_item, "controlbar", ug_data->control_bar); + evas_object_show(ug_data->control_bar); +*/ /* Unset edit mode */ - elm_genlist_decorate_mode_set(genlist, EINA_FALSE); - elm_genlist_reorder_mode_set(genlist, EINA_FALSE); + elm_genlist_decorate_mode_set(ug_data->gl, EINA_FALSE); - elm_genlist_select_mode_set(genlist, ELM_OBJECT_SELECT_MODE_DEFAULT); + elm_genlist_select_mode_set(ug_data->gl, ELM_OBJECT_SELECT_MODE_DEFAULT); elm_object_item_disabled_set(ug_data->root_item, EINA_FALSE); /* Set the navigation bar title */ @@ -2751,7 +2764,6 @@ static void _popup_rename_cb(void *data, Evas_Object *obj, void *event_info) evas_object_smart_callback_add(entry, "unfocused", _entry_unfocused_cb, layout); elm_object_part_content_set(layout, "elm.swallow.content", entry); - elm_object_part_text_set(layout, "elm.guidetext", _("IDS_EMAIL_POP_FOLDER_NAME")); // Set guidetext. elm_object_signal_callback_add(layout, "elm,eraser,clicked", "elm", _eraser_clicked_cb, entry); evas_object_show(entry); elm_object_part_content_set(layout, "elm.swallow.content", entry); @@ -2924,7 +2936,7 @@ static void _popup_movefolder_cb(void *data, Evas_Object *obj, void *event_info) } } } - snprintf(arg1, sizeof(arg1), "Move folder [%s] to [%s]", from_string, to_string); + snprintf(arg1, sizeof(arg1), _("IDS_EMAIL_POP_MOVE_P1SS_TO_P2SS_Q"), from_string, to_string); char *popup_text = elm_entry_utf8_to_markup(arg1); @@ -3043,7 +3055,7 @@ static void _popup_success_cb(void *data, Evas_Object *obj, void *event_info) switch(ug_data->folder_mode) { case ACC_FOLDER_CREATE: - elm_object_text_set(popup, N_("Created")); + elm_object_text_set(popup, _("IDS_EMAIL_POP_CREATED")); break; case ACC_FOLDER_DELETE: elm_object_text_set(popup, dgettext("sys_string", "IDS_COM_POP_DELETED")); @@ -3065,7 +3077,7 @@ static void _popup_success_cb(void *data, Evas_Object *obj, void *event_info) switch(ug_data->folder_mode) { case ACC_FOLDER_CREATE: - ret = status_message_post(N_("Created")); + ret = status_message_post(_("IDS_EMAIL_POP_CREATED")); break; case ACC_FOLDER_DELETE: ret = status_message_post(dgettext("sys_string", "IDS_COM_POP_DELETED")); @@ -3122,10 +3134,10 @@ static void _popup_fail_cb(void *data, Evas_Object *obj, void *event_info) elm_object_text_set(popup, _("IDS_EMAIL_POP_UNABLE_TO_CREATE_FOLDER")); break; case ACC_FOLDER_DELETE: - elm_object_text_set(popup, N_("Unable to delete folder")); + elm_object_text_set(popup, _("IDS_EMAIL_POP_UNABLE_TO_DELETE_FOLDER")); break; case ACC_FOLDER_MOVE_TO: - elm_object_text_set(popup, N_("Unable to move folder")); + elm_object_text_set(popup, _("IDS_EMAIL_POP_UNABLE_TO_MOVE_FOLDER")); break; default: elm_object_text_set(popup, dgettext("sys_string", "IDS_COM_POP_WARNING")); @@ -3145,13 +3157,13 @@ static void _popup_fail_cb(void *data, Evas_Object *obj, void *event_info) ret = status_message_post(_("IDS_EMAIL_POP_UNABLE_TO_CREATE_FOLDER")); break; case ACC_FOLDER_DELETE: - ret = status_message_post(N_("Unable to delete folder")); + ret = status_message_post(_("IDS_EMAIL_POP_UNABLE_TO_DELETE_FOLDER")); break; case ACC_FOLDER_MOVE_TO: - ret = status_message_post(N_("Unable to move folder")); + ret = status_message_post(_("IDS_EMAIL_POP_UNABLE_TO_MOVE_FOLDER")); break; case ACC_FOLDER_RENAME: - ret = status_message_post(N_("Unable to rename folder")); + ret = status_message_post(_("IDS_EMAIL_POP_UNABLE_TO_RENAME_FOLDER")); break; default: debug_log("Warning..."); @@ -3189,16 +3201,16 @@ static void _popup_progress_cb(void *data, Evas_Object *obj, void *event_info) switch(ug_data->folder_mode) { case ACC_FOLDER_CREATE: - elm_object_part_text_set(popup, "title,text", N_("Creating folder...")); + elm_object_part_text_set(popup, "title,text", _("IDS_EMAIL_POP_CREATING_FOLDER_ING")); break; case ACC_FOLDER_DELETE: - elm_object_part_text_set(popup, "title,text", N_("Deleting folder...")); + elm_object_part_text_set(popup, "title,text", _("IDS_EMAIL_POP_DELETING_ING")); break; case ACC_FOLDER_MOVE_TO: - elm_object_part_text_set(popup, "title,text", N_("Moving folder...")); + elm_object_part_text_set(popup, "title,text", _("IDS_EMAIL_POP_MOVING_ING")); break; case ACC_FOLDER_RENAME: - elm_object_part_text_set(popup, "title,text", N_("Renaming folder...")); + elm_object_part_text_set(popup, "title,text", _("IDS_EMAIL_POP_RENAMING_ING")); break; default: elm_object_part_text_set(popup, "title,text", dgettext("sys_string", "IDS_COM_POP_WARNING")); @@ -3301,18 +3313,17 @@ void refresh_account_ug(EmailAccountUGD *ug_data) elm_object_item_text_set(ug_data->navibar_item, _("IDS_EMAIL_HEADER_FOLDERS")); break; case ACC_FOLDER_CREATE: - case ACC_FOLDER_RENAME: - elm_object_item_text_set(ug_data->navibar_item, _("IDS_EMAIL_HEADER_SELECT_FOLDER_ABB")); + elm_object_item_text_set(ug_data->navibar_item, _("IDS_EMAIL_HEADER_CREATE_FOLDER_IN")); break; + case ACC_FOLDER_RENAME: case ACC_FOLDER_DELETE: - elm_object_item_text_set(ug_data->navibar_item, N_("Select delete folder")); + case ACC_FOLDER_MOVE_FROM: + elm_object_item_text_set(ug_data->navibar_item, _("IDS_EMAIL_HEADER_SELECT_FOLDER")); break; case ACC_FOLDER_MOVE_TO: - elm_object_item_text_set(ug_data->navibar_item, N_("Select location folder")); - break; - case ACC_FOLDER_MOVE_FROM: - elm_object_item_text_set(ug_data->navibar_item, N_("Select move folder")); + elm_object_item_text_set(ug_data->navibar_item, _("IDS_EMAIL_HEADER_MOVE_TO")); break; + default: break; } @@ -3579,6 +3590,29 @@ static void _edbus_event_account_receive(void *local_data, DBusMessage *message) debug_log("NOTI_RENAME_MAILBOX_CANCEL"); break; + case NOTI_SYNC_IMAP_MAILBOX_LIST_FINISH : + case NOTI_SYNC_IMAP_MAILBOX_LIST_FAIL : + case NOTI_SYNC_IMAP_MAILBOX_LIST_CANCEL : + debug_log("email imap mailbox list sync is finished"); + if(ug_data->b_foldersync == true) { + ug_data->b_foldersync = false; + debug_log("ug_data->emf_handle : %d", ug_data->emf_handle); + ug_data->emf_handle = EMAIL_HANDLE_INVALID; + Evas_Object * sync_button = elm_object_item_part_content_get(ug_data->navibar_item, "title_right_btn"); + if (sync_button == ug_data->sync_progress) + { + debug_log("remove sync progress"); + elm_object_item_part_content_unset(ug_data->navibar_item, "title_right_btn"); + evas_object_hide(ug_data->sync_progress); + elm_object_item_part_content_set(ug_data->navibar_item, "title_right_btn", ug_data->update_button); + evas_object_show(ug_data->update_button); + if(!ug_data->no_refresh) { + _refresh_folder_view(ug_data); + } + } + } + break; + default: debug_warning("unknown type"); break; @@ -3664,6 +3698,37 @@ static void _eraser_clicked_cb(void *data, Evas_Object *obj, const char *emissio elm_entry_entry_set(data, ""); } +static gboolean _folder_item_dim_state_get(email_mailbox_t *mlist, int folder_mode) +{ + debug_log(""); + if(mlist) { + switch (folder_mode) { + case ACC_FOLDER_NONE: + case ACC_FOLDER_MOVE_FROM: + if (!g_strcmp0(mlist->alias, "[Gmail]") || mlist->no_select) { + return TRUE; + } + break; + case ACC_FOLDER_CREATE: + if (mlist->mailbox_type == EMAIL_MAILBOX_TYPE_OUTBOX) { + return TRUE; + } + break; + case ACC_FOLDER_RENAME: + case ACC_FOLDER_DELETE: + if (mlist->no_select || mlist->mailbox_type != EMAIL_MAILBOX_TYPE_USER_DEFINED) { + return TRUE; + } + break; + + default: + break; + } + } + + return FALSE; +} + // Codes for removing elm_editfield : START /* static void _changed_cb(void *data, Evas_Object *obj, void *event_info) // This callback is for showing(hiding) X marked button. diff --git a/account/src/email-account.c b/account/src/email-account.c index fe49638..d0dbd35 100755 --- a/account/src/email-account.c +++ b/account/src/email-account.c @@ -38,6 +38,8 @@ static void on_message(ui_gadget_h ug, service_h msg, service_h service, void *p static void on_event(ui_gadget_h ug, enum ug_event event, service_h service, void *priv); static void on_key_event(ui_gadget_h ug, enum ug_key_event event, service_h service, void *priv); +static void _win_profile_changed_cb(void *data, Evas_Object *obj, void *event); + /* view logic */ static Evas_Object *create_frameview(EmailAccountUGD *ugd); @@ -51,8 +53,6 @@ static void _gl_del(void *data, Evas_Object *obj); static char *_gl_label_get_for_4text(void *data, Evas_Object *obj, const char *part); static char *_gl_label_get_for_all_emails(void *data, Evas_Object *obj, const char *part); static Evas_Object *_gl_icon_get_for_all_emails(void *data, Evas_Object *obj, const char *part); -static char *_gl_label_get_for_add_account(void *data, Evas_Object *obj, const char *part); -static Evas_Object *_gl_icon_get_for_add_account(void *data, Evas_Object *obj, const char *part); static Evas_Object *_gl_icon_get(void *data, Evas_Object *obj, const char *part); static Eina_Bool _gl_state_get(void *data, Evas_Object *obj, const char *part); static void _open_all_emails(void *data, Evas_Object *obj, void *event_info); @@ -64,8 +64,6 @@ static void _email_account_timezone_change_cb(keynode_t *key, void *data); static void _stop_emf_job(EmailAccountUGD *ug_data, int handle); /* other cb */ -static void _add_account_cb(void *data, Evas_Object *obj, void *event_info); - //static int _emf_account_init(EmailAccountUGD *ug_data); //static void _gl_con(void *data, Evas_Object *obj, void *event_info); //static void _gl_exp_req(void *data, Evas_Object *obj, void *event_info); @@ -79,7 +77,6 @@ static void _add_account_cb(void *data, Evas_Object *obj, void *event_info); EmailAccountUGD *g_account_ugd; static Elm_Genlist_Item_Class itc_item; -static Elm_Genlist_Item_Class itc_item_for_add_accounts; static Elm_Genlist_Item_Class itc_item_for_all_emails; bool g_isRotate = false; @@ -152,6 +149,8 @@ static void *on_create(ui_gadget_h ug, enum ug_mode mode, service_h service, voi ug_data->base = create_frameview(ug_data); } + evas_object_smart_callback_add(ug_data->win, "profile,changed", _win_profile_changed_cb, ug_data); + return ug_data->base; } @@ -330,6 +329,7 @@ static Evas_Object *create_frameview(EmailAccountUGD * ug_data) ug_data->bg = elm_bg_add(ug_data->win); evas_object_size_hint_weight_set(ug_data->bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_win_resize_object_add(ug_data->win, ug_data->bg); evas_object_show(ug_data->bg); ug_data->ly = elm_layout_add(ug_data->win); @@ -350,6 +350,26 @@ static Evas_Object *create_frameview(EmailAccountUGD * ug_data) return ug_data->ly; } +static void _win_profile_changed_cb(void *data, Evas_Object *obj, void *event) +{ + debug_log(""); + if (!data) { + debug_log("data is NULL"); + return; + } + + EmailAccountUGD *ug_data = (EmailAccountUGD *)data; + + const char *profile = elm_config_profile_get(); + if (!g_strcmp0(profile, "desktop")) + elm_layout_theme_set(ug_data->ly, "layout", "application", "noindicator"); + else + elm_layout_theme_set(ug_data->ly, "layout", "application", "default"); + + evas_object_size_hint_weight_set(ug_data->ly, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_show(ug_data->ly); +} + void _create_account_view(EmailAccountUGD *ug_data) { debug_log(""); @@ -474,16 +494,6 @@ void _create_account_view(EmailAccountUGD *ug_data) evas_object_smart_callback_add(gl, "contracted", _gl_con, gl); */ - /* If user make 2 more accounts, we will show `Add account` */ - itc_item_for_add_accounts.item_style = "2text.1icon"; - itc_item_for_add_accounts.func.text_get = _gl_label_get_for_add_account; - itc_item_for_add_accounts.func.content_get = _gl_icon_get_for_add_account; - itc_item_for_add_accounts.func.state_get = _gl_state_get; - itc_item_for_add_accounts.func.del = _gl_del; - - elm_genlist_item_append(gl, &itc_item_for_add_accounts, ug_data, NULL, - ELM_GENLIST_ITEM_NONE, _add_account_cb, ug_data); - return; } @@ -656,49 +666,6 @@ static Evas_Object *_gl_icon_get_for_all_emails(void *data, Evas_Object *obj, co return NULL; } -static char *_gl_label_get_for_add_account(void *data, Evas_Object *obj, const char *part) -{ - debug_log(""); -// EmailAccountUGD *ug_data = (EmailAccountUGD *) data; - char tmp[MAX_STR_LEN] = { 0, }; - - if (!strcmp(part, "elm.text.1")) { - snprintf(tmp, sizeof(tmp), "%s", _("IDS_EMAIL_POP_ADD_ACCOUNTS")); - return g_strdup(tmp); - }else if (!strcmp(part, "elm.text.2")) { - memset(tmp, 0, sizeof(char) * MAX_STR_LEN); - return g_strdup(tmp); - } else { - debug_log("part is invalid"); - } - - snprintf(tmp, sizeof(tmp), _("IDS_EMAIL_BODY_NO_TEXT")); - return g_strdup(tmp); -} - -static Evas_Object *_gl_icon_get_for_add_account(void *data, Evas_Object *obj, const char *part) -{ - debug_log(""); - if (!data) { - debug_log("data is NULL"); - return NULL; - } -// EmailAccountUGD *ug_data = (EmailAccountUGD *) data; - - if (!strcmp(part, "elm.icon")) - { - Evas_Object *icon = elm_icon_add(obj); - elm_image_file_set(icon, ACCOUNT_ICON_ADDACCOUNT, NULL); - evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); - return icon; - } - else - { - debug_log("part is invalid"); - } - - return NULL; -} static Evas_Object *_gl_icon_get(void *data, Evas_Object *obj, const char *part) { @@ -820,7 +787,7 @@ void _open_mail_list(void *data, Evas_Object *obj, void *event_info) service_add_extra_data(service, EMAIL_BUNDLE_KEY_ACCOUNT_TYPE, EMAIL_BUNDLE_VAL_ALL_ACCOUNT); service_add_extra_data(service, EMAIL_BUNDLE_KEY_ACCOUNT_ID, id); - service_add_extra_data(service, EMAIL_BUNDLE_KEY_USER_EMAIL, alist->account_info->user_email_address); + service_add_extra_data(service, EMAIL_BUNDLE_KEY_ACCOUNT_NAME, alist->account_info->account_name); ug_send_result(alist->ug_data->ug, service); alist->ug_data->block_item_click = 1; @@ -867,32 +834,6 @@ static void _open_all_emails(void *data, Evas_Object *obj, void *event_info) service_destroy(service); } -static void _add_account_cb(void *data, Evas_Object *obj, void *event_info) -{ - debug_log(""); - EmailAccountUGD *ug_data = (EmailAccountUGD *)data; - Elm_Object_Item *item = (Elm_Object_Item *)event_info; - int ret; - - elm_genlist_item_selected_set(item, 0); - - service_h service; - if (SERVICE_ERROR_NONE != service_create(&service)) - { - debug_log("creating service handle failed"); - return; - } - - ret = service_add_extra_data(service, EMAIL_BUNDLE_KEY_ACCOUNT_TYPE, EMAIL_BUNDLE_VAL_ADD_ACCOUNT); - debug_log("service_add_extra_data: %d", ret); - - ret = ug_send_result(ug_data->ug, service); - debug_log("ug_send_result: %d", ret); - - ret = service_destroy(service); - debug_log("service_destroy: %d", ret); -} - static void layout_cb(ui_gadget_h ug, enum ug_mode mode, void *priv) { debug_log(""); diff --git a/common/include/email-common-types.h b/common/include/email-common-types.h index 2963a30..b43927c 100755 --- a/common/include/email-common-types.h +++ b/common/include/email-common-types.h @@ -36,9 +36,11 @@ #define EMAIL_BUNDLE_KEY_ACCOUNT_ID "ACCOUNT_ID" #define EMAIL_BUNDLE_KEY_MAILBOX "MAILBOX_ID" #define EMAIL_BUNDLE_KEY_MAILBOX_ALIAS "MAILBOX_ALIAS" -#define EMAIL_BUNDLE_KEY_USER_EMAIL "USER_EMAIL" +#define EMAIL_BUNDLE_KEY_ACCOUNT_NAME "ACCOUNT_NAME" #define EMAIL_BUNDLE_KEY_UPDATE "UPDATE" #define EMAIL_BUNDLE_KEY_CANCEL_ALL "CANCEL_ALL" +#define EMAIL_BUNDLE_KEY_ROTATE_MAILBOX "ROTATE_MAILBOX" +#define EMAIL_BUNDLE_KEY_ROTATE "ROTATE" #define EMAIL_BUNDLE_KEY_VIEW_TYPE "VIEW_TYPE" #define EMAIL_BUNDLE_KEY_RUN_TYPE "RUN_TYPE" #define EMAIL_BUNDLE_KEY_MAIL_ID "MAIL_ID" diff --git a/images/M02_email_icon_popup_date.png b/images/M02_email_icon_popup_date.png deleted file mode 100755 index 4e477ef..0000000 Binary files a/images/M02_email_icon_popup_date.png and /dev/null differ diff --git a/images/M02_email_icon_popup_sender.png b/images/M02_email_icon_popup_sender.png deleted file mode 100755 index 34df142..0000000 Binary files a/images/M02_email_icon_popup_sender.png and /dev/null differ diff --git a/images/M02_email_icon_popup_sender_press.png b/images/M02_email_icon_popup_sender_press.png deleted file mode 100755 index c921611..0000000 Binary files a/images/M02_email_icon_popup_sender_press.png and /dev/null differ diff --git a/images/M02_email_icon_popup_advanced_press.png b/images/M02_icon_attach.png similarity index 80% rename from images/M02_email_icon_popup_advanced_press.png rename to images/M02_icon_attach.png index 1f345f6..6967dcb 100755 Binary files a/images/M02_email_icon_popup_advanced_press.png and b/images/M02_icon_attach.png differ diff --git a/images/M02_icon_event.png b/images/M02_icon_event.png new file mode 100755 index 0000000..24cdfd4 Binary files /dev/null and b/images/M02_icon_event.png differ diff --git a/images/M02_icon_favorite_test.png b/images/M02_icon_favorite_test.png new file mode 100755 index 0000000..690bd0b Binary files /dev/null and b/images/M02_icon_favorite_test.png differ diff --git a/images/M02_icon_favorite_test_off.png b/images/M02_icon_favorite_test_off.png new file mode 100755 index 0000000..4372c1b Binary files /dev/null and b/images/M02_icon_favorite_test_off.png differ diff --git a/images/M02_icon_flag.png b/images/M02_icon_flag.png new file mode 100755 index 0000000..54f4f77 Binary files /dev/null and b/images/M02_icon_flag.png differ diff --git a/images/M02_icon_flag_clear.png b/images/M02_icon_flag_clear.png new file mode 100755 index 0000000..7b8bdbc Binary files /dev/null and b/images/M02_icon_flag_clear.png differ diff --git a/images/M02_icon_flag_complete.png b/images/M02_icon_flag_complete.png new file mode 100755 index 0000000..9ec92a5 Binary files /dev/null and b/images/M02_icon_flag_complete.png differ diff --git a/images/M02_icon_sms.png b/images/M02_icon_sms.png new file mode 100755 index 0000000..ceaf254 Binary files /dev/null and b/images/M02_icon_sms.png differ diff --git a/images/M02_email_icon_popup_title_press.png b/images/M02_icon_title_inbox.png similarity index 89% rename from images/M02_email_icon_popup_title_press.png rename to images/M02_icon_title_inbox.png index c307de8..46f4501 100755 Binary files a/images/M02_email_icon_popup_title_press.png and b/images/M02_icon_title_inbox.png differ diff --git a/images/M02_email_icon_popup_all_press.png b/images/M02_icon_title_inbox_1.png similarity index 83% rename from images/M02_email_icon_popup_all_press.png rename to images/M02_icon_title_inbox_1.png index 0de4137..3a267a3 100755 Binary files a/images/M02_email_icon_popup_all_press.png and b/images/M02_icon_title_inbox_1.png differ diff --git a/images/M02_icon_voice_mail.png b/images/M02_icon_voice_mail.png new file mode 100755 index 0000000..8e7cff7 Binary files /dev/null and b/images/M02_icon_voice_mail.png differ diff --git a/images/M02_list_icon_all_accounts.png b/images/M02_list_icon_all_accounts.png new file mode 100755 index 0000000..e89de51 Binary files /dev/null and b/images/M02_list_icon_all_accounts.png differ diff --git a/images/M02_list_icon_other.png b/images/M02_list_icon_other.png new file mode 100755 index 0000000..de270d8 Binary files /dev/null and b/images/M02_list_icon_other.png differ diff --git a/images/M02_popup_icon_add_account.png b/images/M02_popup_icon_add_account.png new file mode 100755 index 0000000..53508a5 Binary files /dev/null and b/images/M02_popup_icon_add_account.png differ diff --git a/images/M02_popup_icon_add_to_home.png b/images/M02_popup_icon_add_to_home.png new file mode 100755 index 0000000..4d9d27e Binary files /dev/null and b/images/M02_popup_icon_add_to_home.png differ diff --git a/images/M02_email_icon_popup_advanced.png b/images/M02_popup_icon_advanced.png similarity index 82% rename from images/M02_email_icon_popup_advanced.png rename to images/M02_popup_icon_advanced.png index 85362cc..5049b23 100755 Binary files a/images/M02_email_icon_popup_advanced.png and b/images/M02_popup_icon_advanced.png differ diff --git a/images/M02_popup_icon_all.png b/images/M02_popup_icon_all.png new file mode 100755 index 0000000..20098ba Binary files /dev/null and b/images/M02_popup_icon_all.png differ diff --git a/images/M02_popup_icon_block.png b/images/M02_popup_icon_block.png new file mode 100755 index 0000000..e16341e Binary files /dev/null and b/images/M02_popup_icon_block.png differ diff --git a/images/M02_email_icon_popup_date_press.png b/images/M02_popup_icon_date.png similarity index 79% rename from images/M02_email_icon_popup_date_press.png rename to images/M02_popup_icon_date.png index 7c883bf..91f308c 100755 Binary files a/images/M02_email_icon_popup_date_press.png and b/images/M02_popup_icon_date.png differ diff --git a/images/M02_email_icon_popup_all.png b/images/M02_popup_icon_delete_all.png similarity index 84% rename from images/M02_email_icon_popup_all.png rename to images/M02_popup_icon_delete_all.png index 929cd98..5836388 100755 Binary files a/images/M02_email_icon_popup_all.png and b/images/M02_popup_icon_delete_all.png differ diff --git a/images/M02_popup_icon_rename.png b/images/M02_popup_icon_rename.png new file mode 100755 index 0000000..c862720 Binary files /dev/null and b/images/M02_popup_icon_rename.png differ diff --git a/images/M02_popup_icon_sort_by.png b/images/M02_popup_icon_sort_by.png new file mode 100755 index 0000000..e346abe Binary files /dev/null and b/images/M02_popup_icon_sort_by.png differ diff --git a/images/M02_email_icon_popup_title.png b/images/M02_popup_icon_title.png similarity index 91% rename from images/M02_email_icon_popup_title.png rename to images/M02_popup_icon_title.png index 1415601..5787171 100755 Binary files a/images/M02_email_icon_popup_title.png and b/images/M02_popup_icon_title.png differ diff --git a/mailbox/CMakeLists.txt b/mailbox/CMakeLists.txt index 15f4d88..6e74e2c 100755 --- a/mailbox/CMakeLists.txt +++ b/mailbox/CMakeLists.txt @@ -6,6 +6,7 @@ SET(SRCS ./src/email-mailbox-controlbar.c ./src/email-mailbox-item.c ./src/email-mailbox-list.c + ./src/email-mailbox-move.c ./src/email-mailbox-noti-mgr.c ./src/email-mailbox-search.c ./src/email-mailbox-sweep.c @@ -57,6 +58,6 @@ ADD_CUSTOM_TARGET(email-mailbox-theme.edj ) ADD_DEPENDENCIES(${PROJECT_NAME} email-mailbox-theme.edj) -INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${UGDIR}) +INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIBDIR}) INSTALL(FILES ${CMAKE_MAILBOX_BINARY_DIR}/email-mailbox-theme.edj DESTINATION ${EDJDIR}) diff --git a/mailbox/include/email-mailbox-controlbar.h b/mailbox/include/email-mailbox-controlbar.h index 137beca..332525a 100755 --- a/mailbox/include/email-mailbox-controlbar.h +++ b/mailbox/include/email-mailbox-controlbar.h @@ -20,5 +20,7 @@ void _create_controlbar(EmailMailboxUGD *mailbox_ugd); void _delete_controlbar(EmailMailboxUGD *mailbox_ugd); +void _hide_toolbar(EmailMailboxUGD *mailbox_ugd); +void _show_toolbar(EmailMailboxUGD *mailbox_ugd); #endif /* __DEF_EMAIL_MAILBOX_CONTROL_BAR_H_ */ diff --git a/mailbox/include/email-mailbox-move.h b/mailbox/include/email-mailbox-move.h new file mode 100644 index 0000000..34c7007 --- /dev/null +++ b/mailbox/include/email-mailbox-move.h @@ -0,0 +1,26 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.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.tizenopensource.org/license + * + * 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. + */ + +#ifndef __DEF_EMAIL_MAILBOX_MOVE_H_ +#define __DEF_EMAIL_MAILBOX_MOVE_H_ + +//#include "email-mailbox.h" +#include "email-mailbox-item.h" + +int create_mailbox_move_list_view(void *data, int account_id); +void clear_mailbox_move_list_data(EmailMailboxUGD *mailbox_ugd); + +#endif /* __DEF_EMAIL_MAILBOX_MOVE_H_ */ diff --git a/mailbox/include/email-mailbox.h b/mailbox/include/email-mailbox.h index bf6d2f3..f0d33dc 100755 --- a/mailbox/include/email-mailbox.h +++ b/mailbox/include/email-mailbox.h @@ -65,9 +65,9 @@ #define ICON_VIEWMODE IMGDIR"/M02_controlbar_icon_view_mode.png" #define ICON_MORE IMGDIR"/M02_controlbar_icon_more.png" #define ICON_EDIT IMGDIR"/M02_controlbar_icon_edit.png" -#define ICON_CLOSE IMGDIR"/M02_email_icon_title_down.png" -#define ICON_OPEN IMGDIR"/M02_email_icon_title_up.png" -#define ICON_TITLE_ALL_ACC IMGDIR"/M02_email_list_icon_allaccount.png" +#define ICON_CLOSE IMGDIR"/M02_icon_title_inbox_1.png" +#define ICON_OPEN IMGDIR"/M02_icon_title_inbox.png" +#define ICON_TITLE_ALL_ACC IMGDIR"/M02_list_icon_all_accounts.png" #define ICON_INDEX_CLOSE IMGDIR"/M02_email_icon_index_close.png" #define CK_UNCHECKED 0 @@ -203,6 +203,14 @@ typedef struct _email_movefolder_list { EmailMailboxUGD *mailbox_ugd; } email_movefolder_list; +typedef struct _email_move_list { + int mailbox_cnt; + EmailMailboxUGD *mailbox_ugd; + email_account_t *account_info; + email_mailbox_t *mailbox_list; + GNode *folder_root; +} email_move_list; + typedef struct _MailboxAdvSearchViewInfo { Evas_Object *clicked_object; Evas_Object *entry_title; @@ -260,6 +268,7 @@ struct ug_data { Evas_Object *sync_progress; Elm_Object_Item *delete_all_button; Evas_Object *ctxpopup; + Evas_Object *folder_ctxpopup; Evas_Object *passwd_popup; Evas_Object *password_entry; GList *important_list; @@ -304,16 +313,22 @@ struct ug_data { gint mailbox_id; email_mailbox_type_e mailbox_type; gchar *folder_alias; - gchar *user_email; + gchar *account_name; gint initial_run; gint b_thread_list; gint main_w; gint main_h; - EmailSearchType search_type; - email_movefolder_list *move_folder_list; /* revised, used to dealloc */ - gint move_folder_cnt; /* revised, used to dealloc */ + email_move_list *move_list; + email_account_t *move_account_list; + int move_account_cnt; + int move_src_mailbox_id; + int b_duplicated_node; + char *traverse_compare; + email_mailbox_t *traverse_compare_mlist; + GNode *current_parent; + EmailSearchType search_type; MailboxAdvSearchViewInfo *adv_search_info; gboolean b_advanced_search_view; int emf_handle; @@ -338,6 +353,9 @@ struct ug_data { Elm_Genlist_Item_Class itc1; Elm_Genlist_Item_Class itc2; + Elm_Genlist_Item_Class itc3; + Elm_Genlist_Item_Class itc4; + Elm_Genlist_Item_Class itc5; }; @@ -414,7 +432,7 @@ struct ug_data { if(mbox) email_free_mailbox(&mbox, 1);\ i_getmore;\ }) - +void _main_back_clicked(void *data, Evas_Object *obj, void *event_info); void _update_navigationbar_title(EmailMailboxUGD *mailbox_ugd); ui_gadget_h create_composer_ug(char *ug_name, service_h service, void *data); ui_gadget_h create_setting_ug(char *ug_name, service_h service, void *data); diff --git a/mailbox/src/email-mailbox-controlbar.c b/mailbox/src/email-mailbox-controlbar.c index 72e6c8b..b715456 100755 --- a/mailbox/src/email-mailbox-controlbar.c +++ b/mailbox/src/email-mailbox-controlbar.c @@ -24,11 +24,6 @@ static Elm_Genlist_Item_Class itc_popup; static Evas_Object *radio_grp; -Elm_Object_Item *g_delete_button; -Elm_Object_Item *g_move_button; -Elm_Object_Item *g_block_button; -Elm_Object_Item *g_markunread_button; - typedef struct { int index; @@ -48,7 +43,6 @@ static void _viewby_cb(void *data, Evas_Object *obj, void *event_info); static void _more_toolbar_clicked_cb(void *data, Evas_Object *obj, void *event_info); static void _delete_all_emails_cb(void *data, Evas_Object *obj, void *event_info); static void _delete_mail_cb(void *data, Evas_Object *obj, void *event_info); -static void _block_mail_cb(void *data, Evas_Object *obj, void *event_info); static void _markunread_mail_cb(void *data, Evas_Object *obj, void *event_info); static void _markread_mail_cb(void *data, Evas_Object *obj, void *event_info); static void _compose_toolbar_clicked_cb(void *data, Evas_Object *obj, void *event_info); @@ -57,6 +51,7 @@ static void _radio_cb(void *data, Evas_Object *obj, void *event_info); static void _move_ctxpopup(Evas_Object *ctxpopup, Evas_Object *win); static void _move_mail_cb(void *data, Evas_Object *obj, void *event_info); static void _add_account_cb(void *data, Evas_Object *obj, void *event_info); +static void _search_button_clicked_cb(void *data, Evas_Object *obj, void *event_info); static Evas_Object *_create_toolbar_more_btn(Evas_Object *parent, Evas_Smart_Cb func, void *data); static Evas_Object *_create_toolbar_btn(Evas_Object *parent, const char *text, Evas_Smart_Cb func, void *data); @@ -66,113 +61,6 @@ static void _block_clicked_cb(void *data, Evas_Object *obj, void *event_info) evas_object_del(obj); } -static void _block_mail_cb(void *data, Evas_Object *obj, void *event_info) -{ - debug_log(""); - - if (data == NULL) { - debug_log("data == NULL"); - return; - } - - EmailMailboxUGD *mailbox_ugd = (EmailMailboxUGD *)data; - int i = 0, block_count = 0; - int e = 0; - - Eina_List *list = edit_list; - int checked_count = eina_list_count(list); - - if (mailbox_ugd->ctxpopup) { - evas_object_del(mailbox_ugd->ctxpopup); - mailbox_ugd->ctxpopup = NULL; - } - - if (checked_count <= 0) return; - - for (i = 0; i < checked_count; i++) { - Eina_List *nth_list = eina_list_nth_list(list, i); - - list_data *ld = eina_list_data_get(nth_list); - email_rule_t *rule = NULL; - - rule = MEM_ALLOC(rule, 1); - if(!rule) continue; - - rule->account_id = mailbox_ugd->account_id; - rule->type = EMAIL_FILTER_FROM; - - if (g_strcmp0(ld->sender, _("IDS_EMAIL_POP_NO_SENDER")) == 0) { - FREE(rule); - continue; - } else { - rule->value = g_strdup(ld->sender); - } - rule->faction = EMAIL_FILTER_BLOCK; - rule->target_mailbox_id = GET_MAILBOX_ID(ld->account_id, EMAIL_MAILBOX_TYPE_SPAMBOX); - rule->flag1 = 1; - rule->flag2 = RULE_TYPE_INCLUDES; - - if (email_add_rule(rule) < 0) - debug_log("email_add_rule failed"); - - FREE(rule->value); - FREE(rule); - block_count++; - } - -#if 0 - /* Create popup */ - if (block_count > 0) { - debug_log("mail block popup"); - Evas_Object *popup = elm_popup_add(mailbox_ugd->win_main); - elm_object_text_set(popup, _("IDS_EMAIL_POP_BLOCKED")); - //elm_popup_buttons_add(popup, 1, dgettext("sys_string", "IDS_COM_SK_OK"), ELM_POPUP_RESPONSE_OK, NULL); - Evas_Object *btn1 = elm_button_add(popup); - elm_object_text_set(btn1, dgettext("sys_string", "IDS_COM_SK_OK")); - elm_object_part_content_set(popup, "button1", btn1); - //evas_object_smart_callback_add(popup, "response", _response_cb, mailbox_ugd); - evas_object_smart_callback_add(btn1, "clicked", _response_cb, popup); - evas_object_smart_callback_add(popup, "block,clicked", _block_clicked_cb, NULL); - evas_object_show(popup); - } -#else - if (block_count > 0) { - e = status_message_post(_("IDS_EMAIL_POP_BLOCKED")); - - if (e) { - debug_log("fail to status_message_post() : %d\n", e); - } - } -#endif - - mailbox_ugd->view_type = mailbox_ugd->previous_view; - - edit_list = eina_list_free(edit_list); - - //evas_object_smart_callback_add(mailbox_ugd->searchbar_en, "focused", _searchbar_entry_focus_cb, mailbox_ugd); - //evas_object_smart_callback_add(mailbox_ugd->searchbar_en, "unfocused", _searchbar_entry_unfocus_cb, mailbox_ugd); - - elm_genlist_decorate_mode_set(mailbox_ugd->gl[mailbox_ugd->view_type], EINA_FALSE); - elm_genlist_reorder_mode_set(mailbox_ugd->gl[mailbox_ugd->view_type], EINA_FALSE); - elm_genlist_select_mode_set(mailbox_ugd->gl[mailbox_ugd->view_type], ELM_OBJECT_SELECT_MODE_DEFAULT); - b_editmode = false; - elm_object_disabled_set(mailbox_ugd->folder_button, EINA_FALSE); - _update_navigationbar_title(mailbox_ugd); - - if (mailbox_ugd->isRotate == true) { - email_rotate_landscape(mailbox_ugd); - /* - if (mailbox_ugd->current_rotmode == APP_DEVICE_ORIENTATION_270) - on_event(NULL, UG_EVENT_ROTATE_LANDSCAPE, NULL, mailbox_ugd); - else - on_event(NULL, UG_EVENT_ROTATE_LANDSCAPE_UPSIDEDOWN, NULL, mailbox_ugd); - */ - } else { - elm_object_part_content_set(mailbox_ugd->search_layout, "searchbar", mailbox_ugd->searchbar_layout); - edje_object_signal_emit(_EDJ(mailbox_ugd->search_layout), "show_searchbar", "search"); - } -} - static void _markunread_mail_cb(void *data, Evas_Object *obj, void *event_info) { debug_log(""); @@ -235,11 +123,7 @@ static void _markunread_mail_cb(void *data, Evas_Object *obj, void *event_info) else on_event(NULL, UG_EVENT_ROTATE_LANDSCAPE_UPSIDEDOWN, NULL, mailbox_ugd); */ - } else { - elm_object_part_content_set(mailbox_ugd->search_layout, "searchbar", mailbox_ugd->searchbar_layout); - edje_object_signal_emit(_EDJ(mailbox_ugd->search_layout), "show_searchbar", "search"); } - _refresh_mailbox(mailbox_ugd); } @@ -306,9 +190,6 @@ static void _markread_mail_cb(void *data, Evas_Object *obj, void *event_info) else on_event(NULL, UG_EVENT_ROTATE_LANDSCAPE_UPSIDEDOWN, NULL, mailbox_ugd); */ - } else { - elm_object_part_content_set(mailbox_ugd->search_layout, "searchbar", mailbox_ugd->searchbar_layout); - edje_object_signal_emit(_EDJ(mailbox_ugd->search_layout), "show_searchbar", "search"); } _refresh_mailbox(mailbox_ugd); @@ -418,10 +299,15 @@ static void _more_toolbar_clicked_cb(void *data, Evas_Object *obj, void *event_i { debug_log(""); EmailMailboxUGD *mailbox_ugd = (EmailMailboxUGD *)data; + Evas_Object* icon; mailbox_ugd->ctxpopup = elm_ctxpopup_add(mailbox_ugd->navi_bar); evas_object_smart_callback_add(mailbox_ugd->ctxpopup, "dismissed", _dismissed_cb, mailbox_ugd); + icon = elm_icon_add(mailbox_ugd->ctxpopup); + elm_image_file_set(icon, IMGDIR "/M02_popup_icon_sort_by.png", NULL); + elm_ctxpopup_item_append(mailbox_ugd->ctxpopup, _("IDS_EMAIL_SK_SORT_BY"), icon, _viewby_cb, mailbox_ugd); + if (mailbox_ugd->view_type == EMAIL_VIEW_EDIT) { int i = 0; bool read_mail_exist = false; @@ -438,19 +324,29 @@ static void _more_toolbar_clicked_cb(void *data, Evas_Object *obj, void *event_i read_mail_exist = true; } - if (read_mail_exist) - elm_ctxpopup_item_append(mailbox_ugd->ctxpopup, _("IDS_EMAIL_OPT_MARK_AS_UNREAD"), NULL, _markunread_mail_cb, mailbox_ugd); - else - elm_ctxpopup_item_append(mailbox_ugd->ctxpopup, _("IDS_EMAIL_OPT_MARK_AS_READ"), NULL, _markread_mail_cb, mailbox_ugd); - - elm_ctxpopup_item_append(mailbox_ugd->ctxpopup, _("IDS_EMAIL_SK_BLOCK"), NULL, _block_mail_cb, mailbox_ugd); + if (read_mail_exist) { + icon = elm_icon_add(mailbox_ugd->ctxpopup); + elm_image_file_set(icon, IMGDIR "/M02_popup_icon_mark_as_unread.png", NULL); + elm_ctxpopup_item_append(mailbox_ugd->ctxpopup, _("IDS_EMAIL_OPT_MARK_AS_UNREAD"), icon, _markunread_mail_cb, mailbox_ugd); + } else { + icon = elm_icon_add(mailbox_ugd->ctxpopup); + elm_image_file_set(icon, IMGDIR "/M02_popup_icon_mark_as_unread.png", NULL); + elm_ctxpopup_item_append(mailbox_ugd->ctxpopup, _("IDS_EMAIL_OPT_MARK_AS_READ"), icon, _markread_mail_cb, mailbox_ugd); + } - if (mailbox_ugd->isRotate) - elm_ctxpopup_item_append(mailbox_ugd->ctxpopup, dgettext("sys_string", "IDS_COM_BODY_MOVE"), NULL, _move_mail_cb, mailbox_ugd); + if (mailbox_ugd->isRotate) { + icon = elm_icon_add(mailbox_ugd->ctxpopup); + elm_image_file_set(icon, IMGDIR "/M02_popup_icon_move.png", NULL); + elm_ctxpopup_item_append(mailbox_ugd->ctxpopup, dgettext("sys_string", "IDS_COM_BODY_MOVE"), icon, _move_mail_cb, mailbox_ugd); + } } else { + icon = elm_icon_add(mailbox_ugd->ctxpopup); + elm_image_file_set(icon, IMGDIR "/M02_popup_icon_delete_all.png", NULL); + elm_ctxpopup_item_append(mailbox_ugd->ctxpopup, _("IDS_EMAIL_OPT_DELETE_ALL"), icon, _delete_all_emails_cb, mailbox_ugd); - elm_ctxpopup_item_append(mailbox_ugd->ctxpopup, _("IDS_EMAIL_OPT_DELETE_ALL"), NULL, _delete_all_emails_cb, mailbox_ugd); - elm_ctxpopup_item_append(mailbox_ugd->ctxpopup, _("IDS_EMAIL_HEADER_ADD_ACCOUNT"), NULL, _add_account_cb, mailbox_ugd); + icon = elm_icon_add(mailbox_ugd->ctxpopup); + elm_image_file_set(icon, IMGDIR "/M02_popup_icon_add_account.png", NULL); + elm_ctxpopup_item_append(mailbox_ugd->ctxpopup, _("IDS_EMAIL_HEADER_ADD_ACCOUNT"), icon, _add_account_cb, mailbox_ugd); } _move_ctxpopup(mailbox_ugd->ctxpopup, obj); @@ -691,7 +587,7 @@ static void _viewby_cb(void *data, Evas_Object *obj, void *event_info) if (index > 4) index = 4; Evas_Object *box = elm_box_add(mailbox_ugd->viewby_popup); - evas_object_size_hint_min_set(box, 610 * elm_scale_get(), 113 * index * elm_scale_get()); + evas_object_size_hint_min_set(box, 610 * elm_config_scale_get(), 113 * index * elm_config_scale_get()); evas_object_show(genlist); elm_box_pack_end(box, genlist); elm_object_content_set(mailbox_ugd->viewby_popup, box); @@ -844,7 +740,7 @@ static Evas_Object *create_control_option(EmailMailboxUGD *mailbox_ugd) elm_object_item_part_content_set(mailbox_ugd->navibar_item[mailbox_ugd->view_type], "toolbar_button1", btn1); mailbox_ugd->controlbar_lbtn = btn1; - btn2 = _create_toolbar_btn(mailbox_ugd->navi_bar, _("IDS_EMAIL_SK_SORT_BY"), _viewby_cb, mailbox_ugd); + btn2 = _create_toolbar_btn(mailbox_ugd->navi_bar, dgettext("sys_string", "IDS_COM_SK_SEARCH"), _search_button_clicked_cb, mailbox_ugd); elm_object_item_part_content_set(mailbox_ugd->navibar_item[mailbox_ugd->view_type], "toolbar_button2", btn2); mailbox_ugd->controlbar_rbtn = btn2; @@ -937,7 +833,72 @@ static void _move_mail_cb(void *data, Evas_Object *obj, void *event_info) _delete_selection_info(mailbox_ugd); mailbox_process_move_mail(mailbox_ugd); } +static void _search_button_clicked_cb(void *data, Evas_Object *obj, void *event_info) +{ + debug_log(""); + + if (data == NULL) { + debug_log("data == NULL"); + return; + } + EmailMailboxUGD* mailbox_ugd = (EmailMailboxUGD *)data; + + if (evas_object_visible_get(mailbox_ugd->navi_title_ly)) { + debug_log("title is visible, hide title"); + elm_object_item_part_content_unset(mailbox_ugd->navibar_item[mailbox_ugd->view_type], "title"); + evas_object_hide(mailbox_ugd->navi_title_ly); + } + + if(!evas_object_visible_get(mailbox_ugd->searchbar_layout)) { + debug_log("search_bar is not visible, show search bar"); + elm_object_part_content_set(mailbox_ugd->search_layout, "searchbar", mailbox_ugd->searchbar_layout); + edje_object_signal_emit(_EDJ(mailbox_ugd->search_layout), "show_searchbar", "search"); + elm_object_focus_set(mailbox_ugd->searchbar_area, EINA_TRUE); + } + +} +void _hide_toolbar(EmailMailboxUGD *mailbox_ugd) +{ + debug_log(""); + if(mailbox_ugd->main_back_btn) { + evas_object_del(mailbox_ugd->main_back_btn); + mailbox_ugd->main_back_btn = NULL; + } + elm_object_item_part_content_unset(mailbox_ugd->navibar_item[mailbox_ugd->view_type], "prev_btn"); + if(mailbox_ugd->controlbar_lbtn) { + evas_object_del(mailbox_ugd->controlbar_lbtn); + mailbox_ugd->controlbar_lbtn = NULL; + elm_object_item_part_content_unset(mailbox_ugd->navibar_item[mailbox_ugd->view_type], "toolbar_button1"); + } + if(mailbox_ugd->controlbar_rbtn) { + evas_object_del(mailbox_ugd->controlbar_rbtn); + mailbox_ugd->controlbar_rbtn = NULL; + elm_object_item_part_content_unset(mailbox_ugd->navibar_item[mailbox_ugd->view_type], "toolbar_more_btn"); + } + if(mailbox_ugd->controlbar_more_btn) { + evas_object_del(mailbox_ugd->controlbar_more_btn); + mailbox_ugd->controlbar_more_btn = NULL; + elm_object_item_part_content_unset(mailbox_ugd->navibar_item[mailbox_ugd->view_type], "toolbar_button2"); + } + elm_object_item_signal_emit(mailbox_ugd->navibar_item[mailbox_ugd->view_type], "elm,state,toolbar,close", ""); +} +void _show_toolbar(EmailMailboxUGD *mailbox_ugd) +{ + debug_log(""); + + if(!mailbox_ugd->main_back_btn) { + Evas_Object *btn = elm_button_add(mailbox_ugd->navi_bar); + elm_object_style_set(btn, "naviframe/end_btn/default"); + evas_object_smart_callback_add(btn, "clicked", _main_back_clicked, mailbox_ugd); + mailbox_ugd->main_back_btn = btn; + } + elm_object_item_part_content_set(mailbox_ugd->navibar_item[mailbox_ugd->view_type], "prev_btn", mailbox_ugd->main_back_btn); + + _create_controlbar(mailbox_ugd); + + elm_object_item_signal_emit(mailbox_ugd->navibar_item[mailbox_ugd->view_type], "elm,state,toolbar,open", ""); +} diff --git a/mailbox/src/email-mailbox-item.c b/mailbox/src/email-mailbox-item.c index 0f96a24..4684b42 100755 --- a/mailbox/src/email-mailbox-item.c +++ b/mailbox/src/email-mailbox-item.c @@ -19,228 +19,16 @@ #include "email-mailbox.h" #include "email-mailbox-item.h" #include "email-mailbox-list.h" +#include "email-mailbox-move.h" gboolean _g_move_lock = false; gboolean _g_move_cancel_lock = false; -static Elm_Genlist_Item_Class itc_mailbox; extern Eina_List *edit_list; extern gboolean b_editmode; extern gboolean list_lock; - -static Eina_Bool _create_mailbox_list_view(void *data); -static void _mailbox_list_item_clicked(void *data, Evas_Object *obj, void *event_info); -static void _mailbox_list_move_cancel_cb(void *data, Evas_Object *obj, void *event_info); -static char *_gl_mailbox_list_text_get(void *data, Evas_Object *obj, const char *part); -static Evas_Object *_gl_mailbox_list_content_get(void *data, Evas_Object *obj, const char *source); -Eina_Bool _gl_mailbox_list_state_get(void *data, Evas_Object *obj, const char *part); -static void _gl_mailbox_list_del(void *data, Evas_Object *obj); - - -static Eina_Bool _create_mailbox_list_view(void *data) -{ - debug_log(""); - EmailMailboxUGD *mailbox_ugd = (EmailMailboxUGD *)data; - - Evas_Object *genlist = elm_genlist_add(mailbox_ugd->navi_bar); - Evas_Object *btn = elm_button_add(mailbox_ugd->navi_bar); - elm_object_style_set(btn, "naviframe/end_btn/default"); - evas_object_smart_callback_add(btn, "clicked", _mailbox_list_move_cancel_cb, mailbox_ugd); - /*Elm_Object_Item *navibar_item = */elm_naviframe_item_push(mailbox_ugd->navi_bar, dgettext("sys_string", "IDS_COM_BODY_MOVE"), btn, NULL, genlist, NULL); - email_mailbox_t *mailbox_list = NULL; - int mailbox_count = 0; - int i = 0; - - email_get_mailbox_list(mailbox_ugd->account_id, -1, &mailbox_list, &mailbox_count); - - itc_mailbox.item_style = "1text.1icon.2"; - itc_mailbox.func.text_get = _gl_mailbox_list_text_get; - itc_mailbox.func.content_get = _gl_mailbox_list_content_get; - itc_mailbox.func.state_get = _gl_mailbox_list_state_get; - itc_mailbox.func.del = _gl_mailbox_list_del; - - email_movefolder_list *move_folder = (email_movefolder_list *) calloc(mailbox_count, sizeof(email_movefolder_list)); - - for (i = 0; i < mailbox_count; ++i) { - if (mailbox_list[i].mailbox_id != mailbox_ugd->mailbox_id && - mailbox_list[i].mailbox_type != EMAIL_MAILBOX_TYPE_OUTBOX && - mailbox_list[i].mailbox_type != EMAIL_MAILBOX_TYPE_SENTBOX && - mailbox_list[i].mailbox_type != EMAIL_MAILBOX_TYPE_DRAFT && - mailbox_list[i].mailbox_type != EMAIL_MAILBOX_TYPE_TRASH && - mailbox_list[i].mailbox_type != EMAIL_MAILBOX_TYPE_ALL_EMAILS && - mailbox_list[i].mailbox_type != EMAIL_MAILBOX_TYPE_SEARCH_RESULT) { - debug_log("mailbox_name: [%s], mailbox_alias: [%s] ", mailbox_list[i].mailbox_name, mailbox_list[i].alias); - - if (g_strcmp0(mailbox_list[i].alias, "[Gmail]") && !mailbox_list[i].no_select) { - move_folder[i].mailbox_list = &mailbox_list[i]; - move_folder[i].mailbox_ugd = mailbox_ugd; - elm_genlist_item_append(genlist, &itc_mailbox, &move_folder[i], NULL, ELM_GENLIST_ITEM_NONE, _mailbox_list_item_clicked, NULL); - } else { - move_folder[i].mailbox_list = &mailbox_list[i]; - move_folder[i].mailbox_ugd = mailbox_ugd; - Elm_Object_Item *item = elm_genlist_item_append(genlist, &itc_mailbox, &move_folder[i], NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL); - elm_object_item_disabled_set(item, EINA_TRUE); - } - - } else { - move_folder[i].mailbox_list = &mailbox_list[i]; - move_folder[i].mailbox_ugd = mailbox_ugd; - Elm_Object_Item *item = elm_genlist_item_append(genlist, &itc_mailbox, &move_folder[i], NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL); - elm_object_item_disabled_set(item, EINA_TRUE); - } - } - mailbox_ugd->move_folder_list = move_folder; - mailbox_ugd->move_folder_cnt = mailbox_count; - - return 0; -} - -static void _mailbox_list_item_clicked(void *data, Evas_Object *obj, void *event_info) -{ - debug_log(""); - const Elm_Object_Item *it = (Elm_Object_Item *)event_info; - const void *item_data = elm_object_item_data_get(it); - email_movefolder_list *move_folder = (email_movefolder_list *) item_data; - EmailMailboxUGD *mailbox_ugd = move_folder->mailbox_ugd; - int post_rt = 0; - - int count = g_list_length(mailbox_ugd->selected_list); - int mail_ids[count]; - memset(mail_ids, 0, sizeof(mail_ids)); - int i=0; - GList* cur = g_list_first(mailbox_ugd->selected_list); - for( ; i < count ; i++, cur=g_list_next(cur)) { - mail_ids[i] = (int) g_list_nth_data(cur, 0); - debug_log("mail_id (%d)", mail_ids[i]); - } - - int e = email_move_mail_to_mailbox(mail_ids, count,move_folder->mailbox_list->mailbox_id); - if (e != EMAIL_ERROR_NONE) { - debug_warning("email_move_mail_to_mailbox acct(%d) mailbox_id(%d) num(%d) - err (%d)", - mailbox_ugd->account_id, move_folder->mailbox_list->mailbox_id, count, e); - } - - if (e == EMAIL_ERROR_NONE && count >0) { - post_rt = status_message_post(dgettext("sys_string", "IDS_COM_POP_MOVED")); - if (post_rt) { - debug_log("fail to status_message_post() : %d\n", e); - } - } - - g_list_free(mailbox_ugd->selected_list); - mailbox_ugd->selected_list = NULL; - email_free_mailbox(&(mailbox_ugd->move_folder_list->mailbox_list), mailbox_ugd->move_folder_cnt); - FREE(mailbox_ugd->move_folder_list); - - elm_naviframe_item_pop(mailbox_ugd->navi_bar); - - if(mailbox_ugd->view_type == EMAIL_VIEW_EDIT) - { - mailbox_ugd->view_type = mailbox_ugd->previous_view; - - edit_list = eina_list_free(edit_list); - //evas_object_smart_callback_add(mailbox_ugd->searchbar_en, "focused", _searchbar_entry_focus_cb, mailbox_ugd); - //evas_object_smart_callback_add(mailbox_ugd->searchbar_en, "unfocused", _searchbar_entry_unfocus_cb, mailbox_ugd); - - elm_genlist_decorate_mode_set(mailbox_ugd->gl[mailbox_ugd->view_type], EINA_FALSE); - elm_genlist_reorder_mode_set(mailbox_ugd->gl[mailbox_ugd->view_type], EINA_FALSE); - elm_genlist_select_mode_set(mailbox_ugd->gl[mailbox_ugd->view_type], ELM_OBJECT_SELECT_MODE_DEFAULT); - - b_editmode = false; - elm_object_disabled_set(mailbox_ugd->folder_button, EINA_FALSE); - _update_navigationbar_title(mailbox_ugd); - - if (mailbox_ugd->isRotate == true) { - email_rotate_landscape(mailbox_ugd); - /* - if (mailbox_ugd->current_rotmode == APP_DEVICE_ORIENTATION_270) - on_event(NULL, UG_EVENT_ROTATE_LANDSCAPE, NULL, mailbox_ugd); - else - on_event(NULL, UG_EVENT_ROTATE_LANDSCAPE_UPSIDEDOWN, NULL, mailbox_ugd); - */ - } else { - elm_object_part_content_set(mailbox_ugd->search_layout, "searchbar", mailbox_ugd->searchbar_layout); - edje_object_signal_emit(_EDJ(mailbox_ugd->search_layout), "show_searchbar", "search"); - } - } - - if (_g_move_lock) { - _g_move_lock = false; - } - -} - -static void _mailbox_list_move_cancel_cb(void *data, Evas_Object *obj, void *event_info) -{ - debug_log(""); - EmailMailboxUGD *mailbox_ugd = (EmailMailboxUGD *)data; - - if (_g_move_cancel_lock) - return; - else - _g_move_cancel_lock = true; - - _stop_emf_job(mailbox_ugd, mailbox_ugd->emf_handle, true); - elm_naviframe_item_pop(mailbox_ugd->navi_bar); - - if(mailbox_ugd->selected_list) { - g_list_free(mailbox_ugd->selected_list); - mailbox_ugd->selected_list = NULL; - } - email_free_mailbox(&(mailbox_ugd->move_folder_list->mailbox_list), mailbox_ugd->move_folder_cnt); - FREE(mailbox_ugd->move_folder_list); - - if (_g_move_lock) { - _g_move_lock = false; - } -} - -static char *_gl_mailbox_list_text_get(void *data, Evas_Object *obj, const char *part) -{ - email_movefolder_list *move_folder = (email_movefolder_list *) data; - - if (!g_strcmp0(part, "elm.text")) { - if (move_folder->mailbox_list->alias != NULL) - return g_strdup(move_folder->mailbox_list->alias); - } - - return NULL; -} - -static Evas_Object *_gl_mailbox_list_content_get(void *data, Evas_Object *obj, const char *source) -{ - if (data == NULL) { - debug_log("data == NULL"); - return NULL; - } - - if (!g_strcmp0(source, "elm.icon")) { - char folder_icon_path[1024] = { 0, }; - Evas_Object *ic = elm_icon_add(obj); - snprintf(folder_icon_path, sizeof(folder_icon_path), IMGDIR "/U01_icon_folder.png"); - elm_image_file_set(ic, folder_icon_path, NULL); - elm_image_resizable_set(ic, 0, 0); - evas_object_image_smooth_scale_set(ic, 0); - evas_object_show(ic); - - return ic; - } - - return NULL; -} - -Eina_Bool _gl_mailbox_list_state_get(void *data, Evas_Object *obj, const char *part) -{ - return EINA_FALSE; -} - -static void _gl_mailbox_list_del(void *data, Evas_Object *obj) -{ - return; -} - void mailbox_process_move_mail(EmailMailboxUGD *mailbox_ugd) { debug_log(""); @@ -251,6 +39,7 @@ void mailbox_process_move_mail(EmailMailboxUGD *mailbox_ugd) Eina_List *list = edit_list; int checked_count = eina_list_count(list); + int account_id = 0; debug_log("checked_count: [%d]", checked_count); if (checked_count<= 0) return; @@ -260,14 +49,31 @@ void mailbox_process_move_mail(EmailMailboxUGD *mailbox_ugd) Eina_List *nth_list = eina_list_nth_list(list, i); list_data *ld = eina_list_data_get(nth_list); - /* save the mail-id to be moved */ - debug_log("not Thread... previous_view[%d]", mailbox_ugd->previous_view); - int mail_id = ld->mail_id; - mailbox_ugd->selected_list = g_list_prepend(mailbox_ugd->selected_list, GINT_TO_POINTER(mail_id)); + if(account_id < 1) { + account_id = ld->account_id; + mailbox_ugd->move_src_mailbox_id = ld->mailbox_id; + } + + debug_log("Thread... previous_view[%d]", mailbox_ugd->previous_view); + /* Get thread mail list */ + email_mail_list_item_t *mailbox_data = NULL; + int mail_list = 0; + int err = email_get_mail_list(ld->account_id, 0, ld->thread_id, + -1, /* start_index */ + -1, /* limit_count */ + _mailbox_conv_sort_type(mailbox_ugd->sort_type), &mailbox_data, &mail_list); + if( err != EMAIL_ERROR_NONE ) { + debug_warning("email_get_mail_list_ex - err(%d)", err); + } + int k = 0; + for( ; kselected_list = g_list_prepend(mailbox_ugd->selected_list, + GINT_TO_POINTER(mailbox_data[k].mail_id)); + FREE(mailbox_data); } - _create_mailbox_list_view(mailbox_ugd); + create_mailbox_move_list_view(mailbox_ugd, account_id); _g_move_lock = true; _g_move_cancel_lock = false; @@ -285,6 +91,7 @@ void mailbox_process_delete_mail(void* data, Ecore_Thread *thd) edit_req_t *req = (edit_req_t *)data; EmailMailboxUGD *mailbox_ugd = req->mailbox_ugd; + EmailMailboxViewType previous_view = req->previous_view; int i = 0; int max_account_id = email_engine_get_max_account_id(); @@ -458,11 +265,7 @@ void _popup_response_delete_ok_cb(void *data, Evas_Object *obj, void *event_info else on_event(NULL, UG_EVENT_ROTATE_LANDSCAPE_UPSIDEDOWN, NULL, mailbox_ugd); */ - } else { - elm_object_part_content_set(mailbox_ugd->search_layout, "searchbar", mailbox_ugd->searchbar_layout); - edje_object_signal_emit(_EDJ(mailbox_ugd->search_layout), "show_searchbar", "search"); } - } void _popup_response_delete_all_ok_cb(void *data, Evas_Object *obj, void *event_info) diff --git a/mailbox/src/email-mailbox-list.c b/mailbox/src/email-mailbox-list.c index b17c700..ee411be 100755 --- a/mailbox/src/email-mailbox-list.c +++ b/mailbox/src/email-mailbox-list.c @@ -129,8 +129,10 @@ static void _my_gl_mode_right(void *data, Evas_Object *obj, void *event_info); static void _my_gl_mode_left(void *data, Evas_Object *obj, void *event_info); static char *_gl_group_text_get(void *data, Evas_Object *obj, const char *part); static char *_gl_mail_item_text_get(void *data, Evas_Object *obj, const char *part); +static char *_gl_outbox_mail_item_text_get(void *data, Evas_Object *obj, const char *part); static Evas_Object *_gl_mail_item_content_get(void *data, Evas_Object *obj, const char *source); -static void _important_status_changed_cb(void *data, Evas_Object *obj, void *event_info); +static Evas_Object *_gl_outbox_mail_item_content_get(void *data, Evas_Object *obj, const char *source); +static void _important_status_changed_cb(void *data, Evas * evas, Evas_Object *obj, void *event_info); static void _item_followup_flag_touched_cb(void *data, Evas * evas, Evas_Object *obj, void *event_info); static void _realized_cb(void *data, Evas_Object *obj, void *event_info); static Evas_Object *_create_progress_part_in_outbox(list_data *ld, Evas_Object *obj); @@ -362,7 +364,7 @@ static void _my_gl_mode_cancel(void *data, Evas_Object *obj, void *event_info) static Evas_Object *_create_progress_part_in_outbox(list_data *ld, Evas_Object *obj) { - /* debug_log(""); */ + debug_log("ld->mail_status(%d)", ld->mail_status); if (ld == NULL || obj == NULL) { debug_critical("ld or obj is NULL"); return NULL; @@ -371,19 +373,27 @@ static Evas_Object *_create_progress_part_in_outbox(list_data *ld, Evas_Object * switch(ld->mail_status) { case EMAIL_MAIL_STATUS_SENDING: { /* Since mail send is in progress, - add a process icon to the entry in mail list view */ + add a process button to the entry in mail list view */ Evas_Object *progressbar = NULL; + Evas_Object *progress_button = NULL; progressbar = elm_progressbar_add(obj); - elm_object_style_set(progressbar, "list_process"); + elm_object_style_set(progressbar, "list_process_small"); evas_object_size_hint_align_set(progressbar, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_size_hint_weight_set(progressbar, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_show(progressbar); elm_progressbar_pulse(progressbar, EINA_TRUE); - debug_log("Added process icon"); - return progressbar; + progress_button = elm_button_add(obj); + elm_object_part_content_set(obj, "btn_default", progress_button); + elm_object_content_set(progress_button, progressbar); + elm_object_part_content_set(obj, "icon", progress_button); + evas_object_size_hint_align_set(progress_button, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_size_hint_weight_set(progress_button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_show(progress_button); + + debug_log("Added process button"); + return progress_button; } case EMAIL_MAIL_STATUS_SEND_WAIT: { @@ -463,7 +473,7 @@ static void _realized_cb(void *data, Evas_Object *obj, void *event_info) elm_object_disabled_set(ld->check, EINA_TRUE); } -static void _important_status_changed_cb(void *data, Evas_Object *obj, void *event_info) +static void _important_status_changed_cb(void *data, Evas * evas, Evas_Object *obj, void *event_info) { debug_log(""); list_data *ld = (list_data *)data; @@ -484,7 +494,7 @@ static void _important_status_changed_cb(void *data, Evas_Object *obj, void *eve } int e = email_set_flags_field(ld->account_id, mail_ids, count, - EMAIL_FLAGS_FLAGGED_FIELD, ld->imp_sel, true); + EMAIL_FLAGS_FLAGGED_FIELD, ld->imp_sel ? 0 : 1, true); if (e != EMAIL_ERROR_NONE) { debug_warning("_important_status_changed_cb account_id(%d) count(%d)- err (%d)", ld->account_id, count, e); @@ -503,15 +513,15 @@ static void _item_followup_flag_touched_cb(void *data, Evas * evas, Evas_Object { case EMAIL_FLAG_TASK_STATUS_CLEAR: ld->followup_flag = EMAIL_FLAG_TASK_STATUS_ACTIVE; - elm_image_file_set(ld->flag_ic, IMGDIR "/M02_email_Flag_Active.png", NULL); + elm_image_file_set(ld->flag_ic, IMGDIR "/M02_icon_flag.png", NULL); break; case EMAIL_FLAG_TASK_STATUS_ACTIVE: ld->followup_flag = EMAIL_FLAG_TASK_STATUS_COMPLETE; - elm_image_file_set(ld->flag_ic, IMGDIR "/M02_email_Flag_Complete.png", NULL); + elm_image_file_set(ld->flag_ic, IMGDIR "/M02_icon_flag_complete.png", NULL); break; case EMAIL_FLAG_TASK_STATUS_COMPLETE: ld->followup_flag = EMAIL_FLAG_TASK_STATUS_CLEAR; - elm_image_file_set(ld->flag_ic, IMGDIR "/M02_email_Flag_Clear.png", NULL); + elm_image_file_set(ld->flag_ic, IMGDIR "/M02_icon_flag_clear.png", NULL); break; default : debug_log("mail item has no followup flag"); @@ -573,39 +583,58 @@ static Evas_Object *_gl_mail_item_content_get(void *data, Evas_Object *obj, cons evas_object_show(icon); return (void *)icon; } - } else if(!g_strcmp0(source, "elm.icon.3")) { - Evas_Object *box = elm_box_add(obj); - evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - elm_box_horizontal_set(box, EINA_TRUE); - elm_box_padding_set(box, 10, 0); - - ld->important = elm_check_add(obj); - elm_check_state_pointer_set(ld->important, (Eina_Bool *)&ld->imp_sel); - elm_object_style_set(ld->important, "favorite/extended"); - evas_object_smart_callback_add(ld->important, "changed", _important_status_changed_cb, data); - evas_object_propagate_events_set(ld->important, EINA_FALSE); - evas_object_size_hint_min_set(ld->important, 80, 60); - evas_object_show(ld->important); - elm_box_pack_end(box, ld->important); - + } else if(!g_strcmp0(source, "elm.icon.4")) { + if (ld->followup_flag > EMAIL_FLAG_FLAGED) { + ld->flag_ic = elm_icon_add(obj); + switch(ld->followup_flag) + { + case EMAIL_FLAG_TASK_STATUS_CLEAR: + elm_image_file_set(ld->flag_ic, IMGDIR "/M02_icon_flag_clear.png", NULL); + break; + case EMAIL_FLAG_TASK_STATUS_ACTIVE: + elm_image_file_set(ld->flag_ic, IMGDIR "/M02_icon_flag.png", NULL); + break; + case EMAIL_FLAG_TASK_STATUS_COMPLETE: + elm_image_file_set(ld->flag_ic, IMGDIR "/M02_icon_flag_complete.png", NULL); + break; + } + evas_object_size_hint_min_set(ld->flag_ic, 38, 38); + return ld->flag_ic; + } + } else if(!g_strcmp0(source, "elm.icon.4.touch")) { + Evas_Object *rect = evas_object_rectangle_add(evas_object_evas_get(obj)); + evas_object_size_hint_align_set(rect, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_size_hint_weight_set(rect, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + if(ld->followup_flag > EMAIL_FLAG_FLAGED) + evas_object_event_callback_add(rect, EVAS_CALLBACK_MOUSE_UP, _item_followup_flag_touched_cb, data); + else + evas_object_event_callback_add(rect, EVAS_CALLBACK_MOUSE_UP, _important_status_changed_cb, data); + evas_object_propagate_events_set(rect, EINA_FALSE); + evas_object_color_set(rect, 0, 0 ,0, 0); + return rect; + } else if(!g_strcmp0(source, "elm.icon.3")) { if(ld->is_attachment == true) { + Evas_Object *box = elm_box_add(obj); + evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_box_horizontal_set(box, EINA_TRUE); icon = elm_icon_add(obj); - elm_image_file_set(icon, IMGDIR "/M02_email_icon_attach.png", NULL); - evas_object_size_hint_min_set(icon, 35, 35); + elm_image_file_set(icon, IMGDIR "/M02_icon_attach.png", NULL); + evas_object_size_hint_min_set(icon, 38, 38); + evas_object_show(icon); + elm_box_pack_start(box, icon); + icon = evas_object_rectangle_add(evas_object_evas_get(obj)); + evas_object_color_set(icon, 0, 0, 0, 0); + evas_object_size_hint_min_set(icon, 6, 16); evas_object_show(icon); elm_box_pack_start(box, icon); - } - icon = evas_object_rectangle_add(evas_object_evas_get(obj)); - evas_object_color_set(icon, 0, 0, 0, 0); - evas_object_size_hint_min_set(icon, 6, 16); - evas_object_show(icon); - elm_box_pack_start(box, icon); + return box; + } else + return NULL; - return box; } else if (!g_strcmp0(source, "elm.slide.swallow.1")) { /* First button of Sweep Menu */ if (NULL == ld->mailbox_ugd) { @@ -675,19 +704,8 @@ static Evas_Object *_gl_mail_item_content_get(void *data, Evas_Object *obj, cons { return _create_sweep_delete_button(obj, ld); } - } else if (!g_strcmp0(source, "elm.swallow.outbox.progress")) { - - Evas_Object *outbox_progress_part = NULL; - - if (ld->mailbox_ugd->mode == EMAIL_MAILBOX_MODE_MAILBOX && ld->mailbox_type == EMAIL_MAILBOX_TYPE_OUTBOX) { - if (ld->mailbox_ugd->view_type != EMAIL_VIEW_SEARCH && ld->mailbox_ugd->view_type != EMAIL_VIEW_EDIT) { - if (ld->mailbox_ugd->create_progress_part == true) { - outbox_progress_part = _create_progress_part_in_outbox(ld, obj); - } - } - } - return (void *)outbox_progress_part; } + #if 0 // support low priority message, priority icon postion is changed else if(!g_strcmp0(source, "elm.icon.priority")) { @@ -715,6 +733,92 @@ static Evas_Object *_gl_mail_item_content_get(void *data, Evas_Object *obj, cons return NULL; } +static Evas_Object *_gl_outbox_mail_item_content_get(void *data, Evas_Object *obj, const char *source) +{ + //debug_enter(); + if (data == NULL) { + debug_log("data is NULL"); + return NULL; + } + + Evas_Object *icon = NULL; + list_data *ld = (list_data *)data; + + debug_log("source: %s", source); + + if (!g_strcmp0(source, "elm.swallow.colorbar")) { + Evas_Object *small_rect = evas_object_rectangle_add(evas_object_evas_get(obj)); + evas_object_size_hint_fill_set(small_rect, EVAS_HINT_FILL, EVAS_HINT_FILL); + + int r = (ld->account_color & 0xff000000) >> 24; + int g = (ld->account_color & 0x00ff0000) >> 16; + int b = (ld->account_color & 0x0000ff00) >> 8; + int a = ld->account_color & 0x000000ff; + + evas_object_color_set(small_rect, r, g, b, a); + return (void *)small_rect; + } else if (!g_strcmp0(source, "elm.icon.1")) { + ld->check = elm_check_add(obj); + elm_check_state_pointer_set(ld->check, (Eina_Bool *)&ld->chksel); + evas_object_smart_callback_add(ld->check, "changed", _item_check_changed_cb, data); + evas_object_propagate_events_set(ld->check, EINA_FALSE); + return ld->check; + } else if(!g_strcmp0(source, "elm.icon.2")){ + if(ld->priority == EMAIL_OPTION_PRIORITY_HIGH) { + icon = elm_icon_add(obj); + elm_image_file_set(icon, IMGDIR "/M02_email_icon_priority.png", NULL); + elm_image_resizable_set(icon, 0, 0); + evas_object_image_smooth_scale_set(icon, 0); + evas_object_show(icon); + return (void *)icon; + } else if(ld->reply_flag) { + icon = elm_icon_add(obj); + elm_image_file_set(icon, IMGDIR "/M02_email_icon_reply.png", NULL); + elm_image_resizable_set(icon, 0, 0); + evas_object_image_smooth_scale_set(icon, 0); + evas_object_show(icon); + return (void *)icon; + } else if (ld->forward_flag) { + icon = elm_icon_add(obj); + elm_image_file_set(icon, IMGDIR "/M02_email_icon_forward.png", NULL); + elm_image_resizable_set(icon, 0, 0); + evas_object_image_smooth_scale_set(icon, 0); + evas_object_show(icon); + return (void *)icon; + } + } else if(!g_strcmp0(source, "elm.icon.4")) { + Evas_Object *outbox_progress_part = NULL; + + if (ld->mailbox_ugd->mode == EMAIL_MAILBOX_MODE_MAILBOX && ld->mailbox_type == EMAIL_MAILBOX_TYPE_OUTBOX) { + if (ld->mailbox_ugd->view_type != EMAIL_VIEW_SEARCH && ld->mailbox_ugd->view_type != EMAIL_VIEW_EDIT) { + if (ld->mailbox_ugd->create_progress_part == true) { + outbox_progress_part = _create_progress_part_in_outbox(ld, obj); + } + } + } + return (void *)outbox_progress_part; + } else if (!g_strcmp0(source, "elm.slide.swallow.1")) { + /* First button of Sweep Menu */ + if (NULL == ld->mailbox_ugd) { + debug_critical(" ld->mailbox_ugd [%p] ", ld->mailbox_ugd); + return NULL; + } + + return _create_sweep_read_unread_button(obj,ld); + + } else if (!g_strcmp0(source, "elm.slide.swallow.2")) { + /* Second button of Sweep Menu */ + if (NULL == ld->mailbox_ugd) { + debug_critical(" ld->mailbox_ugd [%p] ", ld->mailbox_ugd); + return NULL; + } + + return _create_sweep_delete_button(obj,ld); + } + + return NULL; +} + static char *_gl_mail_item_text_get(void *data, Evas_Object *obj, const char *part) { if (data == NULL) { @@ -765,6 +869,14 @@ static char *_gl_mail_item_text_get(void *data, Evas_Object *obj, const char *pa } } else if (!g_strcmp0(part, "elm.text.3")) { + if (ld->preview_body == NULL) { + debug_log("preview text is NULL"); + return NULL; + } else { + return g_strdup(ld->preview_body); + } + + } else if (!g_strcmp0(part, "elm.text.4")) { if (ld->timeordate == NULL) { debug_log("timeordate is NULL"); @@ -775,16 +887,76 @@ static char *_gl_mail_item_text_get(void *data, Evas_Object *obj, const char *pa return g_strdup(""); else return g_strdup(ld->timeordate); - } else if (!g_strcmp0(part, "elm.text.4")) { + } else if (!g_strcmp0(part, "elm.slide.text.1")) { /* Subject is to be displayed in Sweep Menu. ld->title stores Subject of email */ + return g_strdup(ld->title); + + } else { + debug_log(""); + return NULL; + } + + return NULL; +} + +static char *_gl_outbox_mail_item_text_get(void *data, Evas_Object *obj, const char *part) +{ + if (data == NULL) { + debug_warning("ld is NULL"); + return NULL; + } + + list_data *ld = (list_data *)data; + EmailMailboxUGD *mailbox_ugd = ld->mailbox_ugd; + + debug_log("part: %s", part); + + if (mailbox_ugd == NULL) { + debug_warning("mailbox_ugd is NULL"); + return NULL; + } + if (!g_strcmp0(part, "elm.text.1")) { + char title[SUBJECT_LEN + TAG_LEN*2 + 1] = {0}; /* two tags can be inserted */ + strncat(title, ld->title, SUBJECT_LEN + TAG_LEN); /* search tag may be contained */ + //strcat(title, ""); + return g_strdup(title); + } else if (!g_strcmp0(part, "elm.text.2")) { + /* + if (ld->from == NULL) { + debug_log("from is NULL"); + return NULL; + } + */ + if (mailbox_ugd->view_type == EMAIL_VIEW_SEARCH) { + if(ld->mailbox_ugd->mode == EMAIL_MAILBOX_MODE_MAILBOX && + (ld->mailbox_type == EMAIL_MAILBOX_TYPE_OUTBOX || + ld->mailbox_type == EMAIL_MAILBOX_TYPE_SENTBOX || + ld->mailbox_type == EMAIL_MAILBOX_TYPE_DRAFT)) + return g_strdup(ld->recipient); + else { + if(ld->from) + return g_strdup(ld->from); + else if(ld->alias) + return g_strdup(ld->alias); + } + } else { + if(ld->mailbox_ugd->mode == EMAIL_MAILBOX_MODE_MAILBOX && + (ld->mailbox_type == EMAIL_MAILBOX_TYPE_OUTBOX || + ld->mailbox_type == EMAIL_MAILBOX_TYPE_SENTBOX || + ld->mailbox_type == EMAIL_MAILBOX_TYPE_DRAFT)) + return g_strdup(ld->recipient); + else + return g_strdup(ld->alias); + } + } else if (!g_strcmp0(part, "elm.text.3")) { if (ld->preview_body == NULL) { debug_log("preview text is NULL"); return NULL; } else { return g_strdup(ld->preview_body); } - } else if (!g_strcmp0(part, "elm.slide.text.1")) { /* Subject is to be displayed in Sweep Menu. ld->title stores Subject of email */ return g_strdup(ld->title); + } else { debug_log(""); return NULL; @@ -803,6 +975,11 @@ static void _my_gl_mode_right(void *data, Evas_Object *obj, void *event_info) EmailMailboxUGD *mailbox_ugd = (EmailMailboxUGD *)data; Evas_Coord x = 0, y = 0, w = 0, h = 0; Elm_Object_Item *prev = NULL; + + /* Skip a group item*/ + if (elm_genlist_item_select_mode_get(event_info) == ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY) + return; + evas_object_geometry_get((mailbox_ugd->gl[mailbox_ugd->view_type]), &x, &y, &w, &h); debug_log("x = %d, y = %d, w=%d, h=%d, isRotate = %d, view_type = %d", x, y, w,h, mailbox_ugd->isRotate, mailbox_ugd->view_type); @@ -837,6 +1014,10 @@ static void _my_gl_mode_left(void *data, Evas_Object *obj, void *event_info) debug_log("event_info is NULL");return; } + /* Skip a group item*/ + if (elm_genlist_item_select_mode_get(event_info) == ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY) + return; + /* Finish genlist sweep */ elm_genlist_item_decorate_mode_set(event_info, "slide", EINA_FALSE); elm_genlist_item_select_mode_set(event_info, ELM_OBJECT_SELECT_MODE_DEFAULT); @@ -885,30 +1066,52 @@ void mailbox_create_list_view(EmailMailboxUGD *mailbox_ugd) } /* Set genlist item class */ - mailbox_ugd->itc1.item_style = "email.list"; - mailbox_ugd->itc1.func.text_get = _gl_mail_item_text_get; - mailbox_ugd->itc1.func.content_get = _gl_mail_item_content_get; + mailbox_ugd->itc1.item_style = "grouptitle"; + mailbox_ugd->itc1.func.text_get = _gl_group_text_get; + mailbox_ugd->itc1.func.content_get = NULL; mailbox_ugd->itc1.func.state_get = NULL; mailbox_ugd->itc1.func.del = NULL; - mailbox_ugd->itc1.decorate_all_item_style = "edit_default"; + mailbox_ugd->itc1.decorate_all_item_style = NULL; - mailbox_ugd->itc2.item_style = "grouptitle"; - mailbox_ugd->itc2.func.text_get = _gl_group_text_get; - mailbox_ugd->itc2.func.content_get = NULL; + mailbox_ugd->itc2.item_style = "email.list"; + mailbox_ugd->itc2.func.text_get = _gl_mail_item_text_get; + mailbox_ugd->itc2.func.content_get = _gl_mail_item_content_get; mailbox_ugd->itc2.func.state_get = NULL; mailbox_ugd->itc2.func.del = NULL; - mailbox_ugd->itc2.decorate_all_item_style = NULL; + mailbox_ugd->itc2.decorate_all_item_style = "edit_default"; + + mailbox_ugd->itc3.item_style = "email.list.conversation"; + mailbox_ugd->itc3.func.text_get = _gl_mail_item_text_get; + mailbox_ugd->itc3.func.content_get = _gl_mail_item_content_get; + mailbox_ugd->itc3.func.state_get = NULL; + mailbox_ugd->itc3.func.del = NULL; + mailbox_ugd->itc3.decorate_all_item_style = "edit_default"; + + mailbox_ugd->itc4.item_style = "email.outbox"; + mailbox_ugd->itc4.func.text_get = _gl_outbox_mail_item_text_get; + mailbox_ugd->itc4.func.content_get = _gl_outbox_mail_item_content_get; + mailbox_ugd->itc4.func.state_get = NULL; + mailbox_ugd->itc4.func.del = NULL; + mailbox_ugd->itc4.decorate_all_item_style = "edit_default"; + + mailbox_ugd->itc5.item_style = "email.outbox.conversations"; + mailbox_ugd->itc5.func.text_get = _gl_outbox_mail_item_text_get; + mailbox_ugd->itc5.func.content_get = _gl_outbox_mail_item_content_get; + mailbox_ugd->itc5.func.state_get = NULL; + mailbox_ugd->itc5.func.del = NULL; + mailbox_ugd->itc5.decorate_all_item_style = "edit_default"; Evas_Object *gl = elm_genlist_add(mailbox_ugd->sub_layout[mailbox_ugd->view_type]); /*elm_object_theme_set(gl, mailbox_ugd->theme);*/ evas_object_smart_callback_add(gl, "realized", _realized_cb, NULL); evas_object_smart_callback_add(gl, "drag,start,right", _my_gl_mode_right, mailbox_ugd); - evas_object_smart_callback_add(gl, "drag,start,left", _my_gl_mode_left, NULL); + evas_object_smart_callback_add(gl, "drag,start,left", _my_gl_mode_left, mailbox_ugd); evas_object_smart_callback_add(gl, "drag,start,up", _my_gl_mode_cancel, mailbox_ugd); evas_object_smart_callback_add(gl, "drag,start,down", _my_gl_mode_cancel, NULL); elm_object_style_set(gl, "handler"); + elm_scroller_policy_set(gl, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO); elm_genlist_block_count_set(gl, BLOCK_COUNT); elm_genlist_homogeneous_set(gl, EINA_TRUE); //elm_genlist_mode_set(gl, ELM_LIST_COMPRESS); //genlist is updated when rotate event is detected(Resize) @@ -1057,13 +1260,8 @@ static void _process_item_check_changed_cb(list_data *ld) mailbox_ugd->previous_view = mailbox_ugd->view_type; mailbox_ugd->view_type = EMAIL_VIEW_EDIT; - elm_entry_entry_set(mailbox_ugd->searchbar_en, ""); - elm_object_focus_set(mailbox_ugd->searchbar_layout, EINA_FALSE); - elm_object_part_content_unset(mailbox_ugd->search_layout, "searchbar"); - edje_object_signal_emit(_EDJ(mailbox_ugd->search_layout), "hide_searchbar", "search"); - evas_object_hide(mailbox_ugd->searchbar_layout); - _create_controlbar(mailbox_ugd); + //elm_object_item_part_content_set(mailbox_ugd->navibar_item[mailbox_ugd->previous_view], "controlbar", mailbox_ugd->controlbar_btns); elm_object_disabled_set(mailbox_ugd->folder_button, EINA_TRUE); } else if(cnt <= 0) @@ -1123,12 +1321,7 @@ static void _list_item_clicked(void *data, Evas_Object *obj, void *event_info) return; } - if ((mbox->mailbox_type == EMAIL_MAILBOX_TYPE_DRAFT - || (mbox->mailbox_type == EMAIL_MAILBOX_TYPE_OUTBOX - && (ld->mail_status == EMAIL_MAIL_STATUS_SEND_CANCELED - || ld->mail_status == EMAIL_MAIL_STATUS_SEND_FAILURE))) - && email_engine_check_body_download(ld->mail_id)) { - + if (mbox->mailbox_type == EMAIL_MAILBOX_TYPE_DRAFT && email_engine_check_body_download(ld->mail_id)) { if (ld->mailbox_ugd->ug_composer) { debug_log("Composer UG is already launched"); return; @@ -1181,23 +1374,20 @@ static void _insert_normal_item_to_mailist(EmailMailboxUGD *mailbox_ugd, list_da /* group item is not in genlist, insert group item and normal item in sequence*/ if( !mailbox_ugd->git[view_type][ld->group_index] ) { - /* if next item exists, group item is placed before the next group item */ if( ITEM_EXIST(next) ) { - mailbox_ugd->git[view_type][ld->group_index] = elm_genlist_item_insert_before( - mailbox_ugd->gl[view_type], - &(mailbox_ugd->itc2), + /* if next item exists, group item is placed before the next group item */ + mailbox_ugd->git[view_type][ld->group_index] = elm_genlist_item_insert_before(mailbox_ugd->gl[view_type], + &(mailbox_ugd->itc1), (void *)(ld->group_index + 1), NULL, mailbox_ugd->git[view_type][next->group_index], ELM_GENLIST_ITEM_GROUP, NULL, NULL); elm_genlist_item_select_mode_set(mailbox_ugd->git[view_type][ld->group_index], ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY); - } - /* if there is no next node, this group item is placed at end of list */ - else { - mailbox_ugd->git[view_type][ld->group_index] = elm_genlist_item_append( - mailbox_ugd->gl[view_type], - &(mailbox_ugd->itc2), + } else { + /* if there is no next node, this group item is placed at end of list */ + mailbox_ugd->git[view_type][ld->group_index] = elm_genlist_item_append(mailbox_ugd->gl[view_type], + &(mailbox_ugd->itc1), (void *)(ld->group_index + 1), NULL, ELM_GENLIST_ITEM_GROUP, @@ -1210,25 +1400,38 @@ static void _insert_normal_item_to_mailist(EmailMailboxUGD *mailbox_ugd, list_da return; } - if (ld->mailbox_type == EMAIL_MAILBOX_TYPE_OUTBOX || ld->mailbox_type == EMAIL_MAILBOX_TYPE_DRAFT) - { + if (ld->mailbox_type == EMAIL_MAILBOX_TYPE_OUTBOX || ld->mailbox_type == EMAIL_MAILBOX_TYPE_DRAFT) { debug_log("mode/slide ld->mailbox_type: %d, mailbox_ugd->view_type: %d", ld->mailbox_type,mailbox_ugd->view_type); - mailbox_ugd->itc1.decorate_item_style = "mode/slide2"; + mailbox_ugd->itc2.decorate_item_style = "mode/slide2"; + mailbox_ugd->itc3.decorate_item_style = "mode/slide2"; + mailbox_ugd->itc4.decorate_item_style = "mode/slide2"; + mailbox_ugd->itc5.decorate_item_style = "mode/slide2"; } else { debug_log("mode/slide4 ld->mailbox_type: %d, mailbox_ugd->view_type: %d", ld->mailbox_type,mailbox_ugd->view_type); - mailbox_ugd->itc1.decorate_item_style = "mode/slide4"; + mailbox_ugd->itc2.decorate_item_style = "mode/slide4"; + mailbox_ugd->itc3.decorate_item_style = "mode/slide4"; } /* insert the item after group item */ - ld->item = elm_genlist_item_insert_after( - mailbox_ugd->gl[view_type], - &(mailbox_ugd->itc1), - ld, - mailbox_ugd->git[view_type][ld->group_index], - mailbox_ugd->git[view_type][ld->group_index], - ELM_GENLIST_ITEM_NONE, - _list_item_clicked, - NULL); + if (ld->mailbox_type == EMAIL_MAILBOX_TYPE_OUTBOX) { + ld->item = elm_genlist_item_insert_after(mailbox_ugd->gl[view_type], + &(mailbox_ugd->itc4), + ld, + mailbox_ugd->git[view_type][ld->group_index], + mailbox_ugd->git[view_type][ld->group_index], + ELM_GENLIST_ITEM_NONE, + _list_item_clicked, + NULL); + } else { + ld->item = elm_genlist_item_insert_after(mailbox_ugd->gl[view_type], + &(mailbox_ugd->itc2), + ld, + mailbox_ugd->git[view_type][ld->group_index], + mailbox_ugd->git[view_type][ld->group_index], + ELM_GENLIST_ITEM_NONE, + _list_item_clicked, + NULL); + } } /* there exists the another normal item among the same group. find the normal item in same group */ else { @@ -1237,26 +1440,47 @@ static void _insert_normal_item_to_mailist(EmailMailboxUGD *mailbox_ugd, list_da return; } - if( ITEM_IN_SAME_GROUP(prev, ld) ) - ld->item = elm_genlist_item_insert_after(mailbox_ugd->gl[view_type], - &(mailbox_ugd->itc1), - ld, - mailbox_ugd->git[view_type][ld->group_index], - prev->item, - ELM_GENLIST_ITEM_NONE, - _list_item_clicked, - NULL); - - else if ( ITEM_IN_SAME_GROUP(next, ld) ) - ld->item = elm_genlist_item_insert_before(mailbox_ugd->gl[view_type], - &(mailbox_ugd->itc1), - ld, - mailbox_ugd->git[view_type][ld->group_index], - next->item, - ELM_GENLIST_ITEM_NONE, - _list_item_clicked, - NULL); - else { + if( ITEM_IN_SAME_GROUP(prev, ld) ) { + if (ld->mailbox_type == EMAIL_MAILBOX_TYPE_OUTBOX) { + ld->item = elm_genlist_item_insert_after(mailbox_ugd->gl[view_type], + &(mailbox_ugd->itc4), + ld, + mailbox_ugd->git[view_type][ld->group_index], + prev->item, + ELM_GENLIST_ITEM_NONE, + _list_item_clicked, + NULL); + } else { + ld->item = elm_genlist_item_insert_after(mailbox_ugd->gl[view_type], + &(mailbox_ugd->itc2), + ld, + mailbox_ugd->git[view_type][ld->group_index], + prev->item, + ELM_GENLIST_ITEM_NONE, + _list_item_clicked, + NULL); + } + } else if ( ITEM_IN_SAME_GROUP(next, ld) ) { + if (ld->mailbox_type == EMAIL_MAILBOX_TYPE_OUTBOX) { + ld->item = elm_genlist_item_insert_before(mailbox_ugd->gl[view_type], + &(mailbox_ugd->itc4), + ld, + mailbox_ugd->git[view_type][ld->group_index], + next->item, + ELM_GENLIST_ITEM_NONE, + _list_item_clicked, + NULL); + } else { + ld->item = elm_genlist_item_insert_before(mailbox_ugd->gl[view_type], + &(mailbox_ugd->itc2), + ld, + mailbox_ugd->git[view_type][ld->group_index], + next->item, + ELM_GENLIST_ITEM_NONE, + _list_item_clicked, + NULL); + } + } else { debug_warning("There is group item(%d), but prev item(%d) or next item(%d) is not same group", ld->group_index, GROUP_INDEX(prev), GROUP_INDEX(next)); return; @@ -2222,11 +2446,6 @@ void _edit_back_cb(void *data, Evas_Object *obj, void *event_info) b_editmode = false; elm_object_disabled_set(mailbox_ugd->folder_button, EINA_FALSE); - if (mailbox_ugd->isRotate == false) { - elm_object_part_content_set(mailbox_ugd->search_layout, "searchbar", mailbox_ugd->searchbar_layout); - edje_object_signal_emit(_EDJ(mailbox_ugd->search_layout), "show_searchbar", "search"); - } - debug_leave(); } @@ -2550,59 +2769,61 @@ void _make_account_mail_list(void *data) EmailMailboxUGD *mailbox_ugd = (EmailMailboxUGD *)data; if (mailbox_ugd->account_id == 0) { - mailbox_ugd->mode = EMAIL_MAILBOX_MODE_ALL; - debug_log("mailbox_type:[%d], mailbox_id:[%d]", mailbox_ugd->mailbox_type, mailbox_ugd->mailbox_id); - switch(mailbox_ugd->mailbox_type) + if (mailbox_ugd->mode == EMAIL_MAILBOX_MODE_ALL) { - case EMAIL_MAILBOX_TYPE_INBOX: - { - elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_title", _("IDS_EMAIL_BODY_INBOX")); - } - break; - case EMAIL_MAILBOX_TYPE_SENTBOX: - { - elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_title", _("IDS_EMAIL_BODY_SENTBOX")); - } - break; - case EMAIL_MAILBOX_TYPE_TRASH: - { - elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_title", _("IDS_EMAIL_BODY_TRASH")); - } - break; - case EMAIL_MAILBOX_TYPE_DRAFT: - { - elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_title", _("IDS_EMAIL_BODY_DRAFTS")); - } - break; - case EMAIL_MAILBOX_TYPE_SPAMBOX: - { - elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_title", _("IDS_EMAIL_BODY_SPAMBOX")); - } - break; - case EMAIL_MAILBOX_TYPE_OUTBOX: - { - elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_title", N_("Outbox")); - } - break; - case EMAIL_MAILBOX_TYPE_FLAGGED: + debug_log("mailbox_type:[%d], mailbox_id:[%d]", mailbox_ugd->mailbox_type, mailbox_ugd->mailbox_id); + switch(mailbox_ugd->mailbox_type) { - elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_title", _("IDS_EMAIL_OPT_FAVOURITES")); - } - break; - default: - { - elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_title", _("IDS_EMAIL_BODY_INBOX")); + case EMAIL_MAILBOX_TYPE_INBOX: + { + elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_sub", _("IDS_EMAIL_BODY_INBOX")); + } + break; + case EMAIL_MAILBOX_TYPE_SENTBOX: + { + elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_sub", _("IDS_EMAIL_BODY_SENTBOX")); + } + break; + case EMAIL_MAILBOX_TYPE_TRASH: + { + elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_sub", _("IDS_EMAIL_BODY_TRASH")); + } + break; + case EMAIL_MAILBOX_TYPE_DRAFT: + { + elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_sub", _("IDS_EMAIL_BODY_DRAFTS")); + } + break; + case EMAIL_MAILBOX_TYPE_SPAMBOX: + { + elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_sub", _("IDS_EMAIL_BODY_SPAMBOX")); + } + break; + case EMAIL_MAILBOX_TYPE_OUTBOX: + { + elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_sub", _("IDS_EMAIL_HEADER_OUTBOX")); + } + break; + case EMAIL_MAILBOX_TYPE_FLAGGED: + { + elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_sub", _("IDS_EMAIL_OPT_FAVOURITES")); + } + break; + default: + { + elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_sub", _("IDS_EMAIL_BODY_INBOX")); + } + break; } - break; + elm_image_file_set(mailbox_ugd->sp_icon, ICON_TITLE_ALL_ACC, NULL); + elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_title", _("IDS_EMAIL_HEADER_ALL_ACCOUNTS")); } - elm_image_file_set(mailbox_ugd->sp_icon, ICON_TITLE_ALL_ACC, NULL); - elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_sub", _("IDS_EMAIL_HEADER_ALL_ACCOUNTS")); } else { debug_log("mailbox_id: [%d], account_id: [%d]", mailbox_ugd->mailbox_id, mailbox_ugd->account_id); mailbox_ugd->mode = EMAIL_MAILBOX_MODE_MAILBOX; - elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_title", mailbox_ugd->folder_alias); + elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_sub", mailbox_ugd->folder_alias); mailbox_ugd->mailbox_type = GET_MAILBOX_TYPE(mailbox_ugd->mailbox_id); email_account_t *account; @@ -2612,7 +2833,7 @@ void _make_account_mail_list(void *data) elm_image_file_set(mailbox_ugd->sp_icon, account->logo_icon_path, NULL); } - elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_sub", mailbox_ugd->user_email); + elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_title", mailbox_ugd->account_name); if (account) { elm_image_file_set(mailbox_ugd->sp_icon, account->logo_icon_path, NULL); @@ -3166,38 +3387,62 @@ gint _compare_sort_rule_by_viewtype(gconstpointer a, gconstpointer b) break; case EMAIL_VIEW_UNREAD: - if(first_item->is_seen > second_item->is_seen) - ret = 1; - else if (first_item->is_seen == second_item->is_seen) - ret = 1; - else + if(first_item->is_seen > second_item->is_seen) { + if(first_item->absolute_time > second_item->absolute_time) + ret = -1; + else + ret = 1; + } else if (first_item->is_seen == second_item->is_seen) { + if(first_item->absolute_time > second_item->absolute_time) + ret = -1; + else + ret = 1; + } else ret = -1; break; case EMAIL_VIEW_IMPORTANT: - if(first_item->imp_sel > second_item->imp_sel) - ret = -1; - else if (first_item->imp_sel == second_item->imp_sel) - ret = 1; - else + if(first_item->imp_sel > second_item->imp_sel) { + if(first_item->absolute_time > second_item->absolute_time) + ret = -1; + else + ret = 1; + } else if (first_item->imp_sel == second_item->imp_sel) { + if(first_item->absolute_time > second_item->absolute_time) + ret = -1; + else + ret = 1; + } else ret = 1; break; case EMAIL_VIEW_PRIORITY: - if(first_item->priority > second_item->priority) - ret = -1; - else if (first_item->priority == second_item->priority) - ret = 1; - else + if(first_item->priority > second_item->priority) { + if(first_item->absolute_time > second_item->absolute_time) + ret = -1; + else + ret = 1; + } else if (first_item->priority == second_item->priority) { + if(first_item->absolute_time > second_item->absolute_time) + ret = -1; + else + ret = 1; + } else ret = 1; break; case EMAIL_VIEW_ATTACHMENTS: - if(first_item->is_attachment > second_item->is_attachment) - ret = -1; - else if (first_item->is_attachment == second_item->is_attachment) - ret = 1; - else + if(first_item->is_attachment > second_item->is_attachment) { + if(first_item->absolute_time > second_item->absolute_time) + ret = -1; + else + ret = 1; + } else if (first_item->is_attachment == second_item->is_attachment) { + if(first_item->absolute_time > second_item->absolute_time) + ret = -1; + else + ret = 1; + } else ret = 1; break; @@ -3251,13 +3496,23 @@ static void _insert_mail_to_recipient_mailist(EmailMailboxUGD *mailbox_ugd, list } // insert normal item + if (ld->mailbox_type == EMAIL_MAILBOX_TYPE_OUTBOX) { + ld->item = elm_genlist_item_append(mailbox_ugd->gl[mailbox_ugd->view_type], + &(mailbox_ugd->itc4), + ld, + sender_group, + ELM_GENLIST_ITEM_NONE, + _list_item_clicked, + NULL); + } else { ld->item = elm_genlist_item_append(mailbox_ugd->gl[mailbox_ugd->view_type], - &(mailbox_ugd->itc1), + &(mailbox_ugd->itc2), ld, sender_group, ELM_GENLIST_ITEM_NONE, _list_item_clicked, NULL); + } } else @@ -3272,13 +3527,24 @@ static void _insert_mail_to_recipient_mailist(EmailMailboxUGD *mailbox_ugd, list elm_genlist_item_select_mode_set(sender_group, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY); alias = g_strdup(ld->alias); // insert normal item - ld->item = elm_genlist_item_append(mailbox_ugd->gl[mailbox_ugd->view_type], - &(mailbox_ugd->itc1), - ld, - sender_group, - ELM_GENLIST_ITEM_NONE, - _list_item_clicked, - NULL); + if (ld->mailbox_type == EMAIL_MAILBOX_TYPE_OUTBOX) { + ld->item = elm_genlist_item_append(mailbox_ugd->gl[mailbox_ugd->view_type], + &(mailbox_ugd->itc2), + ld, + sender_group, + ELM_GENLIST_ITEM_NONE, + _list_item_clicked, + NULL); + } else { + ld->item = elm_genlist_item_append(mailbox_ugd->gl[mailbox_ugd->view_type], + &(mailbox_ugd->itc2), + ld, + sender_group, + ELM_GENLIST_ITEM_NONE, + _list_item_clicked, + NULL); + + } } debug_leave(); } diff --git a/mailbox/src/email-mailbox-move.c b/mailbox/src/email-mailbox-move.c new file mode 100644 index 0000000..d407b93 --- /dev/null +++ b/mailbox/src/email-mailbox-move.c @@ -0,0 +1,941 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.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.tizenopensource.org/license + * + * 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 +#include "email-mailbox.h" +#include "email-mailbox-list.h" +#include "email-mailbox-item.h" +#include "email-mailbox-move.h" + +extern gboolean _g_move_lock; +extern gboolean _g_move_cancel_lock; + +extern Eina_List *edit_list; +extern gboolean b_editmode; + +static Elm_Genlist_Item_Class itc_mailbox; +static Elm_Genlist_Item_Class itc_mailbox_subtree; +static Elm_Genlist_Item_Class itc_mailbox_subtree2; + +static void _make_folder_tree(email_move_list *move_list, void *data); +static gboolean _mailbox_move_folder_item_dim_state_get(email_mailbox_t *mlist, EmailMailboxUGD *mailbox_ugd); +static gboolean _mailbox_move_account_item_dim_state_get(int src_account_type, int account_id); +static void _mailbox_list_move_cancel_cb(void *data, Evas_Object *obj, void *event_info); + +static Evas_Object *_gl_icon_get(void *data, Evas_Object *obj, const char *part); +static Evas_Object *_gl_icon_get_for_subitem(void *data, Evas_Object *obj, const char *part); +static Evas_Object *_gl_icon_get_for_leafitem(void *data, Evas_Object *obj, const char *part); +static char *_gl_label_get(void *data, Evas_Object *obj, const char *part); +static char *_gl_label_get_for_subitem(void *data, Evas_Object *obj, const char *part); +static void _gl_del(void *data, Evas_Object *obj); +static Eina_Bool _gl_state_get(void *data, Evas_Object *obj, const char *part); +static void _gl_account_sel(void *data, Evas_Object *obj, void *event_info); +static void _gl_sel(void *data, Evas_Object *obj, void *event_info); +static void _gl_con(void *data, Evas_Object *obj, void *event_info); +static void _gl_exp(void *data, Evas_Object *obj, void *event_info); +static void _gl_exp_sel(void *data, Evas_Object *obj, void *event_info); +static gboolean _check_duplicated_node(GNode *node, gpointer data); +static void _folder_icon_clicked_cb(void *data, Evas_Object *obj, void *event_info); + + +#define FOLDER_ICON_PLUS_FOLDER_LIST IMGDIR"/folder_plus.png" +#define FOLDER_ICON_MINUS_FOLDER_LIST IMGDIR"/folder_minus.png" +#define FOLDER_ICON_FOLDER_LIST IMGDIR"/folder.png" + +typedef struct _List_Item_Data List_Item_Data; +struct _List_Item_Data { + EmailMailboxUGD *ug_data; + email_move_list *move_folder; + + Elm_Object_Item *it; // Genlist Item pointer + Eina_Bool checked; // Check status + + GNode *child; +}; + +int create_mailbox_move_list_view(void *data, int account_id) +{ + debug_log(""); + EmailMailboxUGD *mailbox_ugd = (EmailMailboxUGD *)data; + + Evas_Object *genlist_for_move = elm_genlist_add(mailbox_ugd->navi_bar); + Evas_Object *btn = elm_button_add(mailbox_ugd->navi_bar); + elm_object_style_set(btn, "naviframe/end_btn/default"); + evas_object_smart_callback_add(btn, "clicked", _mailbox_list_move_cancel_cb, mailbox_ugd); + elm_naviframe_item_push(mailbox_ugd->navi_bar, dgettext("sys_string", "IDS_COM_BODY_MOVE"), btn, NULL, genlist_for_move, NULL); + + int i = 0; + int err = EMAIL_ERROR_NONE; + Elm_Object_Item *account_item = NULL; + int src_type = GET_ACCOUNT_SERVER_TYPE(account_id); + + if(mailbox_ugd->move_account_list && mailbox_ugd->move_account_cnt > 0) { + err = email_engine_free_account_list(&(mailbox_ugd->move_account_list), mailbox_ugd->move_account_cnt); + if (err == 0) { + debug_critical("fail to free account - err(%d)", err); + } + } + + err = email_engine_get_account_list(&(mailbox_ugd->move_account_cnt), &(mailbox_ugd->move_account_list)); + + if (err != EMAIL_ERROR_NONE || mailbox_ugd->move_account_cnt == 0 || !mailbox_ugd->move_account_list) { + debug_critical("fail to get account list- err(%d), count(%d), account_list(%p)", err, mailbox_ugd->move_account_cnt, mailbox_ugd->move_account_list); + return err; + } + email_move_list *move_list = (email_move_list *) calloc(mailbox_ugd->move_account_cnt, sizeof(email_move_list)); + memset((move_list), 0, (sizeof(email_move_list)*mailbox_ugd->move_account_cnt)); + + mailbox_ugd->move_list = move_list; + + itc_mailbox.item_style = "dialogue/3text.1icon/expandable"; + itc_mailbox.func.text_get = _gl_label_get; + itc_mailbox.func.content_get = _gl_icon_get; + itc_mailbox.func.state_get = _gl_state_get; + itc_mailbox.func.del = _gl_del; + itc_mailbox.decorate_all_item_style = NULL; + + for (i = 0; i < mailbox_ugd->move_account_cnt; i++) { + List_Item_Data *tree_item_data; + int mailbox_list_count = 0; + int err = 0; + email_mailbox_t *mailbox_list = NULL; + + err = email_get_mailbox_list_ex(mailbox_ugd->move_account_list[i].account_id, -1, 1, &mailbox_list, &mailbox_list_count); + if (err != EMAIL_ERROR_NONE) { + debug_critical("email_get_mailbox_list return error"); + } + move_list[i].mailbox_ugd = (EmailMailboxUGD *)data; + move_list[i].account_info = &(mailbox_ugd->move_account_list[i]); + move_list[i].mailbox_list = mailbox_list; + move_list[i].mailbox_cnt = mailbox_list_count; + + _make_folder_tree(&move_list[i], mailbox_ugd); + tree_item_data = calloc(1, sizeof(List_Item_Data)); + tree_item_data->ug_data = (EmailMailboxUGD *)data; + tree_item_data->move_folder = &move_list[i]; + tree_item_data->child = (GNode *)&move_list[i]; + + if(mailbox_ugd->move_account_list[i].account_id == account_id){ + tree_item_data->it = account_item = elm_genlist_item_append(genlist_for_move, &itc_mailbox, tree_item_data, NULL, ELM_GENLIST_ITEM_TREE, _gl_account_sel, tree_item_data); + } + else { + tree_item_data->it = elm_genlist_item_append(genlist_for_move, &itc_mailbox, tree_item_data, NULL, ELM_GENLIST_ITEM_TREE, _gl_account_sel, tree_item_data); + if(_mailbox_move_account_item_dim_state_get(src_type, mailbox_ugd->move_account_list[i].account_id)) { + elm_object_item_disabled_set(tree_item_data->it, EINA_TRUE); + } + } + } + + evas_object_smart_callback_add(genlist_for_move, "expanded", _gl_exp, data); + evas_object_smart_callback_add(genlist_for_move, "contracted", _gl_con, genlist_for_move); + + elm_genlist_item_expanded_set(account_item, 1); + elm_genlist_item_selected_set(account_item, EINA_FALSE); + + return 0; +} + +static void _make_folder_tree(email_move_list *move_list, void *data) +{ + debug_log(""); + EmailMailboxUGD *mailbox_ugd = (EmailMailboxUGD *)data; + + int i = 0; + int j = 0; + email_mailbox_t *mailbox_list = move_list->mailbox_list; + int mailbox_count = move_list->mailbox_cnt; + gchar **vector[mailbox_count]; + GNode *root = g_node_new(NULL); + + for (i=0; icurrent_parent = root; + for (j=0; jtraverse_compare = g_strdup(vector[i][j]); + mailbox_ugd->traverse_compare_mlist = &mailbox_list[i]; + g_node_traverse(mailbox_ugd->current_parent, G_IN_ORDER, G_TRAVERSE_ALL, -1, _check_duplicated_node, (gpointer)mailbox_ugd); + if (mailbox_ugd->b_duplicated_node == 1) { + GNode *child = g_node_new(mailbox_list+i); + email_mailbox_t *mlist = (email_mailbox_t *)(child->data); + email_mailbox_t *mlist_parent = (email_mailbox_t *)(mailbox_ugd->current_parent->data); + + mailbox_ugd->current_parent = g_node_insert(mailbox_ugd->current_parent, -1, child); + debug_log("*** parent:%s - child:%s", mlist_parent->mailbox_name, mlist->mailbox_name); + } + mailbox_ugd->b_duplicated_node = 0; + g_free(mailbox_ugd->traverse_compare); + mailbox_ugd->traverse_compare = NULL; + } + g_strfreev(vector[i]); + } + move_list->folder_root = root; +} + +static void _mailbox_list_move_cancel_cb(void *data, Evas_Object *obj, void *event_info) +{ + debug_log(""); + EmailMailboxUGD *mailbox_ugd = (EmailMailboxUGD *)data; + + if (_g_move_cancel_lock) + return; + else + _g_move_cancel_lock = true; + + _stop_emf_job(mailbox_ugd, mailbox_ugd->emf_handle, true); + elm_naviframe_item_pop(mailbox_ugd->navi_bar); + + if(mailbox_ugd->selected_list) { + g_list_free(mailbox_ugd->selected_list); + mailbox_ugd->selected_list = NULL; + } + clear_mailbox_move_list_data(mailbox_ugd); + + if (_g_move_lock) { + _g_move_lock = false; + } +} + +static Evas_Object *_gl_icon_get(void *data, Evas_Object *obj, const char *part) +{ + debug_log(""); + if (!data) { + debug_log("data is NULL"); + return NULL; + } + + List_Item_Data *item_data = (List_Item_Data *)data; + email_move_list *move_folder = item_data->move_folder; + + if (!strcmp(part, "elm.icon") || !strcmp(part, "elm.icon.1")) + { + Evas_Object *icon = elm_icon_add(obj); + + elm_image_file_set(icon, move_folder->account_info->logo_icon_path, NULL); + debug_log("logo_icon_path:%s", move_folder->account_info->logo_icon_path); + + evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); + + return icon; + } + else if (!strcmp(part, "elm.swallow.colorbar")) + { + account_user_data_t *user_data = (account_user_data_t *)move_folder->account_info->user_data; + unsigned int val = user_data->index_color; + int r = (val & 0xff000000) >> 24; + int g = (val & 0x00ff0000) >> 16; + int b = (val & 0x0000ff00) >> 8; + int a = val & 0x000000ff; + + Evas_Object *color_bar = evas_object_rectangle_add(evas_object_evas_get(obj)); + evas_object_size_hint_fill_set(color_bar, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_color_set(color_bar, r, g, b, a); + + return color_bar; + } + else + { + debug_log("part is invalid"); + } + + return NULL; +} + +static Evas_Object *_gl_icon_get_for_subitem(void *data, Evas_Object *obj, const char *part) +{ + debug_log(""); + if (!data) { + debug_log("data is NULL"); + return NULL; + } + + if (!strcmp(part, "elm.icon") || !strcmp(part, "elm.icon.1")) + { + Evas_Object *icon = elm_icon_add(obj); + elm_image_file_set(icon, FOLDER_ICON_PLUS_FOLDER_LIST, NULL); + evas_object_smart_callback_add(icon, "clicked", _folder_icon_clicked_cb, data); + evas_object_propagate_events_set(icon, EINA_FALSE); + evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); + return icon; + } + else + { + debug_log("part is invalid"); + } + + return NULL; +} + +static Evas_Object *_gl_icon_get_for_leafitem(void *data, Evas_Object *obj, const char *part) +{ + debug_log(""); + if (!data) { + debug_log("data is NULL"); + return NULL; + } + + if (!strcmp(part, "elm.icon") || !strcmp(part, "elm.icon.1")) + { + Evas_Object *icon = elm_icon_add(obj); + elm_image_file_set(icon, FOLDER_ICON_FOLDER_LIST, NULL); + evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); + + return icon; + } + else + { + debug_log("part is invalid"); + } + + return NULL; +} + +static char *_gl_label_get(void *data, Evas_Object *obj, const char *part) +{ + debug_log(""); + List_Item_Data *tree_item_data = (List_Item_Data *)data; + + if(!tree_item_data) { + debug_log("tree_item_data is NULL"); + return NULL; + } + email_move_list *move_folder = tree_item_data->move_folder; + + if (move_folder == NULL) { + debug_log("move_folder is NULL !!"); + return NULL; + } + + if (!strcmp(part, "elm.text.1")) { + if (move_folder->account_info->account_name != NULL) { + debug_log("account_name: %s", move_folder->account_info->account_name); + return g_strdup(move_folder->account_info->account_name); + } + } else if (!strcmp(part, "elm.text.2")) { + if (move_folder->account_info->user_email_address != NULL) { + debug_log("user_email_addr: %s", move_folder->account_info->user_email_address); + return g_strdup(move_folder->account_info->user_email_address); + } + } + + return NULL; +} + +static char *_gl_label_get_for_subitem(void *data, Evas_Object *obj, const char *part) +{ + debug_log(""); + List_Item_Data *tree_item_data = (List_Item_Data*)data; + + if(!tree_item_data) { + debug_log("tree_item_data is NULL"); + return NULL; + } + + GNode *node = (GNode *)tree_item_data->child; + email_mailbox_t *mlist = (email_mailbox_t *)(node->data); + + if (mlist == NULL) { + debug_log("mlist is NULL !!"); + return NULL; + } + + if (!strcmp(part, "elm.text")) { + if (mlist->alias != NULL) { + return g_strdup(mlist->alias); + } + } + + return NULL; +} + +static void _gl_del(void *data, Evas_Object *obj) +{ + debug_log(""); + List_Item_Data *item_data = (List_Item_Data *)data; + FREE(item_data); +} + +static Eina_Bool _gl_state_get(void *data, Evas_Object *obj, const char *part) +{ + debug_log(""); + return EINA_FALSE; +} + +static void _gl_account_sel(void *data, Evas_Object *obj, void *event_info) +{ + debug_log(""); + Eina_Bool expanded = EINA_FALSE; + if (event_info) + elm_genlist_item_selected_set(event_info, EINA_FALSE); + expanded = elm_genlist_item_expanded_get(event_info); + elm_genlist_item_expanded_set(event_info, !expanded); +} + +static void _gl_sel(void *data, Evas_Object *obj, void *event_info) +{ + debug_log(""); + if (data == NULL) { + debug_log("data is NULL"); + return; + } + email_move_list *move_list = (email_move_list *) data; + Elm_Object_Item *it = event_info; + List_Item_Data *item_data = elm_object_item_data_get((const Elm_Object_Item *)it); + + if (item_data == NULL) { + debug_log("item_data is NULL"); + return; + } + EmailMailboxUGD *mailbox_ugd = move_list->mailbox_ugd; + int post_rt = 0; + int i = 0, err = 0, task_id = 0; + email_mail_list_item_t* mail_info = NULL; + GNode *node = (GNode *)item_data->child; + email_mailbox_t *mlist = (email_mailbox_t *)(node->data); + int count = g_list_length(mailbox_ugd->selected_list); + int mail_ids[count]; + + elm_genlist_item_update(it); + debug_log("selected account_id : %d, selected mailbox_id : %d", move_list->account_info->account_id, mlist->mailbox_id); + + if(count < 0) { + debug_log("There's no selected mail."); + goto FINISH; + } + + memset(mail_ids, 0, sizeof(mail_ids)); + + GList* cur = g_list_first(mailbox_ugd->selected_list); + for( ; i < count ; i++, cur=g_list_next(cur)) { + mail_ids[i] = (int) g_list_nth_data(cur, 0); + debug_log("mail_id (%d)", mail_ids[i]); + } + + mail_info = get_mail_info(mail_ids[0]); + if(!mail_info) { + debug_log("get_mail_info is failed(mail_id : %d)", mail_ids[0]); + goto FINISH; + } + + if(mail_info->account_id == move_list->account_info->account_id) { + err = email_move_mail_to_mailbox(mail_ids, count, mlist->mailbox_id); + if (err != EMAIL_ERROR_NONE) { + debug_warning("email_move_mail_to_mailbox acct(%d) mailbox_id(%d) num(%d) - err (%d)", + move_list->account_info->account_id, mlist->mailbox_id, count, err); + } + if (err == EMAIL_ERROR_NONE && count >0) { + post_rt = status_message_post(dgettext("sys_string", "IDS_COM_POP_MOVED")); + if (post_rt) { + debug_log("fail to status_message_post() : %d\n", err); + } + } + } + else { + err = email_move_mails_to_mailbox_of_another_account(mail_info->mailbox_id, mail_ids, count, mlist->mailbox_id, &task_id); + if (err != EMAIL_ERROR_NONE) { + debug_warning("email_move_mails_to_mailbox_of_another_account src mailbox(%d), dest acc(%d) mailbox_id(%d) num(%d) - err (%d)", + mail_info->mailbox_id, move_list->account_info->account_id, mlist->mailbox_id, count, err); + } + } + + FREE(mail_info); + +FINISH: + g_list_free(mailbox_ugd->selected_list); + mailbox_ugd->selected_list = NULL; + + elm_naviframe_item_pop(mailbox_ugd->navi_bar); + + if(mailbox_ugd->view_type == EMAIL_VIEW_EDIT) + { + mailbox_ugd->view_type = mailbox_ugd->previous_view; + + _clear_checked_status(mailbox_ugd); + edit_list = eina_list_free(edit_list); + + elm_genlist_decorate_mode_set(mailbox_ugd->gl[mailbox_ugd->view_type], EINA_FALSE); + elm_genlist_reorder_mode_set(mailbox_ugd->gl[mailbox_ugd->view_type], EINA_FALSE); + elm_genlist_select_mode_set(mailbox_ugd->gl[mailbox_ugd->view_type], ELM_OBJECT_SELECT_MODE_DEFAULT); + + b_editmode = false; + elm_object_disabled_set(mailbox_ugd->folder_button, EINA_FALSE); + elm_genlist_realized_items_update(mailbox_ugd->gl[mailbox_ugd->view_type]); + _update_navigationbar_title(mailbox_ugd); + + if (mailbox_ugd->isRotate == true) { + email_rotate_landscape(mailbox_ugd); + } + } + + if (_g_move_lock) { + _g_move_lock = false; + } +} + +static void _gl_con(void *data, Evas_Object *obj, void *event_info) +{ + debug_log(""); + Elm_Object_Item *it = event_info; + + elm_genlist_item_selected_set(it, EINA_FALSE); + elm_genlist_item_subitems_clear(it); +} + +static void _gl_exp(void *data, Evas_Object *obj, void *event_info) +{ + debug_log(""); + + Elm_Object_Item *it = event_info; + Evas_Object *gl = elm_object_item_widget_get(it); + + itc_mailbox_subtree.item_style = "1text.1icon.2"; + itc_mailbox_subtree.func.text_get = _gl_label_get_for_subitem; + itc_mailbox_subtree.func.content_get = _gl_icon_get_for_subitem; + itc_mailbox_subtree.func.state_get = _gl_state_get; + itc_mailbox_subtree.func.del = _gl_del; + itc_mailbox_subtree.decorate_all_item_style = NULL; + + itc_mailbox_subtree2.item_style = "1text.1icon.2"; + itc_mailbox_subtree2.func.text_get = _gl_label_get_for_subitem; + itc_mailbox_subtree2.func.content_get = _gl_icon_get_for_leafitem; + itc_mailbox_subtree2.func.state_get = _gl_state_get; + itc_mailbox_subtree2.func.del = _gl_del; + itc_mailbox_subtree2.decorate_all_item_style = NULL; + + int i = 0; + int depth = elm_genlist_item_expanded_depth_get(it); + Elm_Object_Item *sub_it = NULL; + List_Item_Data *tree_item_data; + + debug_log("depth: %d", depth); + + if (depth == 0) { + List_Item_Data *item_data = (List_Item_Data *)elm_object_item_data_get((const Elm_Object_Item *)it); + if (item_data == NULL) { + debug_log("item data is NULL"); + return; + } + email_move_list *move_folder = item_data->move_folder; + + int n_children = g_node_n_children(move_folder->folder_root); + debug_log("n_children of root: %d", n_children); + + for (i = 0; i < n_children; i++) { + GNode *child = g_node_nth_child(move_folder->folder_root, i); + if (g_node_n_children(child) > 0) { + tree_item_data = calloc(1, sizeof(List_Item_Data)); + tree_item_data->ug_data = move_folder->mailbox_ugd; + tree_item_data->move_folder = move_folder; + tree_item_data->child = child; + sub_it = tree_item_data->it = elm_genlist_item_append(gl, &itc_mailbox_subtree, tree_item_data, it, + ELM_GENLIST_ITEM_TREE, _gl_exp_sel, move_folder); + if(_mailbox_move_folder_item_dim_state_get((email_mailbox_t *)(child->data), tree_item_data->ug_data)) { + elm_object_item_disabled_set(tree_item_data->it, EINA_TRUE); + } + //debug_log("move_folder: %p, tree_item_data:%p, tree_item_data->it : %p, it: %p, child: %p", move_folder, tree_item_data, tree_item_data->it, it, child); + } else { + tree_item_data = calloc(1, sizeof(List_Item_Data)); + tree_item_data->ug_data = move_folder->mailbox_ugd; + tree_item_data->move_folder = move_folder; + tree_item_data->child = child; + debug_log("tree_item_data : %p", tree_item_data); + tree_item_data->it = elm_genlist_item_append(gl, &itc_mailbox_subtree2, tree_item_data, it, + ELM_GENLIST_ITEM_NONE, _gl_sel, move_folder); + if(_mailbox_move_folder_item_dim_state_get((email_mailbox_t *)(child->data), tree_item_data->ug_data)) { + elm_object_item_disabled_set(tree_item_data->it, EINA_TRUE); + } + //debug_log("move_folder: %p, tree_item_data:%p, tree_item_data->it : %p, it: %p, child: %p", move_folder, tree_item_data, tree_item_data->it, it, child); + } + } + } + else if (depth > 0) { + List_Item_Data *item_data = (List_Item_Data *)elm_object_item_data_get((const Elm_Object_Item *)it); + if (item_data == NULL) { + debug_log("item data is NULL"); + return; + } + GNode *sub_root = (GNode *)item_data->child; + + int n_children = g_node_n_children(sub_root); + debug_log("n_children of sub_root depth[%d]: %d", depth, n_children); + + Elm_Object_Item *parent_it =it; + for (i = 0; i < depth; i++) + parent_it = elm_genlist_item_parent_get(parent_it); + + List_Item_Data *parent_item_data = elm_object_item_data_get((const Elm_Object_Item *)parent_it); + if (parent_item_data == NULL) { + debug_log("parent item data is NULL"); + return; + } + email_move_list *move_folder = item_data->move_folder; + + for (i = 0; i < n_children; i++) { + GNode *child = g_node_nth_child(sub_root, i); + if (g_node_n_children(child) > 0) { + tree_item_data = calloc(1, sizeof(List_Item_Data)); + tree_item_data->ug_data = move_folder->mailbox_ugd; + tree_item_data->move_folder = move_folder; + tree_item_data->child = child; + sub_it = tree_item_data->it = elm_genlist_item_append(gl, &itc_mailbox_subtree, tree_item_data, it, + ELM_GENLIST_ITEM_TREE, _gl_exp_sel, move_folder); + if(_mailbox_move_folder_item_dim_state_get((email_mailbox_t *)(child->data), tree_item_data->ug_data)) { + elm_object_item_disabled_set(tree_item_data->it, EINA_TRUE); + } + //debug_log("move_folder: %p, tree_item_data:%p, tree_item_data->it : %p, it: %p, child: %p", move_folder, tree_item_data, tree_item_data->it, it, child); + } else { + tree_item_data = calloc(1, sizeof(List_Item_Data)); + tree_item_data->ug_data = move_folder->mailbox_ugd; + tree_item_data->move_folder = move_folder; + tree_item_data->child = child; + tree_item_data->it = elm_genlist_item_append(gl, &itc_mailbox_subtree2, tree_item_data, it, + ELM_GENLIST_ITEM_NONE, _gl_sel, move_folder); + if(_mailbox_move_folder_item_dim_state_get((email_mailbox_t *)(child->data), tree_item_data->ug_data)) { + elm_object_item_disabled_set(tree_item_data->it, EINA_TRUE); + } + //debug_log("move_folder: %p, tree_item_data:%p, tree_item_data->it : %p, it: %p, child: %p", move_folder, tree_item_data, tree_item_data->it, it, child); + } + } + } +} + +static void _gl_exp_sel(void *data, Evas_Object *obj, void *event_info) +{ + debug_log(""); + if (!data) { + debug_log("data is NULL"); + return; + } + + email_move_list *move_list = (email_move_list *) data; + Elm_Object_Item *it = event_info; + List_Item_Data *item_data = elm_object_item_data_get((const Elm_Object_Item *)it); + + if (item_data == NULL) { + debug_log("item_data is NULL"); + return; + } + elm_genlist_item_selected_set(it, 0); + + Evas_Coord x, y = 0; + evas_pointer_canvas_xy_get(evas_object_evas_get(obj), &x, &y); + debug_log("X = %d, Y = %d", x, y); + + GNode *node = (GNode *)item_data->child; + email_mailbox_t *mlist = (email_mailbox_t *)(node->data); + EmailMailboxUGD *mailbox_ugd = move_list->mailbox_ugd; + gchar **vector = NULL; + vector = g_strsplit_set(mlist->mailbox_name, "/", -1); + int vlen = g_strv_length(vector); + + if (mailbox_ugd == NULL) { + debug_log("mailbox_ugd is NULL"); + return; + } + + int main_w = mailbox_ugd->main_w; + int main_h = mailbox_ugd->main_h; + debug_log("isRotate = %d, main_w: %d, main_h:%d", mailbox_ugd->isRotate, main_w, main_h); + + if (mailbox_ugd->isRotate == false) + { + if (x > 0 && x < (100+(vlen*28))) { + debug_log("Potrait Mode"); + return; + } + } else { + if (x > 0 && x < (100+(vlen*28))) { + debug_log("Landscape Mode"); + return; + } + } + g_strfreev(vector); + + if (mailbox_ugd->isRotate == false) + { + if (x > 0 && x < 148) { + debug_log("Potrait Mode"); + return; + } + } else { + if (x > 0 && x < 148) { + debug_log("Landscape Mode"); + return; + } + } + + int post_rt = 0; + int i = 0, err = 0, task_id = 0; + email_mail_list_item_t* mail_info = NULL; + int count = g_list_length(mailbox_ugd->selected_list); + int mail_ids[count]; + + elm_genlist_item_update(it); + debug_log("selected account_id : %d, selected mailbox_id : %d", move_list->account_info->account_id, mlist->mailbox_id); + + if(count < 0) { + debug_log("There's no selected mail."); + goto FINISH; + } + + memset(mail_ids, 0, sizeof(mail_ids)); + + GList* cur = g_list_first(mailbox_ugd->selected_list); + for( ; i < count ; i++, cur=g_list_next(cur)) { + mail_ids[i] = (int) g_list_nth_data(cur, 0); + debug_log("mail_id (%d)", mail_ids[i]); + } + + mail_info = get_mail_info(mail_ids[0]); + if(!mail_info) { + debug_log("get_mail_info is failed(mail_id : %d)", mail_ids[0]); + goto FINISH; + } + + if(mail_info->account_id == move_list->account_info->account_id) { + err = email_move_mail_to_mailbox(mail_ids, count, mlist->mailbox_id); + if (err != EMAIL_ERROR_NONE) { + debug_warning("email_move_mail_to_mailbox acct(%d) mailbox_id(%d) num(%d) - err (%d)", + move_list->account_info->account_id, mlist->mailbox_id, count, err); + } + } + else { + err = email_move_mails_to_mailbox_of_another_account(mail_info->mailbox_id, mail_ids, count, mlist->mailbox_id, &task_id); + if (err != EMAIL_ERROR_NONE) { + debug_warning("email_move_mails_to_mailbox_of_another_account src mailbox(%d), dest acc(%d) mailbox_id(%d) num(%d) - err (%d)", + mail_info->mailbox_id, move_list->account_info->account_id, mlist->mailbox_id, count, err); + } + } + + if (err == EMAIL_ERROR_NONE && count >0) { + post_rt = status_message_post(dgettext("sys_string", "IDS_COM_POP_MOVED")); + if (post_rt) { + debug_log("fail to status_message_post() : %d\n", err); + } + } + FREE(mail_info); + + FINISH: + g_list_free(mailbox_ugd->selected_list); + mailbox_ugd->selected_list = NULL; + + elm_naviframe_item_pop(mailbox_ugd->navi_bar); + + if(mailbox_ugd->view_type == EMAIL_VIEW_EDIT) + { + mailbox_ugd->view_type = mailbox_ugd->previous_view; + + edit_list = eina_list_free(edit_list); + + elm_genlist_decorate_mode_set(mailbox_ugd->gl[mailbox_ugd->view_type], EINA_FALSE); + elm_genlist_reorder_mode_set(mailbox_ugd->gl[mailbox_ugd->view_type], EINA_FALSE); + elm_genlist_select_mode_set(mailbox_ugd->gl[mailbox_ugd->view_type], ELM_OBJECT_SELECT_MODE_DEFAULT); + + b_editmode = false; + elm_object_disabled_set(mailbox_ugd->folder_button, EINA_FALSE); + _update_navigationbar_title(mailbox_ugd); + + if (mailbox_ugd->isRotate == true) { + email_rotate_landscape(mailbox_ugd); + } + } + + if (_g_move_lock) { + _g_move_lock = false; + } + +} + +static gboolean _check_duplicated_node(GNode *node, gpointer data) +{ + debug_log(""); + if (!data) { + debug_log("data is NULL"); + return FALSE; + } + + if (!node) { + debug_log("node is NULL"); + return FALSE; + } + + if (!(node->data)) { + debug_log("node data is NULL"); + return FALSE; + } + + gboolean b_search_parent = FALSE; + EmailMailboxUGD *mailbox_ugd = (EmailMailboxUGD *)data; + email_mailbox_t *node_data = (email_mailbox_t *)node->data; + gchar **vector = NULL; + vector = g_strsplit_set(node_data->mailbox_name, "/", -1); + int vlen = g_strv_length(vector); + + + gchar **vector2 = NULL; + vector2 = g_strsplit_set(mailbox_ugd->traverse_compare_mlist->mailbox_name, "/", -1); + int vlen2 = g_strv_length(vector2); + gchar *foler_name = g_strdup(vector2[vlen2-1]); + gchar* retval = g_strdup(mailbox_ugd->traverse_compare_mlist->mailbox_name); + gchar* ptr = NULL; + ptr = g_strrstr_len(retval, -1, foler_name); + if (ptr != NULL && vlen > 1 && vlen2 > 1){ + gchar* temp = g_strndup(retval, ptr-retval-1); + b_search_parent = TRUE; + g_free(retval); + retval = g_strdup(temp); + g_free(temp); + } + if(node_data->mailbox_id == mailbox_ugd->traverse_compare_mlist->mailbox_id + || vlen != (vlen2-1)) + { + g_free(retval); + g_strfreev(vector); + g_strfreev(vector2); + return FALSE; + } + + if ((b_search_parent == FALSE && g_strcmp0(vector[vlen-1], mailbox_ugd->traverse_compare) == 0) + ||( b_search_parent == TRUE && g_strcmp0(node_data->mailbox_name, retval) == 0)) { + mailbox_ugd->b_duplicated_node = 1; + mailbox_ugd->current_parent = node; + debug_log("** find dup(%s), b_search_parent(%d)", vector[vlen-1], b_search_parent); + + g_free(retval); + g_strfreev(vector); + g_strfreev(vector2); + return TRUE; + } + + g_free(retval); + g_strfreev(vector); + g_strfreev(vector2); + return FALSE; +} + +static gboolean _mailbox_move_folder_item_dim_state_get(email_mailbox_t *mlist, EmailMailboxUGD *mailbox_ugd) +{ + debug_log(""); + + if(mlist && mailbox_ugd) { + if (mlist->mailbox_id != mailbox_ugd->move_src_mailbox_id && + mlist->mailbox_type != EMAIL_MAILBOX_TYPE_OUTBOX && + mlist->mailbox_type != EMAIL_MAILBOX_TYPE_SENTBOX && + mlist->mailbox_type != EMAIL_MAILBOX_TYPE_DRAFT && + mlist->mailbox_type != EMAIL_MAILBOX_TYPE_TRASH && + mlist->mailbox_type != EMAIL_MAILBOX_TYPE_ALL_EMAILS && + mlist->mailbox_type != EMAIL_MAILBOX_TYPE_SEARCH_RESULT) { + if (g_strcmp0(mlist->alias, "[Gmail]") && !mlist->no_select) { + return FALSE; + } else { + return TRUE; + } + } else { + return TRUE; + } + } + + return FALSE; +} + +static gboolean _mailbox_move_account_item_dim_state_get(int src_account_type, int account_id) +{ + debug_log(""); + int type = GET_ACCOUNT_SERVER_TYPE(account_id); + + if(src_account_type == EMAIL_SERVER_TYPE_POP3 || src_account_type == EMAIL_SERVER_TYPE_IMAP4) { + if(type == EMAIL_SERVER_TYPE_ACTIVE_SYNC) { + return TRUE; + } + } else if (src_account_type == EMAIL_SERVER_TYPE_ACTIVE_SYNC) { + return TRUE; + } else { + return TRUE; + } + + return FALSE; +} + +static void _folder_icon_clicked_cb(void *data, Evas_Object *obj, void *event_info) +{ + debug_log(""); + List_Item_Data *item_data = (List_Item_Data *)data; + Eina_Bool expanded = EINA_FALSE; + + if (item_data->it) + elm_genlist_item_selected_set(item_data->it, EINA_FALSE); + expanded = elm_genlist_item_expanded_get(item_data->it); + elm_genlist_item_expanded_set(item_data->it, !expanded); + + if (expanded) { + elm_image_file_set(obj, FOLDER_ICON_MINUS_FOLDER_LIST, NULL); + } else { + elm_image_file_set(obj, FOLDER_ICON_PLUS_FOLDER_LIST, NULL); + } + +} +void clear_mailbox_move_list_data(EmailMailboxUGD *mailbox_ugd) +{ + debug_log(""); + int err = EMAIL_ERROR_NONE; + int i = 0; + + if(!mailbox_ugd) { + debug_log("data(mailbox_ugd) is NULL"); + return; + } + + if(mailbox_ugd->move_list) { + email_move_list *move_list = mailbox_ugd->move_list; + for (i = 0; i < mailbox_ugd->move_account_cnt; i++) { + if(move_list[i].mailbox_list) { + err = email_free_mailbox(&(move_list[i].mailbox_list), move_list[i].mailbox_cnt); + if (err != EMAIL_ERROR_NONE) { + debug_critical("fail to free mailbox list - err(%d)", err); + } + } + } + err = email_engine_free_account_list(&(mailbox_ugd->move_account_list), mailbox_ugd->move_account_cnt); + if (err == 0) { + debug_critical("fail to free account - err(%d)", err); + } + } + + FREE(mailbox_ugd->move_list); + mailbox_ugd->move_list = NULL; + debug_log("mailbox_ugd->move_account_cnt : %d", mailbox_ugd->move_account_cnt); + mailbox_ugd->move_account_cnt = 0; + +} diff --git a/mailbox/src/email-mailbox-noti-mgr.c b/mailbox/src/email-mailbox-noti-mgr.c index c74a521..213d162 100755 --- a/mailbox/src/email-mailbox-noti-mgr.c +++ b/mailbox/src/email-mailbox-noti-mgr.c @@ -19,6 +19,8 @@ #include "email-mailbox-list.h" #include "email-mailbox-search.h" #include "email-mailbox-noti-mgr.h" +#include "email-mailbox-move.h" + E_DBus_Connection *_g_mailbox_conn = NULL; @@ -39,7 +41,9 @@ static void add_seed_mail_cb(void *data, Ecore_Thread *thd, void* msg_data); static gint _find_insert_position(gconstpointer a, gconstpointer b); static gint _find_next_group_position(gconstpointer a, gconstpointer b); static void _parse_set_flag_buf(char *inbuf, char **field_name, GList **mail_list); - +static void _mailbox_create_error_popup(int error_type, void *data); +static void _popup_destroy_cb(void *data, Evas_Object *obj, void *event_info); +static void _mailbox_remove_deleted_flag_mail(int mail_id, void *data); static gint _find_next_group_position(gconstpointer a, gconstpointer b) { @@ -486,9 +490,9 @@ static void _edbus_event_mailbox_receive(void *local_data, DBusMessage *message) mailbox_ugd->account_id = 0; mailbox_ugd->mode = EMAIL_MAILBOX_MODE_ALL; - mailbox_ugd->mailbox_type = EMAIL_MAILBOX_TYPE_NONE; + mailbox_ugd->mailbox_type = EMAIL_MAILBOX_TYPE_INBOX; mailbox_ugd->mailbox_id = 0; - FREE(mailbox_ugd->user_email); + FREE(mailbox_ugd->account_name); FREE(mailbox_ugd->folder_alias); switch(view_type) @@ -519,9 +523,13 @@ static void _edbus_event_mailbox_receive(void *local_data, DBusMessage *message) break; case NOTI_MAIL_MOVE: + debug_log("NOTI_MAIL_MOVE"); account_id = data1; msg_buf = data3; + if(mailbox_ugd->move_account_list && mailbox_ugd->move_account_cnt > 0) + clear_mailbox_move_list_data(mailbox_ugd); + if(view_type == EMAIL_VIEW_RECIPIENT) { _refresh_mailbox(mailbox_ugd); } @@ -542,6 +550,7 @@ static void _edbus_event_mailbox_receive(void *local_data, DBusMessage *message) break; case NOTI_MAIL_DELETE: + debug_log("NOTI_MAIL_DELETE"); account_id = data1; msg_buf = data3; @@ -565,6 +574,7 @@ static void _edbus_event_mailbox_receive(void *local_data, DBusMessage *message) break; case NOTI_MAIL_ADD: /* Seed mail was received */ + debug_log("NOTI_MAIL_ADD"); account_id = data1; thread_id = data4; mailid = data2; @@ -687,6 +697,18 @@ static void _edbus_event_mailbox_receive(void *local_data, DBusMessage *message) switch (update_type) { + case EMAIL_MAIL_ATTRIBUTE_FLAGS_DELETED_FIELD: + debug_log("DELETED FILED UPDATE"); + if(mailbox_ugd->move_account_list && mailbox_ugd->move_account_cnt > 0) { + clear_mailbox_move_list_data(mailbox_ugd); + status_message_post(dgettext("sys_string", "IDS_COM_POP_MOVED")); + } + + G_LIST_FOREACH(mail_list, cur, idx) { + debug_log("idx: [%d]", *idx); + _mailbox_remove_deleted_flag_mail(*idx, mailbox_ugd); + } + break; case EMAIL_MAIL_ATTRIBUTE_FLAGS_SEEN_FIELD: G_LIST_FOREACH(mail_list, cur, idx) { debug_log("idx: [%d]", *idx); @@ -728,6 +750,17 @@ static void _edbus_event_mailbox_receive(void *local_data, DBusMessage *message) } } break; + case EMAIL_MAIL_ATTRIBUTE_SAVE_STATUS: + G_LIST_FOREACH(mail_list, cur, idx) { + + debug_log("idx: [%d]", *idx); + list_data *ld = _find_mailinfo_by_mailid(*idx, mailbox_ugd->list_data[view_type]); + if(ld) { + ld->mail_status = value; + elm_genlist_item_update(ld->item); + } + } + break; } if(mail_list) { G_LIST_FOREACH(mail_list, cur, idx) { @@ -793,6 +826,9 @@ static void _edbus_event_mailbox_receive(void *local_data, DBusMessage *message) evas_object_show(mailbox_ugd->update_button); } + if(data4 != EMAIL_ERROR_NONE) + _mailbox_create_error_popup(data4, local_data); + if(subtype == NOTI_DOWNLOAD_FAIL && (data4 == EMAIL_ERROR_LOGIN_FAILURE || data4 == EMAIL_ERROR_AUTHENTICATE)) { int mailbox_id = 0; if(data2) @@ -872,5 +908,89 @@ static void _parse_set_flag_buf(char *inbuf, char **field_name, GList **mail_lis g_strfreev(outer_tok); } +static void _mailbox_create_error_popup(int error_type, void *data) +{ + debug_log(""); + EmailMailboxUGD *mailbox_ugd = (EmailMailboxUGD *)data; + Evas_Object *popup = NULL, *btn1 = NULL; + char *popup_text = NULL; + + switch(error_type) + { + case EMAIL_ERROR_ACCOUNT_IS_BLOCKED: + popup_text = _("IDS_EMAIL_POP_UNABLE_TO_CONNECT_TO_SERVER"); + break; + + default: + debug_log("Can't find error string. error_type : %d", error_type); + break; + } + + if(popup_text) { + popup = elm_popup_add(mailbox_ugd->win_main); + evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_object_text_set(popup, popup_text); + btn1 = elm_button_add(popup); + elm_object_text_set(btn1, dgettext("sys_string", "IDS_COM_SK_OK")); + elm_object_part_content_set(popup, "button1", btn1); + evas_object_smart_callback_add(btn1, "clicked", _popup_destroy_cb, popup); + evas_object_show(popup); + debug_log("error_type : %d", error_type); + } +} + +static void _popup_destroy_cb(void *data, Evas_Object *obj, void *event_info) +{ + debug_log(""); + if(data) { + evas_object_del(data); + } else { + debug_log("popup destroy failed, data is null"); + } +} + +static void _mailbox_remove_deleted_flag_mail(int mail_id, void *data) +{ + debug_log(""); + EmailMailboxUGD *mailbox_ugd = (EmailMailboxUGD *)data; + int view_type = mailbox_ugd->view_type; + if(mail_id <= 0) { + debug_log("Invalid parameter(mail_id)"); + return; + } + debug_log("mail_id : %d view_type : %d, mailbox_ugd->mode : %d", mail_id, view_type, mailbox_ugd->mode); + list_data *ld = _find_mailinfo_by_mailid(mail_id, mailbox_ugd->list_data[view_type]); + if(ld) { + debug_log("list data exist"); + if(view_type != EMAIL_VIEW_EDIT && view_type != EMAIL_VIEW_SEARCH) + { + debug_log("ld->mailbox_type %d ld->mailbox_id :%d, mailbox_ugd->mailbox_id : %d", ld->mailbox_type, ld->mailbox_id, mailbox_ugd->mailbox_id); + if ((mailbox_ugd->mode == EMAIL_MAILBOX_MODE_ALL && mailbox_ugd->mailbox_type == ld->mailbox_type) + || (mailbox_ugd->mode == EMAIL_MAILBOX_MODE_MAILBOX && ld->mailbox_id == mailbox_ugd->mailbox_id)) { + debug_log("Remove mail from list mail_id : %d", ld->mail_id); + mailbox_delete_mail_item_from_list(mailbox_ugd, ld); + /* to be checked + if(!g_list_length(mailbox_ugd->list_data[view_type])) + { + debug_log("list_lock : %d", list_lock); + if (!list_lock) { + if (evas_object_visible_get(mailbox_ugd->gl[view_type])) + evas_object_hide(mailbox_ugd->gl[view_type]); + } + Evas_Object *no_content = elm_object_part_content_get(mailbox_ugd->search_layout, "noc"); + elm_layout_theme_set(no_content, "layout", "nocontents", "text"); + elm_object_part_text_set(no_content, "elm.text", dgettext("sys_string", "IDS_COM_BODY_NO_CONTENTS")); + edje_object_signal_emit(_EDJ(mailbox_ugd->search_layout), "hide_list", "elm"); + edje_object_signal_emit(_EDJ(mailbox_ugd->search_layout), "show_noc", "elm"); + if (mailbox_ugd->delete_all_button != NULL) { + elm_object_item_disabled_set(mailbox_ugd->delete_all_button, EINA_TRUE); + } + list_lock = true; + }*/ + } + } + } + +} diff --git a/mailbox/src/email-mailbox-search.c b/mailbox/src/email-mailbox-search.c index 266180b..1d151ab 100755 --- a/mailbox/src/email-mailbox-search.c +++ b/mailbox/src/email-mailbox-search.c @@ -24,6 +24,7 @@ #include "email-common-types.h" #include "email-mailbox.h" #include "email-mailbox-list.h" +#include "email-mailbox-controlbar.h" #include "email-mailbox-search.h" @@ -96,15 +97,17 @@ void mailbox_create_searchbar(EmailMailboxUGD *mailbox_ugd) evas_object_size_hint_weight_set(searchbar_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(searchbar_layout, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_object_part_content_set(mailbox_ugd->sub_layout[mailbox_ugd->view_type], "searchbar", searchbar_layout); + //elm_object_part_content_set(mailbox_ugd->sub_layout[mailbox_ugd->view_type], "searchbar", searchbar_layout); //searchbar category button mailbox_ugd->searchby_button = elm_button_add(searchbar_layout); Evas_Object *searchby_icon = elm_icon_add(mailbox_ugd->searchby_button); - elm_image_file_set(searchby_icon, IMGDIR"/M02_email_icon_popup_all_press.png", NULL); - elm_image_resizable_set(searchby_icon, 0, 0); + elm_image_file_set(searchby_icon, IMGDIR"/M02_popup_icon_all.png", NULL); + elm_image_resizable_set(searchby_icon, EINA_TRUE, EINA_TRUE); evas_object_image_smooth_scale_set(searchby_icon, 0); elm_object_content_set(mailbox_ugd->searchby_button, searchby_icon); + elm_object_style_set(mailbox_ugd->searchby_button, "circle/empty"); + evas_object_smart_callback_add(mailbox_ugd->searchby_button, "clicked", _searchby_clicked_cb, mailbox_ugd); mailbox_ugd->search_type = EMAIL_SEARCH_ALL; @@ -183,20 +186,20 @@ static void _searchby_clicked_cb(void *data, Evas_Object *obj, void *event_info) mailbox_ugd->searchby_ctx_popup = NULL; } - mailbox_ugd->searchby_ctx_popup = elm_ctxpopup_add(mailbox_ugd->navi_bar); + mailbox_ugd->searchby_ctx_popup = elm_ctxpopup_add(mailbox_ugd->win_main); evas_object_smart_callback_add(mailbox_ugd->searchby_ctx_popup, "dismissed", _searchby_dismissed_cb, mailbox_ugd); Evas_Object* icon; icon = elm_icon_add(mailbox_ugd->searchby_ctx_popup); - elm_image_file_set(icon, IMGDIR "/M02_email_icon_popup_all.png", NULL); + elm_image_file_set(icon, IMGDIR "/M02_popup_icon_all.png", NULL); elm_ctxpopup_item_append(mailbox_ugd->searchby_ctx_popup, dgettext("sys_string", "IDS_COM_BODY_ALL"), icon, _searchby_ctxpopup_cb, mailbox_ugd); icon = elm_icon_add(mailbox_ugd->searchby_ctx_popup); - elm_image_file_set(icon, IMGDIR "/M02_email_icon_popup_title.png", NULL); + elm_image_file_set(icon, IMGDIR "/M02_popup_icon_title.png", NULL); elm_ctxpopup_item_append(mailbox_ugd->searchby_ctx_popup, dgettext("sys_string", "IDS_COM_BODY_DETAILS_TITLE"), icon, _searchby_ctxpopup_cb, mailbox_ugd); icon = elm_icon_add(mailbox_ugd->searchby_ctx_popup); - elm_image_file_set(icon, IMGDIR "/M02_email_icon_popup_sender.png", NULL); + elm_image_file_set(icon, IMGDIR "/M02_popup_icon_sender.png", NULL); if ((mailbox_ugd->mailbox_type == EMAIL_MAILBOX_TYPE_SENTBOX) || (mailbox_ugd->mailbox_type == EMAIL_MAILBOX_TYPE_OUTBOX) @@ -207,11 +210,11 @@ static void _searchby_clicked_cb(void *data, Evas_Object *obj, void *event_info) } icon = elm_icon_add(mailbox_ugd->searchby_ctx_popup); - elm_image_file_set(icon, IMGDIR "/M02_email_icon_popup_date.png", NULL); + elm_image_file_set(icon, IMGDIR "/M02_popup_icon_date.png", NULL); elm_ctxpopup_item_append(mailbox_ugd->searchby_ctx_popup, _("IDS_EMAIL_OPT_DATE"), icon, _searchby_ctxpopup_cb, mailbox_ugd); icon = elm_icon_add(mailbox_ugd->searchby_ctx_popup); - elm_image_file_set(icon, IMGDIR "/M02_email_icon_popup_advanced.png", NULL); + elm_image_file_set(icon, IMGDIR "/M02_popup_icon_advanced.png", NULL); elm_ctxpopup_item_append(mailbox_ugd->searchby_ctx_popup, _("IDS_EMAIL_OPT_ADVANCED"), icon, _searchby_ctxpopup_cb, mailbox_ugd); _move_searchby_ctxpopup(mailbox_ugd->searchby_ctx_popup, obj); @@ -282,26 +285,26 @@ static void _searchby_ctxpopup_cb(void *data, Evas_Object *obj, void *event_info if (search_type == EMAIL_SEARCH_ALL) // All { - elm_image_file_set(searchby_icon, IMGDIR"/M02_email_icon_popup_all_press.png", NULL); + elm_image_file_set(searchby_icon, IMGDIR"/M02_popup_icon_all.png", NULL); } else if (search_type == EMAIL_SEARCH_SUBJECT) // SUBJECT { - elm_image_file_set(searchby_icon, IMGDIR"/M02_email_icon_popup_title_press.png", NULL); + elm_image_file_set(searchby_icon, IMGDIR"/M02_popup_icon_title.png", NULL); } else if (search_type == EMAIL_SEARCH_FROM || search_type == EMAIL_SEARCH_TO) // FROM or Recipient(TO) { - elm_image_file_set(searchby_icon, IMGDIR"/M02_email_icon_popup_sender_press.png", NULL); + elm_image_file_set(searchby_icon, IMGDIR"/M02_popup_icon_sender.png", NULL); } else if (search_type == EMAIL_SEARCH_DATE) // Date { - elm_image_file_set(searchby_icon, IMGDIR"/M02_email_icon_popup_date_press.png", NULL); + elm_image_file_set(searchby_icon, IMGDIR"/M02_popup_icon_date.png", NULL); } else if (search_type == EMAIL_SEARCH_ADVANCED) // Advanced { - elm_image_file_set(searchby_icon, IMGDIR"/M02_email_icon_popup_advanced_press.png", NULL); + elm_image_file_set(searchby_icon, IMGDIR"/M02_popup_icon_advanced.png", NULL); } - elm_image_resizable_set(searchby_icon, 0, 0); + elm_image_resizable_set(searchby_icon, EINA_TRUE, EINA_TRUE); evas_object_image_smooth_scale_set(searchby_icon, 0); elm_object_content_set(mailbox_ugd->searchby_button, searchby_icon); @@ -354,14 +357,10 @@ static void _searchbar_entry_focus_cb(void *data, Evas_Object *obj, void *event_ } elm_genlist_realized_items_update(mailbox_ugd->gl[mailbox_ugd->view_type]); - - //elm_object_item_part_content_unset(mailbox_ugd->navibar_item[mailbox_ugd->view_type], "controlbar"); - //_delete_controlbar(mailbox_ugd); - elm_object_item_signal_emit(mailbox_ugd->navibar_item[mailbox_ugd->view_type], "elm,state,controlbar,close", ""); + _hide_toolbar(mailbox_ugd); debug_log("view_type = %d", mailbox_ugd->view_type); - elm_object_item_text_set(mailbox_ugd->navibar_item[mailbox_ugd->view_type], _("IDS_EMAIL_HEADER_SEARCH")); mailbox_ugd->previous_view = mailbox_ugd->view_type; mailbox_ugd->view_type = EMAIL_VIEW_SEARCH; @@ -432,18 +431,34 @@ void mailbox_finish_search_mode(EmailMailboxUGD *mailbox_ugd) evas_object_smart_callback_del(mailbox_ugd->searchbar_en, "changed", _searchbar_entry_changed_cb); elm_entry_entry_set(mailbox_ugd->searchbar_en, ""); + elm_object_signal_emit(mailbox_ugd->searchbar_area, "elm,state,eraser,hide", "elm"); elm_object_signal_emit(mailbox_ugd->searchbar_area, "elm,state,guidetext,show", "elm"); elm_object_signal_emit(mailbox_ugd->searchbar_area, "cancel,out", ""); elm_object_focus_set(mailbox_ugd->searchbar_area, EINA_FALSE); elm_object_focus_set(mailbox_ugd->gl[mailbox_ugd->view_type], EINA_TRUE); - elm_object_disabled_set(mailbox_ugd->folder_button, EINA_FALSE); mailbox_ugd->view_type = mailbox_ugd->previous_view; list_lock = false; - _update_navigationbar_title(mailbox_ugd); + if (!evas_object_visible_get(mailbox_ugd->navi_title_ly)) { + debug_log("title is not visible, show title. view_type:%d, previous_view:%d", mailbox_ugd->view_type, mailbox_ugd->previous_view); + elm_object_item_part_content_set(mailbox_ugd->navibar_item[mailbox_ugd->view_type], "title", mailbox_ugd->navi_title_ly); + evas_object_show(mailbox_ugd->navi_title_ly); + } + + + if (evas_object_visible_get(mailbox_ugd->searchbar_layout)) { + debug_log("search_bar is visible, hide search bar"); + elm_entry_entry_set(mailbox_ugd->searchbar_en, ""); + elm_object_focus_set(mailbox_ugd->searchbar_layout, EINA_FALSE); + elm_object_part_content_unset(mailbox_ugd->search_layout, "searchbar"); + edje_object_signal_emit(_EDJ(mailbox_ugd->search_layout), "hide_searchbar", "search"); + evas_object_hide(mailbox_ugd->searchbar_layout); + } + + _show_toolbar(mailbox_ugd); _refresh_mailbox(mailbox_ugd); } @@ -562,7 +577,7 @@ static Eina_Bool _mailbox_create_search_criteria_view(int search_type, void *dat if ( search_type == EMAIL_SEARCH_ADVANCED ) { navi_item = elm_naviframe_item_push(mailbox_ugd->navi_bar, _("IDS_EMAIL_OPT_ADVANCED"), btn_back, NULL, genlist_for_search, NULL); } else if ( search_type == EMAIL_SEARCH_DATE ) { - navi_item = elm_naviframe_item_push(mailbox_ugd->navi_bar, N_("Date range"), btn_back, NULL, genlist_for_search, NULL); + navi_item = elm_naviframe_item_push(mailbox_ugd->navi_bar, _("IDS_EMAIL_HEADER_DATE_RANGE"), btn_back, NULL, genlist_for_search, NULL); } btn_ok = elm_button_add(mailbox_ugd->navi_bar); @@ -573,8 +588,6 @@ static Eina_Bool _mailbox_create_search_criteria_view(int search_type, void *dat _mailbox_advanced_view_create_controlbar_button(btn_cancel, dgettext("sys_string", "IDS_COM_SK_CANCEL"), NULL, _mailbox_advanced_search_cancel_cb, data); elm_object_item_part_content_set(navi_item, "title_right_btn", btn_cancel); - elm_object_item_signal_emit(mailbox_ugd->navibar_item[mailbox_ugd->view_type], "elm,state,controlbar,close", ""); - return 0; } void _mailbox_free_search_list_data(MailboxAdvSearchViewInfo *search_info) @@ -611,14 +624,31 @@ static void _mailbox_advanced_search_cancel_cb(void *data, Evas_Object *obj, voi elm_naviframe_item_pop(mailbox_ugd->navi_bar); mailbox_ugd->b_advanced_search_view = false; - if(g_focus_lock) { - evas_object_smart_callback_del(mailbox_ugd->searchbar_en, "changed", _searchbar_entry_changed_cb); - evas_object_smart_callback_del(mailbox_ugd->searchbar_en, "preedit,changed", _searchbar_entry_changed_cb); + evas_object_smart_callback_del(mailbox_ugd->searchbar_en, "changed", _searchbar_entry_changed_cb); + evas_object_smart_callback_del(mailbox_ugd->searchbar_en, "preedit,changed", _searchbar_entry_changed_cb); + + if(g_focus_lock) { elm_object_focus_set(mailbox_ugd->main_back_btn, EINA_TRUE); mailbox_finish_search_mode(mailbox_ugd); - }else { - _update_navigationbar_title(mailbox_ugd); + } else { + elm_object_focus_set(mailbox_ugd->gl[mailbox_ugd->view_type], EINA_TRUE); + + if (!evas_object_visible_get(mailbox_ugd->navi_title_ly)) { + debug_log("title is not visible, show title. view_type:%d, previous_view:%d", mailbox_ugd->view_type, mailbox_ugd->previous_view); + elm_object_item_part_content_set(mailbox_ugd->navibar_item[mailbox_ugd->view_type], "title", mailbox_ugd->navi_title_ly); + evas_object_show(mailbox_ugd->navi_title_ly); + } + + if (evas_object_visible_get(mailbox_ugd->searchbar_layout)) { + debug_log("search_bar is visible, hide search bar"); + elm_entry_entry_set(mailbox_ugd->searchbar_en, ""); + elm_object_focus_set(mailbox_ugd->searchbar_layout, EINA_FALSE); + elm_object_part_content_unset(mailbox_ugd->search_layout, "searchbar"); + edje_object_signal_emit(_EDJ(mailbox_ugd->search_layout), "hide_searchbar", "search"); + evas_object_hide(mailbox_ugd->searchbar_layout); + } + _show_toolbar(mailbox_ugd); } } @@ -653,8 +683,6 @@ static void _mailbox_advanced_search_start_cb(void *data, Evas_Object *obj, void mailbox_ugd->b_advanced_search_view = false; - elm_object_item_signal_emit(mailbox_ugd->navibar_item[mailbox_ugd->view_type], "elm,state,controlbar,close", ""); - elm_object_item_text_set(mailbox_ugd->navibar_item[mailbox_ugd->view_type], _("IDS_EMAIL_HEADER_SEARCH")); if(!g_focus_lock) { @@ -697,13 +725,13 @@ static void _mailbox_create_list_view_for_advanced_search(void *data, int search i = 2; item_data[i].type = MAILBOX_SEARCH_LIST_TYPE_TITLE; item_data[i].search_info = mailbox_ugd->adv_search_info; - item = elm_genlist_item_append(genlist_for_search, &itc_search_view, &item_data[i], NULL, + elm_genlist_item_append(genlist_for_search, &itc_search_view, &item_data[i], NULL, ELM_GENLIST_ITEM_NONE, _gl_advanced_search_sel_cb, &item_data[i]); /* Sender */ i = 3; item_data[i].type = MAILBOX_SEARCH_LIST_TYPE_SENDER; item_data[i].search_info = mailbox_ugd->adv_search_info; - item = elm_genlist_item_append(genlist_for_search, &itc_search_view, &item_data[i], NULL, + elm_genlist_item_append(genlist_for_search, &itc_search_view, &item_data[i], NULL, ELM_GENLIST_ITEM_NONE, _gl_advanced_search_sel_cb, &item_data[i]); } else if (search_type == EMAIL_SEARCH_DATE) { item_data = (mailbox_search_list_item *)calloc(2, sizeof(mailbox_search_list_item)); @@ -859,7 +887,7 @@ static Evas_Object *_gl_advanced_searcn_view_content_get_cb(void *data, Evas_Obj search_info->from_date = t; //should be replaced with new string elm_object_part_content_set(search_info->search_date_from, "elm.icon", search_info->entry_date_from); - elm_object_part_text_set(search_info->search_date_from, "elm.text", N_("From")); + elm_object_part_text_set(search_info->search_date_from, "elm.text", _("IDS_EMAIL_BODY_FROM_M_PERIOD")); evas_object_smart_callback_add(search_info->entry_date_from, "changed", _mailbox_search_from_date_changed_cb, data); evas_object_show(search_info->entry_date_from); @@ -883,7 +911,7 @@ static Evas_Object *_gl_advanced_searcn_view_content_get_cb(void *data, Evas_Obj search_info->to_date = t; //should be replaced with new string elm_object_part_content_set(search_info->search_date_to, "elm.icon", search_info->entry_date_to); - elm_object_part_text_set(search_info->search_date_to, "elm.text", N_("To")); + elm_object_part_text_set(search_info->search_date_to, "elm.text", _("IDS_EMAIL_BODY_TO_M_PERIOD")); evas_object_smart_callback_add(search_info->entry_date_to, "changed", _mailbix_search_to_date_changed_cb, data); evas_object_show(search_info->entry_date_to); diff --git a/mailbox/src/email-mailbox-sweep.c b/mailbox/src/email-mailbox-sweep.c index d3466f5..85ecc4b 100755 --- a/mailbox/src/email-mailbox-sweep.c +++ b/mailbox/src/email-mailbox-sweep.c @@ -62,8 +62,7 @@ Evas_Object* _create_sweep_read_unread_button(Evas_Object* parent,list_data* ld) evas_object_smart_callback_add(button, "clicked", _sweep_mark_as_read_unread_cb, ld); - if ((ld->mail_status == EMAIL_MAIL_STATUS_SENDING || ld->mail_status == EMAIL_MAIL_STATUS_SEND_WAIT) - || (ld->thread_count > 1 && ld->mailbox_ugd->b_thread_list)) + if ((ld->mail_status == EMAIL_MAIL_STATUS_SENDING || ld->mail_status == EMAIL_MAIL_STATUS_SEND_WAIT)) { elm_object_disabled_set(button,EINA_TRUE); } @@ -204,7 +203,8 @@ static void _sweep_reply_cb(void *data, Evas_Object *obj, void *event_info) } list_data *ld = (list_data *)data; - debug_log("mailbox_ugd->account_id: %d", ld->account_id); + debug_log("ld->account_id: %d", ld->account_id); + debug_log("ld->mailbox_id: %d", ld->mailbox_id); debug_log("ld->mail_id: %d", ld->mail_id); if (ld->mailbox_ugd->ug_composer) { diff --git a/mailbox/src/email-mailbox.c b/mailbox/src/email-mailbox.c index 99ad77b..bbe3316 100755 --- a/mailbox/src/email-mailbox.c +++ b/mailbox/src/email-mailbox.c @@ -37,17 +37,22 @@ extern enum appcore_time_format icu_timeformat; extern Eina_List *edit_list; extern Elm_Object_Item *g_selected_item; - +extern gboolean g_focus_lock; /* * Function prototype declaration */ static void _create_view(EmailMailboxUGD *mailbox_ugd); +static void _win_profile_changed_cb(void *data, Evas_Object *obj, void *event); static void _title_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source); static void _change_unread_icon_to_read_icon(Elm_Object_Item *item); static void _create_all_emails_view(Evas_Object *parent, EmailMailboxUGD *mailbox_ugd); static Evas_Object *_create_navigation_layout(Evas_Object *parent); -static void _account_cb(void *data, Evas_Object *obj, void *event_info); -static void _folder_cb(void *data, Evas_Object *obj, void *event_info); +static void _mailbox_account_cb(void *data, Evas_Object *obj, void *event_info); +static void _mailbox_folder_ctxpopup_dismissed_cb(void *data, Evas_Object *obj, void *event_info); +static void _mailbox_folder_ctxpopup_cb(void *data, Evas_Object *obj, void *event_info); +static void _mailbox_move_folder_ctxpopup(Evas_Object *ctxpopup, Evas_Object *btn); +static void _mailbox_create_folder_ctxpopup_cb(void *data, Evas_Object *obj, void *event_info); +static void _mailbox_show_all_folders(void *data, Evas_Object *obj, void *event_info); static void _add_account(void *data); //static void _process_mailview_back(EmailMailboxUGD *mailbox_ugd); //static char *_gl_text_get(void *data, Evas_Object *obj, const char *part); @@ -62,7 +67,6 @@ static void _add_account(void *data); //static email_mail_list_item_t *_get_sender_mail_list(EmailMailboxUGD *mailbox_ugd, const char *key, int* mail_count); //static void _create_recipient_list(EmailMailboxUGD *mailbox_ugd, const char *text); //static void _sender_item_clicked(void *data, Evas_Object *obj, void *event_info); -static void _main_back_clicked(void *data, Evas_Object *obj, void *event_info); static void _account_dim_clicked(void *data, Evas_Object *obj, const char *emission, const char *source); /* Callback function for Control bar */ @@ -313,7 +317,7 @@ static void on_destroy(ui_gadget_h ug, service_h service, void *priv) FREE(mailbox_ugd->address); FREE(mailbox_ugd->folder_alias); - FREE(mailbox_ugd->user_email); + FREE(mailbox_ugd->account_name); FREE(mailbox_ugd->display_name); /* theme extension */ @@ -598,12 +602,6 @@ static void _mailbox_rotate_to_potrait(void *data, int angle) elm_object_item_part_content_set(mailbox_ugd->navibar_item[mailbox_ugd->view_type], "title", mailbox_ugd->navi_title_ly); } - if (mailbox_ugd->view_type != EMAIL_VIEW_EDIT && !evas_object_visible_get(mailbox_ugd->searchbar_layout)) { - debug_log("search_bar is not visible, show search bar"); - elm_object_part_content_set(mailbox_ugd->search_layout, "searchbar", mailbox_ugd->searchbar_layout); - edje_object_signal_emit(_EDJ(mailbox_ugd->search_layout), "show_searchbar", "search"); - } - if (elm_object_part_content_get(mailbox_ugd->panes, "right") == mailbox_ugd->split_nocontent) { elm_panes_content_left_size_set(mailbox_ugd->panes, 1.0); Evas_Object *r_content = elm_object_part_content_get(mailbox_ugd->panes, "right"); @@ -643,6 +641,20 @@ static void _mailbox_rotate_to_landscape(void *data, int angle) debug_log("advanced search view exists. should be removed"); elm_naviframe_item_pop(mailbox_ugd->navi_bar); mailbox_ugd->b_advanced_search_view = false; + + if(!g_focus_lock) { + elm_object_focus_set(mailbox_ugd->gl[mailbox_ugd->view_type], EINA_TRUE); + + if (evas_object_visible_get(mailbox_ugd->searchbar_layout)) { + debug_log("search_bar is visible, hide search bar"); + elm_entry_entry_set(mailbox_ugd->searchbar_en, ""); + elm_object_focus_set(mailbox_ugd->searchbar_layout, EINA_FALSE); + elm_object_part_content_unset(mailbox_ugd->search_layout, "searchbar"); + edje_object_signal_emit(_EDJ(mailbox_ugd->search_layout), "hide_searchbar", "search"); + evas_object_hide(mailbox_ugd->searchbar_layout); + } + _show_toolbar(mailbox_ugd); + } } if(mailbox_ugd->view_type == EMAIL_VIEW_SEARCH) @@ -686,14 +698,6 @@ static void _mailbox_rotate_to_landscape(void *data, int angle) evas_object_hide(mailbox_ugd->navi_title_ly); } - if (evas_object_visible_get(mailbox_ugd->searchbar_layout)) { - debug_log("search_bar is visible, hide search bar"); - elm_entry_entry_set(mailbox_ugd->searchbar_en, ""); - elm_object_focus_set(mailbox_ugd->searchbar_layout, EINA_FALSE); - elm_object_part_content_unset(mailbox_ugd->search_layout, "searchbar"); - edje_object_signal_emit(_EDJ(mailbox_ugd->search_layout), "hide_searchbar", "search"); - evas_object_hide(mailbox_ugd->searchbar_layout); - } /* destroy account ug and create mailbox ug */ if (mailbox_ugd->ug_account && mailbox_ugd->account_dim) { @@ -811,7 +815,7 @@ static void layout_account_cb(ui_gadget_h ug, enum ug_mode mode, void *priv) if (!base) return; - scale_factor = elm_scale_get(); + scale_factor = elm_config_scale_get(); debug_log("ELM Scale[%f]", scale_factor); switch (mode) { @@ -832,7 +836,8 @@ static void layout_account_cb(ui_gadget_h ug, enum ug_mode mode, void *priv) // create frame view evas_object_raise(base); evas_object_resize(base, acc_w, acc_max_h); - evas_object_move(base, 16, 168); // indicator(50)+Navi(108) + 10(gap) + //evas_object_move(base, 16, 168); // indicator(50)+Navi(108) + 10(gap) + evas_object_move(base, 16, 181); // indicator(60)+Navi(111) + 10(gap) //Hide wipe effect. and direction is up. transit = elm_transit_add(); @@ -937,7 +942,7 @@ static void result_cb(ui_gadget_h ug, service_h service, void *priv) mailbox_ugd = (EmailMailboxUGD *)priv; - FREE(mailbox_ugd->user_email); + FREE(mailbox_ugd->account_name); FREE(mailbox_ugd->folder_alias); mailbox_ugd->mailbox_type = EMAIL_MAILBOX_TYPE_NONE; mailbox_ugd->mailbox_id = 0; @@ -965,21 +970,19 @@ static void result_cb(ui_gadget_h ug, service_h service, void *priv) email_mailbox_t *mailbox = NULL; int e = email_get_mailbox_by_mailbox_type(mailbox_ugd->account_id, EMAIL_MAILBOX_TYPE_INBOX, &mailbox); - if( e == EMAIL_ERROR_NONE && mailbox ) { - debug_log("email_get_mailbox_by_mailbox_type : account_id(%d) type(INBOX) - err(%d) or mailbox is NULL(%p)", mailbox_ugd->account_id, e, mailbox); - - ret = service_get_extra_data(service, EMAIL_BUNDLE_KEY_USER_EMAIL, &(mailbox_ugd->user_email)); + if(e == EMAIL_ERROR_NONE && mailbox) { + ret = service_get_extra_data(service, EMAIL_BUNDLE_KEY_ACCOUNT_NAME, &(mailbox_ugd->account_name)); debug_log("service_get_extra_data: %d", ret); mailbox_ugd->mode = EMAIL_MAILBOX_MODE_MAILBOX; mailbox_ugd->mailbox_id = mailbox->mailbox_id; mailbox_ugd->mailbox_type = EMAIL_MAILBOX_TYPE_INBOX; mailbox_ugd->folder_alias = g_strdup(mailbox->alias); - debug_log("account_id(%d), mailbox_id(%d), folder_alias(%s), user_email(%s)", - mailbox_ugd->account_id, mailbox_ugd->mailbox_id, mailbox_ugd->folder_alias, mailbox_ugd->user_email); - + debug_log("account_id(%d), mailbox_id(%d), folder_alias(%s), account_name(%s)", + mailbox_ugd->account_id, mailbox_ugd->mailbox_id, mailbox_ugd->folder_alias, mailbox_ugd->account_name); email_free_mailbox(&mailbox, 1); - } + } else + debug_log("email_get_mailbox_by_mailbox_type : account_id(%d) type(INBOX) - err(%d) or mailbox is NULL(%p)", mailbox_ugd->account_id, e, mailbox); } else { ret = service_get_extra_data(service, EMAIL_BUNDLE_KEY_MAILBOX_TYPE, &(mailbox_type)); debug_log("service_get_extra_data: %d", ret); @@ -1001,7 +1004,7 @@ static void result_cb(ui_gadget_h ug, service_h service, void *priv) debug_log("service_get_extra_data: %d", ret); ret = service_get_extra_data(service, EMAIL_BUNDLE_KEY_MAILBOX_ALIAS, &(mailbox_ugd->folder_alias)); debug_log("service_get_extra_data: %d", ret); - ret = service_get_extra_data(service, EMAIL_BUNDLE_KEY_USER_EMAIL, &(mailbox_ugd->user_email)); + ret = service_get_extra_data(service, EMAIL_BUNDLE_KEY_ACCOUNT_NAME, &(mailbox_ugd->account_name)); debug_log("service_get_extra_data: %d", ret); mailbox_ugd->account_id = (gint) atoi(account_id); @@ -1011,15 +1014,11 @@ static void result_cb(ui_gadget_h ug, service_h service, void *priv) } else debug_critical("failure on getting mailbox_id"); mailbox_ugd->mode = EMAIL_MAILBOX_MODE_MAILBOX; - debug_log("account_id[%d], mailbox_id[%d], folder_alias(%s), user_email(%s)", - mailbox_ugd->account_id, mailbox_ugd->mailbox_id, mailbox_ugd->folder_alias, mailbox_ugd->user_email); + debug_log("account_id[%d], mailbox_id[%d], folder_alias(%s), account_name(%s)", + mailbox_ugd->account_id, mailbox_ugd->mailbox_id, mailbox_ugd->folder_alias, mailbox_ugd->account_name); reset_get_more_progress_callback_status(mailbox_ugd); _make_account_mail_list(mailbox_ugd); - } else if (g_strcmp0(type, EMAIL_BUNDLE_VAL_ADD_ACCOUNT) == 0) { - debug_log("EMAIL_BUNDLE_VAL_ADD_ACCOUNT"); - - _add_account(mailbox_ugd); } g_free(type); @@ -1430,16 +1429,6 @@ void _sync_all_folder(EmailMailboxUGD *mailbox_ugd) { debug_log(""); - int handle = 0; - int err = 0; - - err = email_sync_header_for_all_account(&handle); - - if (err != EMAIL_ERROR_NONE) { - debug_critical("fail to sync header for all account - err(%d)", err); - return; - } - mailbox_ugd->emf_handle = handle; email_account_t *account_list = NULL; int account_cnt = 0, i = 0; int e = email_get_account_list(&account_list, &account_cnt); @@ -1453,12 +1442,28 @@ void _sync_all_folder(EmailMailboxUGD *mailbox_ugd) EINA_LIST_FREE(g_account_list, data) { g_free(data); } - for (i = 0; i < account_cnt; ++i) { - int *account_id = (int *)calloc(1, sizeof(int)); - *account_id = account_list[i].account_id; - g_account_list = eina_list_append(g_account_list, account_id); + + if(account_cnt > 0 && account_list) { + int handle = 0; + int err = 0; + + for (i = 0; i < account_cnt; ++i) { + err = email_engine_sync_folder(account_list[i].account_id, GET_MAILBOX_ID(account_list[i].account_id, EMAIL_MAILBOX_TYPE_INBOX), &handle); + if (err != EMAIL_ERROR_NONE) { + debug_critical("fail to sync header - account_id(%d) err(%d)", account_list[i].account_id, err); + email_free_account(&account_list, account_cnt); + return; + } else { + int *account_id = (int *)calloc(1, sizeof(int)); + *account_id = account_list[i].account_id; + g_account_list = eina_list_append(g_account_list, account_id); + mailbox_ugd->emf_handle = handle; //TODO, handle management is needed. + debug_log("mailbox_ugd->emf_handle : %d, account_id : %d", mailbox_ugd->emf_handle, account_list[i].account_id); + } + } + email_free_account(&account_list, account_cnt); } - email_free_account(&account_list, account_cnt); + } @@ -1485,6 +1490,8 @@ static void _create_view(EmailMailboxUGD *mailbox_ugd) elm_win_indicator_mode_set(win, ELM_WIN_INDICATOR_SHOW); + evas_object_smart_callback_add(mailbox_ugd->win_main, "profile,changed", _win_profile_changed_cb, mailbox_ugd); + panes = elm_panes_add(layout); evas_object_size_hint_weight_set(panes, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(panes, EVAS_HINT_FILL, EVAS_HINT_FILL); @@ -1514,7 +1521,7 @@ static void _create_view(EmailMailboxUGD *mailbox_ugd) else elm_layout_file_set(mailbox_ugd->sub_layout[mailbox_ugd->view_type], THEME_PATH, "layout.email.mailbox"); // TODO: remove mailbox_ugd->searchbar_layout later - //mailbox_create_searchbar(mailbox_ugd); + mailbox_create_searchbar(mailbox_ugd); /* create genlist */ mailbox_create_list_view(mailbox_ugd); @@ -1555,7 +1562,7 @@ static void _create_view(EmailMailboxUGD *mailbox_ugd) elm_image_resizable_set(folder_icon, 1, 1); evas_object_image_smooth_scale_set(folder_icon, 0); elm_object_content_set(mailbox_ugd->folder_button, folder_icon); - evas_object_smart_callback_add(mailbox_ugd->folder_button, "clicked", _folder_cb, mailbox_ugd); + evas_object_smart_callback_add(mailbox_ugd->folder_button, "clicked", _mailbox_create_folder_ctxpopup_cb, mailbox_ugd); elm_object_part_content_set(mailbox_ugd->navi_title_ly, "left_btn", mailbox_ugd->folder_button); //Title Right Button for update @@ -1576,17 +1583,17 @@ static void _create_view(EmailMailboxUGD *mailbox_ugd) evas_object_size_hint_weight_set(mailbox_ugd->sync_progress, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_progressbar_pulse(mailbox_ugd->sync_progress, EINA_TRUE); - elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_title", _("IDS_EMAIL_BODY_INBOX")); + elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_sub", _("IDS_EMAIL_BODY_INBOX")); if (mailbox_ugd->mode == EMAIL_MAILBOX_MODE_ALL) - elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_sub", _("IDS_EMAIL_HEADER_ALL_ACCOUNTS")); + elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_title", _("IDS_EMAIL_HEADER_ALL_ACCOUNTS")); else - elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_sub", mailbox_ugd->user_email); + elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_title", mailbox_ugd->account_name); // add service provider icon mailbox_ugd->sp_icon = elm_icon_add(mailbox_ugd->navi_title_ly); evas_object_show(mailbox_ugd->sp_icon); - elm_object_part_content_set(mailbox_ugd->navi_title_ly, "sub_left_icon", mailbox_ugd->sp_icon); + elm_object_part_content_set(mailbox_ugd->navi_title_ly, "title_icon", mailbox_ugd->sp_icon); elm_image_file_set(mailbox_ugd->sp_icon, ICON_TITLE_ALL_ACC, NULL); // add expand/collapse icon @@ -1600,6 +1607,26 @@ static void _create_view(EmailMailboxUGD *mailbox_ugd) evas_object_show(mailbox_ugd->ly); } +static void _win_profile_changed_cb(void *data, Evas_Object *obj, void *event) +{ + debug_log(""); + if (!data) { + debug_log("data is NULL"); + return; + } + + EmailMailboxUGD *mailbox_ugd = (EmailMailboxUGD *)data; + + const char *profile = elm_config_profile_get(); + if (!g_strcmp0(profile, "desktop")) + elm_layout_theme_set(mailbox_ugd->layout_main, "layout", "application", "noindicator"); + else + elm_layout_theme_set(mailbox_ugd->layout_main, "layout", "application", "default"); + + evas_object_size_hint_weight_set(mailbox_ugd->layout_main, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_show(mailbox_ugd->layout_main); +} + static void _title_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source) { debug_log(""); @@ -1621,7 +1648,7 @@ static void _title_clicked_cb(void *data, Evas_Object *obj, const char *emission if (mailbox_ugd->view_type != EMAIL_VIEW_EDIT && mailbox_ugd->view_type != EMAIL_VIEW_SEARCH) { elm_image_file_set(mailbox_ugd->title_arrow, ICON_OPEN, NULL); - _account_cb(data, obj, NULL); + _mailbox_account_cb(data, obj, NULL); elm_object_item_data_set(nf_it, (void *) (!oh_opened)); } else @@ -1630,7 +1657,7 @@ static void _title_clicked_cb(void *data, Evas_Object *obj, const char *emission } -static void _main_back_clicked(void *data, Evas_Object *obj, void *event_info) +void _main_back_clicked(void *data, Evas_Object *obj, void *event_info) { debug_log(""); @@ -1798,9 +1825,9 @@ static void _block_clicked_cb(void *data, Evas_Object *obj, void *event_info) -static void _account_cb(void *data, Evas_Object *obj, void *event_info) +static void _mailbox_account_cb(void *data, Evas_Object *obj, void *event_info) { - debug_log(""); + debug_enter(); EmailMailboxUGD *mailbox_ugd = (EmailMailboxUGD *)data; int account_id = 0; if (email_engine_get_default_account(&account_id) == false) { @@ -1834,9 +1861,123 @@ static void _account_cb(void *data, Evas_Object *obj, void *event_info) return; } -static void _folder_cb(void *data, Evas_Object *obj, void *event_info) +static void _mailbox_folder_ctxpopup_dismissed_cb(void *data, Evas_Object *obj, void *event_info) { - debug_log(""); + debug_enter(); + + EmailMailboxUGD *mailbox_ugd = (EmailMailboxUGD *)data; + + evas_object_del(mailbox_ugd->folder_ctxpopup); + mailbox_ugd->folder_ctxpopup = NULL; +} + +static void _mailbox_folder_ctxpopup_cb(void *data, Evas_Object *obj, void *event_info) +{ + debug_enter(); + + EmailMailboxUGD *mailbox_ugd = (EmailMailboxUGD *)data; + email_mailbox_t *mailbox = NULL; + email_mailbox_type_e mailbox_type = EMAIL_MAILBOX_TYPE_NONE; + + const char *label = elm_object_item_text_get((Elm_Object_Item *) event_info); + if(!label) { + debug_critical("label is NULL"); + goto CLEANUP; + } + + debug_log("text(%s) is clicked\n", label); + + if(!g_strcmp0(label, _("IDS_EMAIL_BODY_INBOX"))) + mailbox_type = EMAIL_MAILBOX_TYPE_INBOX; + else if(!g_strcmp0(label, _("IDS_EMAIL_OPT_FAVOURITES"))) + mailbox_type = EMAIL_MAILBOX_TYPE_FLAGGED; + else if(!g_strcmp0(label, _("IDS_EMAIL_BODY_DRAFTS"))) + mailbox_type = EMAIL_MAILBOX_TYPE_DRAFT; + else if(!g_strcmp0(label, _("IDS_EMAIL_BODY_SENTBOX"))) + mailbox_type = EMAIL_MAILBOX_TYPE_SENTBOX; + else if(!g_strcmp0(label, _("IDS_EMAIL_BODY_SHOW_ALL_FOLDERS_ABB"))) { + _mailbox_show_all_folders(data, obj, event_info); + goto CLEANUP; + } + else { + debug_critical("Never get here"); + goto CLEANUP; + } + + if (mailbox_ugd->account_id == 0) { + mailbox_ugd->mode = EMAIL_MAILBOX_MODE_ALL; + mailbox_ugd->mailbox_type = mailbox_type; + debug_log("account_id(%d), mailbox_type(%d)", mailbox_ugd->account_id, mailbox_ugd->mailbox_type); + } else { + int e = email_get_mailbox_by_mailbox_type(mailbox_ugd->account_id, mailbox_type, &mailbox); + + if (e == EMAIL_ERROR_NONE && mailbox) { + mailbox_ugd->mode = EMAIL_MAILBOX_MODE_MAILBOX; + mailbox_ugd->mailbox_type = mailbox_type; + mailbox_ugd->mailbox_id = mailbox->mailbox_id; + mailbox_ugd->folder_alias = g_strdup(mailbox->alias); + debug_log("account_id(%d), mailbox_id(%d), folder_alias(%s), account_name(%s)", + mailbox_ugd->account_id, mailbox_ugd->mailbox_id, mailbox_ugd->folder_alias, mailbox_ugd->account_name); + + email_free_mailbox(&mailbox, 1); + } else { + debug_log("email_get_mailbox_by_mailbox_type : account_id(%d) type(INBOX) - err(%d) or mailbox is NULL(%p)", mailbox_ugd->account_id, e, mailbox); + goto CLEANUP; + } + } + + reset_get_more_progress_callback_status(mailbox_ugd); + _make_account_mail_list(mailbox_ugd); + +CLEANUP: + evas_object_del(mailbox_ugd->folder_ctxpopup); + mailbox_ugd->folder_ctxpopup = NULL; + return; +} + +static void _mailbox_move_folder_ctxpopup(Evas_Object *ctxpopup, Evas_Object *btn) +{ + debug_enter(); + + Evas_Coord x, y, w, h; + evas_object_geometry_get(btn, &x, &y, &w, &h); + evas_object_move(ctxpopup, x + (w / 2), y + h); +} + +static void _mailbox_create_folder_ctxpopup_cb(void *data, Evas_Object *obj, void *event_info) +{ + debug_enter(); + + EmailMailboxUGD *mailbox_ugd = (EmailMailboxUGD *)data; + + if(mailbox_ugd->folder_ctxpopup) { + evas_object_del(mailbox_ugd->folder_ctxpopup); + mailbox_ugd->folder_ctxpopup = NULL; + } + + _stop_emf_job(mailbox_ugd, mailbox_ugd->emf_handle, true); + + mailbox_ugd->folder_ctxpopup = elm_ctxpopup_add(mailbox_ugd->navi_bar); + evas_object_smart_callback_add(mailbox_ugd->folder_ctxpopup,"dismissed", _mailbox_folder_ctxpopup_dismissed_cb, mailbox_ugd); + if (mailbox_ugd->mailbox_type != EMAIL_MAILBOX_TYPE_INBOX) + elm_ctxpopup_item_append(mailbox_ugd->folder_ctxpopup, _("IDS_EMAIL_BODY_INBOX"), NULL, _mailbox_folder_ctxpopup_cb, mailbox_ugd); + if (mailbox_ugd->mode == EMAIL_MAILBOX_MODE_ALL && mailbox_ugd->mailbox_type != EMAIL_MAILBOX_TYPE_FLAGGED) + elm_ctxpopup_item_append(mailbox_ugd->folder_ctxpopup, _("IDS_EMAIL_OPT_FAVOURITES"), NULL, _mailbox_folder_ctxpopup_cb, mailbox_ugd); + if (mailbox_ugd->mailbox_type != EMAIL_MAILBOX_TYPE_DRAFT) + elm_ctxpopup_item_append(mailbox_ugd->folder_ctxpopup, _("IDS_EMAIL_BODY_DRAFTS"), NULL, _mailbox_folder_ctxpopup_cb, mailbox_ugd); + if (mailbox_ugd->mailbox_type != EMAIL_MAILBOX_TYPE_SENTBOX) + elm_ctxpopup_item_append(mailbox_ugd->folder_ctxpopup, _("IDS_EMAIL_BODY_SENTBOX"), NULL, _mailbox_folder_ctxpopup_cb, mailbox_ugd); + elm_ctxpopup_item_append(mailbox_ugd->folder_ctxpopup, _("IDS_EMAIL_BODY_SHOW_ALL_FOLDERS_ABB"), NULL, _mailbox_folder_ctxpopup_cb, mailbox_ugd); + + _mailbox_move_folder_ctxpopup(mailbox_ugd->folder_ctxpopup, obj); + elm_ctxpopup_direction_priority_set(mailbox_ugd->folder_ctxpopup, ELM_CTXPOPUP_DIRECTION_DOWN, ELM_CTXPOPUP_DIRECTION_RIGHT, ELM_CTXPOPUP_DIRECTION_LEFT, ELM_CTXPOPUP_DIRECTION_UP); + evas_object_show(mailbox_ugd->folder_ctxpopup); +} + +static void _mailbox_show_all_folders(void *data, Evas_Object *obj, void *event_info) +{ + debug_enter(); + EmailMailboxUGD *mailbox_ugd = (EmailMailboxUGD *)data; int account_id = 0; @@ -1903,6 +2044,8 @@ static void _add_account(void *data) debug_log("service_add_extra_data: %d", ret); mailbox_ugd->ug_setting = create_setting_ug(UG_NAME_EMAIL_SETTING, service, mailbox_ugd); + + service_destroy(service); } static void _process_update(EmailMailboxUGD *mailbox_ugd) @@ -2004,53 +2147,53 @@ void _update_navigationbar_title(EmailMailboxUGD *mailbox_ugd) case EMAIL_MAILBOX_TYPE_INBOX: { elm_object_item_text_set(mailbox_ugd->navibar_item[mailbox_ugd->view_type], _("IDS_EMAIL_BODY_INBOX")); - elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_title", _("IDS_EMAIL_BODY_INBOX")); + elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_sub", _("IDS_EMAIL_BODY_INBOX")); } break; case EMAIL_MAILBOX_TYPE_SENTBOX: { elm_object_item_text_set(mailbox_ugd->navibar_item[mailbox_ugd->view_type], _("IDS_EMAIL_BODY_SENTBOX")); - elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_title", _("IDS_EMAIL_BODY_SENTBOX")); + elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_sub", _("IDS_EMAIL_BODY_SENTBOX")); } break; case EMAIL_MAILBOX_TYPE_TRASH: { elm_object_item_text_set(mailbox_ugd->navibar_item[mailbox_ugd->view_type], _("IDS_EMAIL_BODY_TRASH")); - elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_title", _("IDS_EMAIL_BODY_TRASH")); + elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_sub", _("IDS_EMAIL_BODY_TRASH")); } break; case EMAIL_MAILBOX_TYPE_DRAFT: { elm_object_item_text_set(mailbox_ugd->navibar_item[mailbox_ugd->view_type], _("IDS_EMAIL_BODY_DRAFTS")); - elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_title", _("IDS_EMAIL_BODY_DRAFTS")); + elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_sub", _("IDS_EMAIL_BODY_DRAFTS")); } break; case EMAIL_MAILBOX_TYPE_SPAMBOX: { elm_object_item_text_set(mailbox_ugd->navibar_item[mailbox_ugd->view_type], _("IDS_EMAIL_BODY_SPAMBOX")); - elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_title", _("IDS_EMAIL_BODY_SPAMBOX")); + elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_sub", _("IDS_EMAIL_BODY_SPAMBOX")); } break; case EMAIL_MAILBOX_TYPE_OUTBOX: { - elm_object_item_text_set(mailbox_ugd->navibar_item[mailbox_ugd->view_type], N_("Outbox")); - elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_title", N_("Outbox")); + elm_object_item_text_set(mailbox_ugd->navibar_item[mailbox_ugd->view_type], _("IDS_EMAIL_HEADER_OUTBOX")); + elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_sub", _("IDS_EMAIL_HEADER_OUTBOX")); } break; case EMAIL_MAILBOX_TYPE_FLAGGED: { elm_object_item_text_set(mailbox_ugd->navibar_item[mailbox_ugd->view_type], _("IDS_EMAIL_OPT_FAVOURITES")); - elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_title", _("IDS_EMAIL_OPT_FAVOURITES")); + elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_sub", _("IDS_EMAIL_OPT_FAVOURITES")); } break; default: { elm_object_item_text_set(mailbox_ugd->navibar_item[mailbox_ugd->view_type], _("IDS_EMAIL_BODY_INBOX")); - elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_title", _("IDS_EMAIL_BODY_INBOX")); + elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_sub", _("IDS_EMAIL_BODY_INBOX")); } break; } - elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_sub", _("IDS_EMAIL_HEADER_ALL_ACCOUNTS")); + elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_title", _("IDS_EMAIL_HEADER_ALL_ACCOUNTS")); if (mailbox_ugd->isRotate == false) { _create_controlbar(mailbox_ugd); @@ -2060,8 +2203,8 @@ void _update_navigationbar_title(EmailMailboxUGD *mailbox_ugd) _create_controlbar(mailbox_ugd); } elm_object_item_text_set(mailbox_ugd->navibar_item[mailbox_ugd->view_type], mailbox_ugd->folder_alias); - elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_title", mailbox_ugd->folder_alias); - elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_sub", mailbox_ugd->user_email); + elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_sub", mailbox_ugd->folder_alias); + elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_title", mailbox_ugd->account_name); email_account_t *account; email_get_account(mailbox_ugd->account_id, 0, &account); @@ -2226,6 +2369,8 @@ static void _mailbox_update_account_password(void *data) if( err != EMAIL_ERROR_NONE || !account_info) { debug_log("fail to get account info - err(%d)", err); + email_free_account(&account_info, 1); + return; } FREE(account_info->incoming_server_password); account_info->incoming_server_password = strdup(mailbox_ugd->str_password); @@ -2236,9 +2381,7 @@ static void _mailbox_update_account_password(void *data) _sync_folder_with_new_password(mailbox_ugd->sync_needed_account_id, mailbox_ugd->sync_needed_mailbox_id, data); } - if (account_info) { - email_free_account(&account_info, 1); - } + email_free_account(&account_info, 1); mailbox_ugd->sync_needed_account_id = -1; mailbox_ugd->sync_needed_mailbox_id = -1; FREE(mailbox_ugd->str_password); diff --git a/mailbox/theme/email-mailbox-theme-macro.edc b/mailbox/theme/email-mailbox-theme-macro.edc index aac48f4..aa2d88f 100755 --- a/mailbox/theme/email-mailbox-theme-macro.edc +++ b/mailbox/theme/email-mailbox-theme-macro.edc @@ -1221,7 +1221,8 @@ styles { } /* genlist multisense macro - end */ -#define SEARCHBAR_BACKGROUND_COLOR_DEFAULT 215 225 232 255 +//#define SEARCHBAR_BACKGROUND_COLOR_DEFAULT 215 225 232 255 +#define SEARCHBAR_BACKGROUND_COLOR_DEFAULT 248 246 239 255 #define SEARCHBAR_BACKGROUND_COLOR_BLACK 36 36 36 255 #define SEARCHBAR_BACKGROUND_COLOR_BLUE 17 23 27 255 #define SEARCHBAR_BACKGROUND_COLOR_WHITE 215 225 232 255 diff --git a/mailbox/theme/email-mailbox-theme.edc b/mailbox/theme/email-mailbox-theme.edc index 86c95fa..64938e7 100755 --- a/mailbox/theme/email-mailbox-theme.edc +++ b/mailbox/theme/email-mailbox-theme.edc @@ -93,6 +93,23 @@ collections } } + part { + name: "selection_info"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 0 1; + align: 0.5 1.0; + rel1 { + relative: 0.0 1.0; + to:"list"; + } + } + description { state: "hide" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + part { name: "noc"; @@ -193,7 +210,7 @@ collections description { state: "default" 0.0; visible: 1; - min: 16 0; + min: 26 0; fixed: 1 0; align: 0.0 0.5; rel1 { relative: 0.0 0.0; to: "bg";} @@ -209,7 +226,7 @@ collections description { state: "default" 0.0; visible: 1; - min: 80 16; + min: 74 16; fixed: 1 1; align: 0.0 0.0; rel1 { relative: 1.0 0.0; to: "searchbar_area_category_pad_left";} @@ -225,7 +242,7 @@ collections description { state: "default" 0.0; visible: 1; - min: 80 16; + min: 74 16; fixed: 1 1; align: 0.0 1.0; rel1 { relative: 1.0 1.0; to: "searchbar_area_category_pad_left";} @@ -241,8 +258,8 @@ collections description { state: "default" 0.0; visible: 1; - min: 80 80; - max: 80 80; + min: 74 74; + max: 74 74; fixed: 1 1; align: 0.0 0.5; rel1 { relative: 1.0 1.0; @@ -273,67 +290,6 @@ collections } //end parts } //end group -group { name: "horizontal_bottom_64"; - parts { - part { - name: "bg"; - type: RECT; - mouse_events: 1; - repeat_events: 1; - scale : 1; - description { - state: "default" 0.0; - min: SELECTION_INFO_MIN_VER_W_INC SELECTION_INFO_MIN_VER_BOTTOM_64_H_INC; - fixed: 1 1; - align: 0.5 1.0; - rel1.relative: 0.5 1.0; - rel2.relative: 0.5 1.0; - color: 0 0 0 0; - } - } - part { name: "base"; - type: RECT; - mouse_events: 1; - scale : 1; - description { - state: "default" 0.0; - min: 0 SELECTION_INFO_VER_PADDING_INC; - fixed: 0 1; - align: 0.5 0.0; - rel1 { relative: 0.0 0.0; to: "bg"; } - rel2 { relative: 1.0 0.32; to: "bg"; } - color: SELECTION_INFO_BACKGROUND_COLOR_INC; - } - } - part { - name: "elm.text"; - type: TEXT; - mouse_events: 0; - scale: 1; - description { - state: "default" 0.0; - align: 0.5 0.0; - rel1 { to: "base"; } - rel2 { to: "base"; } - color: SELECTION_INFO_TEXT_COLOR_INC; - text { - font: "SLP"; - size: SELECTION_INFO_TEXT_FONT_SIZE_INC; - text: ""; - text_class: "slp"; - } - } - } - } - programs { - program { - name: "clicked"; - signal: "mouse,clicked,1"; - source: "base"; - action: SIGNAL_EMIT "elm,action,click" ""; - } - } -} group { name: "layout.email.mailbox"; @@ -409,6 +365,23 @@ group { name: "horizontal_bottom_64"; } } + part { + name: "selection_info"; + type: SWALLOW; + description { state: "default" 0.0; + fixed: 0 1; + align: 0.5 1.0; + rel1 { + relative: 0.0 1.0; + to:"list"; + } + } + description { state: "hide" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + part { name: "noc"; @@ -503,7 +476,7 @@ group { name: "horizontal_bottom_64"; scale: 1; description { state: "default" 0.0; - min: 0 108; + min: 0 111; rel1 { relative: 0.0 0.0; } rel2 { relative: 1.0 1.0; } color: 0 0 0 0; @@ -516,7 +489,7 @@ group { name: "horizontal_bottom_64"; scale: 1; description { state: "default" 0.0; - min: 0 11; + min: 0 4; fixed: 0 1; visible: 0; rel1 { to: "bg"; relative: 0 0; } @@ -544,7 +517,7 @@ group { name: "horizontal_bottom_64"; scale: 1; description { state: "default" 0.0; - min: 5 0; + min: 16 0; fixed: 1 0; visible: 0; rel1 { to: "bg"; relative: 0 0; } @@ -558,7 +531,7 @@ group { name: "horizontal_bottom_64"; scale: 1; description { state: "default" 0.0; - min: 5 0; + min: 26 0; fixed: 1 0; visible: 0; rel1 { to: "bg"; relative: 1 0; } @@ -578,82 +551,108 @@ group { name: "horizontal_bottom_64"; to_y: "top_padding"; } rel2 { - relative: (440/720) 0.0; + relative: (522/720) 0.0; to_x: "bg"; to_y: "bottom_padding"; } - color: 0 0 0 10; + color: 248 246 239 255; } } - part { - name: "txt_title"; - type: TEXT; + name: "title_icon"; + type: SWALLOW; scale: 1; description { state: "default" 0.0; - rel1 { relative: (16/440) 0.0; to: "title_area";} - rel2 { relative: (424/440) (52/88); to: "title_area";} - color : 59 115 182 255; - text { font: "SLP:style=Medium"; - size: 40; - min: 0 0; - max: 1 0; - align: 0.0 0.5; - text_class: "slp"; - } - align: 0.0 0.0; fixed: 1 1; - min: 0 48; + min: 68 68; + max: 68 68; + rel1 { + relative: 1.0 0.0; + to_x: "left_padding"; + to_y: "bottom_padding"; + } + rel2 { + relative: 1.0 0.0; + to_x: "title_area"; + to_y: "bottom_padding"; + } + align: 0.0 1.0; } } - - part { name: "sub_left_padding"; + part { name: "middle_padding"; type: RECT; scale: 1; description { state: "default" 0.0; - min: 21 0; + min: 16 0; fixed: 1 0; visible: 0; rel1 { relative: 1.0 1.0; - to_x: "left_padding"; - to_y: "txt_title"; + to_x: "title_icon"; + to_y: "top_padding"; } rel2 { relative: 1.0 0.0; - to_x: "left_padding"; + to_x: "title_icon"; to_y: "bottom_padding"; } align: 0.0 0.0; } } - part { - name: "sub_left_icon"; - type: SWALLOW; + name: "txt_title"; + type: TEXT; scale: 1; description { - state: "default" 0.0; + state: "default" 0.0; + rel1 { relative: (84/506) (14/96); to: "title_area";} + rel2 { relative: (506/506) (62/96); to: "title_area";} + color : 59 115 182 255; + text { font: "SLP:style=Medium"; + size: 42; + min: 0 0; + max: 1 0; + align: 0.0 0.5; + text_class: "slp"; + } + align: 0.0 0.0; fixed: 1 1; - min: 32 32; - max: 32 32; + min: 0 48; + } + } + part { + name: "txt_sub"; + type: TEXT; + scale: 1; + description { + state: "default" 0.0; rel1 { relative: 1.0 1.0; - to_x: "sub_left_padding"; + to_x: "middle_padding"; to_y: "txt_title"; } rel2 { - relative: 1.0 0.0; - to_x: "sub_left_padding"; - to_y: "bottom_padding"; + relative: 1.0 1.0; + to_x: "title_area"; + to_y: "title_area"; } - align: 0.0 0.5; + color : 59 115 182 255; + text { font: "SLP:style=Medium"; + size: 30; + min: 0 0; + max: 1 0; + align: 0.0 0.5; + text_class: "slp"; + } + align: 0.0 0.0; + fixed: 1 1; + min: 0 34; + max: 356 34; } } - - part { name: "sub_mid_padding"; + part { name: "text_sub_padding"; type: RECT; scale: 1; description { @@ -663,68 +662,58 @@ group { name: "horizontal_bottom_64"; visible: 0; rel1 { relative: 1.0 1.0; - to_x: "sub_left_icon"; + to_x: "txt_sub"; to_y: "txt_title"; } rel2 { relative: 1.0 0.0; - to_x: "sub_left_icon"; + to_x: "txt_sub"; to_y: "bottom_padding"; } align: 0.0 0.0; } } - - part { - name: "sub_right_icon"; - type: SWALLOW; + part { name: "sub_icon_bottom_padding"; + type: RECT; scale: 1; description { state: "default" 0.0; - fixed: 1 1; - min: 32 32; - max: 32 32; + min: 0 6; + fixed: 0 1; + visible: 0; rel1 { - relative: 1.0 1.0; - to_x: "title_area"; - to_y: "txt_title"; + relative: 1.0 0.0; + to_x: "text_sub_padding"; + to_y: "bottom_padding"; } rel2 { relative: 1.0 0.0; to_x: "title_area"; to_y: "bottom_padding"; } - align: 1.0 0.0; + align: 0.0 1.0; } } - part { - name: "txt_sub"; - type: TEXT; + name: "sub_right_icon"; + type: SWALLOW; scale: 1; description { state: "default" 0.0; + fixed: 1 1; + min: 18 16; + max: 18 16; rel1 { - relative: 1.0 1.0; - to_x: "sub_mid_padding"; - to_y: "txt_title"; + relative: 1.0 0.0; + to_x: "text_sub_padding"; + to_y: "sub_icon_bottom_padding"; } rel2 { - relative: 0.0 0.0; - to_x: "sub_right_icon"; - to_y: "bottom_padding"; - } - color : 59 115 182 255; - text { font: "SLP:style=Medium"; - size: 24; - min: 0 0; - max: 1 0; - align: 0.0 0.5; - text_class: "slp"; + relative: 1.0 0.0; + to_x: "title_area"; + to_y: "sub_icon_bottom_padding"; } - align: 0.0 0.0; - fixed: 1 1; - min: 0 40; + align: 0.0 1.0; } } @@ -735,8 +724,8 @@ group { name: "horizontal_bottom_64"; description { state: "default" 0.0; fixed: 1 0; - min: 120 78; - max: 120 78; + min: 68 78; + max: 68 78; align: 1.0 0.5; rel1 { relative: 0.0 1.0; @@ -752,14 +741,14 @@ group { name: "horizontal_bottom_64"; } part { - name: "seperator1"; + name: "button_padding"; type: SWALLOW; scale: 1; description { state: "default" 0.0; - fixed: 1 1; - min: 2 48; - max: 2 48; + min: 18 0; + fixed: 1 0; + visible: 0; align: 1.0 0.5; rel1 { relative: 0.0 1.0; @@ -782,31 +771,31 @@ group { name: "horizontal_bottom_64"; description { state: "default" 0.0; fixed: 1 0; - min: 120 78; - max: 120 78; + min: 68 78; + max: 68 78; align: 1.0 0.5; rel1 { relative: 0.0 1.0; - to_x: "seperator1"; + to_x: "button_padding"; to_y: "top_padding"; } rel2 { relative: 0.0 0.0; - to_x: "seperator1"; + to_x: "button_padding"; to_y: "bottom_padding"; } } } - +/* part { name: "seperator2"; type: SWALLOW; scale: 1; description { state: "default" 0.0; - fixed: 1 1; - min: 2 48; - max: 2 48; + min: 18 0; + fixed: 1 0; + visible: 0; align: 1.0 0.5; rel1 { relative: 0.0 1.0; @@ -821,7 +810,7 @@ group { name: "horizontal_bottom_64"; //image.normal: "00_winset_title_line.png"; } } - +*/ part { name: "event_area"; ignore_flags: ON_HOLD; @@ -904,7 +893,7 @@ group { name: "horizontal_bottom_64"; type: RECT; description { state: "default" 0.0; color: 0 0 0 153; - min: 0 1124; //213; height(1280) - (indicator(50)+Navi(111)+frameview(909)+10) +5 + min: 0 1120; //213; height(1280) - (indicator(50)+Navi(111)+frameview(909)+10) +5 max: 9999 213; fixed: 1 1; visible: 1; @@ -921,8 +910,8 @@ group { name: "horizontal_bottom_64"; max: 26 21; align: 0.5 1.0; - rel1 { relative: (56/720) (10/1122); to: "block_events";} - rel2 { relative: (82/720) (10/1122); to: "block_events";} + rel1 { relative: (56/720) (20/1119); to: "block_events";} + rel2 { relative: (82/720) (20/1119); to: "block_events";} image.normal: "M02_email_popup_bubble_tail_top.png"; } } diff --git a/packaging/org.tizen.email.spec b/packaging/org.tizen.email.spec index 12b950e..da23c5a 100755 --- a/packaging/org.tizen.email.spec +++ b/packaging/org.tizen.email.spec @@ -94,8 +94,8 @@ ln -sf /usr/bin/ug-client %{_ugdir}/bin/email-setting-efl %{_libdir}/libemail-common.so %{_ugdir}/lib/libug-email-composer-efl.so %{_ugdir}/lib/libug-email-viewer-efl.so -%{_ugdir}/lib/libug-email-account-efl.so -%{_ugdir}/lib/libug-email-mailbox-efl.so +%{_libdir}/libug-email-account-efl.so +%{_libdir}/libug-email-mailbox-efl.so %{_ugdir}/lib/libug-email-setting-efl.so %{_pkgdir}/res/edje/email-viewer-theme.edj %{_pkgdir}/res/edje/email-setting-theme.edj diff --git a/setting/include/email-setting-view.h b/setting/include/email-setting-view.h index 0b0ca92..f39e9f2 100755 --- a/setting/include/email-setting-view.h +++ b/setting/include/email-setting-view.h @@ -23,9 +23,12 @@ typedef enum { VIEW_SP_SELECT, VIEW_ACCOUNT_SETUP, VIEW_MANUAL_SETUP, + VIEW_SLOT_SIZE, VIEW_ACCOUNT_EDIT, + VIEW_SHOW_EMAIL_COUNT, VIEW_MAILBOX_MAPPING, VIEW_ACCOUNT_OPTIONS, + VIEW_DEFAULT_ACCOUNT, VIEW_INITIAL_ACCESS, VIEW_SYNC_SCHEDULE, VIEW_SYNC_SETUP, diff --git a/setting/include/email-setting.h b/setting/include/email-setting.h index 7825571..d579ebb 100755 --- a/setting/include/email-setting.h +++ b/setting/include/email-setting.h @@ -52,11 +52,12 @@ #define _EDJ(o) elm_layout_edje_get(o) +#define ACCOUNT_ICON_EXCHANGE IMGDIR"/M02_email_list_icon_exchange.png" #define ACCOUNT_ICON_GMAIL IMGDIR"/M02_email_list_icon_gmail.png" #define ACCOUNT_ICON_HOTMAIL IMGDIR"/M02_email_list_icon_hotmail.png" #define ACCOUNT_ICON_YAHOO IMGDIR"/M02_email_list_icon_YahooMail.png" #define ACCOUNT_ICON_AOL IMGDIR"/M02_email_list_icon_AOL.png" -#define ACCOUNT_ICON_OTHERS IMGDIR"/M02_title_icon_others.png" +#define ACCOUNT_ICON_OTHERS IMGDIR"/M02_list_icon_other.png" #define CBAR_ICON_ADD IMGDIR"/01_controlbar_icon_create_folder.png" #define TITLE_ICON_REFRESH IMGDIR"/00_icon_refresh.png" diff --git a/setting/src/email-setting.c b/setting/src/email-setting.c index 9e31a80..bb9a66a 100755 --- a/setting/src/email-setting.c +++ b/setting/src/email-setting.c @@ -56,6 +56,7 @@ static int _parse_option(service_h service, struct ug_data *ugd); static void _dispatch_view(struct ug_data *ugd); static void _create_navigationbar(struct ug_data *ugd); static Evas_Object *_create_layout(Evas_Object *parent, struct ug_data *ugd); +static void _win_profile_changed_cb(void *data, Evas_Object *obj, void *event); static void _layout_block_cb(ui_gadget_h ug, enum ug_mode mode, void *priv); static void _result_block_cb(ui_gadget_h ug, service_h service, void *priv); @@ -145,6 +146,7 @@ static void *on_create(ui_gadget_h ug, enum ug_mode mode, service_h service, voi /*elm_theme_extension_add(ugd->theme, EV_BLOCK_THEME_PATH); //Use block theme*/ ugd->layout_main = _create_layout(parent, ugd); + evas_object_smart_callback_add(ugd->win, "profile,changed", _win_profile_changed_cb, ugd); _create_navigationbar(ugd); ugd->base = ugd->layout_main; elm_win_indicator_mode_set(ugd->win, ELM_WIN_INDICATOR_SHOW); @@ -155,6 +157,9 @@ static void *on_create(ui_gadget_h ug, enum ug_mode mode, service_h service, voi static void on_event(ui_gadget_h ug, enum ug_event event, service_h service, void *priv) { debug_log(""); + + EmailSettingUGD *ugd = (EmailSettingUGD *)priv; + switch (event) { case UG_EVENT_LOW_MEMORY: break; @@ -238,6 +243,37 @@ static void on_key_event(ui_gadget_h ug, enum ug_key_event event, service_h serv static void on_message(ui_gadget_h ug, service_h msg, service_h service, void *priv) { debug_log(""); + EmailSettingUGD *ugd = NULL; + char *rotation_str = NULL; + int rotation_mode = UG_EVENT_ROTATE_PORTRAIT; + + ugd = (EmailSettingUGD *)priv; + if (!ug || !msg) + return; + + service_get_extra_data(msg, EMAIL_BUNDLE_KEY_ROTATE, &rotation_str); + if (rotation_str) { + debug_log("rotation mode: %s", rotation_str); + int angle = 0; + rotation_mode = atoi(rotation_str); + switch (rotation_mode) { + case UG_EVENT_ROTATE_PORTRAIT_UPSIDEDOWN: + angle = 180; + break; + case UG_EVENT_ROTATE_LANDSCAPE: + angle = -90; + break; + case UG_EVENT_ROTATE_LANDSCAPE_UPSIDEDOWN: + angle = 90; + break; + case UG_EVENT_ROTATE_PORTRAIT: + default: + angle = 0; + break; + } + + elm_win_rotation_with_resize_set(ugd->win, angle); + } return; } @@ -838,6 +874,26 @@ static Evas_Object *_create_layout(Evas_Object *parent, struct ug_data *ugd) return base; } +static void _win_profile_changed_cb(void *data, Evas_Object *obj, void *event) +{ + debug_log(""); + if (!data) { + debug_log("data is NULL"); + return; + } + + EmailSettingUGD *ugd = (EmailSettingUGD *)data; + + const char *profile = elm_config_profile_get(); + if (!g_strcmp0(profile, "desktop")) + elm_layout_theme_set(ugd->layout_main, "layout", "application", "noindicator"); + else + elm_layout_theme_set(ugd->layout_main, "layout", "application", "default"); + + evas_object_size_hint_weight_set(ugd->layout_main, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_show(ugd->layout_main); +} + static void _layout_block_cb(ui_gadget_h ug, enum ug_mode mode, void *priv) { debug_log(""); diff --git a/setting/src/email-view-account-edit.c b/setting/src/email-view-account-edit.c index 0c5050b..d09ba53 100755 --- a/setting/src/email-view-account-edit.c +++ b/setting/src/email-view-account-edit.c @@ -1532,7 +1532,7 @@ static Evas_Object *_gl_ef_content_get_cb(void *data, Evas_Object *obj, const ch elm_entry_input_panel_return_key_disabled_set(p->entry_password, EINA_TRUE); elm_entry_password_set(p->entry_password, 1); elm_entry_cnp_mode_set(p->entry_password, ELM_CNP_MODE_PLAINTEXT); - elm_entry_input_panel_layout_set(p->entry_password, ELM_INPUT_PANEL_LAYOUT_EMAIL); + elm_entry_input_panel_layout_set(p->entry_password, ELM_INPUT_PANEL_LAYOUT_NORMAL); evas_object_smart_callback_add(p->entry_password, "changed", _backup_input_cb, p->ef_password); evas_object_smart_callback_add(p->entry_password, "focused", _entry_focused_cb, p->ef_password); evas_object_smart_callback_add(p->entry_password, "unfocused", _entry_unfocused_cb, p->ef_password); @@ -1683,7 +1683,7 @@ static Evas_Object *_gl_ef_content_get_cb(void *data, Evas_Object *obj, const ch elm_entry_input_panel_return_key_disabled_set(p->entry_sending_password, EINA_TRUE); elm_entry_password_set(p->entry_sending_password, 1); elm_entry_cnp_mode_set(p->entry_sending_password, ELM_CNP_MODE_PLAINTEXT); - elm_entry_input_panel_layout_set(p->entry_sending_password, ELM_INPUT_PANEL_LAYOUT_EMAIL); + elm_entry_input_panel_layout_set(p->entry_sending_password, ELM_INPUT_PANEL_LAYOUT_NORMAL); if (account_data->outgoing_server_use_same_authenticator) { elm_entry_context_menu_disabled_set(p->entry_sending_password, EINA_TRUE); } else { diff --git a/setting/src/email-view-account-options.c b/setting/src/email-view-account-options.c index 948879e..e89fd28 100755 --- a/setting/src/email-view-account-options.c +++ b/setting/src/email-view-account-options.c @@ -62,6 +62,7 @@ static Evas_Object *_gl_ex_size_content_get_cb(void *data, Evas_Object *obj, con static Evas_Object *_gl_ex_recent_content_get_cb(void *data, Evas_Object *obj, const char *part); static Evas_Object *_gl_ex_deleting_content_get_cb(void *data, Evas_Object *obj, const char *part); static void _gl_sel_cb(void *data, Evas_Object *obj, void *event_info); +static void _gl_sig_sel_cb(void *data, Evas_Object *obj, void *event_info); static void _gl_ex_sel_cb(void *data, Evas_Object *obj, void *event_info); static void _gl_ex_cc_sel_cb(void *data, Evas_Object *obj, void *event_info); static void _gl_ex_size_sel_cb(void *data, Evas_Object *obj, void *event_info); @@ -459,7 +460,7 @@ static void _create_list(struct viewdata *vd) /*--signature--*/ p->gl_sig_item = elm_genlist_item_append(p->genlist, &(p->itc_ef), NULL, - git, ELM_GENLIST_ITEM_NONE, NULL, NULL); + git, ELM_GENLIST_ITEM_NONE, _gl_sig_sel_cb, NULL); if (account_data->options.add_signature == FALSE) { if (p->gl_sig_item) elm_object_item_disabled_set(p->gl_sig_item, EINA_TRUE); @@ -972,7 +973,7 @@ static char *_gl_recent_text_get_cb(void *data, Evas_Object *obj, const char *pa if (!g_strcmp0(part, "elm.text.1")) { char buf[MAX_STR_LEN] = { 0, }; - snprintf(buf, sizeof(buf), "%s", _("IDS_EMAIL_BODY_RECENT_EMAILS")); + snprintf(buf, sizeof(buf), "%s", _("IDS_EMAIL_BODY_NUMBER_OF_EMAILS_TO_LOAD_ABB")); return g_strdup(buf); } @@ -1504,6 +1505,15 @@ static void _gl_sel_cb(void *data, Evas_Object *obj, void *event_info) _update_account_info(vd); } +static void _gl_sig_sel_cb(void *data, Evas_Object *obj, void *event_info) +{ + debug_log(""); + + Elm_Object_Item *item = (Elm_Object_Item *)event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + + +} static void _gl_ex_sel_cb(void *data, Evas_Object *obj, void *event_info) { debug_log(""); diff --git a/setting/src/email-view-account-setup.c b/setting/src/email-view-account-setup.c index c81b740..11ab3d8 100755 --- a/setting/src/email-view-account-setup.c +++ b/setting/src/email-view-account-setup.c @@ -55,6 +55,7 @@ static void _popup_cancel_validation_cb(void *data, Evas_Object *obj, void *even static void _backup_input_cb(void *data, Evas_Object *obj, void *event_info); static void _entry_focused_cb(void *data, Evas_Object *obj, void *event_info); static void _entry_unfocused_cb(void *data, Evas_Object *obj, void *event_info); +static void _entry_theme_changed_cb(void *data, Evas_Object *obj, void *event_info); static void _eraser_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source); static void _input_panel_state_changed_cb(void *data, Ecore_IMF_Context *ctx, int value); static void _gl_ef_sel_cb(void *data, Evas_Object *obj, void *event_info); @@ -333,7 +334,7 @@ static void _push_naviframe(struct viewdata *vd) evas_object_show(p->l_button); if (vd->ugd->account_info == NULL) { - elm_object_text_set(p->l_button, dgettext("sys_string", "IDS_COM_SK_NEXT")); + elm_object_text_set(p->l_button, dgettext("sys_string", "IDS_COM_BUTTON_LOGIN")); evas_object_smart_callback_add(p->l_button, "clicked", _next_cb, vd); } else { elm_object_text_set(p->l_button, dgettext("sys_string", "IDS_COM_BUTTON_LOGIN")); @@ -1267,7 +1268,6 @@ static Eina_Bool _after_validation_cb(void *data) setting_change_view(VIEW_SYNC_SETUP, ugd); - setting_get_small_notify(vd, _("IDS_EMAIL_POP_SUCCEEDED")); /*debug_log("_after_validation_cb %s", vd->ugd->start_view_type); @@ -1566,6 +1566,36 @@ static void _entry_unfocused_cb(void *data, Evas_Object *obj, void *event_info) elm_object_signal_emit(data, "elm,state,eraser,hide", "elm"); } +static void _entry_theme_changed_cb(void *data, Evas_Object *obj, void *event_info) +{ + debug_log(""); + + if (!obj) { + debug_log("obj is NULL"); + return; + } + + struct viewdata *vd = (struct viewdata *)data; + + if (vd == NULL) { + debug_log("vd is NULL"); + return; + } + + struct priv_data *p = NULL; + p = vd->priv; + + Ecore_IMF_Context *imf_context = NULL; + imf_context = elm_entry_imf_context_get(p->entry_password); + if (imf_context) { + ecore_imf_context_input_panel_event_callback_del(imf_context, + ECORE_IMF_INPUT_PANEL_STATE_EVENT, _input_panel_state_changed_cb); + ecore_imf_context_input_panel_event_callback_add(imf_context, + ECORE_IMF_INPUT_PANEL_STATE_EVENT, + _input_panel_state_changed_cb, (void *)vd); + } +} + static void _eraser_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source) { debug_log(""); @@ -1663,12 +1693,12 @@ static Evas_Object *_gl_ef_content_get_cb(void *data, Evas_Object *obj, const ch int index = (int)data; struct viewdata *vd = g_vd; struct priv_data *p = vd->priv; - EmailSettingUGD *ugd = vd->ugd; + //EmailSettingUGD *ugd = vd->ugd; Ecore_IMF_Context *imf_context = NULL; if (!strcmp(part, "elm.icon")) { if (index == 1) { - p->icon_get_cnt1++; + //p->icon_get_cnt1++; debug_log(""); p->ef_account_name = elm_layout_add(p->genlist); @@ -1702,7 +1732,7 @@ static Evas_Object *_gl_ef_content_get_cb(void *data, Evas_Object *obj, const ch if (p->str_account_name) elm_entry_entry_set(p->entry_account_name, p->str_account_name); - if (ugd->account_info == NULL && p->icon_get_cnt1 == 2 && + /*if (ugd->account_info == NULL && p->icon_get_cnt1 == 2 && strcmp(ugd->start_view_type, EMAIL_BUNDLE_VAL_VIEW_ACCOUNT_ADD) != 0) { p->clicked_object = p->entry_account_name; evas_object_show(p->entry_account_name); @@ -1714,7 +1744,7 @@ static Evas_Object *_gl_ef_content_get_cb(void *data, Evas_Object *obj, const ch p->clicked_object = p->entry_account_name; evas_object_show(p->entry_account_name); elm_object_focus_set(p->entry_account_name, EINA_TRUE); - } + }*/ return p->ef_account_name; } else if (index == 2) { @@ -1786,7 +1816,7 @@ static Evas_Object *_gl_ef_content_get_cb(void *data, Evas_Object *obj, const ch return p->ef_display_name; } else if (index == 4) { - p->icon_get_cnt2++; + //p->icon_get_cnt2++; debug_log(""); p->ef_email_address = elm_layout_add(p->genlist); @@ -1820,7 +1850,7 @@ static Evas_Object *_gl_ef_content_get_cb(void *data, Evas_Object *obj, const ch if (p->str_email_address) elm_entry_entry_set(p->entry_email_address, p->str_email_address); - if (ugd->account_info != NULL && p->icon_get_cnt2 == 2 && + /*if (ugd->account_info != NULL && p->icon_get_cnt2 == 2 && strcmp(ugd->start_view_type, EMAIL_BUNDLE_VAL_VIEW_ACCOUNT_ADD) != 0) { p->clicked_object = p->entry_email_address; evas_object_show(p->entry_email_address); @@ -1834,7 +1864,7 @@ static Evas_Object *_gl_ef_content_get_cb(void *data, Evas_Object *obj, const ch evas_object_show(p->entry_email_address); elm_object_focus_set(p->entry_email_address, EINA_TRUE); elm_entry_cursor_begin_set(p->entry_email_address); - } + }*/ return p->ef_email_address; } else if (index == 5) { @@ -1846,7 +1876,7 @@ static Evas_Object *_gl_ef_content_get_cb(void *data, Evas_Object *obj, const ch elm_entry_single_line_set(p->entry_password, EINA_TRUE); elm_entry_input_panel_return_key_disabled_set(p->entry_password, EINA_TRUE); elm_entry_cnp_mode_set(p->entry_password, ELM_CNP_MODE_PLAINTEXT); - elm_entry_input_panel_layout_set(p->entry_password, ELM_INPUT_PANEL_LAYOUT_EMAIL); + elm_entry_input_panel_layout_set(p->entry_password, ELM_INPUT_PANEL_LAYOUT_NORMAL); elm_entry_editable_set(p->entry_password, EINA_TRUE); elm_entry_password_set(p->entry_password, EINA_TRUE); diff --git a/setting/src/email-view-manual-setup.c b/setting/src/email-view-manual-setup.c index 535a5db..497a2ec 100755 --- a/setting/src/email-view-manual-setup.c +++ b/setting/src/email-view-manual-setup.c @@ -884,7 +884,6 @@ static Eina_Bool _after_validation_cb(void *data) setting_change_view(VIEW_SYNC_SETUP, ugd); - setting_get_small_notify(vd, _("IDS_EMAIL_POP_SUCCEEDED")); /*if (vd->ugd->start_view_type != NULL && g_strcmp0(vd->ugd->start_view_type, "first-setup") == 0) { @@ -1343,7 +1342,7 @@ static Evas_Object *_gl_ef_content_get_cb(void *data, Evas_Object *obj, const ch elm_entry_single_line_set(p->entry_password, EINA_TRUE); elm_entry_input_panel_return_key_disabled_set(p->entry_password, EINA_TRUE); elm_entry_cnp_mode_set(p->entry_password, ELM_CNP_MODE_PLAINTEXT); - elm_entry_input_panel_layout_set(p->entry_password, ELM_INPUT_PANEL_LAYOUT_EMAIL); + elm_entry_input_panel_layout_set(p->entry_password, ELM_INPUT_PANEL_LAYOUT_NORMAL); elm_entry_editable_set(p->entry_password, EINA_TRUE); elm_entry_password_set(p->entry_password, EINA_TRUE); diff --git a/setting/src/email-view-setting.c b/setting/src/email-view-setting.c index c1fa323..d7f846f 100755 --- a/setting/src/email-view-setting.c +++ b/setting/src/email-view-setting.c @@ -355,16 +355,7 @@ static void _create_list(struct viewdata *vd) else p->default_account_item = elm_genlist_item_append(p->genlist, &(p->itc6), (void *)i, git, ELM_GENLIST_ITEM_NONE, _gl_sel_cb, NULL); -/* setting UI is implemented. - i = 4; - elm_genlist_item_append(p->genlist, &(p->itc3), (void *)i, git, - ELM_GENLIST_ITEM_NONE, _priority_senders_email_cb, (void *)vd); -*/ -/* For Text templates - i = 5; - elm_genlist_item_append(p->genlist, &(p->itc3), (void *)i, git, - ELM_GENLIST_ITEM_NONE, NULL, (void *)vd); -*/ + i = 6; git = elm_genlist_item_append(p->genlist, &(p->itc5), (void *)i, NULL, ELM_GENLIST_ITEM_GROUP, NULL, NULL); diff --git a/setting/src/email-view-sync-schedule.c b/setting/src/email-view-sync-schedule.c index 4b117d2..0485931 100755 --- a/setting/src/email-view-sync-schedule.c +++ b/setting/src/email-view-sync-schedule.c @@ -738,8 +738,6 @@ static Eina_Bool _after_delete_cb(void *data) } else { setting_back_to_prev_view(vd); } - - setting_get_small_notify(vd, dgettext("sys_string", "IDS_COM_POP_DELETED")); } return ECORE_CALLBACK_CANCEL; diff --git a/setting/src/email-view-sync-setup.c b/setting/src/email-view-sync-setup.c index 1987e09..2660907 100755 --- a/setting/src/email-view-sync-setup.c +++ b/setting/src/email-view-sync-setup.c @@ -766,7 +766,6 @@ static Eina_Bool _after_delete_cb(void *data) } vd->ugd->atomic_pop = 0; - setting_get_small_notify(vd, dgettext("sys_string", "IDS_COM_POP_DELETED")); } return ECORE_CALLBACK_CANCEL; diff --git a/setting/theme/email-setting-theme.edc b/setting/theme/email-setting-theme.edc index 17c3f27..f7408ab 100755 --- a/setting/theme/email-setting-theme.edc +++ b/setting/theme/email-setting-theme.edc @@ -718,7 +718,7 @@ collections { rel2 { relative: 1.0 1.0;} } } - + part { name: "top_padding"; type: RECT; @@ -735,88 +735,6 @@ collections { } part { - name: "bg_for_sp"; - type: RECT; - scale: 1; - description { - state: "default" 0.0; - fixed: 0 1; - min: 0 80; - rel1 { relative: 0 1; to: "top_padding"; } - rel2 { relative: 1 1; to: "top_padding"; } - align: 0.0 0.0; - visible: 0; - } - } - - part { - name: "sp2"; - type: IMAGE; - description { - state: "default" 0.0; - min: 80 80; - rel1 { relative: 0.5 0.5; offset: -52 0; to: "bg_for_sp"; } - rel2 { relative: 0.5 0.5; offset: -52 0; to: "bg_for_sp"; } - align: 0.5 0.5; - image.normal: "M02_email_list_icon_gmail.png"; - } - } - - part { - name: "sp1"; - type: IMAGE; - description { - state: "default" 0.0; - min: 80 80; - rel1 { relative: 0.0 0.5; offset: -64 0; to: "sp2"; } - rel2 { relative: 0.0 0.5; offset: -64 0; to: "sp2"; } - align: 0.5 0.5; - image.normal: "M02_email_list_icon_exchange.png"; - } - } - - part { - name: "sp3"; - type: IMAGE; - description { - state: "default" 0.0; - min: 80 80; - rel1 { relative: 0.5 0.5; offset: 52 0; to: "bg_for_sp"; } - rel2 { relative: 0.5 0.5; offset: 52 0; to: "bg_for_sp"; } - align: 0.5 0.5; - image.normal: "M02_email_list_icon_hotmail.png"; - } - } - - part { - name: "sp4"; - type: IMAGE; - description { - state: "default" 0.0; - min: 80 80; - rel1 { relative: 1.0 0.5; offset: 64 0; to: "sp3"; } - rel2 { relative: 1.0 0.5; offset: 64 0; to: "sp3"; } - align: 0.5 0.5; - image.normal: "M02_email_list_icon_AOL.png"; - } - } - - part { - name: "middle_padding2"; - type: RECT; - scale: 1; - description { - state: "default" 0.0; - min: 0 52; - fixed: 0 1; - rel1 { relative: 0.0 1.0; to_y: "bg_for_sp"; } - rel2 { relative: 1.0 1.0; to_y: "bg_for_sp"; } - align: 0.0 0.0; - visible: 0; - } - } - - part { name: "label"; type: SWALLOW; scale: 1; @@ -824,14 +742,14 @@ collections { state: "default" 0.0; fixed: 0 1; min: 0 200; - rel1 { relative: 0.0 1.0; to_y: "middle_padding2"; offset: 50 0; } - rel2 { relative: 1.0 1.0; to_y: "middle_padding2"; offset: -50 0; } + rel1 { relative: 0.0 1.0; to_y: "top_padding"; offset: 50 0; } + rel2 { relative: 1.0 1.0; to_y: "top_padding"; offset: -50 0; } align: 0.5 0.0; } } - + part { - name: "middle_padding3"; + name: "middle_padding"; type: RECT; scale: 1; description { @@ -851,7 +769,7 @@ collections { scale: 1; description { state: "default" 0.0; - rel1 { relative: 0.0 1.0; to: "middle_padding3"; } + rel1 { relative: 0.0 1.0; to: "middle_padding"; } rel2 { relative: 1.0 1.0; to: "bg"; } } } @@ -878,7 +796,7 @@ collections { rel2 { relative: 1.0 1.0;} } } - + part { name: "top_padding"; type: RECT; @@ -895,75 +813,6 @@ collections { } part { - name: "bg_for_sp"; - type: RECT; - scale: 1; - description { - state: "default" 0.0; - fixed: 0 1; - min: 0 80; - rel1 { relative: 0 1; to: "top_padding"; } - rel2 { relative: 1 1; to: "top_padding"; } - align: 0.0 0.0; - visible: 0; - } - } - - part { - name: "sp2"; - type: IMAGE; - description { - state: "default" 0.0; - min: 80 80; - rel1 { relative: 0.5 0.5; to: "bg_for_sp"; } - rel2 { relative: 0.5 0.5; to: "bg_for_sp"; } - align: 0.5 0.5; - image.normal: "M02_email_list_icon_hotmail.png"; - } - } - - part { - name: "sp1"; - type: IMAGE; - description { - state: "default" 0.0; - min: 80 80; - rel1 { relative: 0.0 0.5; offset: -64 0; to: "sp2"; } - rel2 { relative: 0.0 0.5; offset: -64 0; to: "sp2"; } - align: 0.5 0.5; - image.normal: "M02_email_list_icon_gmail.png"; - } - } - - part { - name: "sp3"; - type: IMAGE; - description { - state: "default" 0.0; - min: 80 80; - rel1 { relative: 1.0 0.5; offset: 64 0; to: "sp2"; } - rel2 { relative: 1.0 0.5; offset: 64 0; to: "sp2"; } - align: 0.5 0.5; - image.normal: "M02_email_list_icon_AOL.png"; - } - } - - part { - name: "middle_padding2"; - type: RECT; - scale: 1; - description { - state: "default" 0.0; - min: 0 52; - fixed: 0 1; - rel1 { relative: 0.0 1.0; to_y: "bg_for_sp"; } - rel2 { relative: 1.0 1.0; to_y: "bg_for_sp"; } - align: 0.0 0.0; - visible: 0; - } - } - - part { name: "label"; type: SWALLOW; scale: 1; @@ -971,14 +820,14 @@ collections { state: "default" 0.0; fixed: 0 1; min: 0 200; - rel1 { relative: 0.0 1.0; to_y: "middle_padding2"; offset: 50 0; } - rel2 { relative: 1.0 1.0; to_y: "middle_padding2"; offset: -50 0; } + rel1 { relative: 0.0 1.0; to_y: "top_padding"; offset: 50 0; } + rel2 { relative: 1.0 1.0; to_y: "top_padding"; offset: -50 0; } align: 0.5 0.0; } } - + part { - name: "middle_padding3"; + name: "middle_padding"; type: RECT; scale: 1; description { @@ -998,13 +847,13 @@ collections { scale: 1; description { state: "default" 0.0; - rel1 { relative: 0.0 1.0; to: "middle_padding3"; } + rel1 { relative: 0.0 1.0; to: "middle_padding"; } rel2 { relative: 1.0 1.0; to: "bg"; } } } } } - + group { name: "initial_access_hd_public"; images { @@ -1025,7 +874,7 @@ collections { rel2 { relative: 1.0 1.0;} } } - + part { name: "top_padding"; type: RECT; @@ -1042,75 +891,6 @@ collections { } part { - name: "bg_for_sp"; - type: RECT; - scale: 1; - description { - state: "default" 0.0; - fixed: 0 1; - min: 0 248; - rel1 { relative: 0 1; to: "top_padding"; } - rel2 { relative: 1 1; to: "top_padding"; } - align: 0.0 0.0; - visible: 0; - } - } - - part { - name: "sp2"; - type: IMAGE; - description { - state: "default" 0.0; - min: 80 80; - rel1 { relative: 0.5 0.5; to: "bg_for_sp"; } - rel2 { relative: 0.5 0.5; to: "bg_for_sp"; } - align: 0.5 0.5; - image.normal: "M02_email_list_icon_hotmail.png"; - } - } - - part { - name: "sp1"; - type: IMAGE; - description { - state: "default" 0.0; - min: 80 80; - rel1 { relative: 0.0 0.5; offset: -100 0; to: "sp2"; } - rel2 { relative: 0.0 0.5; offset: -100 0; to: "sp2"; } - align: 0.5 0.5; - image.normal: "M02_email_list_icon_gmail.png"; - } - } - - part { - name: "sp3"; - type: IMAGE; - description { - state: "default" 0.0; - min: 80 80; - rel1 { relative: 1.0 0.5; offset: 100 0; to: "sp2"; } - rel2 { relative: 1.0 0.5; offset: 100 0; to: "sp2"; } - align: 0.5 0.5; - image.normal: "M02_email_list_icon_AOL.png"; - } - } - - part { - name: "middle_padding2"; - type: RECT; - scale: 1; - description { - state: "default" 0.0; - min: 0 16; - fixed: 0 1; - rel1 { relative: 0.0 1.0; to_y: "bg_for_sp"; } - rel2 { relative: 1.0 1.0; to_y: "bg_for_sp"; } - align: 0.0 0.0; - visible: 0; - } - } - - part { name: "label"; type: SWALLOW; scale: 1; @@ -1118,15 +898,15 @@ collections { state: "default" 0.0; fixed: 0 1; min: 0 114; - rel1 { relative: 0.0 1.0; to_y: "middle_padding2"; offset: 50 0; } - rel2 { relative: 1.0 1.0; to_y: "middle_padding2"; offset: -50 0; } + rel1 { relative: 0.0 1.0; to_y: "top_padding"; offset: 50 0; } + rel2 { relative: 1.0 1.0; to_y: "top_padding"; offset: -50 0; } align: 0.5 0.0; } } - + part { - name: "middle_padding3"; + name: "middle_padding"; type: RECT; scale: 1; description { @@ -1146,7 +926,7 @@ collections { scale: 1; description { state: "default" 0.0; - rel1 { relative: 0.0 1.0; to: "middle_padding3"; } + rel1 { relative: 0.0 1.0; to: "middle_padding"; } rel2 { relative: 1.0 1.0; to: "bg"; } } } @@ -1174,99 +954,18 @@ collections { rel2 { relative: 1.0 1.0;} } } - + part { name: "top_padding"; type: RECT; scale: 1; description { state: "default" 0.0; - min: 0 26; + min: 0 65; fixed: 0 1; rel1 { relative: 0 0; to: "bg"; } rel2 { relative: 1 0; to: "bg"; } - align: 0.0 0.0; - visible: 0; - } - } - - part { - name: "bg_for_sp"; - type: RECT; - scale: 1; - description { - state: "default" 0.0; - fixed: 0 1; - min: 0 248; - rel1 { relative: 0 1; to: "top_padding"; } - rel2 { relative: 1 1; to: "top_padding"; } - align: 0.0 0.0; - visible: 0; - } - } - part { - name: "sp2"; - type: IMAGE; - description { - state: "default" 0.0; - min: 80 80; - rel1 { relative: 0.5 0.5; offset: -70 0; to: "bg_for_sp"; } - rel2 { relative: 0.5 0.5; offset: -70 0; to: "bg_for_sp"; } - align: 0.5 0.5; - image.normal: "M02_email_list_icon_gmail.png"; - } - } - - part { - name: "sp1"; - type: IMAGE; - description { - state: "default" 0.0; - min: 80 80; - rel1 { relative: 0.0 0.5; offset: -100 0; to: "sp2"; } - rel2 { relative: 0.0 0.5; offset: -100 0; to: "sp2"; } - align: 0.5 0.5; - image.normal: "M02_email_list_icon_exchange.png"; - } - } - - part { - name: "sp3"; - type: IMAGE; - description { - state: "default" 0.0; - min: 80 80; - rel1 { relative: 0.5 0.5; offset: 70 0; to: "bg_for_sp"; } - rel2 { relative: 0.5 0.5; offset: 70 0; to: "bg_for_sp"; } - align: 0.5 0.5; - image.normal: "M02_email_list_icon_hotmail.png"; - } - } - - part { - name: "sp4"; - type: IMAGE; - description { - state: "default" 0.0; - min: 80 80; - rel1 { relative: 1.0 0.5; offset: 100 0; to: "sp3"; } - rel2 { relative: 1.0 0.5; offset: 100 0; to: "sp3"; } - align: 0.5 0.5; - image.normal: "M02_email_list_icon_AOL.png"; - } - } - - part { - name: "middle_padding2"; - type: RECT; - scale: 1; - description { - state: "default" 0.0; - min: 0 16; - fixed: 0 1; - rel1 { relative: 0.0 1.0; to_y: "bg_for_sp"; } - rel2 { relative: 1.0 1.0; to_y: "bg_for_sp"; } align: 0.0 0.0; visible: 0; } @@ -1280,20 +979,20 @@ collections { state: "default" 0.0; fixed: 0 1; min: 0 114; - rel1 { relative: 0.0 1.0; to_y: "middle_padding2"; offset: 50 0; } - rel2 { relative: 1.0 1.0; to_y: "middle_padding2"; offset: -50 0; } + rel1 { relative: 0.0 1.0; to_y: "top_padding"; offset: 50 0; } + rel2 { relative: 1.0 1.0; to_y: "top_padding"; offset: -50 0; } align: 0.5 0.0; } } - + part { - name: "middle_padding3"; + name: "middle_padding"; type: RECT; scale: 1; description { state: "default" 0.0; - min: 0 16; + min: 0 30; fixed: 0 1; rel1 { relative: 0.0 1.0; to_y: "label"; } rel2 { relative: 1.0 1.0; to_y: "label"; } @@ -1308,7 +1007,7 @@ collections { scale: 1; description { state: "default" 0.0; - rel1 { relative: 0.0 1.0; to: "middle_padding3"; } + rel1 { relative: 0.0 1.0; to: "middle_padding"; } rel2 { relative: 1.0 1.0; to: "bg"; } } } @@ -1492,7 +1191,7 @@ collections { } } } - + programs { program { name: "text1_clicked"; @@ -1509,7 +1208,7 @@ collections { } } } - + group { name: "account_add_checkbox_set_wvga"; parts { @@ -1687,7 +1386,7 @@ collections { } } } - + programs { program { name: "text1_clicked"; @@ -1793,7 +1492,7 @@ collections { } } } - + group { name: "account_add_manual_button_wvga"; parts { part { name: "base"; @@ -1897,7 +1596,7 @@ collections { align: 0.0 0.0; } } - + part { name: "list"; type: SWALLOW; scale: 1; @@ -1946,7 +1645,7 @@ collections { align: 0.0 0.0; } } - + part { name: "list"; type: SWALLOW; scale: 1; @@ -1980,9 +1679,9 @@ collections { } } } - + #define _SCALE 0.64 - + group { name: "account_add_wvga"; parts { part { name: "bg"; @@ -1997,7 +1696,7 @@ collections { align: 0.0 0.0; } } - + part { name: "list"; type: SWALLOW; scale: 1; @@ -2046,7 +1745,7 @@ collections { align: 0.0 0.0; } } - + part { name: "list"; type: SWALLOW; scale: 1; @@ -2080,7 +1779,7 @@ collections { } } } - + group { name: "elm/genlist/item/dialogue/email.1text.1icon.2/default"; alias: "elm/genlist/item_odd/dialogue/email.1text.1icon.2/default"; alias: "elm/genlist/item_compress/dialogue/email.1text.1icon.2/default"; @@ -2118,7 +1817,7 @@ collections { } GENLIST_DESCRIPTION_FLIP_ENABLED } - + part { name: "elm.padding.icon.right"; clip_to: "disclip"; type: RECT; @@ -2135,7 +1834,7 @@ collections { visible: 0; } } - + part { name: "elm.text"; clip_to: "disclip"; type: TEXT; @@ -2203,7 +1902,7 @@ collections { //GENLIST_PROGRAM_PLAY_BUTTON_PRESS } } - + group { name: "elm/bg/base/email_default"; parts { part { name: "base"; @@ -2213,17 +1912,17 @@ collections { color: 210 210 210 255; } } - + part { name: "elm.swallow.rectangle"; type: SWALLOW; description { state: "default" 0.0; } } - + part { name: "elm.swallow.background"; type: SWALLOW; description { state: "default" 0.0; } } - + part { name: "elm.swallow.content"; type: SWALLOW; description { state: "default" 0.0; }