#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"
#include "string_match.h"
#include "toolbar.h"
#include "news.h"
+#include "matcher.h"
+#include "matcher_parser.h"
+#include "hooks.h"
#define SUMMARY_COL_MARK_WIDTH 10
#define SUMMARY_COL_UNREAD_WIDTH 13
static void summary_searchbar_pressed (GtkWidget *ctree,
GdkEventKey *event,
SummaryView *summaryview);
+static void summary_searchbar_focus_evt (GtkWidget *ctree,
+ GdkEventFocus *event,
+ SummaryView *summaryview);
static void summary_searchtype_changed (GtkMenuItem *widget,
gpointer data);
static void summary_open_row (GtkSCTree *sctree,
static void tog_searchbar_cb (GtkWidget *w,
gpointer data);
+static gboolean summary_update_msg (gpointer source, gpointer data);
GtkTargetEntry summary_drag_types[1] =
{
debug_print("Creating summary view...\n");
summaryview = g_new0(SummaryView, 1);
- vbox = gtk_vbox_new(FALSE, 3);
+#define SUMMARY_VBOX_SPACING 3
+ vbox = gtk_vbox_new(FALSE, SUMMARY_VBOX_SPACING);
/* create status label */
hbox = gtk_hbox_new(FALSE, 0);
GTK_SIGNAL_FUNC(summary_searchtype_changed),
summaryview);
MENUITEM_ADD (search_type, menuitem, _("To"), S_SEARCH_TO);
+ gtk_signal_connect(GTK_OBJECT(menuitem), "activate",
+ GTK_SIGNAL_FUNC(summary_searchtype_changed),
+ summaryview);
+ MENUITEM_ADD (search_type, menuitem, _("Extended"), S_SEARCH_EXTENDED);
gtk_signal_connect(GTK_OBJECT(menuitem), "activate",
GTK_SIGNAL_FUNC(summary_searchtype_changed),
summaryview);
gtk_option_menu_set_menu(GTK_OPTION_MENU(search_type_opt), search_type);
+
+ gtk_option_menu_set_history(GTK_OPTION_MENU(search_type_opt), prefs_common.summary_quicksearch_type);
+
gtk_widget_show(search_type);
search_string = gtk_entry_new();
GTK_SIGNAL_FUNC(summary_searchbar_pressed),
summaryview);
+ gtk_signal_connect(GTK_OBJECT(search_string), "focus_in_event",
+ GTK_SIGNAL_FUNC(summary_searchbar_focus_evt),
+ summaryview);
+
+ gtk_signal_connect(GTK_OBJECT(search_string), "focus_out_event",
+ GTK_SIGNAL_FUNC(summary_searchbar_focus_evt),
+ summaryview);
+
gtk_signal_connect (GTK_OBJECT(toggle_search), "toggled",
- GTK_SIGNAL_FUNC(tog_searchbar_cb), hbox_search);
+ GTK_SIGNAL_FUNC(tog_searchbar_cb), summaryview);
/* create popup menu */
n_entries = sizeof(summary_popup_entries) /
summaryview->search_type_opt = search_type_opt;
summaryview->search_type = search_type;
summaryview->search_string = search_string;
+ summaryview->msginfo_update_callback_id =
+ hooks_register_hook(MSGINFO_UPDATE_HOOKLIST, 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) {
GTK_MENU(summaryview->search_type))))));
gchar *search_string = gtk_entry_get_text(GTK_ENTRY(summaryview->search_string));
gchar *searched_header = NULL;
+ MatcherList * tmp_list = NULL;
+ if (search_type == S_SEARCH_EXTENDED) {
+ char *newstr = NULL;
+
+ newstr = expand_search_string(search_string);
+ if (newstr) {
+ tmp_list = matcher_parser_get_cond(newstr);
+ g_free(newstr);
+ }
+ else
+ tmp_list = NULL;
+ }
+
not_killed = NULL;
for (cur = mlist ; cur != NULL ; cur = g_slist_next(cur)) {
MsgInfo * msginfo = (MsgInfo *) cur->data;
case S_SEARCH_TO:
searched_header = msginfo->to;
break;
+ case S_SEARCH_EXTENDED:
+ break;
default:
debug_print("unknown search type (%d)\n", search_type);
break;
}
- if (searched_header && strcasestr(searched_header, search_string) != NULL)
- not_killed = g_slist_append(not_killed, msginfo);
- else
- procmsg_msginfo_free(msginfo);
+ if (search_type != S_SEARCH_EXTENDED) {
+ if (searched_header && strcasestr(searched_header, search_string) != NULL)
+ not_killed = g_slist_append(not_killed, msginfo);
+ else
+ procmsg_msginfo_free(msginfo);
+ } else {
+ if ((tmp_list != NULL) && matcherlist_match(tmp_list, msginfo))
+ not_killed = g_slist_append(not_killed, msginfo);
+ else
+ procmsg_msginfo_free(msginfo);
+ }
+ }
+ if (search_type == S_SEARCH_EXTENDED && tmp_list != NULL) {
+ matcherlist_free(tmp_list);
+ tmp_list = NULL;
}
+
g_slist_free(mlist);
mlist = not_killed;
}
debug_print("\n");
STATUSBAR_PUSH(summaryview->mainwin, _("Done."));
-
+ STATUSBAR_POP(summaryview->mainwin);
main_window_cursor_normal(summaryview->mainwin);
summary_unlock(summaryview);
inc_unlock();
summaryview->newmsgs++;
if (MSG_IS_UNREAD(msginfo->flags) && !MSG_IS_IGNORE_THREAD(msginfo->flags))
summaryview->unread++;
+ if (MSG_IS_UNREAD(msginfo->flags) && !MSG_IS_IGNORE_THREAD(msginfo->flags)
+ && procmsg_msg_has_marked_parent(msginfo))
+ summaryview->unreadmarked++;
+
if (MSG_IS_DELETED(msginfo->flags))
summaryview->deleted++;
summaryview->newmsgs++;
if (MSG_IS_UNREAD(msginfo->flags)&& !MSG_IS_IGNORE_THREAD(msginfo->flags))
summaryview->unread++;
+ if (MSG_IS_UNREAD(msginfo->flags) && !MSG_IS_IGNORE_THREAD(msginfo->flags)
+ && procmsg_msg_has_marked_parent(msginfo))
+ summaryview->unreadmarked++;
if (MSG_IS_DELETED(msginfo->flags))
summaryview->deleted++;
if (MSG_IS_MOVE(msginfo->flags))
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 {
debug_print("done.\n");
STATUSBAR_POP(summaryview->mainwin);
- if (debug_mode) {
+ if (debug_get_mode()) {
debug_print("\tmsgid hash table size = %d\n",
g_hash_table_size(msgid_table));
debug_print("\tsubject hash table size = %d\n",
summaryview->newmsgs--;
if (MSG_IS_UNREAD(msginfo->flags) && !MSG_IS_IGNORE_THREAD(msginfo->flags))
summaryview->unread--;
+ if (MSG_IS_UNREAD(msginfo->flags) && !MSG_IS_IGNORE_THREAD(msginfo->flags)
+ && procmsg_msg_has_marked_parent(msginfo))
+ summaryview->unreadmarked--;
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);
summary_set_row_marks(summaryview, GTK_CTREE_NODE(cur->data));
}
+static gboolean summary_update_unread_children (SummaryView *summaryview, MsgInfo *info, gboolean newly_marked)
+{
+ GSList *children = procmsg_find_children(info);
+ GSList *cur;
+ gboolean changed = FALSE;
+ for (cur = children; cur != NULL; cur = g_slist_next(cur)) {
+ MsgInfo *tmp = (MsgInfo *)cur->data;
+ if(MSG_IS_UNREAD(tmp->flags) && !MSG_IS_IGNORE_THREAD(tmp->flags)) {
+ if(newly_marked)
+ summaryview->unreadmarked++;
+ else
+ summaryview->unreadmarked--;
+ changed = TRUE;
+ }
+ procmsg_msginfo_free(tmp);
+ }
+ return changed;
+}
+
static void summary_mark_row(SummaryView *summaryview, GtkCTreeNode *row)
{
gboolean changed = FALSE;
if (MSG_IS_MOVE(msginfo->flags)) {
summaryview->moved--;
changed = TRUE;
+ msginfo->to_folder->op_count--;
+ if (msginfo->to_folder->op_count == 0)
+ folder_update_item(msginfo->to_folder, FALSE);
}
if (MSG_IS_COPY(msginfo->flags)) {
summaryview->copied--;
changed = TRUE;
- }
- 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);
}
+ changed |= summary_update_unread_children (summaryview, msginfo, TRUE);
+
msginfo->to_folder = NULL;
procmsg_msginfo_unset_flags(msginfo, MSG_DELETED, MSG_MOVE | MSG_COPY);
procmsg_msginfo_set_flags(msginfo, MSG_MARKED, 0);
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);
summaryview->newmsgs--;
if (MSG_IS_UNREAD(msginfo->flags) && !MSG_IS_IGNORE_THREAD(msginfo->flags))
summaryview->unread--;
+ if (MSG_IS_UNREAD(msginfo->flags) && !MSG_IS_IGNORE_THREAD(msginfo->flags)
+ && procmsg_msg_has_marked_parent(msginfo))
+ summaryview->unreadmarked--;
procmsg_msginfo_unset_flags(msginfo, MSG_NEW | MSG_UNREAD, 0);
summary_set_row_marks(summaryview, row);
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);
}
if (!MSG_IS_UNREAD(msginfo->flags) && !MSG_IS_IGNORE_THREAD(msginfo->flags))
summaryview->unread++;
+ if (!MSG_IS_UNREAD(msginfo->flags) && !MSG_IS_IGNORE_THREAD(msginfo->flags)
+ && procmsg_msg_has_marked_parent(msginfo))
+ summaryview->unreadmarked++;
+
procmsg_msginfo_unset_flags(msginfo, MSG_REPLIED | MSG_FORWARDED, 0);
procmsg_msginfo_set_flags(msginfo, MSG_UNREAD, 0);
debug_print("Message %d is marked as unread\n",
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 (MSG_IS_MOVE(msginfo->flags)) {
summaryview->moved--;
changed = TRUE;
+ msginfo->to_folder->op_count--;
+ if (msginfo->to_folder->op_count == 0)
+ folder_update_item(msginfo->to_folder, FALSE);
}
if (MSG_IS_COPY(msginfo->flags)) {
summaryview->copied--;
changed = TRUE;
- }
- 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);
}
+ changed |= summary_update_unread_children (summaryview, msginfo, FALSE);
+
msginfo->to_folder = NULL;
procmsg_msginfo_unset_flags(msginfo, MSG_MARKED, MSG_MOVE | MSG_COPY);
procmsg_msginfo_set_flags(msginfo, MSG_DELETED, 0);
{
GtkCTreeNode *found;
MsgInfo *msginfo = GTK_CTREE_ROW(node)->row.data;
-
+ MsgInfo *dup_msginfo;
+
if (!msginfo->msgid || !*msginfo->msgid) return;
found = g_hash_table_lookup(summaryview->msgid_table, msginfo->msgid);
-
- if (found && found != node)
- summary_delete_row(summaryview, node);
+
+ if (found && found != node) {
+ dup_msginfo = gtk_ctree_node_get_row_data(ctree, found);
+ /* prefer to delete the unread one */
+ if ((MSG_IS_UNREAD(msginfo->flags) && !MSG_IS_UNREAD(dup_msginfo->flags))
+ || (MSG_IS_UNREAD(msginfo->flags) == MSG_IS_UNREAD(dup_msginfo->flags)))
+ summary_delete_row(summaryview, node);
+ }
}
static void summary_unmark_row(SummaryView *summaryview, GtkCTreeNode *row)
if (MSG_IS_DELETED(msginfo->flags))
summaryview->deleted--;
if (MSG_IS_MOVE(msginfo->flags)) {
+ if (!prefs_common.immediate_exec) {
+ msginfo->to_folder->op_count--;
+ if (msginfo->to_folder->op_count == 0)
+ folder_update_item(msginfo->to_folder, FALSE);
+ }
summaryview->moved--;
changed = TRUE;
}
if (MSG_IS_COPY(msginfo->flags)) {
+ if (!prefs_common.immediate_exec) {
+ msginfo->to_folder->op_count--;
+ if (msginfo->to_folder->op_count == 0)
+ folder_update_item(msginfo->to_folder, FALSE);
+ }
summaryview->copied--;
changed = TRUE;
}
- 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);
- }
+ changed |= summary_update_unread_children (summaryview, msginfo, FALSE);
+
msginfo->to_folder = NULL;
procmsg_msginfo_unset_flags(msginfo, MSG_MARKED | MSG_DELETED, MSG_MOVE | MSG_COPY);
summary_set_row_marks(summaryview, row);
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);
}
}
gchar *filename = NULL;
gchar *src, *dest;
- AlertValue aval;
+ AlertValue aval = 0;
if (!summaryview->selected) return;
msginfo = gtk_ctree_node_get_row_data(ctree, summaryview->selected);
aval = alertpanel(_("Append or Overwrite"),
_("Append or overwrite existing file?"),
_("Append"), _("Overwrite"), _("Cancel"));
- if (aval!=0 && aval!=1) return;
+ if (aval != 0 && aval != 1)
+ return;
}
src = procmsg_get_message_file(msginfo);
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)
gint color_index;
msginfo = gtk_ctree_node_get_row_data(ctree, node);
- procmsg_msginfo_unset_flags(msginfo, MSG_CLABEL_FLAG_MASK, 0);
- procmsg_msginfo_set_flags(msginfo, MSG_COLORLABEL_TO_FLAGS(labelcolor), 0);
color_index = labelcolor == 0 ? -1 : (gint)labelcolor - 1;
ctree_style = gtk_widget_get_style(GTK_WIDGET(ctree));
gtk_ctree_node_set_row_style(ctree, node, style);
}
+static void summary_set_row_colorlable(SummaryView *summaryview, GtkCTreeNode *row, guint labelcolor)
+{
+ GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
+ MsgInfo *msginfo;
+
+ msginfo = gtk_ctree_node_get_row_data(ctree, row);
+
+ procmsg_msginfo_unset_flags(msginfo, MSG_CLABEL_FLAG_MASK, 0);
+ procmsg_msginfo_set_flags(msginfo, MSG_COLORLABEL_TO_FLAGS(labelcolor), 0);
+}
+
void summary_set_colorlabel(SummaryView *summaryview, guint labelcolor,
GtkWidget *widget)
{
GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
- GtkCList *clist = GTK_CLIST(summaryview->ctree);
GList *cur;
- for (cur = clist->selection; cur != NULL; cur = cur->next)
- summary_set_colorlabel_color(ctree, GTK_CTREE_NODE(cur->data),
- labelcolor);
+ for (cur = GTK_CLIST(ctree)->selection; cur != NULL; cur = cur->next)
+ summary_set_row_colorlable(summaryview,
+ GTK_CTREE_NODE(cur->data), labelcolor);
}
static void summary_colorlabel_menu_item_activate_item_cb(GtkMenuItem *menu_item,
summary_show(summaryview, summaryview->folder_item);
}
+static void summary_searchbar_focus_evt(GtkWidget *widget, GdkEventFocus *event,
+ SummaryView *summaryview)
+{
+ if (event != NULL && event->in)
+ gtk_signal_handler_block_by_func(GTK_OBJECT(summaryview->mainwin->window),
+ GTK_SIGNAL_FUNC(mainwindow_key_pressed),
+ summaryview->mainwin);
+ else
+ gtk_signal_handler_unblock_by_func(GTK_OBJECT(summaryview->mainwin->window),
+ GTK_SIGNAL_FUNC(mainwindow_key_pressed),
+ summaryview->mainwin);
+}
+
static void summary_searchtype_changed(GtkMenuItem *widget, gpointer data)
{
SummaryView *sw = (SummaryView *)data;
+ prefs_common.summary_quicksearch_type = GPOINTER_TO_INT(gtk_object_get_user_data(
+ GTK_OBJECT(GTK_MENU_ITEM(gtk_menu_get_active(
+ GTK_MENU(sw->search_type))))));
+
if (gtk_entry_get_text(GTK_ENTRY(sw->search_string)))
summary_show(sw, sw->folder_item);
}
static void tog_searchbar_cb(GtkWidget *w, gpointer data)
{
+ SummaryView *summaryview = (SummaryView *)data;
+ GtkWidget *hbox= summaryview->hbox_search;
+ GtkAllocation size = hbox->allocation;
+ GtkAllocation msgview_size = summaryview->messageview->vbox->allocation;
+ GtkAllocation parent_size = summaryview->vbox->allocation;
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))) {
prefs_common.show_searchbar = TRUE;
- gtk_widget_show(GTK_WIDGET(data));
+ gtk_widget_show(hbox);
+ if (!prefs_common.sep_msg && messageview_is_visible(summaryview->messageview)
+ && msgview_size.height > 1 && parent_size.height > 1) {
+ gtk_widget_set_usize(GTK_WIDGET(summaryview->messageview->vbox),
+ -1,msgview_size.height - size.height - SUMMARY_VBOX_SPACING);
+ gtk_widget_set_usize(GTK_WIDGET(summaryview->vbox),
+ -1,parent_size.height + size.height + SUMMARY_VBOX_SPACING);
+ gtk_paned_set_position(GTK_PANED(summaryview->vbox->parent),-1);
+ }
} else {
prefs_common.show_searchbar = FALSE;
- gtk_widget_hide(GTK_WIDGET(data));
+ gtk_widget_hide(hbox);
+ if (!prefs_common.sep_msg && messageview_is_visible(summaryview->messageview)
+ && msgview_size.height > 1 && parent_size.height > 1) {
+ gtk_widget_set_usize(GTK_WIDGET(summaryview->messageview->vbox),
+ -1,msgview_size.height + size.height + SUMMARY_VBOX_SPACING);
+ gtk_widget_set_usize(GTK_WIDGET(summaryview->vbox),
+ -1,parent_size.height - size.height - SUMMARY_VBOX_SPACING);
+ gtk_paned_set_position(GTK_PANED(summaryview->vbox->parent),-1);
+ }
}
}
switch (column < 0 ? column : summaryview->col_state[column].type) {
case S_COL_MARK:
if (MSG_IS_MARKED(msginfo->flags)) {
- procmsg_msginfo_unset_flags(msginfo, MSG_MARKED, 0);
- summary_set_row_marks(summaryview, row);
+ summary_unmark_row(summaryview, row);
} else
summary_mark_row(summaryview, row);
break;
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);
summaryview->newmsgs--;
if (MSG_IS_UNREAD(msginfo->flags))
summaryview->unread--;
+ if (MSG_IS_UNREAD(msginfo->flags) && procmsg_msg_has_marked_parent(msginfo))
+ summaryview->unreadmarked--;
procmsg_msginfo_set_flags(msginfo, MSG_IGNORE_THREAD, 0);
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);
}
summaryview->newmsgs++;
if (MSG_IS_UNREAD(msginfo->flags))
summaryview->unread++;
+ if (MSG_IS_UNREAD(msginfo->flags) && procmsg_msg_has_marked_parent(msginfo))
+ summaryview->unreadmarked++;
procmsg_msginfo_unset_flags(msginfo, MSG_IGNORE_THREAD, 0);
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 gboolean summary_update_msg(gpointer source, gpointer data) {
+ MsgInfoUpdate *msginfo_update = (MsgInfoUpdate *) source;
+ SummaryView *summaryview = (SummaryView *)data;
+ GtkCTreeNode *node;
+
+ g_return_val_if_fail(msginfo_update != NULL, TRUE);
+ g_return_val_if_fail(summaryview != NULL, FALSE);
+
+ node = gtk_ctree_find_by_row_data(GTK_CTREE(summaryview->ctree), NULL, msginfo_update->msginfo);
+
+ if (node)
+ summary_set_row_marks(summaryview, node);
+
+ return FALSE;
+}
+
/*
* End of Source.
*/