|
|
6159b2 |
diff -up evolution-3.22.6/modules/mail/e-mail-shell-view-actions.c.magic-spacebar-with-caret-mode evolution-3.22.6/modules/mail/e-mail-shell-view-actions.c
|
|
|
6159b2 |
--- evolution-3.22.6/modules/mail/e-mail-shell-view-actions.c.magic-spacebar-with-caret-mode 2016-10-25 22:13:15.000000000 +0200
|
|
|
6159b2 |
+++ evolution-3.22.6/modules/mail/e-mail-shell-view-actions.c 2017-03-24 13:38:49.059671868 +0100
|
|
|
6159b2 |
@@ -1361,27 +1361,21 @@ action_mail_send_receive_send_all_cb (Gt
|
|
|
6159b2 |
}
|
|
|
6159b2 |
|
|
|
6159b2 |
static void
|
|
|
6159b2 |
-action_mail_smart_backward_cb (GtkAction *action,
|
|
|
6159b2 |
- EMailShellView *mail_shell_view)
|
|
|
6159b2 |
+mail_shell_view_magic_spacebar (EMailShellView *mail_shell_view,
|
|
|
6159b2 |
+ gboolean move_forward)
|
|
|
6159b2 |
{
|
|
|
6159b2 |
- EShellView *shell_view;
|
|
|
6159b2 |
- EShellWindow *shell_window;
|
|
|
6159b2 |
EMailShellContent *mail_shell_content;
|
|
|
6159b2 |
EMailShellSidebar *mail_shell_sidebar;
|
|
|
6159b2 |
EMFolderTree *folder_tree;
|
|
|
6159b2 |
EMailReader *reader;
|
|
|
6159b2 |
EMailView *mail_view;
|
|
|
6159b2 |
GtkWidget *message_list;
|
|
|
6159b2 |
- GtkToggleAction *toggle_action;
|
|
|
6159b2 |
EMailDisplay *display;
|
|
|
6159b2 |
GSettings *settings;
|
|
|
6159b2 |
- gboolean caret_mode;
|
|
|
6159b2 |
gboolean magic_spacebar;
|
|
|
6159b2 |
|
|
|
6159b2 |
/* This implements the so-called "Magic Backspace". */
|
|
|
6159b2 |
-
|
|
|
6159b2 |
- shell_view = E_SHELL_VIEW (mail_shell_view);
|
|
|
6159b2 |
- shell_window = e_shell_view_get_shell_window (shell_view);
|
|
|
6159b2 |
+ g_return_if_fail (E_IS_MAIL_SHELL_VIEW (mail_shell_view));
|
|
|
6159b2 |
|
|
|
6159b2 |
mail_shell_content = mail_shell_view->priv->mail_shell_content;
|
|
|
6159b2 |
mail_view = e_mail_shell_content_get_mail_view (mail_shell_content);
|
|
|
6159b2 |
@@ -1397,27 +1391,14 @@ action_mail_smart_backward_cb (GtkAction
|
|
|
6159b2 |
magic_spacebar = g_settings_get_boolean (settings, "magic-spacebar");
|
|
|
6159b2 |
g_object_unref (settings);
|
|
|
6159b2 |
|
|
|
6159b2 |
- toggle_action = GTK_TOGGLE_ACTION (ACTION (MAIL_CARET_MODE));
|
|
|
6159b2 |
- caret_mode = gtk_toggle_action_get_active (toggle_action);
|
|
|
6159b2 |
-
|
|
|
6159b2 |
- if (!e_mail_display_process_magic_spacebar (display, FALSE)) {
|
|
|
6159b2 |
+ if (!e_mail_display_process_magic_spacebar (display, move_forward)) {
|
|
|
6159b2 |
+ guint32 direction = move_forward ? MESSAGE_LIST_SELECT_NEXT : MESSAGE_LIST_SELECT_PREVIOUS;
|
|
|
6159b2 |
|
|
|
6159b2 |
- if (caret_mode || !magic_spacebar)
|
|
|
6159b2 |
+ if (!magic_spacebar)
|
|
|
6159b2 |
return;
|
|
|
6159b2 |
|
|
|
6159b2 |
- /* XXX Are two separate calls really necessary? */
|
|
|
6159b2 |
-
|
|
|
6159b2 |
- if (message_list_select (
|
|
|
6159b2 |
- MESSAGE_LIST (message_list),
|
|
|
6159b2 |
- MESSAGE_LIST_SELECT_PREVIOUS |
|
|
|
6159b2 |
- MESSAGE_LIST_SELECT_INCLUDE_COLLAPSED,
|
|
|
6159b2 |
- 0, CAMEL_MESSAGE_SEEN))
|
|
|
6159b2 |
- return;
|
|
|
6159b2 |
-
|
|
|
6159b2 |
- if (message_list_select (
|
|
|
6159b2 |
- MESSAGE_LIST (message_list),
|
|
|
6159b2 |
- MESSAGE_LIST_SELECT_PREVIOUS |
|
|
|
6159b2 |
- MESSAGE_LIST_SELECT_WRAP |
|
|
|
6159b2 |
+ if (message_list_select (MESSAGE_LIST (message_list),
|
|
|
6159b2 |
+ direction | MESSAGE_LIST_SELECT_WRAP |
|
|
|
6159b2 |
MESSAGE_LIST_SELECT_INCLUDE_COLLAPSED,
|
|
|
6159b2 |
0, CAMEL_MESSAGE_SEEN))
|
|
|
6159b2 |
return;
|
|
|
6159b2 |
@@ -1429,71 +1410,17 @@ action_mail_smart_backward_cb (GtkAction
|
|
|
6159b2 |
}
|
|
|
6159b2 |
|
|
|
6159b2 |
static void
|
|
|
6159b2 |
+action_mail_smart_backward_cb (GtkAction *action,
|
|
|
6159b2 |
+ EMailShellView *mail_shell_view)
|
|
|
6159b2 |
+{
|
|
|
6159b2 |
+ mail_shell_view_magic_spacebar (mail_shell_view, FALSE);
|
|
|
6159b2 |
+}
|
|
|
6159b2 |
+
|
|
|
6159b2 |
+static void
|
|
|
6159b2 |
action_mail_smart_forward_cb (GtkAction *action,
|
|
|
6159b2 |
EMailShellView *mail_shell_view)
|
|
|
6159b2 |
{
|
|
|
6159b2 |
- EShellView *shell_view;
|
|
|
6159b2 |
- EShellWindow *shell_window;
|
|
|
6159b2 |
- EMailShellContent *mail_shell_content;
|
|
|
6159b2 |
- EMailShellSidebar *mail_shell_sidebar;
|
|
|
6159b2 |
- EMFolderTree *folder_tree;
|
|
|
6159b2 |
- EMailReader *reader;
|
|
|
6159b2 |
- EMailView *mail_view;
|
|
|
6159b2 |
- GtkWidget *message_list;
|
|
|
6159b2 |
- GtkToggleAction *toggle_action;
|
|
|
6159b2 |
- EMailDisplay *display;
|
|
|
6159b2 |
- GSettings *settings;
|
|
|
6159b2 |
- gboolean caret_mode;
|
|
|
6159b2 |
- gboolean magic_spacebar;
|
|
|
6159b2 |
-
|
|
|
6159b2 |
- /* This implements the so-called "Magic Spacebar". */
|
|
|
6159b2 |
-
|
|
|
6159b2 |
- shell_view = E_SHELL_VIEW (mail_shell_view);
|
|
|
6159b2 |
- shell_window = e_shell_view_get_shell_window (shell_view);
|
|
|
6159b2 |
-
|
|
|
6159b2 |
- mail_shell_content = mail_shell_view->priv->mail_shell_content;
|
|
|
6159b2 |
- mail_view = e_mail_shell_content_get_mail_view (mail_shell_content);
|
|
|
6159b2 |
-
|
|
|
6159b2 |
- mail_shell_sidebar = mail_shell_view->priv->mail_shell_sidebar;
|
|
|
6159b2 |
- folder_tree = e_mail_shell_sidebar_get_folder_tree (mail_shell_sidebar);
|
|
|
6159b2 |
-
|
|
|
6159b2 |
- reader = E_MAIL_READER (mail_view);
|
|
|
6159b2 |
- display = e_mail_reader_get_mail_display (reader);
|
|
|
6159b2 |
- message_list = e_mail_reader_get_message_list (reader);
|
|
|
6159b2 |
-
|
|
|
6159b2 |
- settings = e_util_ref_settings ("org.gnome.evolution.mail");
|
|
|
6159b2 |
- magic_spacebar = g_settings_get_boolean (settings, "magic-spacebar");
|
|
|
6159b2 |
- g_object_unref (settings);
|
|
|
6159b2 |
-
|
|
|
6159b2 |
- toggle_action = GTK_TOGGLE_ACTION (ACTION (MAIL_CARET_MODE));
|
|
|
6159b2 |
- caret_mode = gtk_toggle_action_get_active (toggle_action);
|
|
|
6159b2 |
-
|
|
|
6159b2 |
- if (!e_mail_display_process_magic_spacebar (display, TRUE)) {
|
|
|
6159b2 |
-
|
|
|
6159b2 |
- if (caret_mode || !magic_spacebar)
|
|
|
6159b2 |
- return;
|
|
|
6159b2 |
-
|
|
|
6159b2 |
- /* XXX Are two separate calls really necessary? */
|
|
|
6159b2 |
-
|
|
|
6159b2 |
- if (message_list_select (
|
|
|
6159b2 |
- MESSAGE_LIST (message_list),
|
|
|
6159b2 |
- MESSAGE_LIST_SELECT_NEXT |
|
|
|
6159b2 |
- MESSAGE_LIST_SELECT_INCLUDE_COLLAPSED,
|
|
|
6159b2 |
- 0, CAMEL_MESSAGE_SEEN))
|
|
|
6159b2 |
- return;
|
|
|
6159b2 |
-
|
|
|
6159b2 |
- if (message_list_select (
|
|
|
6159b2 |
- MESSAGE_LIST (message_list),
|
|
|
6159b2 |
- MESSAGE_LIST_SELECT_NEXT |
|
|
|
6159b2 |
- MESSAGE_LIST_SELECT_WRAP |
|
|
|
6159b2 |
- MESSAGE_LIST_SELECT_INCLUDE_COLLAPSED,
|
|
|
6159b2 |
- 0, CAMEL_MESSAGE_SEEN))
|
|
|
6159b2 |
- return;
|
|
|
6159b2 |
-
|
|
|
6159b2 |
- em_folder_tree_select_next_path (folder_tree, TRUE);
|
|
|
6159b2 |
-
|
|
|
6159b2 |
- gtk_widget_grab_focus (message_list);
|
|
|
6159b2 |
- }
|
|
|
6159b2 |
+ mail_shell_view_magic_spacebar (mail_shell_view, TRUE);
|
|
|
6159b2 |
}
|
|
|
6159b2 |
|
|
|
6159b2 |
static void
|