diff options
-rw-r--r-- | modules/mail/e-mail-shell-view-actions.c | 74 | ||||
-rw-r--r-- | modules/mail/e-mail-shell-view-actions.h | 4 | ||||
-rw-r--r-- | modules/mail/e-mail-shell-view.c | 2 | ||||
-rw-r--r-- | ui/evolution-mail.ui | 4 |
4 files changed, 47 insertions, 37 deletions
diff --git a/modules/mail/e-mail-shell-view-actions.c b/modules/mail/e-mail-shell-view-actions.c index ab37d31a62..272edfb689 100644 --- a/modules/mail/e-mail-shell-view-actions.c +++ b/modules/mail/e-mail-shell-view-actions.c @@ -132,19 +132,6 @@ action_mail_download_cb (GtkAction *action, } static void -action_mail_empty_trashes_cb (GtkAction *action, - EMailShellView *mail_shell_view) -{ - EShellWindow *shell_window; - EShellView *shell_view; - - shell_view = E_SHELL_VIEW (mail_shell_view); - shell_window = e_shell_view_get_shell_window (shell_view); - - em_utils_empty_trash (GTK_WIDGET (shell_window)); -} - -static void action_mail_flush_outbox_cb (GtkAction *action, EMailShellView *mail_shell_view) { @@ -194,17 +181,27 @@ static void action_mail_folder_expunge_cb (GtkAction *action, EMailShellView *mail_shell_view) { - EMailReader *reader; + EMailShellSidebar *mail_shell_sidebar; + EMFolderTree *folder_tree; EShellWindow *shell_window; EShellView *shell_view; CamelFolder *folder; + /* This handles both the "folder-expunge" and "account-expunge" + * actions. */ + shell_view = E_SHELL_VIEW (mail_shell_view); shell_window = e_shell_view_get_shell_window (shell_view); - reader = E_MAIL_READER (mail_shell_view->priv->mail_shell_content); + /* Get the folder from the folder tree, not the message list. + * This correctly handles the use case of right-clicking on + * the "Trash" folder and selecting "Empty Trash" without + * actually selecting the folder. In that case the message + * list would not contain the correct folder to expunge. */ - folder = e_mail_reader_get_folder (reader); + mail_shell_sidebar = mail_shell_view->priv->mail_shell_sidebar; + folder_tree = e_mail_shell_sidebar_get_folder_tree (mail_shell_sidebar); + folder = em_folder_tree_get_selected_folder (folder_tree); g_return_if_fail (folder != NULL); em_utils_expunge_folder (GTK_WIDGET (shell_window), folder); @@ -396,6 +393,19 @@ action_mail_folder_unsubscribe_cb (GtkAction *action, } static void +action_mail_global_expunge_cb (GtkAction *action, + EMailShellView *mail_shell_view) +{ + EShellWindow *shell_window; + EShellView *shell_view; + + shell_view = E_SHELL_VIEW (mail_shell_view); + shell_window = e_shell_view_get_shell_window (shell_view); + + em_utils_empty_trash (GTK_WIDGET (shell_window)); +} + +static void action_mail_hide_deleted_cb (GtkToggleAction *action, EMailShellView *mail_shell_view) { @@ -915,6 +925,13 @@ static GtkActionEntry mail_entries[] = { N_("Disable this account"), G_CALLBACK (action_mail_account_disable_cb) }, + { "mail-account-expunge", + NULL, + N_("_Empty Trash"), + NULL, + N_("Permanently remove all the deleted messages from all folders"), + G_CALLBACK (action_mail_folder_expunge_cb) }, + { "mail-create-search-folder", NULL, N_("C_reate Search Folder From Search..."), @@ -929,20 +946,6 @@ static GtkActionEntry mail_entries[] = { N_("Download messages of accounts and folders marked for offline"), G_CALLBACK (action_mail_download_cb) }, - { "mail-empty-trashes", /* this is File->Empty Trash action */ - NULL, - N_("Empty _Trash"), - NULL, - N_("Permanently remove all the deleted messages from all folders"), - G_CALLBACK (action_mail_empty_trashes_cb) }, - - { "mail-empty-trash", /* this is a popup action over the trash folder */ - NULL, - N_("_Empty Trash"), - NULL, - N_("Permanently remove all the deleted messages from all folders"), - G_CALLBACK (action_mail_folder_expunge_cb) }, - { "mail-flush-outbox", "mail-send", N_("Fl_ush Outbox"), @@ -1034,6 +1037,13 @@ static GtkActionEntry mail_entries[] = { N_("Unsubscribe from the selected folder"), G_CALLBACK (action_mail_folder_unsubscribe_cb) }, + { "mail-global-expunge", + NULL, + N_("Empty _Trash"), + NULL, + N_("Permanently remove all the deleted messages from all accounts"), + G_CALLBACK (action_mail_global_expunge_cb) }, + { "mail-label-new", NULL, N_("_New Label"), @@ -1155,9 +1165,9 @@ static EPopupActionEntry mail_popup_entries[] = { NULL, "mail-account-disable" }, - { "mail-popup-empty-trash", + { "mail-popup-account-expunge", NULL, - "mail-empty-trash" }, + "mail-account-expunge" }, { "mail-popup-flush-outbox", NULL, diff --git a/modules/mail/e-mail-shell-view-actions.h b/modules/mail/e-mail-shell-view-actions.h index 0ddc29488e..eb11f46013 100644 --- a/modules/mail/e-mail-shell-view-actions.h +++ b/modules/mail/e-mail-shell-view-actions.h @@ -27,6 +27,8 @@ /* Mail Actions */ #define E_SHELL_WINDOW_ACTION_MAIL_ACCOUNT_DISABLE(window) \ E_SHELL_WINDOW_ACTION ((window), "mail-account-disable") +#define E_SHELL_WINDOW_ACTION_MAIL_ACCOUNT_EXPUNGE(window) \ + E_SHELL_WINDOW_ACTION ((window), "mail-account-expunge") #define E_SHELL_WINDOW_ACTION_MAIL_ADD_SENDER(window) \ E_SHELL_WINDOW_ACTION ((window), "mail-add-sender") #define E_SHELL_WINDOW_ACTION_MAIL_CARET_MODE(window) \ @@ -43,8 +45,6 @@ E_SHELL_WINDOW_ACTION ((window), "mail-delete") #define E_SHELL_WINDOW_ACTION_MAIL_DOWNLOAD(window) \ E_SHELL_WINDOW_ACTION ((window), "mail-download") -#define E_SHELL_WINDOW_ACTION_MAIL_EMPTY_TRASH(window) \ - E_SHELL_WINDOW_ACTION ((window), "mail-empty-trash") #define E_SHELL_WINDOW_ACTION_MAIL_FILTER_ON_MAILING_LIST(window) \ E_SHELL_WINDOW_ACTION ((window), "mail-filter-on-mailing-list") #define E_SHELL_WINDOW_ACTION_MAIL_FILTER_ON_RECIPIENTS(window) \ diff --git a/modules/mail/e-mail-shell-view.c b/modules/mail/e-mail-shell-view.c index e86a5bb6ac..6016a14717 100644 --- a/modules/mail/e-mail-shell-view.c +++ b/modules/mail/e-mail-shell-view.c @@ -527,7 +527,7 @@ mail_shell_view_update_actions (EShellView *shell_view) gtk_action_set_sensitive (action, sensitive); g_object_set (action, "label", label, NULL); - action = ACTION (MAIL_EMPTY_TRASH); + action = ACTION (MAIL_ACCOUNT_EXPUNGE); sensitive = folder_is_trash; gtk_action_set_sensitive (action, sensitive); diff --git a/ui/evolution-mail.ui b/ui/evolution-mail.ui index ec971201d1..cf012efcf7 100644 --- a/ui/evolution-mail.ui +++ b/ui/evolution-mail.ui @@ -2,7 +2,7 @@ <menubar name='main-menu'> <menu action='file-menu'> <placeholder name='long-running-actions'> - <menuitem action='mail-empty-trashes'/> + <menuitem action='mail-global-expunge'/> <menuitem action='mail-download'/> </placeholder> </menu> @@ -78,7 +78,7 @@ <menuitem action='mail-popup-folder-rename'/> <menuitem action='mail-popup-folder-refresh'/> <menuitem action='mail-popup-flush-outbox'/> - <menuitem action='mail-popup-empty-trash'/> + <menuitem action='mail-popup-account-expunge'/> <menuitem action='mail-popup-account-disable'/> <separator/> <menuitem action='mail-popup-folder-unsubscribe'/> |