diff -ur pan-fix-orig/pan/articlelist.c pan-fix/pan/articlelist.c --- pan-fix-orig/pan/articlelist.c Sun Apr 14 03:15:57 2002 +++ pan-fix/pan/articlelist.c Sun Apr 14 03:11:27 2002 @@ -57,6 +57,7 @@ #include #include #include +#include #include #include @@ -134,7 +135,7 @@ static GString * cur_message_id = NULL; static GString * prev_message_id = NULL; -static GtkStyle * normal_style[2] = { NULL, NULL }; +static GtkStyle * normal_style[4] = { NULL, NULL, NULL, NULL }; static GtkStyle * read_style[2] = { NULL, NULL }; static GtkStyle * watched_style[2] = { NULL, NULL }; static GtkStyle * killfile_style[2] = { NULL, NULL }; @@ -143,6 +144,7 @@ GdkColor watched_color; GdkColor thread_normal_color; GdkColor thread_read_color; +GdkColor answer_color; GnomeUIInfo header_pane_popup_uiinfo []; GtkWidget * header_pane_popup_menu; @@ -731,6 +733,39 @@ } void +articlelist_read_next_unread_answer (void) +{ + const Article * a = NULL; + GtkCTreeNode * node; + GtkCTreeNode * in; + + if ((node = articlelist_get_selected_node ()) == NULL) + node = gtk_ctree_node_nth (GTK_CTREE(Pan.article_ctree), 1); + else + node = find_next_article (node); + in = node; + + do { + if ((a = articlelist_get_article_from_node (node)) == NULL) + break; + + if (!article_is_read (a) && article_is_answer_to_me (a)) { + if (!navigate_cached_only) + break; + if (article_has_body(a)) + break; + } + if ((node = find_next_article (node)) == in) { + node = NULL; + break; + } + } while (a!=NULL); + + select_and_maybe_read_nolock (node, navigate_read_on_select); +} + + +void articlelist_read_next_thread (void) { GtkCTreeNode * node; @@ -1800,7 +1835,7 @@ #define NORMAL 0 #define NEW_REPLIES 1 - +#define ANSWER_ME 2 static void articlelist_set_node_style_nolock (GtkCTreeNode * node, const Article * article) @@ -1839,6 +1874,15 @@ if (f != NULL) watched_style[i]->font = f; } + normal_style[ANSWER_ME+NORMAL] = gtk_style_copy (s); + normal_style[ANSWER_ME+NORMAL]->fg[0] = answer_color; + if (newrepliesfont != NULL) + normal_style[ANSWER_ME+NORMAL]->font = normalfont; + normal_style[ANSWER_ME+NEW_REPLIES] = gtk_style_copy (s); + normal_style[ANSWER_ME+NEW_REPLIES]->fg[0] = answer_color; + if (newrepliesfont != NULL) + normal_style[ANSWER_ME+NEW_REPLIES]->font = newrepliesfont; + } if (1) @@ -1856,6 +1900,9 @@ if (thread_state == THREAD_IGNORED) style = killfile_style [do_mark_new ? NEW_REPLIES : NORMAL]; + else if (article_is_answer_to_me (article)) { + style = normal_style[ANSWER_ME + (is_unread ? NEW_REPLIES : NORMAL) ]; + } else if (thread_state == THREAD_WATCHED) style = watched_style [do_mark_new ? NEW_REPLIES : NORMAL]; else if (do_mark_new) @@ -3636,4 +3683,17 @@ { gui_queue_add (set_group_mainthread_begin, argset_new1(group)); } +} + +gboolean +article_is_answer_to_me (Article * article) +{ + Identity * id; + if(article != NULL && article->parent != NULL) { + id = identity_manager_get_identity_by_author + (article->parent->author_real, article->parent->author_addr); + return (id != NULL); + } + + return FALSE; } diff -ur pan-fix-orig/pan/articlelist.h pan-fix/pan/articlelist.h --- pan-fix-orig/pan/articlelist.h Sun Apr 14 03:15:57 2002 +++ pan-fix/pan/articlelist.h Sun Apr 14 02:56:38 2002 @@ -34,7 +34,7 @@ extern GdkColor thread_normal_color; extern GdkColor thread_read_color; - +extern GdkColor answer_color; extern GdkColor killfile_color; extern GdkColor watched_color; @@ -71,6 +71,7 @@ void articlelist_read_last_read (void); void articlelist_read_next (gboolean cached_only, gboolean read); void articlelist_read_next_unread (void); +void articlelist_read_next_unread_answer (void); void articlelist_read_next_thread (void); void articlelist_read_next_unread_thread (void); void articlelist_read_prev (void); diff -ur pan-fix-orig/pan/gui.c pan-fix/pan/gui.c --- pan-fix-orig/pan/gui.c Sun Apr 14 03:15:24 2002 +++ pan-fix/pan/gui.c Sun Apr 14 03:22:25 2002 @@ -372,6 +372,10 @@ N_("Next Unread Article"), articlelist_read_next_unread, GNOME_STOCK_MENU_FORWARD, 'N', 0), + GNOMEUIINFO_ITEM_STOCK_ACCEL (N_("_Next Unread Answer to me"), + N_("Next Unread Answer to me"), + articlelist_read_next_unread_answer, + GNOME_STOCK_MENU_FORWARD, 'N', GDK_CONTROL_MASK), GNOMEUIINFO_ITEM_STOCK_ACCEL (N_("Next _Article"), N_("Next Article"), gui_read_next, diff -ur pan-fix-orig/pan/prefs.c pan-fix/pan/prefs.c --- pan-fix-orig/pan/prefs.c Sun Apr 14 03:15:57 2002 +++ pan-fix/pan/prefs.c Sun Apr 14 03:13:12 2002 @@ -153,6 +153,7 @@ GtkWidget * message_gfp; GtkWidget * message_fixed_gfp; GtkWidget * thread_read_gcp; + GtkWidget * answer_gcp; GtkWidget * thread_normal_gcp; GtkWidget * ignored_gcp; GtkWidget * watched_gcp; @@ -529,6 +530,7 @@ articlelist_changed |= handle_color_picker ("watched_color", &watched_color, win->watched_gcp); articlelist_changed |= handle_color_picker ("thread_normal_color", &thread_normal_color, win->thread_normal_gcp); articlelist_changed |= handle_color_picker ("thread_read_color", &thread_read_color, win->thread_read_gcp); + articlelist_changed |= handle_color_picker ("answer_color", &answer_color, win->answer_gcp); /* text window colors */ b = 0; @@ -1146,6 +1148,7 @@ set_color (&thread_read_color, "thread_read_color", 40000, 40000, 40000); set_color (&killfile_color, "killfile_color", 35723, 17733, 4883); set_color (&watched_color, "watched_color", 0, 52428, 0); + set_color (&answer_color, "answer_color", 0, 52428, 0); set_color (&text_fg_color, "text_fg_color", 0, 0, 0); set_color (&text_bg_color, "text_bg_color", 65335, 65335, 65335); set_color (&text_url_color, "text_url_color", 0, 0, 40000); @@ -2140,6 +2143,8 @@ w = create_color_picker (_("Ignored Threads"), &killfile_color, &win->ignored_gcp); gtk_box_pack_start (GTK_BOX(v), w, 0, 0, 0); w = create_color_picker (_("Watched Threads"), &watched_color, &win->watched_gcp); + gtk_box_pack_start (GTK_BOX(v), w, 0, 0, 0); + w = create_color_picker (_("Answers to me"), &answer_color, &win->answer_gcp); gtk_box_pack_start (GTK_BOX(v), w, 0, 0, 0); frame = gtk_frame_new (_("Colors")); gtk_container_add (GTK_CONTAINER(frame), v);