aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-callbacks.c
diff options
context:
space:
mode:
authorjacob berkman <jacob@ximian.com>2001-06-26 05:12:10 +0800
committerJacob Berkman <jberkman@src.gnome.org>2001-06-26 05:12:10 +0800
commit57db15334b2ea42d619024a48bda764af46d0e2a (patch)
treebcedce63814055decf0206e29deb9fec968148b6 /mail/mail-callbacks.c
parent4d5ccfcb23509552645597c073fd0fa311701ded (diff)
downloadgsoc2013-evolution-57db15334b2ea42d619024a48bda764af46d0e2a.tar
gsoc2013-evolution-57db15334b2ea42d619024a48bda764af46d0e2a.tar.gz
gsoc2013-evolution-57db15334b2ea42d619024a48bda764af46d0e2a.tar.bz2
gsoc2013-evolution-57db15334b2ea42d619024a48bda764af46d0e2a.tar.lz
gsoc2013-evolution-57db15334b2ea42d619024a48bda764af46d0e2a.tar.xz
gsoc2013-evolution-57db15334b2ea42d619024a48bda764af46d0e2a.tar.zst
gsoc2013-evolution-57db15334b2ea42d619024a48bda764af46d0e2a.zip
sync folders after we've gotten mail
2001-06-25 jacob berkman <jacob@ximian.com> * mail-send-recv.c (free_send_data): sync folders after we've gotten mail * folder-browser-factory.c (control_activate): set the ui component on the folder browser (control_activate): update the view preview item (control_deactivate): don't sync the folder here (control_deactivate): unset the ui component of the folder browser * mail-callbacks.c (toggle_flags): stuff from jleach to add an importance keybinding (mark_as_important): ditto (toggle_as_important): again * mail-config.c (mail_config_get_show_preview): (mail_config_set_show_preview): basically a copy of get_thread_list() but for the preview pane * folder-browser.c (folder_browser_destroy): unref the our ui component (folder_browser_set_ui_component): new function for setting the ui component (save_cursor_pos): (set_cursor_pos): try to show the selected row when the preview pane is shown (folder_browser_set_message_preview): implement (folder_browser_toggle_preview): toggle the preview (duh) (on_key_press): add keybindings for marking as important (!), and hiding the preview pane (q) (etree_key): clean up a little bit, and make enter either show the preview pane or open the message (fb_resize_cb): only save the paned size if the preview is alread shown (folder_browser_gui_init): pass ourselves to fb_resize_cb (on_message_selected): only add the timeout if the preview is shown svn path=/trunk/; revision=10491
Diffstat (limited to 'mail/mail-callbacks.c')
-rw-r--r--mail/mail-callbacks.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c
index 730df51c5e..e5e359e219 100644
--- a/mail/mail-callbacks.c
+++ b/mail/mail-callbacks.c
@@ -1024,6 +1024,42 @@ flag_messages(FolderBrowser *fb, guint32 mask, guint32 set)
return i;
}
+static int
+toggle_flags (FolderBrowser *fb, guint32 mask)
+{
+ MessageList *ml = fb->message_list;
+ GPtrArray *uids;
+ int i;
+
+ if (ml->folder == NULL)
+ return 0;
+
+ /* could just use specific callback but i'm lazy */
+ uids = g_ptr_array_new ();
+ message_list_foreach (ml, enumerate_msg, uids);
+ camel_folder_freeze (ml->folder);
+ for (i = 0; i < uids->len; i++) {
+ gint flags;
+
+ flags = camel_folder_get_message_flags (ml->folder, uids->pdata[i]);
+
+ if (flags & mask)
+ camel_folder_set_message_flags (ml->folder, uids->pdata[i], mask, 0);
+ else {
+ if ((mask & CAMEL_MESSAGE_FLAGGED) && (flags & CAMEL_MESSAGE_DELETED))
+ camel_folder_set_message_flags (ml->folder, uids->pdata[i], CAMEL_MESSAGE_DELETED, 0);
+ camel_folder_set_message_flags (ml->folder, uids->pdata[i], mask, mask);
+ }
+
+ g_free (uids->pdata[i]);
+ }
+ camel_folder_thaw (ml->folder);
+
+ g_ptr_array_free (uids, TRUE);
+
+ return i;
+}
+
void
mark_as_seen (BonoboUIComponent *uih, void *user_data, const char *path)
{
@@ -1043,6 +1079,19 @@ mark_all_as_seen (BonoboUIComponent *uih, void *user_data, const char *path)
flag_messages (FOLDER_BROWSER (user_data), CAMEL_MESSAGE_SEEN, CAMEL_MESSAGE_SEEN);
}
+void
+mark_as_important (BonoboUIComponent *uih, void *user_data, const char *path)
+{
+ flag_messages (FOLDER_BROWSER (user_data), CAMEL_MESSAGE_DELETED, 0);
+ flag_messages (FOLDER_BROWSER (user_data), CAMEL_MESSAGE_FLAGGED, CAMEL_MESSAGE_FLAGGED);
+}
+
+void
+toggle_as_important (BonoboUIComponent *uih, void *user_data, const char *path)
+{
+ toggle_flags (FOLDER_BROWSER (user_data), CAMEL_MESSAGE_FLAGGED);
+}
+
static void
do_edit_messages(CamelFolder *folder, GPtrArray *uids, GPtrArray *messages, void *data)
{