diff options
author | Sankar P <psankar@novell.com> | 2008-06-19 18:35:28 +0800 |
---|---|---|
committer | Sankarasivasubramanian Pasupathilingam <psankar@src.gnome.org> | 2008-06-19 18:35:28 +0800 |
commit | 8b47322170aaa87bd4a60a41027885c7ee7d1d69 (patch) | |
tree | 612665dcb35d72e149d6957a6d6fcfedb6b53cc1 /plugins/groupwise-features/mail-retract.c | |
parent | 3fb43a13154fd27f93d51f5c85bc6a91dbd55463 (diff) | |
download | gsoc2013-evolution-8b47322170aaa87bd4a60a41027885c7ee7d1d69.tar.gz gsoc2013-evolution-8b47322170aaa87bd4a60a41027885c7ee7d1d69.tar.zst gsoc2013-evolution-8b47322170aaa87bd4a60a41027885c7ee7d1d69.zip |
Ask the user if he really wants to retract mails. Re-arrange the menus a
2008-06-19 Sankar P <psankar@novell.com>
* mail-retract.c (retract_mail_settings):
Ask the user if he really wants to retract mails.
Re-arrange the menus a little for grouping related things.
svn path=/trunk/; revision=35653
Diffstat (limited to 'plugins/groupwise-features/mail-retract.c')
-rw-r--r-- | plugins/groupwise-features/mail-retract.c | 37 |
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) |