aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/groupwise-features/mail-retract.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/groupwise-features/mail-retract.c')
-rw-r--r--plugins/groupwise-features/mail-retract.c37
1 files changed, 29 insertions, 8 deletions
diff --git a/plugins/groupwise-features/mail-retract.c b/plugins/groupwise-features/mail-retract.c
index 2026bb714e..a9219c2038 100644
--- a/plugins/groupwise-features/mail-retract.c
+++ b/plugins/groupwise-features/mail-retract.c
@@ -42,22 +42,43 @@ static void retract_mail_settings (EPopup *ep, EPopupItem *item, void *data)
CamelFolder *folder = (CamelFolder *)data;
CamelStore *store = folder->parent_store;
char *id;
+ GtkWidget *confirm_dialog, *confirm_warning;
cnc = get_cnc (store);
id = (char *)item->user_data;
- if (e_gw_connection_retract_request (cnc, id, NULL, FALSE, FALSE) != E_GW_CONNECTION_STATUS_OK )
- e_error_run (NULL, "org.gnome.evolution.message.retract:retract-failure", NULL);
- else {
- GtkWidget *dialog;
- dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE, _("Message retracted successfully"));
- gtk_dialog_run (GTK_DIALOG(dialog));
- gtk_widget_destroy (dialog);
+ confirm_dialog = gtk_dialog_new_with_buttons (_("Message Retract"), NULL,
+ GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_STOCK_YES, GTK_RESPONSE_YES,
+ GTK_STOCK_NO, GTK_RESPONSE_NO, NULL);
+
+ confirm_warning = gtk_label_new (_("Retracting a message may remove it from the recipient's mailbox. Are you sure you want to do this ?"));
+ gtk_label_set_line_wrap (GTK_LABEL (confirm_warning), TRUE);
+ gtk_label_set_selectable (GTK_LABEL (confirm_warning), TRUE);
+
+ gtk_container_add (GTK_CONTAINER ((GTK_DIALOG(confirm_dialog))->vbox), confirm_warning);
+ gtk_widget_set_size_request (confirm_dialog, 400, 100);
+ gtk_widget_show_all (confirm_dialog);
+
+ if (gtk_dialog_run (GTK_DIALOG (confirm_dialog)) == GTK_RESPONSE_YES) {
+
+ if (e_gw_connection_retract_request (cnc, id, NULL, FALSE, FALSE) != E_GW_CONNECTION_STATUS_OK )
+ e_error_run (NULL, "org.gnome.evolution.message.retract:retract-failure", NULL);
+ else {
+ GtkWidget *dialog;
+ dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE, _("Message retracted successfully"));
+ gtk_dialog_run (GTK_DIALOG(dialog));
+ gtk_widget_destroy (dialog);
+ }
}
+
+ gtk_widget_destroy (confirm_warning);
+ gtk_widget_destroy (confirm_dialog);
}
static EPopupItem popup_items[] = {
-{ E_POPUP_ITEM, "50.emfv.06", N_("Retract Mail"), retract_mail_settings, NULL, NULL, 0, EM_POPUP_SELECT_MANY|EM_FOLDER_VIEW_SELECT_LISTONLY}
+{ E_POPUP_BAR, "20.emfv.03" },
+{ E_POPUP_ITEM, "20.emfv.04", N_("Retract Mail"), retract_mail_settings, NULL, NULL, 0, EM_POPUP_SELECT_ONE|EM_FOLDER_VIEW_SELECT_LISTONLY}
};
static void popup_free (EPopup *ep, GSList *items, void *data)