aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2008-12-18 10:04:27 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2008-12-18 10:04:27 +0800
commitda75a8ebebe61c6f36c961f63f47f4a446502eed (patch)
tree4defe366fbb631ba6215a00182a540bd0b95e295 /mail
parentd05caaf34695a99fba53f0ec59b23568e8746454 (diff)
downloadgsoc2013-evolution-da75a8ebebe61c6f36c961f63f47f4a446502eed.tar
gsoc2013-evolution-da75a8ebebe61c6f36c961f63f47f4a446502eed.tar.gz
gsoc2013-evolution-da75a8ebebe61c6f36c961f63f47f4a446502eed.tar.bz2
gsoc2013-evolution-da75a8ebebe61c6f36c961f63f47f4a446502eed.tar.lz
gsoc2013-evolution-da75a8ebebe61c6f36c961f63f47f4a446502eed.tar.xz
gsoc2013-evolution-da75a8ebebe61c6f36c961f63f47f4a446502eed.tar.zst
gsoc2013-evolution-da75a8ebebe61c6f36c961f63f47f4a446502eed.zip
Implement more mail actions. Slowly phasing out EMFolderView.
svn path=/branches/kill-bonobo/; revision=36914
Diffstat (limited to 'mail')
-rw-r--r--mail/e-mail-shell-content.c38
-rw-r--r--mail/e-mail-shell-content.h6
-rw-r--r--mail/e-mail-shell-view-actions.c456
-rw-r--r--mail/e-mail-shell-view-private.h2
-rw-r--r--mail/em-folder-view.c649
-rw-r--r--mail/em-folder-view.h1
6 files changed, 756 insertions, 396 deletions
diff --git a/mail/e-mail-shell-content.c b/mail/e-mail-shell-content.c
index 7ab8dbbcd2..025b49c18a 100644
--- a/mail/e-mail-shell-content.c
+++ b/mail/e-mail-shell-content.c
@@ -29,7 +29,6 @@
#include "widgets/menus/gal-view-instance.h"
#include "em-folder-view.h"
-#include "em-format-html-display.h"
#include "em-search-context.h"
#include "em-utils.h"
#include "mail-config.h"
@@ -196,11 +195,10 @@ mail_shell_content_constructed (GObject *object)
container = widget;
- widget = em_folder_view_new ();
- gtk_paned_add1 (GTK_PANED (container), ((EMFolderView *) widget)->list);
- gtk_widget_show (((EMFolderView *) widget)->list);
- /*gtk_paned_add1 (GTK_PANED (container), widget);*/
- priv->folder_view = g_object_ref (widget);
+ /* XXX Kill EMFolderView? */
+ priv->folder_view = em_folder_view_new ();
+ widget = GTK_WIDGET (((EMFolderView *) priv->folder_view)->list);
+ gtk_paned_add1 (GTK_PANED (container), widget);
gtk_widget_show (widget);
widget = gtk_scrolled_window_new (NULL, NULL);
@@ -214,9 +212,11 @@ mail_shell_content_constructed (GObject *object)
container = widget;
+ /* XXX Kill EMFolderView? */
priv->preview = ((EMFolderView *) priv->folder_view)->preview;
- gtk_container_add (GTK_CONTAINER (container), ((EMFormatHTML *) priv->preview)->html);
- gtk_widget_show (((EMFormatHTML *) priv->preview)->html);
+ widget = GTK_WIDGET (((EMFormatHTML *) priv->preview)->html);
+ gtk_container_add (GTK_CONTAINER (container), widget);
+ gtk_widget_show (widget);
/* Load the view instance. */
@@ -343,6 +343,15 @@ e_mail_shell_content_get_folder_view (EMailShellContent *mail_shell_content)
return EM_FOLDER_VIEW (mail_shell_content->priv->folder_view);
}
+EMFormatHTMLDisplay *
+e_mail_shell_content_get_preview_format (EMailShellContent *mail_shell_content)
+{
+ g_return_val_if_fail (
+ E_IS_MAIL_SHELL_CONTENT (mail_shell_content), NULL);
+
+ return mail_shell_content->priv->preview;
+}
+
gboolean
e_mail_shell_content_get_preview_visible (EMailShellContent *mail_shell_content)
{
@@ -377,6 +386,19 @@ e_mail_shell_content_set_preview_visible (EMailShellContent *mail_shell_content,
g_object_notify (G_OBJECT (mail_shell_content), "preview-visible");
}
+GtkWidget *
+e_mail_shell_content_get_preview_widget (EMailShellContent *mail_shell_content)
+{
+ EMFormatHTML *format;
+
+ g_return_val_if_fail (
+ E_IS_MAIL_SHELL_CONTENT (mail_shell_content), NULL);
+
+ format = (EMFormatHTML *) mail_shell_content->priv->preview;
+
+ return GTK_WIDGET (format->html);
+}
+
gboolean
e_mail_shell_content_get_vertical_view (EMailShellContent *mail_shell_content)
{
diff --git a/mail/e-mail-shell-content.h b/mail/e-mail-shell-content.h
index a15dd0309b..a804919c2d 100644
--- a/mail/e-mail-shell-content.h
+++ b/mail/e-mail-shell-content.h
@@ -26,6 +26,7 @@
#include <shell/e-shell-view.h>
#include "em-folder-view.h"
+#include "em-format-html-display.h"
/* Standard GObject macros */
#define E_TYPE_MAIL_SHELL_CONTENT \
@@ -87,11 +88,16 @@ GType e_mail_shell_content_get_type (void);
GtkWidget * e_mail_shell_content_new (EShellView *shell_view);
EMFolderView * e_mail_shell_content_get_folder_view
(EMailShellContent *mail_shell_content);
+EMFormatHTMLDisplay *
+ e_mail_shell_content_get_preview_format
+ (EMailShellContent *mail_shell_content);
gboolean e_mail_shell_content_get_preview_visible
(EMailShellContent *mail_shell_content);
void e_mail_shell_content_set_preview_visible
(EMailShellContent *mail_shell_content,
gboolean preview_visible);
+GtkWidget * e_mail_shell_content_get_preview_widget
+ (EMailShellContent *mail_shell_content);
gboolean e_mail_shell_content_get_vertical_view
(EMailShellContent *mail_shell_content);
void e_mail_shell_content_set_vertical_view
diff --git a/mail/e-mail-shell-view-actions.c b/mail/e-mail-shell-view-actions.c
index 42c8070298..6195dce936 100644
--- a/mail/e-mail-shell-view-actions.c
+++ b/mail/e-mail-shell-view-actions.c
@@ -26,10 +26,40 @@ static gchar *default_xfer_messages_uri;
static void
action_mail_add_sender_cb (GtkAction *action,
- EMailShellView *mail_shell_view)
+ EMailShellView *mail_shell_view)
{
- /* FIXME */
- g_print ("Action: %s\n", gtk_action_get_name (GTK_ACTION (action)));
+ EMailShellContent *mail_shell_content;
+ EMFolderView *folder_view;
+ EShellWindow *shell_window;
+ EShellView *shell_view;
+ CamelMessageInfo *info;
+ GPtrArray *uids;
+ const gchar *address;
+
+ shell_view = E_SHELL_VIEW (mail_shell_view);
+ shell_window = e_shell_view_get_shell_window (shell_view);
+
+ mail_shell_content = mail_shell_view->priv->mail_shell_content;
+ folder_view = e_mail_shell_content_get_folder_view (mail_shell_content);
+
+ uids = message_list_get_selected (folder_view->list);
+
+ if (uids->len != 1)
+ goto exit;
+
+ info = camel_folder_get_message_info (
+ folder_view->folder, uids->pdata[0]);
+ if (info == NULL)
+ goto exit;
+
+ address = camel_message_info_from (info);
+ if (address == NULL || *address == '\0')
+ goto exit;
+
+ em_utils_add_address (GTK_WIDGET (shell_window), address);
+
+exit:
+ em_utils_uids_free (uids);
}
static void
@@ -44,16 +74,29 @@ static void
action_mail_check_for_junk_cb (GtkAction *action,
EMailShellView *mail_shell_view)
{
- /* FIXME */
- g_print ("Action: %s\n", gtk_action_get_name (GTK_ACTION (action)));
+ EMailShellContent *mail_shell_content;
+ EMFolderView *folder_view;
+ GPtrArray *uids;
+
+ mail_shell_content = mail_shell_view->priv->mail_shell_content;
+ folder_view = e_mail_shell_content_get_folder_view (mail_shell_content);
+
+ uids = message_list_get_selected (folder_view->list);
+
+ mail_filter_junk (folder_view->folder, uids);
}
static void
action_mail_clipboard_copy_cb (GtkAction *action,
EMailShellView *mail_shell_view)
{
- /* FIXME */
- g_print ("Action: %s\n", gtk_action_get_name (GTK_ACTION (action)));
+ EMailShellContent *mail_shell_content;
+ GtkWidget *preview;
+
+ mail_shell_content = mail_shell_view->priv->mail_shell_content;
+ preview = e_mail_shell_content_get_preview_widget (mail_shell_content);
+
+ gtk_html_copy (GTK_HTML (preview));
}
static void
@@ -146,8 +189,13 @@ static void
action_mail_empty_trash_cb (GtkAction *action,
EMailShellView *mail_shell_view)
{
- /* FIXME */
- g_print ("Action: %s\n", gtk_action_get_name (GTK_ACTION (action)));
+ 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
@@ -186,8 +234,16 @@ static void
action_mail_filters_apply_cb (GtkAction *action,
EMailShellView *mail_shell_view)
{
- /* FIXME */
- g_print ("Action: %s\n", gtk_action_get_name (GTK_ACTION (action)));
+ EMailShellContent *mail_shell_content;
+ EMFolderView *folder_view;
+ GPtrArray *uids;
+
+ mail_shell_content = mail_shell_view->priv->mail_shell_content;
+ folder_view = e_mail_shell_content_get_folder_view (mail_shell_content);
+
+ uids = message_list_get_selected (folder_view->list);
+
+ mail_filter_on_demand (folder_view->folder, uids);
}
static void
@@ -330,32 +386,100 @@ static void
action_mail_forward_cb (GtkAction *action,
EMailShellView *mail_shell_view)
{
- /* FIXME */
- g_print ("Action: %s\n", gtk_action_get_name (GTK_ACTION (action)));
+ EMailShellContent *mail_shell_content;
+ EMFolderView *folder_view;
+ EShellWindow *shell_window;
+ EShellView *shell_view;
+ GPtrArray *uids;
+
+ shell_view = E_SHELL_VIEW (mail_shell_view);
+ shell_window = e_shell_view_get_shell_window (shell_view);
+
+ mail_shell_content = mail_shell_view->priv->mail_shell_content;
+ folder_view = e_mail_shell_content_get_folder_view (mail_shell_content);
+
+ if (!em_utils_check_user_can_send_mail (GTK_WIDGET (shell_window)))
+ return;
+
+ uids = message_list_get_selected (folder_view->list);
+
+ em_utils_forward_messages (
+ folder_view->folder, uids, folder_view->folder_uri);
}
static void
action_mail_forward_attached_cb (GtkAction *action,
EMailShellView *mail_shell_view)
{
- /* FIXME */
- g_print ("Action: %s\n", gtk_action_get_name (GTK_ACTION (action)));
+ EMailShellContent *mail_shell_content;
+ EMFolderView *folder_view;
+ EShellWindow *shell_window;
+ EShellView *shell_view;
+ GPtrArray *uids;
+
+ shell_view = E_SHELL_VIEW (mail_shell_view);
+ shell_window = e_shell_view_get_shell_window (shell_view);
+
+ mail_shell_content = mail_shell_view->priv->mail_shell_content;
+ folder_view = e_mail_shell_content_get_folder_view (mail_shell_content);
+
+ if (!em_utils_check_user_can_send_mail (GTK_WIDGET (shell_window)))
+ return;
+
+ uids = message_list_get_selected (folder_view->list);
+
+ em_utils_forward_attached (
+ folder_view->folder, uids, folder_view->folder_uri);
}
static void
action_mail_forward_inline_cb (GtkAction *action,
EMailShellView *mail_shell_view)
{
- /* FIXME */
- g_print ("Action: %s\n", gtk_action_get_name (GTK_ACTION (action)));
+ EMailShellContent *mail_shell_content;
+ EMFolderView *folder_view;
+ EShellWindow *shell_window;
+ EShellView *shell_view;
+ GPtrArray *uids;
+
+ shell_view = E_SHELL_VIEW (mail_shell_view);
+ shell_window = e_shell_view_get_shell_window (shell_view);
+
+ mail_shell_content = mail_shell_view->priv->mail_shell_content;
+ folder_view = e_mail_shell_content_get_folder_view (mail_shell_content);
+
+ if (!em_utils_check_user_can_send_mail (GTK_WIDGET (shell_window)))
+ return;
+
+ uids = message_list_get_selected (folder_view->list);
+
+ em_utils_forward_inline (
+ folder_view->folder, uids, folder_view->folder_uri);
}
static void
action_mail_forward_quoted_cb (GtkAction *action,
EMailShellView *mail_shell_view)
{
- /* FIXME */
- g_print ("Action: %s\n", gtk_action_get_name (GTK_ACTION (action)));
+ EMailShellContent *mail_shell_content;
+ EMFolderView *folder_view;
+ EShellWindow *shell_window;
+ EShellView *shell_view;
+ GPtrArray *uids;
+
+ shell_view = E_SHELL_VIEW (mail_shell_view);
+ shell_window = e_shell_view_get_shell_window (shell_view);
+
+ mail_shell_content = mail_shell_view->priv->mail_shell_content;
+ folder_view = e_mail_shell_content_get_folder_view (mail_shell_content);
+
+ if (!em_utils_check_user_can_send_mail (GTK_WIDGET (shell_window)))
+ return;
+
+ uids = message_list_get_selected (folder_view->list);
+
+ em_utils_forward_quoted (
+ folder_view->folder, uids, folder_view->folder_uri);
}
static void
@@ -386,8 +510,13 @@ static void
action_mail_load_images_cb (GtkAction *action,
EMailShellView *mail_shell_view)
{
- /* FIXME */
- g_print ("Action: %s\n", gtk_action_get_name (GTK_ACTION (action)));
+ EMailShellContent *mail_shell_content;
+ EMFormatHTMLDisplay *format;
+
+ mail_shell_content = mail_shell_view->priv->mail_shell_content;
+ format = e_mail_shell_content_get_preview_format (mail_shell_content);
+
+ em_format_html_load_http ((EMFormatHTML *) format);
}
static void
@@ -508,16 +637,45 @@ static void
action_mail_message_edit_cb (GtkAction *action,
EMailShellView *mail_shell_view)
{
- /* FIXME */
- g_print ("Action: %s\n", gtk_action_get_name (GTK_ACTION (action)));
+ EMailShellContent *mail_shell_content;
+ EMFolderView *folder_view;
+ EShellWindow *shell_window;
+ EShellView *shell_view;
+ GPtrArray *uids;
+
+ shell_view = E_SHELL_VIEW (mail_shell_view);
+ shell_window = e_shell_view_get_shell_window (shell_view);
+
+ mail_shell_content = mail_shell_view->priv->mail_shell_content;
+ folder_view = e_mail_shell_content_get_folder_view (mail_shell_content);
+
+ if (!em_utils_check_user_can_send_mail (GTK_WIDGET (shell_window)))
+ return;
+
+ uids = message_list_get_selected (folder_view->list);
+
+ em_utils_edit_messages (folder_view->folder, uids, FALSE);
}
static void
action_mail_message_new_cb (GtkAction *action,
EMailShellView *mail_shell_view)
{
- /* FIXME */
- g_print ("Action: %s\n", gtk_action_get_name (GTK_ACTION (action)));
+ EMailShellContent *mail_shell_content;
+ EMFolderView *folder_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);
+
+ mail_shell_content = mail_shell_view->priv->mail_shell_content;
+ folder_view = e_mail_shell_content_get_folder_view (mail_shell_content);
+
+ if (!em_utils_check_user_can_send_mail (GTK_WIDGET (shell_window)))
+ return;
+
+ em_utils_compose_new_message (folder_view->folder_uri);
}
static void
@@ -602,32 +760,70 @@ static void
action_mail_next_cb (GtkAction *action,
EMailShellView *mail_shell_view)
{
- /* FIXME */
- g_print ("Action: %s\n", gtk_action_get_name (GTK_ACTION (action)));
+ EMailShellContent *mail_shell_content;
+ MessageListSelectDirection direction;
+ EMFolderView *folder_view;
+ guint32 flags, mask;
+
+ mail_shell_content = mail_shell_view->priv->mail_shell_content;
+ folder_view = e_mail_shell_content_get_folder_view (mail_shell_content);
+
+ direction = MESSAGE_LIST_SELECT_NEXT;
+ flags = 0;
+ mask = 0;
+
+ message_list_select (folder_view->list, direction, flags, mask);
}
static void
action_mail_next_important_cb (GtkAction *action,
EMailShellView *mail_shell_view)
{
- /* FIXME */
- g_print ("Action: %s\n", gtk_action_get_name (GTK_ACTION (action)));
+ EMailShellContent *mail_shell_content;
+ MessageListSelectDirection direction;
+ EMFolderView *folder_view;
+ guint32 flags, mask;
+
+ mail_shell_content = mail_shell_view->priv->mail_shell_content;
+ folder_view = e_mail_shell_content_get_folder_view (mail_shell_content);
+
+ direction = MESSAGE_LIST_SELECT_NEXT | MESSAGE_LIST_SELECT_WRAP;
+ flags = CAMEL_MESSAGE_FLAGGED;
+ mask = CAMEL_MESSAGE_FLAGGED;
+
+ message_list_select (folder_view->list, direction, flags, mask);
}
static void
action_mail_next_thread_cb (GtkAction *action,
EMailShellView *mail_shell_view)
{
- /* FIXME */
- g_print ("Action: %s\n", gtk_action_get_name (GTK_ACTION (action)));
+ EMailShellContent *mail_shell_content;
+ EMFolderView *folder_view;
+
+ mail_shell_content = mail_shell_view->priv->mail_shell_content;
+ folder_view = e_mail_shell_content_get_folder_view (mail_shell_content);
+
+ message_list_select_next_thread (folder_view->list);
}
static void
action_mail_next_unread_cb (GtkAction *action,
EMailShellView *mail_shell_view)
{
- /* FIXME */
- g_print ("Action: %s\n", gtk_action_get_name (GTK_ACTION (action)));
+ EMailShellContent *mail_shell_content;
+ MessageListSelectDirection direction;
+ EMFolderView *folder_view;
+ guint32 flags, mask;
+
+ mail_shell_content = mail_shell_view->priv->mail_shell_content;
+ folder_view = e_mail_shell_content_get_folder_view (mail_shell_content);
+
+ direction = MESSAGE_LIST_SELECT_NEXT | MESSAGE_LIST_SELECT_WRAP;
+ flags = 0;
+ mask = CAMEL_MESSAGE_SEEN;
+
+ message_list_select (folder_view->list, direction, flags, mask);
}
static void
@@ -648,88 +844,198 @@ static void
action_mail_previous_cb (GtkAction *action,
EMailShellView *mail_shell_view)
{
- /* FIXME */
- g_print ("Action: %s\n", gtk_action_get_name (GTK_ACTION (action)));
+ EMailShellContent *mail_shell_content;
+ MessageListSelectDirection direction;
+ EMFolderView *folder_view;
+ guint32 flags, mask;
+
+ mail_shell_content = mail_shell_view->priv->mail_shell_content;
+ folder_view = e_mail_shell_content_get_folder_view (mail_shell_content);
+
+ direction = MESSAGE_LIST_SELECT_PREVIOUS;
+ flags = 0;
+ mask = 0;
+
+ message_list_select (folder_view->list, direction, flags, mask);
}
static void
action_mail_previous_important_cb (GtkAction *action,
EMailShellView *mail_shell_view)
{
- /* FIXME */
- g_print ("Action: %s\n", gtk_action_get_name (GTK_ACTION (action)));
+ EMailShellContent *mail_shell_content;
+ MessageListSelectDirection direction;
+ EMFolderView *folder_view;
+ guint32 flags, mask;
+
+ mail_shell_content = mail_shell_view->priv->mail_shell_content;
+ folder_view = e_mail_shell_content_get_folder_view (mail_shell_content);
+
+ direction = MESSAGE_LIST_SELECT_PREVIOUS | MESSAGE_LIST_SELECT_WRAP;
+ flags = CAMEL_MESSAGE_FLAGGED;
+ mask = CAMEL_MESSAGE_FLAGGED;
+
+ message_list_select (folder_view->list, direction, flags, mask);
}
static void
action_mail_previous_unread_cb (GtkAction *action,
EMailShellView *mail_shell_view)
{
- /* FIXME */
- g_print ("Action: %s\n", gtk_action_get_name (GTK_ACTION (action)));
+ EMailShellContent *mail_shell_content;
+ MessageListSelectDirection direction;
+ EMFolderView *folder_view;
+ guint32 flags, mask;
+
+ mail_shell_content = mail_shell_view->priv->mail_shell_content;
+ folder_view = e_mail_shell_content_get_folder_view (mail_shell_content);
+
+ direction = MESSAGE_LIST_SELECT_PREVIOUS | MESSAGE_LIST_SELECT_WRAP;
+ flags = 0;
+ mask = CAMEL_MESSAGE_SEEN;
+
+ message_list_select (folder_view->list, direction, flags, mask);
}
static void
action_mail_print_cb (GtkAction *action,
EMailShellView *mail_shell_view)
{
- /* FIXME */
- g_print ("Action: %s\n", gtk_action_get_name (GTK_ACTION (action)));
+ EMailShellContent *mail_shell_content;
+ GtkPrintOperationAction print_action;
+ EMFolderView *folder_view;
+
+ mail_shell_content = mail_shell_view->priv->mail_shell_content;
+ folder_view = e_mail_shell_content_get_folder_view (mail_shell_content);
+
+ print_action = GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG;
+ em_folder_view_print (folder_view, print_action);
}
static void
action_mail_print_preview_cb (GtkAction *action,
EMailShellView *mail_shell_view)
{
- /* FIXME */
- g_print ("Action: %s\n", gtk_action_get_name (GTK_ACTION (action)));
+ EMailShellContent *mail_shell_content;
+ GtkPrintOperationAction print_action;
+ EMFolderView *folder_view;
+
+ mail_shell_content = mail_shell_view->priv->mail_shell_content;
+ folder_view = e_mail_shell_content_get_folder_view (mail_shell_content);
+
+ print_action = GTK_PRINT_OPERATION_ACTION_PREVIEW;
+ em_folder_view_print (folder_view, print_action);
}
static void
action_mail_redirect_cb (GtkAction *action,
EMailShellView *mail_shell_view)
{
- /* FIXME */
- g_print ("Action: %s\n", gtk_action_get_name (GTK_ACTION (action)));
+ EMailShellContent *mail_shell_content;
+ EMFolderView *folder_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);
+
+ mail_shell_content = mail_shell_view->priv->mail_shell_content;
+ folder_view = e_mail_shell_content_get_folder_view (mail_shell_content);
+
+ if (folder_view->list->cursor_uid == NULL)
+ return;
+
+ if (!em_utils_check_user_can_send_mail (GTK_WIDGET (shell_window)))
+ return;
+
+ em_utils_redirect_message_by_uid (
+ folder_view->folder, folder_view->list->cursor_uid);
}
static void
action_mail_reply_all_cb (GtkAction *action,
EMailShellView *mail_shell_view)
{
- /* FIXME */
- g_print ("Action: %s\n", gtk_action_get_name (GTK_ACTION (action)));
+ EMailShellContent *mail_shell_content;
+ EMFolderView *folder_view;
+
+ mail_shell_content = mail_shell_view->priv->mail_shell_content;
+ folder_view = e_mail_shell_content_get_folder_view (mail_shell_content);
+
+ em_folder_view_message_reply (folder_view, REPLY_MODE_ALL);
}
static void
action_mail_reply_list_cb (GtkAction *action,
EMailShellView *mail_shell_view)
{
- /* FIXME */
- g_print ("Action: %s\n", gtk_action_get_name (GTK_ACTION (action)));
+ EMailShellContent *mail_shell_content;
+ EMFolderView *folder_view;
+
+ mail_shell_content = mail_shell_view->priv->mail_shell_content;
+ folder_view = e_mail_shell_content_get_folder_view (mail_shell_content);
+
+ em_folder_view_message_reply (folder_view, REPLY_MODE_LIST);
}
static void
action_mail_reply_post_cb (GtkAction *action,
EMailShellView *mail_shell_view)
{
- /* FIXME */
- g_print ("Action: %s\n", gtk_action_get_name (GTK_ACTION (action)));
+ EMailShellContent *mail_shell_content;
+ EMFolderView *folder_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);
+
+ mail_shell_content = mail_shell_view->priv->mail_shell_content;
+ folder_view = e_mail_shell_content_get_folder_view (mail_shell_content);
+
+ if (folder_view->list->cursor_uid == NULL)
+ return;
+
+ if (!em_utils_check_user_can_send_mail (GTK_WIDGET (shell_window)))
+ return;
+
+ em_utils_post_reply_to_message_by_uid (
+ folder_view->folder, folder_view->list->cursor_uid);
}
static void
action_mail_reply_sender_cb (GtkAction *action,
EMailShellView *mail_shell_view)
{
- /* FIXME */
- g_print ("Action: %s\n", gtk_action_get_name (GTK_ACTION (action)));
+ EMailShellContent *mail_shell_content;
+ EMFolderView *folder_view;
+
+ mail_shell_content = mail_shell_view->priv->mail_shell_content;
+ folder_view = e_mail_shell_content_get_folder_view (mail_shell_content);
+
+ em_folder_view_message_reply (folder_view, REPLY_MODE_SENDER);
}
static void
action_mail_save_as_cb (GtkAction *action,
EMailShellView *mail_shell_view)
{
- /* FIXME */
- g_print ("Action: %s\n", gtk_action_get_name (GTK_ACTION (action)));
+ EMailShellContent *mail_shell_content;
+ EMFolderView *folder_view;
+ EShellWindow *shell_window;
+ EShellView *shell_view;
+ GPtrArray *uids;
+
+ shell_view = E_SHELL_VIEW (mail_shell_view);
+ shell_window = e_shell_view_get_shell_window (shell_view);
+
+ mail_shell_content = mail_shell_view->priv->mail_shell_content;
+ folder_view = e_mail_shell_content_get_folder_view (mail_shell_content);
+
+ uids = message_list_get_selected (folder_view->list);
+
+ em_utils_save_messages (
+ GTK_WIDGET (shell_window), folder_view->folder, uids);
}
static void
@@ -856,8 +1162,17 @@ static void
action_mail_undelete_cb (GtkAction *action,
EMailShellView *mail_shell_view)
{
- /* FIXME */
- g_print ("Action: %s\n", gtk_action_get_name (GTK_ACTION (action)));
+ EMailShellContent *mail_shell_content;
+ EMFolderView *folder_view;
+ guint32 mask, set;
+
+ mail_shell_content = mail_shell_view->priv->mail_shell_content;
+ folder_view = e_mail_shell_content_get_folder_view (mail_shell_content);
+
+ mask = CAMEL_MESSAGE_DELETED;
+ set = 0;
+
+ em_folder_view_mark_selected (folder_view, mask, set);
}
static void
@@ -904,24 +1219,39 @@ static void
action_mail_zoom_100_cb (GtkAction *action,
EMailShellView *mail_shell_view)
{
- /* FIXME */
- g_print ("Action: %s\n", gtk_action_get_name (GTK_ACTION (action)));
+ EMailShellContent *mail_shell_content;
+ EMFormatHTMLDisplay *format;
+
+ mail_shell_content = mail_shell_view->priv->mail_shell_content;
+ format = e_mail_shell_content_get_preview_format (mail_shell_content);
+
+ em_format_html_display_zoom_reset (format);
}
static void
action_mail_zoom_in_cb (GtkAction *action,
EMailShellView *mail_shell_view)
{
- /* FIXME */
- g_print ("Action: %s\n", gtk_action_get_name (GTK_ACTION (action)));
+ EMailShellContent *mail_shell_content;
+ EMFormatHTMLDisplay *format;
+
+ mail_shell_content = mail_shell_view->priv->mail_shell_content;
+ format = e_mail_shell_content_get_preview_format (mail_shell_content);
+
+ em_format_html_display_zoom_in (format);
}
static void
action_mail_zoom_out_cb (GtkAction *action,
EMailShellView *mail_shell_view)
{
- /* FIXME */
- g_print ("Action: %s\n", gtk_action_get_name (GTK_ACTION (action)));
+ EMailShellContent *mail_shell_content;
+ EMFormatHTMLDisplay *format;
+
+ mail_shell_content = mail_shell_view->priv->mail_shell_content;
+ format = e_mail_shell_content_get_preview_format (mail_shell_content);
+
+ em_format_html_display_zoom_out (format);
}
static void
diff --git a/mail/e-mail-shell-view-private.h b/mail/e-mail-shell-view-private.h
index 086c3edd81..db21203cae 100644
--- a/mail/e-mail-shell-view-private.h
+++ b/mail/e-mail-shell-view-private.h
@@ -25,11 +25,13 @@
#include "e-mail-shell-view.h"
#include <glib/gi18n.h>
+#include <gtkhtml/gtkhtml.h>
#include <camel/camel-vtrash-folder.h>
#include "e-util/gconf-bridge.h"
#include "widgets/menus/gal-view-instance.h"
+#include "em-composer-utils.h"
#include "em-folder-selector.h"
#include "em-utils.h"
#include "mail-ops.h"
diff --git a/mail/em-folder-view.c b/mail/em-folder-view.c
index e737021eab..1b851eb196 100644
--- a/mail/em-folder-view.c
+++ b/mail/em-folder-view.c
@@ -126,7 +126,6 @@ static void emfv_set_folder_uri(EMFolderView *emfv, const char *uri);
static void emfv_set_message(EMFolderView *emfv, const char *uid, int nomarkseen);
static void emfv_activate(EMFolderView *emfv, BonoboUIComponent *uic, int state);
-static void emfv_message_reply(EMFolderView *emfv, int mode);
static void vfolder_type_current (EMFolderView *emfv, int type);
static void filter_type_current (EMFolderView *emfv, int type);
@@ -667,51 +666,51 @@ emfv_popup_open(EPopup *ep, EPopupItem *pitem, void *data)
em_folder_view_open_selected(emfv);
}
-static void
-emfv_popup_edit (EPopup *ep, EPopupItem *pitem, void *data)
-{
- EMFolderView *emfv = data;
- GPtrArray *uids;
-
- if (!em_utils_check_user_can_send_mail((GtkWidget *)emfv))
- return;
-
- uids = message_list_get_selected(emfv->list);
- em_utils_edit_messages (emfv->folder, uids, FALSE);
-}
-
-static void
-emfv_popup_saveas(EPopup *ep, EPopupItem *pitem, void *data)
-{
- EMFolderView *emfv = data;
- GPtrArray *uids;
-
- uids = message_list_get_selected(emfv->list);
- em_utils_save_messages((GtkWidget *)emfv, emfv->folder, uids);
-}
+//static void
+//emfv_popup_edit (EPopup *ep, EPopupItem *pitem, void *data)
+//{
+// EMFolderView *emfv = data;
+// GPtrArray *uids;
+//
+// if (!em_utils_check_user_can_send_mail((GtkWidget *)emfv))
+// return;
+//
+// uids = message_list_get_selected(emfv->list);
+// em_utils_edit_messages (emfv->folder, uids, FALSE);
+//}
-static void
-emfv_view_load_images(BonoboUIComponent *uic, void *data, const char *path)
-{
- EMFolderView *emfv = data;
+//static void
+//emfv_popup_saveas(EPopup *ep, EPopupItem *pitem, void *data)
+//{
+// EMFolderView *emfv = data;
+// GPtrArray *uids;
+//
+// uids = message_list_get_selected(emfv->list);
+// em_utils_save_messages((GtkWidget *)emfv, emfv->folder, uids);
+//}
- if (emfv->preview)
- em_format_html_load_http((EMFormatHTML *)emfv->preview);
-}
+//static void
+//emfv_view_load_images(BonoboUIComponent *uic, void *data, const char *path)
+//{
+// EMFolderView *emfv = data;
+//
+// if (emfv->preview)
+// em_format_html_load_http((EMFormatHTML *)emfv->preview);
+//}
-static void
-emfv_popup_print(EPopup *ep, EPopupItem *pitem, void *data)
-{
- EMFolderView *emfv = data;
- em_folder_view_print(emfv, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG);
-}
+//static void
+//emfv_popup_print(EPopup *ep, EPopupItem *pitem, void *data)
+//{
+// EMFolderView *emfv = data;
+// em_folder_view_print(emfv, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG);
+//}
-static void
-emfv_popup_copy_text(EPopup *ep, EPopupItem *pitem, void *data)
-{
- EMFolderView *emfv = data;
- gtk_html_copy (((EMFormatHTML *)emfv->preview)->html);
-}
+//static void
+//emfv_popup_copy_text(EPopup *ep, EPopupItem *pitem, void *data)
+//{
+// EMFolderView *emfv = data;
+// gtk_html_copy (((EMFormatHTML *)emfv->preview)->html);
+//}
static void
emfv_popup_source(EPopup *ep, EPopupItem *pitem, void *data)
@@ -732,50 +731,50 @@ emfv_popup_source(EPopup *ep, EPopupItem *pitem, void *data)
message_list_free_uids(emfv->list, uids);
}
-static void
-emfv_mail_compose(BonoboUIComponent *uid, void *data, const char *path)
-{
- EMFolderView *emfv = data;
-
- if (!em_utils_check_user_can_send_mail((GtkWidget *)emfv))
- return;
-
- em_utils_compose_new_message(emfv->folder_uri);
-}
-
-static void
-emfv_popup_reply_sender(EPopup *ep, EPopupItem *pitem, void *data)
-{
- EMFolderView *emfv = data;
- emfv_message_reply(emfv, REPLY_MODE_SENDER);
-}
-
-static void
-emfv_popup_reply_list(EPopup *ep, EPopupItem *pitem, void *data)
-{
- EMFolderView *emfv = data;
- emfv_message_reply(emfv, REPLY_MODE_LIST);
-}
+//static void
+//emfv_mail_compose(BonoboUIComponent *uid, void *data, const char *path)
+//{
+// EMFolderView *emfv = data;
+//
+// if (!em_utils_check_user_can_send_mail((GtkWidget *)emfv))
+// return;
+//
+// em_utils_compose_new_message(emfv->folder_uri);
+//}
-static void
-emfv_popup_reply_all(EPopup *ep, EPopupItem *pitem, void *data)
-{
- EMFolderView *emfv = data;
- emfv_message_reply(emfv, REPLY_MODE_ALL);
-}
+//static void
+//emfv_popup_reply_sender(EPopup *ep, EPopupItem *pitem, void *data)
+//{
+// EMFolderView *emfv = data;
+// em_folder_view_message_reply(emfv, REPLY_MODE_SENDER);
+//}
-static void
-emfv_popup_forward(EPopup *ep, EPopupItem *pitem, void *data)
-{
- EMFolderView *emfv = data;
- GPtrArray *uids;
+//static void
+//emfv_popup_reply_list(EPopup *ep, EPopupItem *pitem, void *data)
+//{
+// EMFolderView *emfv = data;
+// em_folder_view_message_reply(emfv, REPLY_MODE_LIST);
+//}
- if (!em_utils_check_user_can_send_mail((GtkWidget *)emfv))
- return;
+//static void
+//emfv_popup_reply_all(EPopup *ep, EPopupItem *pitem, void *data)
+//{
+// EMFolderView *emfv = data;
+// em_folder_view_message_reply(emfv, REPLY_MODE_ALL);
+//}
- uids = message_list_get_selected(emfv->list);
- em_utils_forward_messages (emfv->folder, uids, emfv->folder_uri);
-}
+//static void
+//emfv_popup_forward(EPopup *ep, EPopupItem *pitem, void *data)
+//{
+// EMFolderView *emfv = data;
+// GPtrArray *uids;
+//
+// if (!em_utils_check_user_can_send_mail((GtkWidget *)emfv))
+// return;
+//
+// uids = message_list_get_selected(emfv->list);
+// em_utils_forward_messages (emfv->folder, uids, emfv->folder_uri);
+//}
static void
emfv_popup_flag_followup(EPopup *ep, EPopupItem *pitem, void *data)
@@ -978,12 +977,12 @@ emfv_popup_delete (EPopup *ep, EPopupItem *pitem, void *data)
#undef DelInVFolderCheckName
#undef DelInVFolderKey
-static void
-emfv_popup_undelete(EPopup *ep, EPopupItem *pitem, void *data)
-{
- EMFolderView *emfv = data;
- em_folder_view_mark_selected(emfv, CAMEL_MESSAGE_DELETED, 0);
-}
+//static void
+//emfv_popup_undelete(EPopup *ep, EPopupItem *pitem, void *data)
+//{
+// EMFolderView *emfv = data;
+// em_folder_view_mark_selected(emfv, CAMEL_MESSAGE_DELETED, 0);
+//}
//struct _move_data {
// EMFolderView *emfv;
@@ -1101,40 +1100,40 @@ emfv_popup_label_new (EPopup *ep, EPopupItem *pitem, void *data)
}
}
-static void
-emfv_popup_add_sender(EPopup *ep, EPopupItem *pitem, void *data)
-{
- EMFolderView *emfv = data;
- GPtrArray *uids = message_list_get_selected(emfv->list);
- CamelMessageInfo *info;
- const char *addr;
-
- if (uids->len == 1
- && (info = camel_folder_get_message_info(emfv->folder, uids->pdata[0])) != NULL
- && (addr = camel_message_info_from(info)) != NULL
- && addr[0] != 0)
- em_utils_add_address((GtkWidget *)emfv, addr);
-
- em_utils_uids_free(uids);
-}
-
-static void
-emfv_popup_apply_filters(EPopup *ep, EPopupItem *pitem, void *data)
-{
- EMFolderView *emfv = data;
- GPtrArray *uids = message_list_get_selected(emfv->list);
-
- mail_filter_on_demand(emfv->folder, uids);
-}
+//static void
+//emfv_popup_add_sender(EPopup *ep, EPopupItem *pitem, void *data)
+//{
+// EMFolderView *emfv = data;
+// GPtrArray *uids = message_list_get_selected(emfv->list);
+// CamelMessageInfo *info;
+// const char *addr;
+//
+// if (uids->len == 1
+// && (info = camel_folder_get_message_info(emfv->folder, uids->pdata[0])) != NULL
+// && (addr = camel_message_info_from(info)) != NULL
+// && addr[0] != 0)
+// em_utils_add_address((GtkWidget *)emfv, addr);
+//
+// em_utils_uids_free(uids);
+//}
-static void
-emfv_popup_filter_junk(EPopup *ep, EPopupItem *pitem, void *data)
-{
- EMFolderView *emfv = data;
- GPtrArray *uids = message_list_get_selected(emfv->list);
+//static void
+//emfv_popup_apply_filters(EPopup *ep, EPopupItem *pitem, void *data)
+//{
+// EMFolderView *emfv = data;
+// GPtrArray *uids = message_list_get_selected(emfv->list);
+//
+// mail_filter_on_demand(emfv->folder, uids);
+//}
- mail_filter_junk(emfv->folder, uids);
-}
+//static void
+//emfv_popup_filter_junk(EPopup *ep, EPopupItem *pitem, void *data)
+//{
+// EMFolderView *emfv = data;
+// GPtrArray *uids = message_list_get_selected(emfv->list);
+//
+// mail_filter_junk(emfv->folder, uids);
+//}
/* filter callbacks, this will eventually be a wizard, see
filter_type_current/vfolder_type_current for implementation */
@@ -1160,23 +1159,23 @@ EMFV_POPUP_AUTO_TYPE(filter_type_current, emfv_popup_filter_mlist, AUTO_MLIST)
/* TODO: Move some of these to be 'standard' menu's */
static EPopupItem emfv_popup_items[] = {
- { E_POPUP_ITEM, "00.emfv.00", N_("_Copy"), emfv_popup_copy_text, NULL, "edit-copy", EM_FOLDER_VIEW_SELECT_DISPLAY|EM_FOLDER_VIEW_SELECT_SELECTION },
+// { E_POPUP_ITEM, "00.emfv.00", N_("_Copy"), emfv_popup_copy_text, NULL, "edit-copy", EM_FOLDER_VIEW_SELECT_DISPLAY|EM_FOLDER_VIEW_SELECT_SELECTION },
{ E_POPUP_BAR, "10.emfv", NULL, NULL, NULL, NULL },
- { E_POPUP_ITEM, "10.emfv.00", N_("_Reply to Sender"), emfv_popup_reply_sender, NULL, "mail-reply-sender", EM_POPUP_SELECT_ONE },
- { E_POPUP_ITEM, "10.emfv.01", N_("Reply to _All"), emfv_popup_reply_all, NULL, "mail-reply-all", EM_POPUP_SELECT_ONE },
- { E_POPUP_ITEM, "10.emfv.02", N_("_Forward"), emfv_popup_forward, NULL, "mail-forward", EM_POPUP_SELECT_MANY },
+// { E_POPUP_ITEM, "10.emfv.00", N_("_Reply to Sender"), emfv_popup_reply_sender, NULL, "mail-reply-sender", EM_POPUP_SELECT_ONE },
+// { E_POPUP_ITEM, "10.emfv.01", N_("Reply to _All"), emfv_popup_reply_all, NULL, "mail-reply-all", EM_POPUP_SELECT_ONE },
+// { E_POPUP_ITEM, "10.emfv.02", N_("_Forward"), emfv_popup_forward, NULL, "mail-forward", EM_POPUP_SELECT_MANY },
{ E_POPUP_BAR, "20.emfv", NULL, NULL, NULL, NULL },
/* EM_POPUP_EDIT was used here. This is changed to EM_POPUP_SELECT_ONE as Edit-as-new-messaeg need not be restricted to Sent-Items folder alone */
- { E_POPUP_ITEM, "20.emfv.00", N_("_Edit as New Message..."), emfv_popup_edit, NULL, NULL, EM_POPUP_SELECT_ONE },
- { E_POPUP_ITEM, "20.emfv.01", N_("_Save As..."), emfv_popup_saveas, NULL, "document-save-as", EM_POPUP_SELECT_MANY },
- { E_POPUP_ITEM, "20.emfv.02", N_("_Print..."), emfv_popup_print, NULL, "document-print", EM_POPUP_SELECT_ONE },
+// { E_POPUP_ITEM, "20.emfv.00", N_("_Edit as New Message..."), emfv_popup_edit, NULL, NULL, EM_POPUP_SELECT_ONE },
+// { E_POPUP_ITEM, "20.emfv.01", N_("_Save As..."), emfv_popup_saveas, NULL, "document-save-as", EM_POPUP_SELECT_MANY },
+// { E_POPUP_ITEM, "20.emfv.02", N_("_Print..."), emfv_popup_print, NULL, "document-print", EM_POPUP_SELECT_ONE },
{ E_POPUP_BAR, "40.emfv", NULL, NULL, NULL, NULL },
{ E_POPUP_ITEM, "40.emfv.00", N_("_Delete"), emfv_popup_delete, NULL, "edit-delete", EM_POPUP_SELECT_DELETE|EM_FOLDER_VIEW_SELECT_LISTONLY },
- { E_POPUP_ITEM, "40.emfv.01", N_("U_ndelete"), emfv_popup_undelete, NULL, NULL, EM_POPUP_SELECT_UNDELETE|EM_FOLDER_VIEW_SELECT_LISTONLY },
+// { E_POPUP_ITEM, "40.emfv.01", N_("U_ndelete"), emfv_popup_undelete, NULL, NULL, EM_POPUP_SELECT_UNDELETE|EM_FOLDER_VIEW_SELECT_LISTONLY },
// { E_POPUP_ITEM, "40.emfv.02", N_("_Move to Folder..."), emfv_popup_move, NULL, "mail-move", EM_POPUP_SELECT_MANY|EM_FOLDER_VIEW_SELECT_LISTONLY },
// { E_POPUP_ITEM, "40.emfv.03", N_("_Copy to Folder..."), emfv_popup_copy, NULL, "mail-copy", EM_POPUP_SELECT_MANY|EM_FOLDER_VIEW_SELECT_LISTONLY },
@@ -1357,15 +1356,15 @@ from(BonoboUIComponent *uid, void *data, const char *path) \
to(NULL, NULL, data); \
}
-EMFV_MAP_CALLBACK(emfv_add_sender_addressbook, emfv_popup_add_sender)
-EMFV_MAP_CALLBACK(emfv_message_apply_filters, emfv_popup_apply_filters)
-EMFV_MAP_CALLBACK(emfv_message_filter_junk, emfv_popup_filter_junk)
+//EMFV_MAP_CALLBACK(emfv_add_sender_addressbook, emfv_popup_add_sender)
+//EMFV_MAP_CALLBACK(emfv_message_apply_filters, emfv_popup_apply_filters)
+//EMFV_MAP_CALLBACK(emfv_message_filter_junk, emfv_popup_filter_junk)
//EMFV_MAP_CALLBACK(emfv_message_copy, emfv_popup_copy)
//EMFV_MAP_CALLBACK(emfv_message_move, emfv_popup_move)
-EMFV_MAP_CALLBACK(emfv_message_forward, emfv_popup_forward)
-EMFV_MAP_CALLBACK(emfv_message_reply_all, emfv_popup_reply_all)
-EMFV_MAP_CALLBACK(emfv_message_reply_list, emfv_popup_reply_list)
-EMFV_MAP_CALLBACK(emfv_message_reply_sender, emfv_popup_reply_sender)
+//EMFV_MAP_CALLBACK(emfv_message_forward, emfv_popup_forward)
+//EMFV_MAP_CALLBACK(emfv_message_reply_all, emfv_popup_reply_all)
+//EMFV_MAP_CALLBACK(emfv_message_reply_list, emfv_popup_reply_list)
+//EMFV_MAP_CALLBACK(emfv_message_reply_sender, emfv_popup_reply_sender)
//EMFV_MAP_CALLBACK(emfv_message_mark_read, emfv_popup_mark_read)
//EMFV_MAP_CALLBACK(emfv_message_mark_unread, emfv_popup_mark_unread)
//EMFV_MAP_CALLBACK(emfv_message_mark_important, emfv_popup_mark_important)
@@ -1373,23 +1372,23 @@ EMFV_MAP_CALLBACK(emfv_message_reply_sender, emfv_popup_reply_sender)
//EMFV_MAP_CALLBACK(emfv_message_mark_junk, emfv_popup_mark_junk)
//EMFV_MAP_CALLBACK(emfv_message_mark_nojunk, emfv_popup_mark_nojunk)
EMFV_MAP_CALLBACK(emfv_message_delete, emfv_popup_delete)
-EMFV_MAP_CALLBACK(emfv_message_undelete, emfv_popup_undelete)
+//EMFV_MAP_CALLBACK(emfv_message_undelete, emfv_popup_undelete)
EMFV_MAP_CALLBACK(emfv_message_followup_flag, emfv_popup_flag_followup)
EMFV_MAP_CALLBACK(emfv_message_followup_clear, emfv_popup_flag_clear)
EMFV_MAP_CALLBACK(emfv_message_followup_completed, emfv_popup_flag_completed)
EMFV_MAP_CALLBACK(emfv_message_open, emfv_popup_open)
-EMFV_MAP_CALLBACK(emfv_message_edit, emfv_popup_edit)
-EMFV_MAP_CALLBACK(emfv_message_saveas, emfv_popup_saveas)
-EMFV_MAP_CALLBACK(emfv_print_message, emfv_popup_print)
+//EMFV_MAP_CALLBACK(emfv_message_edit, emfv_popup_edit)
+//EMFV_MAP_CALLBACK(emfv_message_saveas, emfv_popup_saveas)
+//EMFV_MAP_CALLBACK(emfv_print_message, emfv_popup_print)
EMFV_MAP_CALLBACK(emfv_message_source, emfv_popup_source)
-static void
-emfv_empty_trash(BonoboUIComponent *uid, void *data, const char *path)
-{
- EMFolderView *emfv = data;
-
- em_utils_empty_trash (gtk_widget_get_toplevel ((GtkWidget *) emfv));
-}
+//static void
+//emfv_empty_trash(BonoboUIComponent *uid, void *data, const char *path)
+//{
+// EMFolderView *emfv = data;
+//
+// em_utils_empty_trash (gtk_widget_get_toplevel ((GtkWidget *) emfv));
+//}
static void
prepare_offline(void *key, void *value, void *data)
@@ -1451,132 +1450,132 @@ emfv_select_all_text(BonoboUIComponent *uid, void *data, const char *path)
}
-static void
-emfv_mail_next(BonoboUIComponent *uid, void *data, const char *path)
-{
- EMFolderView *emfv = data;
-
- e_profile_event_emit("goto.next", "", 0);
-
- message_list_select(emfv->list, MESSAGE_LIST_SELECT_NEXT, 0, 0);
-}
-
-static void
-emfv_mail_next_flagged(BonoboUIComponent *uid, void *data, const char *path)
-{
- EMFolderView *emfv = data;
-
- message_list_select(emfv->list, MESSAGE_LIST_SELECT_NEXT|MESSAGE_LIST_SELECT_WRAP, CAMEL_MESSAGE_FLAGGED, CAMEL_MESSAGE_FLAGGED);
-}
-
-static void
-emfv_mail_next_unread(BonoboUIComponent *uid, void *data, const char *path)
-{
- EMFolderView *emfv = data;
-
- gtk_widget_grab_focus((GtkWidget *) emfv->list);
- message_list_select(emfv->list, MESSAGE_LIST_SELECT_NEXT|MESSAGE_LIST_SELECT_WRAP, 0, CAMEL_MESSAGE_SEEN);
-}
-
-static void
-emfv_mail_next_thread(BonoboUIComponent *uid, void *data, const char *path)
-{
- EMFolderView *emfv = data;
-
- message_list_select_next_thread(emfv->list);
-}
-
-static void
-emfv_mail_previous(BonoboUIComponent *uid, void *data, const char *path)
-{
- EMFolderView *emfv = data;
-
- message_list_select(emfv->list, MESSAGE_LIST_SELECT_PREVIOUS, 0, 0);
-}
-
-static void
-emfv_mail_previous_flagged(BonoboUIComponent *uid, void *data, const char *path)
-{
- EMFolderView *emfv = data;
-
- message_list_select(emfv->list, MESSAGE_LIST_SELECT_PREVIOUS|MESSAGE_LIST_SELECT_WRAP, CAMEL_MESSAGE_FLAGGED, CAMEL_MESSAGE_FLAGGED);
-}
-
-static void
-emfv_mail_previous_unread(BonoboUIComponent *uid, void *data, const char *path)
-{
- EMFolderView *emfv = data;
-
- gtk_widget_grab_focus((GtkWidget *) emfv->list);
- message_list_select(emfv->list, MESSAGE_LIST_SELECT_PREVIOUS|MESSAGE_LIST_SELECT_WRAP, 0, CAMEL_MESSAGE_SEEN);
-}
-
-static void
-emfv_message_forward_attached (BonoboUIComponent *uic, void *data, const char *path)
-{
- EMFolderView *emfv = data;
- GPtrArray *uids;
-
- if (!em_utils_check_user_can_send_mail ((GtkWidget *) emfv))
- return;
-
- uids = message_list_get_selected (emfv->list);
- em_utils_forward_attached (emfv->folder, uids, emfv->folder_uri);
-}
-
-static void
-emfv_message_forward_inline (BonoboUIComponent *uic, void *data, const char *path)
-{
- EMFolderView *emfv = data;
- GPtrArray *uids;
-
- if (!em_utils_check_user_can_send_mail ((GtkWidget *) emfv))
- return;
-
- uids = message_list_get_selected (emfv->list);
- em_utils_forward_inline (emfv->folder, uids, emfv->folder_uri);
-}
+//static void
+//emfv_mail_next(BonoboUIComponent *uid, void *data, const char *path)
+//{
+// EMFolderView *emfv = data;
+//
+// e_profile_event_emit("goto.next", "", 0);
+//
+// message_list_select(emfv->list, MESSAGE_LIST_SELECT_NEXT, 0, 0);
+//}
-static void
-emfv_message_forward_quoted (BonoboUIComponent *uic, void *data, const char *path)
-{
- EMFolderView *emfv = data;
- GPtrArray *uids;
+//static void
+//emfv_mail_next_flagged(BonoboUIComponent *uid, void *data, const char *path)
+//{
+// EMFolderView *emfv = data;
+//
+// message_list_select(emfv->list, MESSAGE_LIST_SELECT_NEXT|MESSAGE_LIST_SELECT_WRAP, CAMEL_MESSAGE_FLAGGED, CAMEL_MESSAGE_FLAGGED);
+//}
- if (!em_utils_check_user_can_send_mail ((GtkWidget *) emfv))
- return;
+//static void
+//emfv_mail_next_unread(BonoboUIComponent *uid, void *data, const char *path)
+//{
+// EMFolderView *emfv = data;
+//
+// gtk_widget_grab_focus((GtkWidget *) emfv->list);
+// message_list_select(emfv->list, MESSAGE_LIST_SELECT_NEXT|MESSAGE_LIST_SELECT_WRAP, 0, CAMEL_MESSAGE_SEEN);
+//}
- uids = message_list_get_selected (emfv->list);
- em_utils_forward_quoted (emfv->folder, uids, emfv->folder_uri);
-}
+//static void
+//emfv_mail_next_thread(BonoboUIComponent *uid, void *data, const char *path)
+//{
+// EMFolderView *emfv = data;
+//
+// message_list_select_next_thread(emfv->list);
+//}
-static void
-emfv_message_redirect (BonoboUIComponent *uic, void *data, const char *path)
-{
- EMFolderView *emfv = data;
+//static void
+//emfv_mail_previous(BonoboUIComponent *uid, void *data, const char *path)
+//{
+// EMFolderView *emfv = data;
+//
+// message_list_select(emfv->list, MESSAGE_LIST_SELECT_PREVIOUS, 0, 0);
+//}
- if (emfv->list->cursor_uid == NULL)
- return;
+//static void
+//emfv_mail_previous_flagged(BonoboUIComponent *uid, void *data, const char *path)
+//{
+// EMFolderView *emfv = data;
+//
+// message_list_select(emfv->list, MESSAGE_LIST_SELECT_PREVIOUS|MESSAGE_LIST_SELECT_WRAP, CAMEL_MESSAGE_FLAGGED, CAMEL_MESSAGE_FLAGGED);
+//}
- if (!em_utils_check_user_can_send_mail ((GtkWidget *) emfv))
- return;
+//static void
+//emfv_mail_previous_unread(BonoboUIComponent *uid, void *data, const char *path)
+//{
+// EMFolderView *emfv = data;
+//
+// gtk_widget_grab_focus((GtkWidget *) emfv->list);
+// message_list_select(emfv->list, MESSAGE_LIST_SELECT_PREVIOUS|MESSAGE_LIST_SELECT_WRAP, 0, CAMEL_MESSAGE_SEEN);
+//}
- em_utils_redirect_message_by_uid (emfv->folder, emfv->list->cursor_uid);
-}
+//static void
+//emfv_message_forward_attached (BonoboUIComponent *uic, void *data, const char *path)
+//{
+// EMFolderView *emfv = data;
+// GPtrArray *uids;
+//
+// if (!em_utils_check_user_can_send_mail ((GtkWidget *) emfv))
+// return;
+//
+// uids = message_list_get_selected (emfv->list);
+// em_utils_forward_attached (emfv->folder, uids, emfv->folder_uri);
+//}
-static void
-emfv_message_post_reply (BonoboUIComponent *uic, void *data, const char *path)
-{
- EMFolderView *emfv = data;
+//static void
+//emfv_message_forward_inline (BonoboUIComponent *uic, void *data, const char *path)
+//{
+// EMFolderView *emfv = data;
+// GPtrArray *uids;
+//
+// if (!em_utils_check_user_can_send_mail ((GtkWidget *) emfv))
+// return;
+//
+// uids = message_list_get_selected (emfv->list);
+// em_utils_forward_inline (emfv->folder, uids, emfv->folder_uri);
+//}
- if (emfv->list->cursor_uid == NULL)
- return;
+//static void
+//emfv_message_forward_quoted (BonoboUIComponent *uic, void *data, const char *path)
+//{
+// EMFolderView *emfv = data;
+// GPtrArray *uids;
+//
+// if (!em_utils_check_user_can_send_mail ((GtkWidget *) emfv))
+// return;
+//
+// uids = message_list_get_selected (emfv->list);
+// em_utils_forward_quoted (emfv->folder, uids, emfv->folder_uri);
+//}
- if (!em_utils_check_user_can_send_mail ((GtkWidget *) emfv))
- return;
+//static void
+//emfv_message_redirect (BonoboUIComponent *uic, void *data, const char *path)
+//{
+// EMFolderView *emfv = data;
+//
+// if (emfv->list->cursor_uid == NULL)
+// return;
+//
+// if (!em_utils_check_user_can_send_mail ((GtkWidget *) emfv))
+// return;
+//
+// em_utils_redirect_message_by_uid (emfv->folder, emfv->list->cursor_uid);
+//}
- em_utils_post_reply_to_message_by_uid (emfv->folder, emfv->list->cursor_uid);
-}
+//static void
+//emfv_message_post_reply (BonoboUIComponent *uic, void *data, const char *path)
+//{
+// EMFolderView *emfv = data;
+//
+// if (emfv->list->cursor_uid == NULL)
+// return;
+//
+// if (!em_utils_check_user_can_send_mail ((GtkWidget *) emfv))
+// return;
+//
+// em_utils_post_reply_to_message_by_uid (emfv->folder, emfv->list->cursor_uid);
+//}
static gboolean
html_contains_nonwhitespace (const char *html, gint len)
@@ -1616,8 +1615,8 @@ html_contains_nonwhitespace (const char *html, gint len)
return p - html < len - 1 && c != 0;
}
-static void
-emfv_message_reply(EMFolderView *emfv, int mode)
+void
+em_folder_view_message_reply(EMFolderView *emfv, int mode)
{
char *html = NULL;
gint len;
@@ -1672,40 +1671,40 @@ emfv_message_search(BonoboUIComponent *uic, void *data, const char *path)
#endif
}
-static void
-emfv_print_preview_message(BonoboUIComponent *uic, void *data, const char *path)
-{
- EMFolderView *emfv = data;
-
- em_folder_view_print(emfv, GTK_PRINT_OPERATION_ACTION_PREVIEW);
-}
-
-static void
-emfv_text_zoom_in(BonoboUIComponent *uic, void *data, const char *path)
-{
- EMFolderView *emfv = data;
-
- if (emfv->preview)
- em_format_html_display_zoom_in(emfv->preview);
-}
-
-static void
-emfv_text_zoom_out(BonoboUIComponent *uic, void *data, const char *path)
-{
- EMFolderView *emfv = data;
+//static void
+//emfv_print_preview_message(BonoboUIComponent *uic, void *data, const char *path)
+//{
+// EMFolderView *emfv = data;
+//
+// em_folder_view_print(emfv, GTK_PRINT_OPERATION_ACTION_PREVIEW);
+//}
- if (emfv->preview)
- em_format_html_display_zoom_out(emfv->preview);
-}
+//static void
+//emfv_text_zoom_in(BonoboUIComponent *uic, void *data, const char *path)
+//{
+// EMFolderView *emfv = data;
+//
+// if (emfv->preview)
+// em_format_html_display_zoom_in(emfv->preview);
+//}
-static void
-emfv_text_zoom_reset(BonoboUIComponent *uic, void *data, const char *path)
-{
- EMFolderView *emfv = data;
+//static void
+//emfv_text_zoom_out(BonoboUIComponent *uic, void *data, const char *path)
+//{
+// EMFolderView *emfv = data;
+//
+// if (emfv->preview)
+// em_format_html_display_zoom_out(emfv->preview);
+//}
- if (emfv->preview)
- em_format_html_display_zoom_reset(emfv->preview);
-}
+//static void
+//emfv_text_zoom_reset(BonoboUIComponent *uic, void *data, const char *path)
+//{
+// EMFolderView *emfv = data;
+//
+// if (emfv->preview)
+// em_format_html_display_zoom_reset(emfv->preview);
+//}
/* ********************************************************************** */
@@ -1874,7 +1873,7 @@ EMFV_MAP_CALLBACK(emfv_tools_vfolder_mlist, emfv_popup_vfolder_mlist)
/* ********************************************************************** */
static BonoboUIVerb emfv_message_verbs[] = {
- BONOBO_UI_UNSAFE_VERB ("EmptyTrash", emfv_empty_trash),
+// BONOBO_UI_UNSAFE_VERB ("EmptyTrash", emfv_empty_trash),
BONOBO_UI_UNSAFE_VERB ("PrepareForOffline", emfv_prepare_offline),
BONOBO_UI_UNSAFE_VERB ("EditCut", emfv_edit_cut),
BONOBO_UI_UNSAFE_VERB ("EditCopy", emfv_edit_copy),
@@ -1882,26 +1881,26 @@ static BonoboUIVerb emfv_message_verbs[] = {
BONOBO_UI_UNSAFE_VERB ("SelectAllText", emfv_select_all_text),
- BONOBO_UI_UNSAFE_VERB ("MailNext", emfv_mail_next),
- BONOBO_UI_UNSAFE_VERB ("MailNextFlagged", emfv_mail_next_flagged),
- BONOBO_UI_UNSAFE_VERB ("MailNextUnread", emfv_mail_next_unread),
- BONOBO_UI_UNSAFE_VERB ("MailNextThread", emfv_mail_next_thread),
- BONOBO_UI_UNSAFE_VERB ("MailPrevious", emfv_mail_previous),
- BONOBO_UI_UNSAFE_VERB ("MailPreviousFlagged", emfv_mail_previous_flagged),
- BONOBO_UI_UNSAFE_VERB ("MailPreviousUnread", emfv_mail_previous_unread),
+// BONOBO_UI_UNSAFE_VERB ("MailNext", emfv_mail_next),
+// BONOBO_UI_UNSAFE_VERB ("MailNextFlagged", emfv_mail_next_flagged),
+// BONOBO_UI_UNSAFE_VERB ("MailNextUnread", emfv_mail_next_unread),
+// BONOBO_UI_UNSAFE_VERB ("MailNextThread", emfv_mail_next_thread),
+// BONOBO_UI_UNSAFE_VERB ("MailPrevious", emfv_mail_previous),
+// BONOBO_UI_UNSAFE_VERB ("MailPreviousFlagged", emfv_mail_previous_flagged),
+// BONOBO_UI_UNSAFE_VERB ("MailPreviousUnread", emfv_mail_previous_unread),
- BONOBO_UI_UNSAFE_VERB ("AddSenderToAddressbook", emfv_add_sender_addressbook),
+// BONOBO_UI_UNSAFE_VERB ("AddSenderToAddressbook", emfv_add_sender_addressbook),
- BONOBO_UI_UNSAFE_VERB ("MessageApplyFilters", emfv_message_apply_filters),
- BONOBO_UI_UNSAFE_VERB ("MessageFilterJunk", emfv_message_filter_junk),
+// BONOBO_UI_UNSAFE_VERB ("MessageApplyFilters", emfv_message_apply_filters),
+// BONOBO_UI_UNSAFE_VERB ("MessageFilterJunk", emfv_message_filter_junk),
// BONOBO_UI_UNSAFE_VERB ("MessageCopy", emfv_message_copy),
BONOBO_UI_UNSAFE_VERB ("MessageDelete", emfv_message_delete),
BONOBO_UI_UNSAFE_VERB ("MessageDeleteKey", emfv_message_delete),
- BONOBO_UI_UNSAFE_VERB ("MessageForward", emfv_message_forward),
- BONOBO_UI_UNSAFE_VERB ("MessageForwardAttached", emfv_message_forward_attached),
- BONOBO_UI_UNSAFE_VERB ("MessageForwardInline", emfv_message_forward_inline),
- BONOBO_UI_UNSAFE_VERB ("MessageForwardQuoted", emfv_message_forward_quoted),
- BONOBO_UI_UNSAFE_VERB ("MessageRedirect", emfv_message_redirect),
+// BONOBO_UI_UNSAFE_VERB ("MessageForward", emfv_message_forward),
+// BONOBO_UI_UNSAFE_VERB ("MessageForwardAttached", emfv_message_forward_attached),
+// BONOBO_UI_UNSAFE_VERB ("MessageForwardInline", emfv_message_forward_inline),
+// BONOBO_UI_UNSAFE_VERB ("MessageForwardQuoted", emfv_message_forward_quoted),
+// BONOBO_UI_UNSAFE_VERB ("MessageRedirect", emfv_message_redirect),
// BONOBO_UI_UNSAFE_VERB ("MessageMarkAsRead", emfv_message_mark_read),
// BONOBO_UI_UNSAFE_VERB ("MessageMarkAsUnRead", emfv_message_mark_unread),
// BONOBO_UI_UNSAFE_VERB ("MessageMarkAsImportant", emfv_message_mark_important),
@@ -1913,25 +1912,25 @@ static BonoboUIVerb emfv_message_verbs[] = {
BONOBO_UI_UNSAFE_VERB ("MessageFollowUpClear", emfv_message_followup_clear),
// BONOBO_UI_UNSAFE_VERB ("MessageMove", emfv_message_move),
BONOBO_UI_UNSAFE_VERB ("MessageOpen", emfv_message_open),
- BONOBO_UI_UNSAFE_VERB ("MessagePostReply", emfv_message_post_reply),
- BONOBO_UI_UNSAFE_VERB ("MessageReplyAll", emfv_message_reply_all),
- BONOBO_UI_UNSAFE_VERB ("MessageReplyList", emfv_message_reply_list),
- BONOBO_UI_UNSAFE_VERB ("MessageReplySender", emfv_message_reply_sender),
- BONOBO_UI_UNSAFE_VERB ("MessageEdit", emfv_message_edit),
- BONOBO_UI_UNSAFE_VERB ("MessageSaveAs", emfv_message_saveas),
+// BONOBO_UI_UNSAFE_VERB ("MessagePostReply", emfv_message_post_reply),
+// BONOBO_UI_UNSAFE_VERB ("MessageReplyAll", emfv_message_reply_all),
+// BONOBO_UI_UNSAFE_VERB ("MessageReplyList", emfv_message_reply_list),
+// BONOBO_UI_UNSAFE_VERB ("MessageReplySender", emfv_message_reply_sender),
+// BONOBO_UI_UNSAFE_VERB ("MessageEdit", emfv_message_edit),
+// BONOBO_UI_UNSAFE_VERB ("MessageSaveAs", emfv_message_saveas),
BONOBO_UI_UNSAFE_VERB ("MessageSearch", emfv_message_search),
- BONOBO_UI_UNSAFE_VERB ("MessageUndelete", emfv_message_undelete),
+// BONOBO_UI_UNSAFE_VERB ("MessageUndelete", emfv_message_undelete),
- BONOBO_UI_UNSAFE_VERB ("PrintMessage", emfv_print_message),
- BONOBO_UI_UNSAFE_VERB ("PrintPreviewMessage", emfv_print_preview_message),
+// BONOBO_UI_UNSAFE_VERB ("PrintMessage", emfv_print_message),
+// BONOBO_UI_UNSAFE_VERB ("PrintPreviewMessage", emfv_print_preview_message),
- BONOBO_UI_UNSAFE_VERB ("TextZoomIn", emfv_text_zoom_in),
- BONOBO_UI_UNSAFE_VERB ("TextZoomOut", emfv_text_zoom_out),
- BONOBO_UI_UNSAFE_VERB ("TextZoomReset", emfv_text_zoom_reset),
+// BONOBO_UI_UNSAFE_VERB ("TextZoomIn", emfv_text_zoom_in),
+// BONOBO_UI_UNSAFE_VERB ("TextZoomOut", emfv_text_zoom_out),
+// BONOBO_UI_UNSAFE_VERB ("TextZoomReset", emfv_text_zoom_reset),
BONOBO_UI_UNSAFE_VERB ("ViewSource", emfv_message_source),
- BONOBO_UI_UNSAFE_VERB ("MailCompose", emfv_mail_compose),
+// BONOBO_UI_UNSAFE_VERB ("MailCompose", emfv_mail_compose),
/* TODO: This stuff should just be 1 item that runs a wizard */
BONOBO_UI_UNSAFE_VERB ("ToolsFilterMailingList", emfv_tools_filter_mlist),
@@ -1943,7 +1942,7 @@ static BonoboUIVerb emfv_message_verbs[] = {
BONOBO_UI_UNSAFE_VERB ("ToolsVFolderSender", emfv_tools_vfolder_sender),
BONOBO_UI_UNSAFE_VERB ("ToolsVFolderSubject", emfv_tools_vfolder_subject),
- BONOBO_UI_UNSAFE_VERB ("ViewLoadImages", emfv_view_load_images),
+// BONOBO_UI_UNSAFE_VERB ("ViewLoadImages", emfv_view_load_images),
/* ViewHeaders stuff is a radio */
/* CaretMode is a toggle */
@@ -2446,7 +2445,7 @@ emfv_list_key_press(ETree *tree, int row, ETreePath path, int col, GdkEvent *ev,
break;
#ifdef HAVE_XFREE
case XF86XK_Reply:
- emfv_message_reply(emfv, REPLY_MODE_ALL);
+ em_folder_view_message_reply(emfv, REPLY_MODE_ALL);
break;
case XF86XK_MailForward:
uids = message_list_get_selected(emfv->list);
diff --git a/mail/em-folder-view.h b/mail/em-folder-view.h
index a42d34ded5..02d6583c0b 100644
--- a/mail/em-folder-view.h
+++ b/mail/em-folder-view.h
@@ -141,6 +141,7 @@ GtkWidget *em_folder_view_new(void);
#define em_folder_view_set_message(emfv, uid, nomarkseen) EM_FOLDER_VIEW_GET_CLASS (emfv)->set_message((emfv), (uid), (nomarkseen))
void em_folder_view_select_next_message(EMFolderView *emfv, int count, gboolean always_can_previous);
+void em_folder_view_message_reply(EMFolderView *emfv, int mode);
EMPopupTargetSelect *em_folder_view_get_popup_target(EMFolderView *emfv, EMPopup *emp, int on_display);