diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-12-01 03:46:26 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-12-01 07:34:38 +0800 |
commit | d94534c3673956164f9fb2c7f6b12188994503ae (patch) | |
tree | c26a8a2edb293478b2ad43e36de5feebaf84ce1d /modules | |
parent | 420a4ccb20825d618b06c6be742c2c47cc15ca71 (diff) | |
download | gsoc2013-evolution-d94534c3673956164f9fb2c7f6b12188994503ae.tar gsoc2013-evolution-d94534c3673956164f9fb2c7f6b12188994503ae.tar.gz gsoc2013-evolution-d94534c3673956164f9fb2c7f6b12188994503ae.tar.bz2 gsoc2013-evolution-d94534c3673956164f9fb2c7f6b12188994503ae.tar.lz gsoc2013-evolution-d94534c3673956164f9fb2c7f6b12188994503ae.tar.xz gsoc2013-evolution-d94534c3673956164f9fb2c7f6b12188994503ae.tar.zst gsoc2013-evolution-d94534c3673956164f9fb2c7f6b12188994503ae.zip |
Merge bits and pieces of the anjal-evo-2-30 branch.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/mail/e-mail-shell-content.c | 1 | ||||
-rw-r--r-- | modules/mail/e-mail-shell-sidebar.c | 25 | ||||
-rw-r--r-- | modules/mail/e-mail-shell-view-actions.c | 139 | ||||
-rw-r--r-- | modules/mail/e-mail-shell-view-private.h | 1 | ||||
-rw-r--r-- | modules/mail/e-mail-shell-view.c | 17 |
5 files changed, 86 insertions, 97 deletions
diff --git a/modules/mail/e-mail-shell-content.c b/modules/mail/e-mail-shell-content.c index 465022a48f..fb4a6ab4fb 100644 --- a/modules/mail/e-mail-shell-content.c +++ b/modules/mail/e-mail-shell-content.c @@ -35,6 +35,7 @@ #include "em-utils.h" #include "mail-config.h" #include "mail-ops.h" +#include "message-list.h" #include "e-mail-reader.h" #include "e-mail-search-bar.h" diff --git a/modules/mail/e-mail-shell-sidebar.c b/modules/mail/e-mail-shell-sidebar.c index d182f98426..fa0acd1f5a 100644 --- a/modules/mail/e-mail-shell-sidebar.c +++ b/modules/mail/e-mail-shell-sidebar.c @@ -365,29 +365,6 @@ mail_shell_sidebar_selection_changed_cb (EShellSidebar *shell_sidebar, } static void -tree_hidden_key_event_cb (EMFolderTree *emft, GdkEvent *event, EShellView *shell_view) -{ - if (event && event->type == GDK_KEY_PRESS && shell_view) { - MessageList *msg_list = e_mail_reader_get_message_list (E_MAIL_READER (e_shell_view_get_shell_content (shell_view))); - - g_return_if_fail (msg_list != NULL); - - switch (event->key.keyval) { - case '[': - case ',': - gtk_widget_grab_focus ((GtkWidget *) msg_list); - message_list_select (msg_list, MESSAGE_LIST_SELECT_PREVIOUS|MESSAGE_LIST_SELECT_WRAP, 0, CAMEL_MESSAGE_SEEN); - break; - case ']': - case '.': - gtk_widget_grab_focus ((GtkWidget *) msg_list); - message_list_select (msg_list, MESSAGE_LIST_SELECT_NEXT|MESSAGE_LIST_SELECT_WRAP, 0, CAMEL_MESSAGE_SEEN); - break; - } - } -} - -static void mail_shell_sidebar_get_property (GObject *object, guint property_id, GValue *value, @@ -484,8 +461,6 @@ mail_shell_sidebar_constructed (GObject *object) shell_settings, "mail-side-bar-search", widget, "enable-search"); - g_signal_connect (widget, "hidden-key-event", G_CALLBACK (tree_hidden_key_event_cb), shell_view); - tree_view = GTK_TREE_VIEW (mail_shell_sidebar->priv->folder_tree); selection = gtk_tree_view_get_selection (tree_view); model = gtk_tree_view_get_model (tree_view); diff --git a/modules/mail/e-mail-shell-view-actions.c b/modules/mail/e-mail-shell-view-actions.c index 4dce2de80b..d9785a9cdf 100644 --- a/modules/mail/e-mail-shell-view-actions.c +++ b/modules/mail/e-mail-shell-view-actions.c @@ -83,7 +83,7 @@ action_mail_create_search_folder_cb (GtkAction *action, EMailReader *reader; EShellView *shell_view; EShellContent *shell_content; - MessageList *message_list; + GtkWidget *message_list; EFilterRule *search_rule; EMVFolderRule *vfolder_rule; const gchar *folder_uri; @@ -104,7 +104,7 @@ action_mail_create_search_folder_cb (GtkAction *action, reader = E_MAIL_READER (shell_content); message_list = e_mail_reader_get_message_list (reader); - folder_uri = message_list->folder_uri; + folder_uri = MESSAGE_LIST (message_list)->folder_uri; search_rule = vfolder_clone_rule (search_rule); rule_name = g_strdup_printf ("%s %s", search_rule->name, search_text); @@ -195,19 +195,21 @@ action_mail_folder_expunge_cb (GtkAction *action, EMailShellView *mail_shell_view) { EMailReader *reader; - MessageList *message_list; + GtkWidget *message_list; EShellWindow *shell_window; EShellView *shell_view; + CamelFolder *folder; 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); message_list = e_mail_reader_get_message_list (reader); - g_return_if_fail (message_list->folder != NULL); - em_utils_expunge_folder ( - GTK_WIDGET (shell_window), message_list->folder); + folder = MESSAGE_LIST (message_list)->folder; + g_return_if_fail (folder != NULL); + + em_utils_expunge_folder (GTK_WIDGET (shell_window), folder); } static void @@ -215,7 +217,7 @@ action_mail_folder_mark_all_as_read_cb (GtkAction *action, EMailShellView *mail_shell_view) { EMailReader *reader; - MessageList *message_list; + GtkWidget *message_list; EShellWindow *shell_window; EShellView *shell_view; CamelFolder *folder; @@ -231,7 +233,8 @@ action_mail_folder_mark_all_as_read_cb (GtkAction *action, reader = E_MAIL_READER (mail_shell_view->priv->mail_shell_content); message_list = e_mail_reader_get_message_list (reader); - folder = message_list->folder; + + folder = MESSAGE_LIST (message_list)->folder; g_return_if_fail (folder != NULL); key = "/apps/evolution/mail/prompts/mark_all_read"; @@ -240,7 +243,7 @@ action_mail_folder_mark_all_as_read_cb (GtkAction *action, if (!em_utils_prompt_user (parent, key, prompt, NULL)) return; - uids = message_list_get_uids (message_list); + uids = message_list_get_uids (MESSAGE_LIST (message_list)); camel_folder_freeze (folder); for (ii = 0; ii < uids->len; ii++) @@ -249,7 +252,7 @@ action_mail_folder_mark_all_as_read_cb (GtkAction *action, CAMEL_MESSAGE_SEEN, CAMEL_MESSAGE_SEEN); camel_folder_thaw (folder); - message_list_free_uids (message_list, uids); + message_list_free_uids (MESSAGE_LIST (message_list), uids); } static void @@ -356,10 +359,10 @@ action_mail_folder_rename_cb (GtkAction *action, /* Helper for action_mail_folder_select_all_cb() */ static gboolean -action_mail_folder_select_all_timeout_cb (MessageList *message_list) +action_mail_folder_select_all_timeout_cb (GtkWidget *message_list) { - message_list_select_all (message_list); - gtk_widget_grab_focus (GTK_WIDGET (message_list)); + message_list_select_all (MESSAGE_LIST (message_list)); + gtk_widget_grab_focus (message_list); return FALSE; } @@ -369,7 +372,7 @@ action_mail_folder_select_all_cb (GtkAction *action, EMailShellView *mail_shell_view) { EMailReader *reader; - MessageList *message_list; + GtkWidget *message_list; EShellWindow *shell_window; EShellView *shell_view; @@ -379,7 +382,7 @@ action_mail_folder_select_all_cb (GtkAction *action, reader = E_MAIL_READER (mail_shell_view->priv->mail_shell_content); message_list = e_mail_reader_get_message_list (reader); - if (message_list->threaded) { + if (MESSAGE_LIST (message_list)->threaded) { gtk_action_activate (ACTION (MAIL_THREADS_EXPAND_ALL)); /* XXX The timeout below is added so that the execution @@ -400,26 +403,26 @@ static void action_mail_folder_select_thread_cb (GtkAction *action, EMailShellView *mail_shell_view) { - MessageList *message_list; + GtkWidget *message_list; EMailReader *reader; reader = E_MAIL_READER (mail_shell_view->priv->mail_shell_content); message_list = e_mail_reader_get_message_list (reader); - message_list_select_thread (message_list); + message_list_select_thread (MESSAGE_LIST (message_list)); } static void action_mail_folder_select_subthread_cb (GtkAction *action, EMailShellView *mail_shell_view) { - MessageList *message_list; + GtkWidget *message_list; EMailReader *reader; reader = E_MAIL_READER (mail_shell_view->priv->mail_shell_content); message_list = e_mail_reader_get_message_list (reader); - message_list_select_subthread (message_list); + message_list_select_subthread (MESSAGE_LIST (message_list)); } static void @@ -442,7 +445,7 @@ static void action_mail_hide_deleted_cb (GtkToggleAction *action, EMailShellView *mail_shell_view) { - MessageList *message_list; + GtkWidget *message_list; EMailReader *reader; gboolean active; @@ -450,21 +453,21 @@ action_mail_hide_deleted_cb (GtkToggleAction *action, message_list = e_mail_reader_get_message_list (reader); active = gtk_toggle_action_get_active (action); - message_list_set_hidedeleted (message_list, active); + message_list_set_hidedeleted (MESSAGE_LIST (message_list), active); } static void action_mail_hide_read_cb (GtkAction *action, EMailShellView *mail_shell_view) { - MessageList *message_list; + GtkWidget *message_list; EMailReader *reader; reader = E_MAIL_READER (mail_shell_view->priv->mail_shell_content); message_list = e_mail_reader_get_message_list (reader); message_list_hide_add ( - message_list, + MESSAGE_LIST (message_list), "(match-all (system-flag \"seen\"))", ML_HIDE_SAME, ML_HIDE_SAME); } @@ -473,16 +476,16 @@ static void action_mail_hide_selected_cb (GtkAction *action, EMailShellView *mail_shell_view) { - MessageList *message_list; + GtkWidget *message_list; EMailReader *reader; GPtrArray *uids; reader = E_MAIL_READER (mail_shell_view->priv->mail_shell_content); message_list = e_mail_reader_get_message_list (reader); - uids = message_list_get_selected (message_list); - message_list_hide_uids (message_list, uids); - message_list_free_uids (message_list, uids); + uids = message_list_get_selected (MESSAGE_LIST (message_list)); + message_list_hide_uids (MESSAGE_LIST (message_list), uids); + message_list_free_uids (MESSAGE_LIST (message_list), uids); } static void @@ -490,7 +493,7 @@ action_mail_label_cb (GtkToggleAction *action, EMailShellView *mail_shell_view) { EMailReader *reader; - MessageList *message_list; + GtkWidget *message_list; CamelFolder *folder; GPtrArray *uids; const gchar *tag; @@ -501,9 +504,9 @@ action_mail_label_cb (GtkToggleAction *action, reader = E_MAIL_READER (mail_shell_view->priv->mail_shell_content); message_list = e_mail_reader_get_message_list (reader); - folder = message_list->folder; + folder = MESSAGE_LIST (message_list)->folder; - uids = message_list_get_selected (message_list); + uids = message_list_get_selected (MESSAGE_LIST (message_list)); for (ii = 0; ii < uids->len; ii++) { if (gtk_toggle_action_get_active (action)) @@ -517,7 +520,7 @@ action_mail_label_cb (GtkToggleAction *action, } } - message_list_free_uids (message_list, uids); + message_list_free_uids (MESSAGE_LIST (message_list), uids); } static void @@ -531,7 +534,7 @@ action_mail_label_new_cb (GtkAction *action, EMailLabelDialog *label_dialog; EMailLabelListStore *store; EMailReader *reader; - MessageList *message_list; + GtkWidget *message_list; CamelFolder *folder; GtkTreeModel *model; GtkTreeIter iter; @@ -578,15 +581,15 @@ action_mail_label_new_cb (GtkAction *action, reader = E_MAIL_READER (mail_shell_view->priv->mail_shell_content); message_list = e_mail_reader_get_message_list (reader); - folder = message_list->folder; - uids = message_list_get_selected (message_list); + folder = MESSAGE_LIST (message_list)->folder; + uids = message_list_get_selected (MESSAGE_LIST (message_list)); for (ii = 0; ii < uids->len; ii++) camel_folder_set_message_user_flag ( folder, uids->pdata[ii], label_tag, TRUE); - message_list_free_uids (message_list, uids); + message_list_free_uids (MESSAGE_LIST (message_list), uids); g_free (label_tag); @@ -603,7 +606,7 @@ action_mail_label_none_cb (GtkAction *action, EShellSettings *shell_settings; EShellWindow *shell_window; EMailReader *reader; - MessageList *message_list; + GtkWidget *message_list; GtkTreeModel *tree_model; CamelFolder *folder; GtkTreeIter iter; @@ -621,8 +624,8 @@ action_mail_label_none_cb (GtkAction *action, reader = E_MAIL_READER (mail_shell_view->priv->mail_shell_content); message_list = e_mail_reader_get_message_list (reader); - uids = message_list_get_selected (message_list); - folder = message_list->folder; + uids = message_list_get_selected (MESSAGE_LIST (message_list)); + folder = MESSAGE_LIST (message_list)->folder; valid = gtk_tree_model_get_iter_first (tree_model, &iter); @@ -644,20 +647,20 @@ action_mail_label_none_cb (GtkAction *action, valid = gtk_tree_model_iter_next (tree_model, &iter); } - message_list_free_uids (message_list, uids); + message_list_free_uids (MESSAGE_LIST (message_list), uids); } static void action_mail_show_hidden_cb (GtkAction *action, EMailShellView *mail_shell_view) { - MessageList *message_list; + GtkWidget *message_list; EMailReader *reader; reader = E_MAIL_READER (mail_shell_view->priv->mail_shell_content); message_list = e_mail_reader_get_message_list (reader); - message_list_hide_clear (message_list); + message_list_hide_clear (MESSAGE_LIST (message_list)); } static void @@ -672,7 +675,7 @@ action_mail_smart_backward_cb (GtkAction *action, EMFolderTree *folder_tree; EMFormatHTMLDisplay *html_display; EMailReader *reader; - MessageList *message_list; + GtkWidget *message_list; GtkToggleAction *toggle_action; GtkHTML *html; gboolean caret_mode; @@ -709,18 +712,21 @@ action_mail_smart_backward_cb (GtkAction *action, /* XXX Are two separate calls really necessary? */ if (message_list_select ( - message_list, MESSAGE_LIST_SELECT_PREVIOUS, + MESSAGE_LIST (message_list), + MESSAGE_LIST_SELECT_PREVIOUS, 0, CAMEL_MESSAGE_SEEN)) return; if (message_list_select ( - message_list, MESSAGE_LIST_SELECT_PREVIOUS | - MESSAGE_LIST_SELECT_WRAP, 0, CAMEL_MESSAGE_SEEN)) + MESSAGE_LIST (message_list), + MESSAGE_LIST_SELECT_PREVIOUS | + MESSAGE_LIST_SELECT_WRAP, 0, + CAMEL_MESSAGE_SEEN)) return; em_folder_tree_select_prev_path (folder_tree, TRUE); - gtk_widget_grab_focus (GTK_WIDGET (message_list)); + gtk_widget_grab_focus (message_list); } static void @@ -735,7 +741,7 @@ action_mail_smart_forward_cb (GtkAction *action, EMFolderTree *folder_tree; EMFormatHTMLDisplay *html_display; EMailReader *reader; - MessageList *message_list; + GtkWidget *message_list; GtkToggleAction *toggle_action; GtkHTML *html; gboolean caret_mode; @@ -772,18 +778,21 @@ action_mail_smart_forward_cb (GtkAction *action, /* XXX Are two separate calls really necessary? */ if (message_list_select ( - message_list, MESSAGE_LIST_SELECT_NEXT, + MESSAGE_LIST (message_list), + MESSAGE_LIST_SELECT_NEXT, 0, CAMEL_MESSAGE_SEEN)) return; if (message_list_select ( - message_list, MESSAGE_LIST_SELECT_NEXT | - MESSAGE_LIST_SELECT_WRAP, 0, CAMEL_MESSAGE_SEEN)) + MESSAGE_LIST (message_list), + MESSAGE_LIST_SELECT_NEXT | + MESSAGE_LIST_SELECT_WRAP, + 0, CAMEL_MESSAGE_SEEN)) return; em_folder_tree_select_next_path (folder_tree, TRUE); - gtk_widget_grab_focus (GTK_WIDGET (message_list)); + gtk_widget_grab_focus (message_list); } static void @@ -797,26 +806,26 @@ static void action_mail_threads_collapse_all_cb (GtkAction *action, EMailShellView *mail_shell_view) { - MessageList *message_list; + GtkWidget *message_list; EMailReader *reader; reader = E_MAIL_READER (mail_shell_view->priv->mail_shell_content); message_list = e_mail_reader_get_message_list (reader); - message_list_set_threaded_collapse_all (message_list); + message_list_set_threaded_collapse_all (MESSAGE_LIST (message_list)); } static void action_mail_threads_expand_all_cb (GtkAction *action, EMailShellView *mail_shell_view) { - MessageList *message_list; + GtkWidget *message_list; EMailReader *reader; reader = E_MAIL_READER (mail_shell_view->priv->mail_shell_content); message_list = e_mail_reader_get_message_list (reader); - message_list_set_threaded_expand_all (message_list); + message_list_set_threaded_expand_all (MESSAGE_LIST (message_list)); } static void @@ -824,7 +833,7 @@ action_mail_threads_group_by_cb (GtkToggleAction *action, EMailShellView *mail_shell_view) { EMailShellContent *mail_shell_content; - MessageList *message_list; + GtkWidget *message_list; EMailReader *reader; gboolean active; @@ -834,7 +843,7 @@ action_mail_threads_group_by_cb (GtkToggleAction *action, reader = E_MAIL_READER (mail_shell_content); message_list = e_mail_reader_get_message_list (reader); - message_list_set_threaded (message_list, active); + message_list_set_threaded (MESSAGE_LIST (message_list), active); } static void @@ -909,7 +918,7 @@ action_search_filter_cb (GtkRadioAction *action, EShellContent *shell_content; EShellWindow *shell_window; EMailReader *reader; - MessageList *message_list; + GtkWidget *message_list; GKeyFile *key_file; const gchar *folder_uri; @@ -919,7 +928,7 @@ action_search_filter_cb (GtkRadioAction *action, reader = E_MAIL_READER (shell_content); message_list = e_mail_reader_get_message_list (reader); - folder_uri = message_list->folder_uri; + folder_uri = MESSAGE_LIST (message_list)->folder_uri; if (folder_uri != NULL) { const gchar *key; @@ -947,7 +956,7 @@ action_search_scope_cb (GtkRadioAction *action, EShellContent *shell_content; EShellWindow *shell_window; EMailReader *reader; - MessageList *message_list; + GtkWidget *message_list; GKeyFile *key_file; const gchar *folder_uri; @@ -957,7 +966,7 @@ action_search_scope_cb (GtkRadioAction *action, reader = E_MAIL_READER (shell_content); message_list = e_mail_reader_get_message_list (reader); - folder_uri = message_list->folder_uri; + folder_uri = MESSAGE_LIST (message_list)->folder_uri; if (folder_uri != NULL) { const gchar *key; @@ -1651,7 +1660,7 @@ e_mail_shell_view_update_popup_labels (EMailShellView *mail_shell_view) EShellWindow *shell_window; EShellView *shell_view; EMailReader *reader; - MessageList *message_list; + GtkWidget *message_list; GtkUIManager *ui_manager; GtkActionGroup *action_group; GtkTreeModel *tree_model; @@ -1684,7 +1693,7 @@ e_mail_shell_view_update_popup_labels (EMailShellView *mail_shell_view) reader = E_MAIL_READER (mail_shell_view->priv->mail_shell_content); message_list = e_mail_reader_get_message_list (reader); - uids = message_list_get_selected (message_list); + uids = message_list_get_selected (MESSAGE_LIST (message_list)); valid = gtk_tree_model_get_iter_first (tree_model, &iter); @@ -1715,7 +1724,7 @@ e_mail_shell_view_update_popup_labels (EMailShellView *mail_shell_view) /* Configure the action before we connect to signals. */ mail_shell_view_update_label_action ( GTK_TOGGLE_ACTION (label_action), - message_list, uids, tag); + MESSAGE_LIST (message_list), uids, tag); g_signal_connect ( label_action, "toggled", @@ -1738,7 +1747,7 @@ e_mail_shell_view_update_popup_labels (EMailShellView *mail_shell_view) ii++; } - message_list_free_uids (message_list, uids); + message_list_free_uids (MESSAGE_LIST (message_list), uids); g_object_unref (tree_model); } diff --git a/modules/mail/e-mail-shell-view-private.h b/modules/mail/e-mail-shell-view-private.h index 70700dddfc..dac7d81ca0 100644 --- a/modules/mail/e-mail-shell-view-private.h +++ b/modules/mail/e-mail-shell-view-private.h @@ -57,6 +57,7 @@ #include "mail-ops.h" #include "mail-send-recv.h" #include "mail-vfolder.h" +#include "message-list.h" #include "e-mail-shell-backend.h" #include "e-mail-shell-content.h" diff --git a/modules/mail/e-mail-shell-view.c b/modules/mail/e-mail-shell-view.c index c18b3e68b0..7cd7bdfaf4 100644 --- a/modules/mail/e-mail-shell-view.c +++ b/modules/mail/e-mail-shell-view.c @@ -93,7 +93,7 @@ mail_shell_view_execute_search (EShellView *shell_view) EShellSettings *shell_settings; EMFormatHTMLDisplay *html_display; EMailShellContent *mail_shell_content; - MessageList *message_list; + GtkWidget *message_list; EFilterRule *rule; EMailReader *reader; CamelFolder *folder; @@ -126,8 +126,8 @@ mail_shell_view_execute_search (EShellView *shell_view) html_display = e_mail_reader_get_html_display (reader); message_list = e_mail_reader_get_message_list (reader); - folder_uri = message_list->folder_uri; - folder = message_list->folder; + folder_uri = MESSAGE_LIST (message_list)->folder_uri; + folder = MESSAGE_LIST (message_list)->folder; if (folder_uri != NULL) { GKeyFile *key_file; @@ -346,7 +346,7 @@ filter: break; } - message_list_set_search (message_list, query); + message_list_set_search (MESSAGE_LIST (message_list), query); e_mail_shell_content_set_search_strings ( mail_shell_content, search_strings); @@ -464,7 +464,11 @@ mail_shell_view_update_actions (EShellView *shell_view) uri = em_folder_tree_get_selected_uri (folder_tree); if (uri != NULL) { EMFolderTreeModel *model; - MessageList *message_list; + GtkWidget *message_list; + const gchar *folder_uri; + + message_list = e_mail_reader_get_message_list (reader); + folder_uri = MESSAGE_LIST (message_list)->folder_uri; /* XXX If the user right-clicks on a folder other than what * the message list is showing, disable folder rename. @@ -473,9 +477,8 @@ mail_shell_view_update_actions (EShellView *shell_view) * back to where it was to avoid cancelling the inline * folder tree editing, it's just too hairy to try to * get right. So we're punting. */ - message_list = e_mail_reader_get_message_list (reader); folder_tree_and_message_list_agree = - (g_strcmp0 (uri, message_list->folder_uri) == 0); + (g_strcmp0 (uri, folder_uri) == 0); account = mail_config_get_account_by_source_url (uri); |