#include "sourcewindow.h"
#include "prefs_common.h"
#include "prefs_summary_column.h"
-#include "prefs_filter.h"
#include "prefs_filtering.h"
#include "account.h"
#include "compose.h"
#include "alertpanel.h"
#include "inputdialog.h"
#include "statusbar.h"
-#include "filter.h"
#include "folder.h"
#include "colorlabel.h"
#include "inc.h"
static void tog_searchbar_cb (GtkWidget *w,
gpointer data);
+static void summary_update_msg (MsgInfo *info, gpointer data);
GtkTargetEntry summary_drag_types[1] =
{
summaryview->search_type_opt = search_type_opt;
summaryview->search_type = search_type;
summaryview->search_string = search_string;
+ summaryview->msginfo_update_callback_id =
+ msginfo_update_callback_register(summary_update_msg, (gpointer) summaryview);
/* CLAWS: need this to get the SummaryView * from
* the CList */
small_style = gtk_style_copy
(gtk_widget_get_style(summaryview->ctree));
if (!smallfont)
- smallfont = gdk_fontset_load(SMALL_FONT);
+ smallfont = gtkut_font_load(SMALL_FONT);
small_style->font = smallfont;
small_marked_style = gtk_style_copy(small_style);
small_marked_style->fg[GTK_STATE_NORMAL] =
bold_style = gtk_style_copy
(gtk_widget_get_style(summaryview->ctree));
if (!boldfont)
- boldfont = gdk_fontset_load(BOLD_FONT);
+ boldfont = gtkut_font_load(BOLD_FONT);
bold_style->font = boldfont;
bold_marked_style = gtk_style_copy(bold_style);
bold_marked_style->fg[GTK_STATE_NORMAL] =
gtk_entry_set_text(GTK_ENTRY(summaryview->search_string), "");
}
- STATUSBAR_POP(summaryview->mainwin);
+ /* STATUSBAR_POP(summaryview->mainwin); */
is_refresh = (item == summaryview->folder_item) ? TRUE : FALSE;
if (is_refresh) {
debug_print("\n");
STATUSBAR_PUSH(summaryview->mainwin, _("Done."));
-
+ STATUSBAR_POP(summaryview->mainwin);
main_window_cursor_normal(summaryview->mainwin);
summary_unlock(summaryview);
inc_unlock();
prefs_common.ng_abbrev_len < strlen(summaryview->folder_item->path)) {
gchar *group;
group = get_abbrev_newsgroup_name
- (g_basename(summaryview->folder_item->path));
+ (g_basename(summaryview->folder_item->path), prefs_common.ng_abbrev_len);
gtk_label_set(GTK_LABEL(summaryview->statlabel_folder), group);
g_free(group);
} else {
msginfo->threadscore = msginfo->score;
}
- if (global_scoring || summaryview->folder_item->prefs->scoring) {
- summaryview->important_score = prefs_common.important_score;
- if (summaryview->folder_item->prefs->important_score >
- summaryview->important_score)
- summaryview->important_score =
- summaryview->folder_item->prefs->important_score;
- }
-
if (summaryview->threaded) {
GNode *root, *gnode;
g_node_destroy(root);
- folderview_update_items_when_required(FALSE);
+ folder_update_items_when_required(FALSE);
summary_thread_init(summaryview);
} else {
_("(No Subject)");
}
-#define CHANGE_FLAGS(msginfo) \
-{ \
-if (msginfo->folder->folder->change_flags != NULL) \
-msginfo->folder->folder->change_flags(msginfo->folder->folder, \
- msginfo->folder, \
- msginfo); \
-}
-
static void summary_display_msg(SummaryView *summaryview, GtkCTreeNode *row)
{
summary_display_msg_full(summaryview, row, FALSE, FALSE);
if (MSG_IS_NEW(msginfo->flags) || MSG_IS_UNREAD(msginfo->flags)) {
procmsg_msginfo_unset_flags
(msginfo, MSG_NEW | MSG_UNREAD, 0);
- folderview_update_item(msginfo->folder, FALSE);
+ folder_update_item(msginfo->folder, FALSE);
summary_set_row_marks(summaryview, row);
gtk_clist_thaw(GTK_CLIST(ctree));
summary_status_show(summaryview);
(GTK_SCTREE(ctree),
GTK_CTREE_NODE(GTK_CLIST(ctree)->selection->data));
-#if 0
- if(summaryview->selected) {
- gtk_sctree_reanchor (GTK_SCTREE(ctree), summaryview->selected);
- }
-#endif
-
}
void summary_toggle_view(SummaryView *summaryview)
if (changed && !prefs_common.immediate_exec) {
msginfo->to_folder->op_count--;
if (msginfo->to_folder->op_count == 0)
- folderview_update_item(msginfo->to_folder, 0);
+ folder_update_item(msginfo->to_folder, FALSE);
}
msginfo->to_folder = NULL;
procmsg_msginfo_unset_flags(msginfo, MSG_DELETED, MSG_MOVE | MSG_COPY);
if (changed && !prefs_common.immediate_exec) {
msginfo->to_folder->op_count--;
if (msginfo->to_folder->op_count == 0)
- folderview_update_item(msginfo->to_folder, 0);
+ folder_update_item(msginfo->to_folder, FALSE);
}
msginfo->to_folder = NULL;
procmsg_msginfo_unset_flags(msginfo, MSG_DELETED, MSG_MOVE | MSG_COPY);
for (cur = GTK_CLIST(ctree)->selection; cur != NULL; cur = cur->next)
summary_mark_row_as_read(summaryview,
GTK_CTREE_NODE(cur->data));
- folderview_update_items_when_required(FALSE);
+ folder_update_items_when_required(FALSE);
summary_status_show(summaryview);
}
summary_set_row_marks(summaryview, node);
}
gtk_clist_thaw(clist);
- folderview_update_items_when_required(FALSE);
+ folder_update_items_when_required(FALSE);
summary_status_show(summaryview);
}
for (cur = GTK_CLIST(ctree)->selection; cur != NULL; cur = cur->next)
summary_mark_row_as_unread(summaryview,
GTK_CTREE_NODE(cur->data));
- folderview_update_items_when_required(FALSE);
+ folder_update_items_when_required(FALSE);
summary_status_show(summaryview);
}
if (changed && !prefs_common.immediate_exec) {
msginfo->to_folder->op_count--;
if (msginfo->to_folder->op_count == 0)
- folderview_update_item(msginfo->to_folder, 0);
+ folder_update_item(msginfo->to_folder, FALSE);
}
msginfo->to_folder = NULL;
procmsg_msginfo_unset_flags(msginfo, MSG_MARKED, MSG_MOVE | MSG_COPY);
if (changed && !prefs_common.immediate_exec) {
msginfo->to_folder->op_count--;
if (msginfo->to_folder->op_count == 0)
- folderview_update_item(msginfo->to_folder, 0);
+ folder_update_item(msginfo->to_folder, FALSE);
}
msginfo->to_folder = NULL;
procmsg_msginfo_unset_flags(msginfo, MSG_MARKED | MSG_DELETED, MSG_MOVE | MSG_COPY);
if (!prefs_common.immediate_exec) {
msginfo->to_folder->op_count--;
if (msginfo->to_folder->op_count == 0) {
- folderview_update_item(msginfo->to_folder, 0);
+ folder_update_item(msginfo->to_folder, FALSE);
changed = TRUE;
}
}
if (changed) {
msginfo->to_folder->op_count++;
if (msginfo->to_folder->op_count == 1)
- folderview_update_item(msginfo->to_folder, 0);
+ folder_update_item(msginfo->to_folder, FALSE);
}
}
else {
summary_status_show(summaryview);
- folderview_update_item(to_folder, 0);
+ folder_update_item(to_folder, FALSE);
}
if (!summaryview->selected) { /* this was the last message */
if (!prefs_common.immediate_exec) {
msginfo->to_folder->op_count--;
if (msginfo->to_folder->op_count == 0) {
- folderview_update_item(msginfo->to_folder, 0);
+ folder_update_item(msginfo->to_folder, FALSE);
changed = TRUE;
}
}
if (changed) {
msginfo->to_folder->op_count++;
if (msginfo->to_folder->op_count == 1)
- folderview_update_item(msginfo->to_folder, 0);
+ folder_update_item(msginfo->to_folder, FALSE);
}
}
else {
summary_status_show(summaryview);
- folderview_update_item(to_folder, 0);
+ folder_update_item(to_folder, FALSE);
}
}
if (summaryview->mlist) {
procmsg_move_messages(summaryview->mlist);
- folderview_update_items_when_required(FALSE);
+ folder_update_items_when_required(FALSE);
for (cur = summaryview->mlist; cur != NULL; cur = cur->next)
procmsg_msginfo_free((MsgInfo *)cur->data);
summaryview->mlist = NULL;
}
- folderview_update_item(summaryview->folder_item, FALSE);
+ folder_update_item(summaryview->folder_item, FALSE);
}
static void summary_execute_move_func(GtkCTree *ctree, GtkCTreeNode *node,
if (summaryview->mlist) {
procmsg_copy_messages(summaryview->mlist);
- folderview_update_items_when_required(FALSE);
+ folder_update_items_when_required(FALSE);
g_slist_free(summaryview->mlist);
summaryview->mlist = NULL;
summaryview->mlist = NULL;
if ((summaryview->folder_item != trash) && (trash != NULL)) {
- folderview_update_item(trash, FALSE);
+ folder_update_item(trash, FALSE);
}
- folderview_update_item(summaryview->folder_item, FALSE);
+ folder_update_item(summaryview->folder_item, FALSE);
}
static void summary_execute_delete_func(GtkCTree *ctree, GtkCTreeNode *node,
if (msginfo->msgid && *msginfo->msgid &&
node == g_hash_table_lookup(summaryview->msgid_table,
- msginfo->msgid))
+ msginfo->msgid)) {
g_hash_table_remove(summaryview->msgid_table,
msginfo->msgid);
+ }
+ if (msginfo->subject && *msginfo->subject &&
+ node == g_hash_table_lookup(summaryview->subject_table,
+ msginfo->subject)) {
+ g_hash_table_remove(summaryview->subject_table,
+ msginfo->subject);
+ }
}
}
void summary_filter(SummaryView *summaryview)
{
- if (!prefs_common.fltlist && !global_processing) {
+ if (!global_processing) {
alertpanel_error(_("No filter rules defined."));
return;
}
gtk_clist_thaw(GTK_CLIST(summaryview->ctree));
- folderview_update_items_when_required(FALSE);
+ folder_update_items_when_required(FALSE);
}
debug_print("done.\n");
gpointer data)
{
MsgInfo *msginfo = GTKUT_CTREE_NODE_GET_ROW_DATA(node);
- SummaryView *summaryview = data;
- gchar *file;
- FolderItem *dest;
-
- if (global_processing == NULL) {
- /* old filtering */
- file = procmsg_get_message_file(msginfo);
- dest = filter_get_dest_folder(prefs_common.fltlist, file);
- g_free(file);
- if (dest && strcmp2(dest->path, FILTER_NOT_RECEIVE) != 0 &&
- summaryview->folder_item != dest)
- summary_move_row_to(summaryview, node, dest);
- } else
- filter_message_by_msginfo(global_processing, msginfo);
+ filter_message_by_msginfo(global_processing, msginfo);
}
void summary_filter_open(SummaryView *summaryview, PrefsFilterType type)
summaryview->selected);
if (!msginfo) return;
- if (global_processing) {
- header_offset = 1;
- hentry_offset = 5;
- }
- else {
- header_offset = 0;
- hentry_offset = 0;
- }
+ header_offset = 1;
+ hentry_offset = 5;
switch (type) {
case FILTER_BY_NONE:
* and have set entries. Otherwise we're hosed.
*/
- if (global_processing)
- prefs_filtering_open(NULL, header, key);
- else
- prefs_filter_open(header, key);
+ prefs_filtering_open(NULL, header, key);
}
void summary_reply(SummaryView *summaryview, ComposeMode mode)
debug_print(" <%s>", (gchar *)value);
if (MSG_IS_NEW(msginfo->flags) || MSG_IS_UNREAD(msginfo->flags)) {
procmsg_msginfo_unset_flags(msginfo, MSG_NEW | MSG_UNREAD, 0);
- folderview_update_item(msginfo->folder, FALSE);
+ folder_update_item(msginfo->folder, FALSE);
procmsg_msginfo_set_flags(msginfo, mff->account->crosspost_col, 0);
}
g_hash_table_remove(mff->newsart, key);
for (cur = GTK_CLIST(ctree)->selection; cur != NULL; cur = cur->next) {
gtk_ctree_pre_recursive(ctree, GTK_CTREE_NODE(cur->data), GTK_CTREE_FUNC(summary_ignore_thread_func), summaryview);
}
- folderview_update_items_when_required(FALSE);
+ folder_update_items_when_required(FALSE);
summary_status_show(summaryview);
}
for (cur = GTK_CLIST(ctree)->selection; cur != NULL; cur = cur->next) {
gtk_ctree_pre_recursive(ctree, GTK_CTREE_NODE(cur->data), GTK_CTREE_FUNC(summary_unignore_thread_func), summaryview);
}
- folderview_update_items_when_required(FALSE);
+ folder_update_items_when_required(FALSE);
summary_status_show(summaryview);
}
/* Threading */
summaryview->threaded = item->threaded;
+
+ /* Scoring */
+ if (global_scoring || item->prefs->scoring) {
+ summaryview->important_score = prefs_common.important_score;
+ if (item->prefs->important_score >
+ summaryview->important_score)
+ summaryview->important_score =
+ item->prefs->important_score;
+ }
}
void summary_save_prefs_to_folderitem(SummaryView *summaryview, FolderItem *item)
item->threaded = summaryview->threaded;
}
+static void summary_update_msg(MsgInfo *msginfo, gpointer data) {
+ GtkCTreeNode *node;
+ SummaryView *summaryview = (SummaryView *)data;
+ node = gtk_ctree_find_by_row_data(GTK_CTREE(summaryview->ctree), NULL, msginfo);
+
+ if (node)
+ summary_set_row_marks(summaryview, node);
+}
+
/*
* End of Source.
*/