/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2005 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2006 Hiroyuki Yamamoto and the Sylpheed-Claws team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
GSList *mlist);
static void summary_set_header (SummaryView *summaryview,
gchar *text[],
- MsgInfo *msginfo);
+ MsgInfo *msginfo,
+ gboolean *free_from_to);
static void summary_display_msg (SummaryView *summaryview,
GtkCTreeNode *row);
static void summary_display_msg_full (SummaryView *summaryview,
gboolean changed = FALSE;
val = alertpanel(_("Process mark"),
- _("Some marks are left. Process it?"),
- GTK_STOCK_YES, GTK_STOCK_NO, GTK_STOCK_CANCEL);
- if (G_ALERTDEFAULT == val) {
+ _("Some marks are left. Process them?"),
+ GTK_STOCK_NO, GTK_STOCK_YES, GTK_STOCK_CANCEL);
+ if (G_ALERTALTERNATE == val) {
summary_unlock(summaryview);
summary_execute(summaryview);
summary_lock(summaryview);
changed = TRUE;
- } else if (G_ALERTALTERNATE == val) {
+ } else if (G_ALERTDEFAULT == val) {
/* DO NOTHING */
} else {
summary_unlock(summaryview);
summary_lock(summaryview);
menuitem = gtk_item_factory_get_widget(ifactory, "/View/All header");
- gtk_check_menu_item_set_active
- (GTK_CHECK_MENU_ITEM(menuitem),
- summaryview->messageview->mimeview->textview->show_all_headers);
+ if (summaryview->messageview
+ && summaryview->messageview->mimeview
+ && summaryview->messageview->mimeview->textview)
+ gtk_check_menu_item_set_active
+ (GTK_CHECK_MENU_ITEM(menuitem),
+ summaryview->messageview->mimeview->textview->show_all_headers);
summary_unlock(summaryview);
}
val = alertpanel(_("No more unread messages"),
_("No unread message found. "
"Search from the end?"),
- GTK_STOCK_YES, GTK_STOCK_NO, NULL);
+ GTK_STOCK_NO, "+"GTK_STOCK_YES, NULL);
break;
case NEXTUNREADMSGDIALOG_ASSUME_YES:
- val = G_ALERTDEFAULT;
+ val = G_ALERTALTERNATE;
break;
case NEXTUNREADMSGDIALOG_ASSUME_NO:
- val = !G_ALERTDEFAULT;
+ val = !G_ALERTALTERNATE;
break;
default:
debug_print(
_("Internal error: unexpected value for prefs_common.next_unread_msg_dialog\n"));
}
- if (val != G_ALERTDEFAULT) return;
+ if (val != G_ALERTALTERNATE) return;
node = summary_find_prev_flagged_msg(summaryview, NULL,
MSG_UNREAD, FALSE);
}
val = alertpanel(_("No more unread messages"),
_("No unread message found. "
"Go to next folder?"),
- GTK_STOCK_YES, GTK_STOCK_NO, NULL);
+ GTK_STOCK_NO, "+"GTK_STOCK_YES, NULL);
break;
case NEXTUNREADMSGDIALOG_ASSUME_YES:
- val = G_ALERTDEFAULT;
+ val = G_ALERTALTERNATE;
break;
case NEXTUNREADMSGDIALOG_ASSUME_NO:
val = G_ALERTOTHER;
_("Internal error: unexpected value for prefs_common.next_unread_msg_dialog\n"));
}
- if (val == G_ALERTDEFAULT) {
+ if (val == G_ALERTALTERNATE) {
folderview_select_next_unread(summaryview->folderview);
return;
}
val = alertpanel(_("No more new messages"),
_("No new message found. "
"Search from the end?"),
- GTK_STOCK_YES, GTK_STOCK_NO, NULL);
+ GTK_STOCK_NO, "+"GTK_STOCK_YES, NULL);
break;
case NEXTUNREADMSGDIALOG_ASSUME_YES:
- val = G_ALERTDEFAULT;
+ val = G_ALERTALTERNATE;
break;
case NEXTUNREADMSGDIALOG_ASSUME_NO:
- val = !G_ALERTDEFAULT;
+ val = !G_ALERTALTERNATE;
break;
default:
debug_print(
_("Internal error: unexpected value for prefs_common.next_unread_msg_dialog\n"));
}
- if (val != G_ALERTDEFAULT) return;
+ if (val != G_ALERTALTERNATE) return;
node = summary_find_prev_flagged_msg(summaryview, NULL,
MSG_NEW, FALSE);
}
val = alertpanel(_("No more new messages"),
_("No new message found. "
"Go to next folder?"),
- GTK_STOCK_YES, GTK_STOCK_NO, NULL);
+ GTK_STOCK_NO, "+"GTK_STOCK_YES, NULL);
break;
case NEXTUNREADMSGDIALOG_ASSUME_YES:
- val = G_ALERTDEFAULT;
+ val = G_ALERTALTERNATE;
break;
case NEXTUNREADMSGDIALOG_ASSUME_NO:
val = G_ALERTOTHER;
_("Internal error: unexpected value for prefs_common.next_unread_msg_dialog\n"));
}
- if (val == G_ALERTDEFAULT) {
+ if (val == G_ALERTALTERNATE) {
folderview_select_next_new(summaryview->folderview);
return;
}
val = alertpanel(_("No more marked messages"),
_("No marked message found. "
"Search from the end?"),
- GTK_STOCK_YES, GTK_STOCK_NO, NULL);
- if (val != G_ALERTDEFAULT) return;
+ GTK_STOCK_NO, "+"GTK_STOCK_YES, NULL);
+ if (val != G_ALERTALTERNATE) return;
node = summary_find_prev_flagged_msg(summaryview, NULL,
MSG_MARKED, TRUE);
}
val = alertpanel(_("No more marked messages"),
_("No marked message found. "
"Search from the beginning?"),
- GTK_STOCK_YES, GTK_STOCK_NO, NULL);
- if (val != G_ALERTDEFAULT) return;
+ GTK_STOCK_NO, "+"GTK_STOCK_YES, NULL);
+ if (val != G_ALERTALTERNATE) return;
node = summary_find_next_flagged_msg(summaryview, NULL,
MSG_MARKED, TRUE);
}
val = alertpanel(_("No more labeled messages"),
_("No labeled message found. "
"Search from the end?"),
- GTK_STOCK_YES, GTK_STOCK_NO, NULL);
- if (val != G_ALERTDEFAULT) return;
+ GTK_STOCK_NO, "+"GTK_STOCK_YES, NULL);
+ if (val != G_ALERTALTERNATE) return;
node = summary_find_prev_flagged_msg(summaryview, NULL,
MSG_CLABEL_FLAG_MASK, TRUE);
}
val = alertpanel(_("No more labeled messages"),
_("No labeled message found. "
"Search from the beginning?"),
- GTK_STOCK_YES, GTK_STOCK_NO, NULL);
- if (val != G_ALERTDEFAULT) return;
+ GTK_STOCK_NO, "+"GTK_STOCK_YES, NULL);
+ if (val != G_ALERTALTERNATE) return;
node = summary_find_next_flagged_msg(summaryview, NULL,
MSG_CLABEL_FLAG_MASK, TRUE);
}
gint *col_pos = summaryview->col_pos;
const gchar *msgid = msginfo->msgid;
GHashTable *msgid_table = summaryview->msgid_table;
-
- summary_set_header(summaryview, text, msginfo);
+ gboolean free_from_to = FALSE;
+
+ summary_set_header(summaryview, text, msginfo, &free_from_to);
gtk_sctree_set_node_info(ctree, cnode, text[col_pos[S_COL_SUBJECT]], 2,
NULL, NULL, NULL, NULL, FALSE,
SET_TEXT(S_COL_TO);
/* SET_TEXT(S_COL_SUBJECT); already set by node info */
+ if (free_from_to) {
+ g_free(text[col_pos[S_COL_FROM]]);
+ g_free(text[col_pos[S_COL_TO]]);
+ text[col_pos[S_COL_FROM]] = NULL;
+ text[col_pos[S_COL_TO]] = NULL;
+ }
+
#undef SET_TEXT
GTKUT_CTREE_NODE_SET_ROW_DATA(cnode, msginfo);
summary_thread_init(summaryview);
} else {
gchar *text[N_SUMMARY_COLS];
+ gboolean free_from_to = FALSE;
+ gint *col_pos = summaryview->col_pos;
+
cur = mlist;
for (; mlist != NULL; mlist = mlist->next) {
msginfo = (MsgInfo *)mlist->data;
- summary_set_header(summaryview, text, msginfo);
+ summary_set_header(summaryview, text, msginfo, &free_from_to);
node = gtk_sctree_insert_node
(ctree, NULL, node, text, 2,
NULL, NULL, NULL, NULL,
FALSE, FALSE);
+ if (free_from_to) {
+ g_free(text[col_pos[S_COL_FROM]]);
+ g_free(text[col_pos[S_COL_TO]]);
+ text[col_pos[S_COL_FROM]] = NULL;
+ text[col_pos[S_COL_TO]] = NULL;
+ }
GTKUT_CTREE_NODE_SET_ROW_DATA(node, msginfo);
summary_set_marks_func(ctree, node, summaryview);
}
static void summary_set_header(SummaryView *summaryview, gchar *text[],
- MsgInfo *msginfo)
+ MsgInfo *msginfo, gboolean *free_from_to)
{
static gchar date_modified[80];
static gchar col_score[11];
if (!should_swap) {
text[col_pos[S_COL_FROM]] = from_text;
text[col_pos[S_COL_TO]] = to_text;
+ *free_from_to = FALSE;
} else {
gchar *tmp = NULL;
tmp = g_strconcat("-->", to_text, NULL);
text[col_pos[S_COL_FROM]] = tmp;
tmp = g_strconcat("<--", from_text, NULL);
text[col_pos[S_COL_TO]] = tmp;
+ *free_from_to = TRUE;
}
if (summaryview->simplify_subject_preg != NULL)
aval = alertpanel(_("Delete message(s)"),
_("Do you really want to delete selected message(s)?"),
- GTK_STOCK_YES, GTK_STOCK_NO, NULL);
- if (aval != G_ALERTDEFAULT) return;
+ GTK_STOCK_CANCEL, "+"GTK_STOCK_DELETE, NULL);
+ if (aval != G_ALERTALTERNATE) return;
for (cur = GTK_CLIST(ctree)->selection; cur != NULL && cur->data != NULL;
cur = cur->next) {