aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog14
-rw-r--r--mail/mail-send-recv.c101
-rw-r--r--mail/message-list.c65
3 files changed, 115 insertions, 65 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index e8005367c5..6d4483cac2 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,17 @@
+2001-02-02 Not Zed <NotZed@Ximian.com>
+
+ * mail-send-recv.c (mail_send_receive): Cleaned up so we dont add
+ an unecessary level of indenting.
+
+ * message-list.c (ml_tree_value_at): For collapsed tree nodes,
+ scan the collapses nodes for the unread and status information.
+ Since we dont really have fake nodes anymore.
+
+2001-01-30 Ian Campbell <ijc25@cam.ac.uk>
+
+ * message-list.c: Add support for new icons for being
+ read/unread for fake root messages on threads.
+
2001-01-30 Iain Holmes <iain@ximian.com>
* mail-send-recv.c (mail_send_receive): Only allow one send and
diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c
index aec94a7ba5..87b5cebedf 100644
--- a/mail/mail-send-recv.c
+++ b/mail/mail-send-recv.c
@@ -186,8 +186,7 @@ static struct _send_data *build_dialogue(GSList *sources, CamelFolder *outbox, c
gd = (GnomeDialog *)gnome_dialog_new(_("Send & Receive mail"), GNOME_STOCK_BUTTON_OK, GNOME_STOCK_BUTTON_CANCEL, NULL);
gnome_dialog_set_sensitive(gd, 0, FALSE);
- gnome_window_icon_set_from_file (GTK_WINDOW (gd),
- EVOLUTION_DATADIR "images/evolution/evolution-inbox.png");
+ gnome_window_icon_set_from_file((GtkWindow *)gd, EVOLUTION_DATADIR "images/evolution/evolution-inbox.png");
frame= (GtkFrame *)gtk_frame_new(_("Receiving"));
gtk_box_pack_start((GtkBox *)gd->vbox, (GtkWidget *)frame, TRUE, TRUE, 0);
@@ -501,58 +500,58 @@ void mail_send_receive(void)
const MailConfigAccount *account;
if (gd != NULL) {
- g_assert (GTK_WIDGET_REALIZED (gd));
- gdk_window_show (gd->window);
- gdk_window_raise (gd->window);
- } else {
- sources = mail_config_get_sources();
- if (!sources)
- return;
- account = mail_config_get_default_account();
- if (!account || !account->transport)
- return;
+ g_assert(GTK_WIDGET_REALIZED(gd));
+ gdk_window_show(gd->window);
+ gdk_window_raise(gd->window);
+ return;
+ }
+
+ sources = mail_config_get_sources();
+ if (!sources)
+ return;
+ account = mail_config_get_default_account();
+ if (!account || !account->transport)
+ return;
+
+ fc = mail_load_filter_context();
- fc = mail_load_filter_context();
+ /* what to do about pop before smtp ?
+ Well, probably hook into receive_done or receive_status on
+ the right pop account, and when it is, then kick off the
+ smtp one. */
+ data = build_dialogue(sources, outbox_folder, account->transport->url);
+ scan = data->infos;
+ gd = data->gd;
+ gtk_signal_connect((GtkObject *)gd, "destroy", gtk_widget_destroyed, &gd);
+ while (scan) {
+ struct _send_info *info = scan->data;
- /* what to do about pop before smtp ?
- Well, probably hook into receive_done or receive_status on
- the right pop account, and when it is, then kick off the
- smtp one. */
- data = build_dialogue(sources, outbox_folder, account->transport->url);
- scan = data->infos;
- gd = data->gd;
- gtk_signal_connect (GTK_OBJECT (gd), "destroy",
- GTK_SIGNAL_FUNC (gtk_widget_destroyed), &gd);
- while (scan) {
- struct _send_info *info = scan->data;
-
- switch(info->type) {
- case SEND_RECEIVE:
- mail_fetch_mail(info->uri, info->keep,
- fc, FILTER_SOURCE_INCOMING,
- info->cancel,
- receive_get_folder, info,
- receive_status, info,
- receive_done, info);
- break;
- case SEND_SEND:
- /* todo, store the folder in info? */
- mail_send_queue(outbox_folder, info->uri,
- fc, FILTER_SOURCE_OUTGOING,
- info->cancel,
- receive_get_folder, info,
- receive_status, info,
- receive_done, info);
- break;
- case SEND_UPDATE:
- /* FIXME: error reporting? */
- mail_get_store(info->uri, receive_update_got_store, info);
- break;
- }
- scan = scan->next;
+ switch(info->type) {
+ case SEND_RECEIVE:
+ mail_fetch_mail(info->uri, info->keep,
+ fc, FILTER_SOURCE_INCOMING,
+ info->cancel,
+ receive_get_folder, info,
+ receive_status, info,
+ receive_done, info);
+ break;
+ case SEND_SEND:
+ /* todo, store the folder in info? */
+ mail_send_queue(outbox_folder, info->uri,
+ fc, FILTER_SOURCE_OUTGOING,
+ info->cancel,
+ receive_get_folder, info,
+ receive_status, info,
+ receive_done, info);
+ break;
+ case SEND_UPDATE:
+ /* FIXME: error reporting? */
+ mail_get_store(info->uri, receive_update_got_store, info);
+ break;
}
-
- gtk_object_unref((GtkObject *)fc);
+ scan = scan->next;
}
+
+ gtk_object_unref((GtkObject *)fc);
}
diff --git a/mail/message-list.c b/mail/message-list.c
index 6b43964477..5c2904d795 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -133,6 +133,9 @@ static struct {
{ mail_new_xpm, NULL },
{ mail_read_xpm, NULL },
{ mail_replied_xpm, NULL },
+/* FIXME: Replace these with pixmaps for multiple_read and multiple_unread */
+ { mail_new_xpm, NULL },
+ { mail_read_xpm, NULL },
{ empty_xpm, NULL },
{ attachment_xpm, NULL },
{ priority_high_xpm, NULL },
@@ -610,6 +613,12 @@ ml_value_to_string (ETableModel *etm, int col, const void *value, void *data)
case 2:
return g_strdup (_("Answered"));
break;
+ case 3:
+ return g_strdup (_("Multiple Unseen Messages"));
+ break;
+ case 4:
+ return g_strdup (_("Multiple Messages"));
+ break;
default:
return g_strdup ("");
break;
@@ -780,8 +789,10 @@ ml_tree_value_at (ETreeModel *etm, ETreePath *path, int col, void *model_data)
uid="s ERROR ERROR - UNKNOWN ROW IN TREE";
goto fake;
}
- if (!id_is_uid(uid))
+ if (!id_is_uid(uid)) {
+ g_warning("Invalid node encountered: %s", uid);
goto fake;
+ }
uid = id_uid(uid);
/* we need ot keep the msg_info ref'd as we return the data, sigh.
@@ -802,14 +813,26 @@ ml_tree_value_at (ETreeModel *etm, ETreePath *path, int col, void *model_data)
}
switch (col){
- case COL_MESSAGE_STATUS:
+ case COL_MESSAGE_STATUS: {
+ ETreePath *child;
+
+ /* if a tree is collapsed, then scan its insides for details */
+ child = e_tree_model_node_get_first_child(etm, path);
+ if (child && !e_tree_model_node_is_expanded(etm, path)) {
+ if (subtree_unread(message_list, child))
+ return (void *)3;
+ else
+ return (void *)4;
+ }
+
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);
else
return GINT_TO_POINTER (0);
-
+ }
+
case COL_FLAGGED:
return (void *)((msg_info->flags & CAMEL_MESSAGE_FLAGGED) != 0);
@@ -849,9 +872,17 @@ ml_tree_value_at (ETreeModel *etm, ETreePath *path, int col, void *model_data)
case COL_DELETED:
return (void *)((msg_info->flags & CAMEL_MESSAGE_DELETED) != 0);
- case COL_UNREAD:
+ case COL_UNREAD: {
+ ETreePath *child;
+
+ child = e_tree_model_node_get_first_child(etm, path);
+ if (child && !e_tree_model_node_is_expanded(etm, path)
+ && (msg_info->flags & CAMEL_MESSAGE_SEEN)) {
+ return (void *)subtree_unread(message_list, child);
+ }
+
return GINT_TO_POINTER (!(msg_info->flags & CAMEL_MESSAGE_SEEN));
-
+ }
case COL_COLOUR:
{
const char *colour;
@@ -879,6 +910,12 @@ ml_tree_value_at (ETreeModel *etm, ETreePath *path, int col, void *model_data)
return (void *)subtree_unread(message_list, e_tree_model_node_get_first_child(etm, path));
case COL_MESSAGE_STATUS:
+ /* The same applies as for COL_UNREAD just above */
+ if (subtree_unread(message_list, e_tree_model_node_get_first_child(etm,path)))
+ return (void *)3;
+ else
+ return (void *)4;
+
case COL_FLAGGED:
case COL_SCORE:
case COL_ATTACHMENT:
@@ -1038,28 +1075,28 @@ 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 [11].pixbuf);
- e_table_extras_add_pixbuf(extras, "attachment", states_pixmaps [4].pixbuf);
- e_table_extras_add_pixbuf(extras, "flagged", states_pixmaps [5].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_compare(extras, "address_compare", address_compare);
e_table_extras_add_compare(extras, "subject_compare", subject_compare);
- for (i = 0; i < 3; 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, 3, 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 + 3].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 [5].pixbuf;
+ images [1] = states_pixmaps [7].pixbuf;
e_table_extras_add_cell(extras, "render_flagged", e_cell_toggle_new (0, 2, images));
for (i = 0; i < 7; i++)
- images[i] = states_pixmaps [i + 5].pixbuf;
+ images[i] = states_pixmaps [i + 7].pixbuf;
e_table_extras_add_cell(extras, "render_score", e_cell_toggle_new (0, 7, images));