MSG_UI_RET_IF(MSG_UI_LEVEL_ERR, !thread || !data || !msg_data);
PMSG_BUBBLE_DATA pData = (PMSG_BUBBLE_DATA)data;
- char buf[DEF_BUF_LEN_S] = {0,};
int *ret = msg_data;
D_MSG("Delete message return value =[%d]", *ret);
if (*ret == MSG_SUCCESS) {
- if (pData->progressbar) {
- snprintf(buf, sizeof(buf), "%d/%d %s", pData->del_index + 1, pData->check_cnt, dgettext("sys_string", "IDS_COM_POP_DELETED"));
- elm_object_text_set(pData->progresslabel, buf);
+ if (pData->progressbar)
elm_progressbar_value_set(pData->progressbar, (double) (pData->del_index + 1) / pData->check_cnt);
- }
} else if (*ret == BUBBLE_RETURN_DELETE_CANCEL) {
if (pData->del_cancel == true) {
_delete_finish(pData);
msg_error_t err = MSG_SUCCESS;
- err = msg_delete_thread_message_list(pData->msgHandle, pData->threadId, false);
+ err = msg_delete_thread_message_list(pData->msgHandle, pData->threadId, true);
if (err == MSG_SUCCESS) {
pData->bubble_count = 0;
msg_ui_bubble_close_title_menu_genlist(pData);
}
+static void __msg_ui_bubble_popup_button_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ PMSG_BUBBLE_DATA pData = (PMSG_BUBBLE_DATA)data;
+ MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)pData->callback_data;
+ Evas_Object *check = NULL;
+ Eina_Bool include_protected = EINA_FALSE;
+ PMSG_APP_CONV_DATA_S item_data = NULL;
+
+ if (pData->popup) {
+ if (obj == elm_object_part_content_get(pData->popup, "button1")) {
+ // delete
+ check = (Evas_Object *)evas_object_data_get(pData->popup, "check");
+ if (check)
+ include_protected = elm_check_state_get(check);
+
+ bool isDraft = msg_ui_composer_common_is_send_possible(cd);
+
+ if (pData->sel_all_checked && isDraft == false && (!check || include_protected == EINA_TRUE)) {
+ pData->bubble_count = 0;
+ _del_all_item(pData);
+ } else {
+ if (!include_protected) {
+ int i = pData->check_cnt;
+ for (; i > 0; i--) {
+ item_data = eina_list_nth(pData->chk_list, i-1);
+ if (item_data && item_data->bProtected) {
+ pData->chk_list = eina_list_remove(pData->chk_list, item_data);
+ pData->check_cnt--;
+ }
+ }
+ }
+ evas_object_del(pData->popup);
+ pData->popup = NULL;
+
+ pData->popup = msg_ui_bubble_show_notify_with_progressbar(pData, pData->check_cnt);
+ pData->del_thread = ecore_thread_feedback_run(_del_thread_fn, _del_thread_feedback_fn, NULL, NULL, (void *)pData, EINA_TRUE);
+ }
+ } else {
+ evas_object_del(pData->popup);
+ pData->popup = NULL;
+ }
+ }
+}
+
+
+static Evas_Object *__msg_ui_bubble_delete_confirm_popup(PMSG_BUBBLE_DATA pData)
+{
+ D_ENTER;
+ MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)pData->callback_data;
+
+ Evas_Object *popup = NULL;
+ Evas_Object *layout = NULL;
+ Evas_Object *check = NULL;
+ Evas_Object *ok_btn = NULL;
+ Evas_Object *cancel_btn = NULL;
+ Eina_List *l = NULL;
+ bool is_protected_msg = false;
+ PMSG_APP_CONV_DATA_S item_data = NULL;
+
+ popup = elm_popup_add(cd->main_window);
+ evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
+ elm_object_part_text_set(popup, "title,text", dgettext(MESSAGE_PKGNAME, "IDS_MSGF_OPT_DELETE_Q"));
+
+ layout = elm_layout_add(popup);
+ elm_layout_file_set(layout, MSG_COMMON_EDJ, "popup_with_checkbox");
+ evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, 0.0);
+
+ EINA_LIST_FOREACH(pData->chk_list, l, item_data) {
+ if (item_data && item_data->bProtected) {
+ is_protected_msg = true;
+ break;
+ }
+ }
+ if (is_protected_msg) {
+ check = elm_check_add(popup);
+ evas_object_size_hint_align_set(check, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_size_hint_weight_set(check, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_object_part_content_set(layout, "elm.swallow.check", check);
+ evas_object_show(check);
+
+ elm_object_part_text_set(layout, "elm.text", dgettext(MESSAGE_PKGNAME, "IDS_MSGF_POP_INCLUDE_PROTECTED_MESSAGE"));
+ evas_object_data_set(popup, "check", check);
+ }
+
+ evas_object_show(layout);
+ elm_object_content_set(popup, layout);
+
+ ok_btn = elm_button_add(popup);
+ elm_object_style_set(ok_btn, "popup_button/default");
+ elm_object_text_set(ok_btn, dgettext("sys_string", "IDS_COM_SK_DELETE"));
+ elm_object_part_content_set(popup, "button1", ok_btn);
+ evas_object_smart_callback_add(ok_btn, "clicked", __msg_ui_bubble_popup_button_clicked_cb, pData);
+
+ cancel_btn = elm_button_add(popup);
+ elm_object_style_set(cancel_btn, "popup_button/default");
+ elm_object_text_set(cancel_btn, dgettext("sys_string", "IDS_COM_SK_CANCEL"));
+ elm_object_part_content_set(popup, "button2", cancel_btn);
+ evas_object_smart_callback_add(cancel_btn, "clicked", __msg_ui_bubble_popup_button_clicked_cb, pData);
+
+ evas_object_show(popup);
+
+ return popup;
+}
+
+
void msg_ui_bubble_ctlbar_delete_cb(void *data, Evas_Object *obj, void *event_info)
{
D_ENTER;
pData->popup = NULL;
}
- bool isDraft = msg_ui_composer_common_is_send_possible(cd);
-
- if (pData->sel_all_checked && isDraft == false) {
- pData->bubble_count = 0;
- _del_all_item(pData);
- } else {
- pData->popup = msg_ui_bubble_show_notify_with_progressbar(pData, pData->check_cnt);
- pData->del_thread = ecore_thread_feedback_run(_del_thread_fn, _del_thread_feedback_fn, NULL, NULL, (void *)pData, EINA_TRUE);
- }
-
+ pData->popup = __msg_ui_bubble_delete_confirm_popup(pData);
}
void msg_ui_bubble_ctlbar_cancel_cb(void *data, Evas_Object *obj, void *event_info)