#include <ctype.h>
#include <unistd.h>
#include <sys/stat.h>
+#include <regex.h>
#include "intl.h"
#include "main.h"
#include "scoring.h"
#include "prefs_folder_item.h"
#include "filtering.h"
+#include "string_match.h"
#define STATUSBAR_PUSH(mainwin, str) \
{ \
GtkCTreeNode *node,
gpointer data);
+void summary_simplify_subject(SummaryView *summaryview, gchar * rexp,
+ GSList * mlist);
+
void summary_processing(SummaryView *summaryview, GSList * mlist);
static void summary_filter_func (GtkCTree *ctree,
GtkCTreeNode *node,
&forwardedxpm, &forwardedxpmmask);
stock_pixmap_gdk(summaryview->ctree, STOCK_PIXMAP_CLIP,
&clipxpm, &clipxpmmask);
+ stock_pixmap_gdk(summaryview->ctree, STOCK_PIXMAP_LOCKED,
+ &lockedxpm, &lockedxpmmask);
+ stock_pixmap_gdk(summaryview->ctree, STOCK_PIXMAP_IGNORETHREAD,
+ &ignorethreadxpm, &ignorethreadxpmmask);
if (!small_style) {
small_style = gtk_style_copy
return FALSE;
}
folder_update_op_count();
- }
-
- summary_write_cache(summaryview);
+ } else
+ summary_write_cache(summaryview);
summaryview->folderview->opened = selected_node;
mlist = not_killed;
}
+ if (item->prefs->enable_simplify_subject
+ && item->prefs->simplify_subject_regexp != NULL
+ && strlen(item->prefs->simplify_subject_regexp) != 0) {
+ summary_simplify_subject(summaryview,
+ item->prefs->simplify_subject_regexp,
+ mlist);
+ }
+
STATUSBAR_POP(summaryview->mainwin);
/* set ctree and hash table from the msginfo list
SORT_BY_FROM,
SORT_BY_DATE,
SORT_BY_SIZE,
- SORT_BY_NUMBER
+ SORT_BY_NUMBER,
+ SORT_BY_SCORE,
+ SORT_BY_LOCKED
};
for (pos = 0; pos < N_SUMMARY_COLS; pos++) {
type = summaryview->col_state[pos].type;
- single_char = (type == S_COL_MIME ||
- type == S_COL_MARK || type == S_COL_UNREAD);
+ /* CLAWS: mime and unread are single char headers */
+ single_char = (type == S_COL_MIME || type == S_COL_UNREAD);
justify = (type == S_COL_NUMBER || type == S_COL_SIZE)
? GTK_JUSTIFY_RIGHT : GTK_JUSTIFY_LEFT;
else
title = col_label[type];
break;
+ /* CLAWS: dummies for mark and locked headers */
+ case S_COL_MARK:
+ case S_COL_LOCKED:
+ title = "";
+ break;
default:
title = gettext(col_label[type]);
}
continue;
}
- hbox = gtk_hbox_new(FALSE, 4);
- label = gtk_label_new(title);
+ /* CLAWS: changed so that locked and mark headers
+ * show a pixmap instead of single character */
+ hbox = gtk_hbox_new(FALSE, 4);
+
+ if (type == S_COL_LOCKED)
+ label = gtk_pixmap_new(lockedxpm, lockedxpmmask);
+ else if (type == S_COL_MARK)
+ label = gtk_pixmap_new(markxpm, markxpmmask);
+ else
+ label = gtk_label_new(title);
+
if (justify == GTK_JUSTIFY_RIGHT)
gtk_box_pack_end(GTK_BOX(hbox), label,
FALSE, FALSE, 0);
}
}
+void summary_simplify_subject(SummaryView *summaryview, gchar * rexp,
+ GSList * mlist)
+{
+ GSList * cur;
+ for(cur = mlist ; cur != NULL ; cur = cur->next) {
+ MsgInfo * msginfo = (MsgInfo *) cur->data;
+ string_remove_all_matches(msginfo->subject, rexp,
+ REG_EXTENDED, 0);
+ }
+}
+
void summary_processing(SummaryView *summaryview, GSList * mlist)
{
GSList * processing_list;