diff options
author | Jon Trowbridge <trow@ximian.com> | 2001-12-12 02:03:44 +0800 |
---|---|---|
committer | Jon Trowbridge <trow@src.gnome.org> | 2001-12-12 02:03:44 +0800 |
commit | 6642d01f14a95b02f2f5bd96d59bc7d1dc9bf835 (patch) | |
tree | 0c7dd23b31755185165cd4db54c3840f6891f148 /mail/message-list.c | |
parent | 0bdb17a8e32c7a4a636a008cc0466e44ee6bdaff (diff) | |
download | gsoc2013-evolution-6642d01f14a95b02f2f5bd96d59bc7d1dc9bf835.tar.gz gsoc2013-evolution-6642d01f14a95b02f2f5bd96d59bc7d1dc9bf835.tar.zst gsoc2013-evolution-6642d01f14a95b02f2f5bd96d59bc7d1dc9bf835.zip |
Add ETable magic for our new "Needs Reply" column. (The next few entries
2001-12-11 Jon Trowbridge <trow@ximian.com>
* message-list.etspec: Add ETable magic for our new "Needs Reply"
column. (The next few entries are for bug #90)
* message-list.h: Add COL_NEED_REPLY.
* message-list.c: Move mail_need_reply_xpm to the end of
states_pixmaps.
(ml_duplicate_value): Handle COL_NEED_REPLY.
(ml_free_value): Handle COL_NEED_REPLY.
(ml_initialize_value): Handle COL_NEED_REPLY.
(ml_value_is_empty): Handle COL_NEED_REPLY. Added
needs_reply_map[] array.
(ml_value_to_string): Handle COL_NEED_REPLY.
(ml_tree_value_at): Fix magic numbers, undoing my changes from the
otehr day. Add handler for COL_NEED_REPLY.
(message_list_create_extras): Attach icons for COL_NEED_REPLY.
(on_click): Undo my previous changes to display need-reply status
in COL_MESSAGE_STATUS. Add handing for COL_NEED_REPLY.
* mail.h: Change mail_format_mime_message, mail_format_raw_message
and the MailMimeHandlerFn typedef to take GtkHTML and
GtkHTMLStream args, as per our changes in mail-format.c.
* mail-format.c: Giant refactoring. Remove the assumption
throughout that we will always want to render into the GtkHTML
object contained in the MailDisplay. Instead, always pass in the
GtkHTML and GtkHTMLStream that we want to write to. Also, ignore
theme work-arounds if the printing flag is set. (This and what
follows fixes bug #82)
* mail-display.h: Remove GtkHTMLStream *stream from MailDisplay.
We don't need it anymore.
* mail-display.c (mail_display_render): Added. Breaks the code
that renders the message into the GtkHTML object out of
mail_display_redisplay.
(mail_display_redisplay): Call mail_display_render.
(mail_display_init): Remove reference to ->stream.
(mail_display_new): Remove reference to ->stream.
* mail-callbacks.c (do_mail_print): Create a new GtkHTML to render
our printed version into (via the new function
mail_display_render. Set the MailDisplay's printing flag to TRUE
before we render, and set it back to FALSE afterwards.
(do_mail_fetch_and_print): If the preview pane isn't open when we
try to print, fetch the message before printing.
(print_msg): Call do_mail_fetch_and_print.
(print_preview_msg): Call do_mail_fetch_and_print.
* folder-browser-ui.c: Remove "PrintMessage" and
"PrintPreviewMessage" from message_pane_enables... these now work
when the preview pane is closed. Disable printing if multiple
messages are selected.
svn path=/trunk/; revision=14981
Diffstat (limited to 'mail/message-list.c')
-rw-r--r-- | mail/message-list.c | 96 |
1 files changed, 47 insertions, 49 deletions
diff --git a/mail/message-list.c b/mail/message-list.c index 02e6d234c9..24fac02cbe 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -138,7 +138,6 @@ static struct { { mail_new_xpm, NULL }, { mail_read_xpm, NULL }, { mail_replied_xpm, NULL }, - { mail_need_reply_xpm, NULL }, /* FIXME: Replace these with pixmaps for multiple_read and multiple_unread */ { mail_new_xpm, NULL }, { mail_read_xpm, NULL }, @@ -152,6 +151,7 @@ static struct { { score_high_xpm, NULL }, { score_higher_xpm, NULL }, { score_highest_xpm, NULL }, + { mail_need_reply_xpm, NULL }, { NULL, NULL } }; @@ -540,6 +540,7 @@ ml_duplicate_value (ETreeModel *etm, int col, const void *value, void *data) { switch (col){ case COL_MESSAGE_STATUS: + case COL_NEED_REPLY: case COL_FLAGGED: case COL_SCORE: case COL_ATTACHMENT: @@ -566,6 +567,7 @@ ml_free_value (ETreeModel *etm, int col, void *value, void *data) { switch (col){ case COL_MESSAGE_STATUS: + case COL_NEED_REPLY: case COL_FLAGGED: case COL_SCORE: case COL_ATTACHMENT: @@ -591,6 +593,7 @@ ml_initialize_value (ETreeModel *etm, int col, void *data) { switch (col){ case COL_MESSAGE_STATUS: + case COL_NEED_REPLY: case COL_FLAGGED: case COL_SCORE: case COL_ATTACHMENT: @@ -617,6 +620,7 @@ ml_value_is_empty (ETreeModel *etm, int col, const void *value, void *data) { switch (col){ case COL_MESSAGE_STATUS: + case COL_NEED_REPLY: case COL_FLAGGED: case COL_SCORE: case COL_ATTACHMENT: @@ -645,6 +649,11 @@ static const char *status_map[] = { N_("Multiple Messages"), }; +static const char *needs_reply_map[] = { + "", + N_("Needs Reply"), +}; + static const char *score_map[] = { N_("Lowest"), N_("Lower"), @@ -667,6 +676,10 @@ ml_value_to_string (ETreeModel *etm, int col, const void *value, void *data) return g_strdup(""); return g_strdup(_(status_map[i])); + case COL_NEED_REPLY: + i = (unsigned int)value; + return g_strdup (_(needs_reply_map[i])); + case COL_SCORE: i = (unsigned int)value + 3; if (i > 6) @@ -794,14 +807,12 @@ ml_tree_value_at (ETreeModel *etm, ETreePath path, int col, void *model_data) child = e_tree_model_node_get_first_child(etm, path); if (child && !e_tree_node_is_expanded(message_list->tree, path)) { if (subtree_unread(message_list, child)) - return (void *)4; + return (void *)3; else - return (void *)5; + return (void *)4; } - if (msg_info->flags & CAMEL_MESSAGE_NEEDS_REPLY) - return GINT_TO_POINTER (3); - else if (msg_info->flags & CAMEL_MESSAGE_ANSWERED) + if (msg_info->flags & CAMEL_MESSAGE_ANSWERED) return GINT_TO_POINTER (2); else if (msg_info->flags & CAMEL_MESSAGE_SEEN) return GINT_TO_POINTER (1); @@ -809,6 +820,8 @@ ml_tree_value_at (ETreeModel *etm, ETreePath path, int col, void *model_data) return GINT_TO_POINTER (0); break; } + case COL_NEED_REPLY: + return GINT_TO_POINTER ((msg_info->flags & CAMEL_MESSAGE_NEEDS_REPLY) != 0); case COL_FLAGGED: return GINT_TO_POINTER ((msg_info->flags & CAMEL_MESSAGE_FLAGGED) != 0); case COL_SCORE: { @@ -966,31 +979,36 @@ message_list_create_extras (void) extras = e_table_extras_new(); e_table_extras_add_pixbuf(extras, "status", states_pixmaps [0].pixbuf); - e_table_extras_add_pixbuf(extras, "score", states_pixmaps [14].pixbuf); - e_table_extras_add_pixbuf(extras, "attachment", states_pixmaps [7].pixbuf); - e_table_extras_add_pixbuf(extras, "flagged", states_pixmaps [8].pixbuf); + e_table_extras_add_pixbuf(extras, "score", states_pixmaps [13].pixbuf); + e_table_extras_add_pixbuf(extras, "attachment", states_pixmaps [6].pixbuf); + e_table_extras_add_pixbuf(extras, "flagged", states_pixmaps [7].pixbuf); + e_table_extras_add_pixbuf(extras, "needsreply", states_pixmaps [15].pixbuf); e_table_extras_add_compare(extras, "address_compare", address_compare); e_table_extras_add_compare(extras, "subject_compare", subject_compare); - for (i = 0; i < 6; i++) + for (i = 0; i < 5; i++) images [i] = states_pixmaps [i].pixbuf; - e_table_extras_add_cell(extras, "render_message_status", e_cell_toggle_new (0, 6, images)); + e_table_extras_add_cell(extras, "render_message_status", e_cell_toggle_new (0, 5, images)); for (i = 0; i < 2; i++) - images [i] = states_pixmaps [i + 6].pixbuf; + images [i] = states_pixmaps [i + 5].pixbuf; e_table_extras_add_cell(extras, "render_attachment", e_cell_toggle_new (0, 2, images)); - images [1] = states_pixmaps [8].pixbuf; + images [1] = states_pixmaps [7].pixbuf; e_table_extras_add_cell(extras, "render_flagged", e_cell_toggle_new (0, 2, images)); + images [1] = states_pixmaps [15].pixbuf; + e_table_extras_add_cell(extras, "render_needs_reply", e_cell_toggle_new (0, 2, images)); + for (i = 0; i < 7; i++) - images[i] = states_pixmaps [i + 8].pixbuf; + images[i] = states_pixmaps [i + 7].pixbuf; e_table_extras_add_cell(extras, "render_score", e_cell_toggle_new (0, 7, images)); - + + /* date cell */ cell = e_cell_date_new (NULL, GTK_JUSTIFY_LEFT); gtk_object_set (GTK_OBJECT (cell), @@ -2028,51 +2046,31 @@ on_click (ETree *tree, gint row, ETreePath path, gint col, GdkEvent *event, Mess int flag; CamelMessageInfo *info; - if (col == COL_MESSAGE_STATUS) { - guint32 msg_flags; - - info = get_message_info (list, path); - if (info == NULL) { - return FALSE; - } - - msg_flags = camel_folder_get_message_flags (list->folder, camel_message_info_uid (info)); - - if (msg_flags & CAMEL_MESSAGE_NEEDS_REPLY) { - flag = 0; - } else if (msg_flags & CAMEL_MESSAGE_SEEN) { - flag = CAMEL_MESSAGE_SEEN | CAMEL_MESSAGE_NEEDS_REPLY; - } else { - flag = CAMEL_MESSAGE_SEEN; - } - - camel_folder_set_message_flags (list->folder, camel_message_info_uid (info), - CAMEL_MESSAGE_SEEN | CAMEL_MESSAGE_NEEDS_REPLY, flag); - - if (flag & CAMEL_MESSAGE_SEEN && list->seen_id) { - gtk_timeout_remove (list->seen_id); - list->seen_id = 0; - } - - return TRUE; - } - - if (col == COL_FLAGGED) + if (col == COL_MESSAGE_STATUS) + flag = CAMEL_MESSAGE_SEEN; + else if (col == COL_FLAGGED) flag = CAMEL_MESSAGE_FLAGGED; + else if (col == COL_NEED_REPLY) + flag = CAMEL_MESSAGE_NEEDS_REPLY; else return FALSE; - + info = get_message_info (list, path); if (info == NULL) { return FALSE; } - + /* If a message was marked as deleted and the user flags it as important, undelete it */ - if (col == COL_FLAGGED && (info->flags & CAMEL_MESSAGE_DELETED)) + if ((col == COL_FLAGGED || col == COL_NEED_REPLY) && (info->flags & CAMEL_MESSAGE_DELETED)) flag |= CAMEL_MESSAGE_DELETED; camel_folder_set_message_flags (list->folder, camel_message_info_uid (info), flag, ~info->flags); - + + if (flag == CAMEL_MESSAGE_SEEN && list->seen_id) { + gtk_timeout_remove (list->seen_id); + list->seen_id = 0; + } + return TRUE; } |