#define SUMMARY_COL_LOCKED_WIDTH 13
#define SUMMARY_COL_MIME_WIDTH 11
-static GdkFont *boldfont;
-static GdkFont *smallfont;
static GtkStyle *bold_style;
static GtkStyle *bold_marked_style;
void summary_init(SummaryView *summaryview)
{
+ static GdkFont *boldfont = NULL;
+ static GdkFont *smallfont = NULL;
GtkStyle *style;
GtkWidget *pixmap;
stock_pixmap_gdk(summaryview->ctree, STOCK_PIXMAP_GPG_SIGNED,
&gpgsignedxpm, &gpgsignedxpmmask);
+ if (!bold_style) {
+ bold_style = gtk_style_copy
+ (gtk_widget_get_style(summaryview->ctree));
+ if (!boldfont)
+ boldfont = gtkut_font_load(BOLD_FONT);
+ if (boldfont)
+ bold_style->font = boldfont;
+ bold_marked_style = gtk_style_copy(bold_style);
+ bold_marked_style->fg[GTK_STATE_NORMAL] =
+ summaryview->color_marked;
+ bold_deleted_style = gtk_style_copy(bold_style);
+ bold_deleted_style->fg[GTK_STATE_NORMAL] =
+ summaryview->color_dim;
+ }
+
if (!small_style) {
small_style = gtk_style_copy
(gtk_widget_get_style(summaryview->ctree));
small_deleted_style->fg[GTK_STATE_NORMAL] =
summaryview->color_dim;
}
- if (!bold_style) {
- bold_style = gtk_style_copy
- (gtk_widget_get_style(summaryview->ctree));
- if (!boldfont)
- 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] =
- summaryview->color_marked;
- bold_deleted_style = gtk_style_copy(bold_style);
- bold_deleted_style->fg[GTK_STATE_NORMAL] =
- summaryview->color_dim;
- }
style = gtk_style_copy(gtk_widget_get_style
(summaryview->statlabel_folder));
-
+ if (smallfont)
+ style->font = smallfont;
gtk_widget_set_style(summaryview->statlabel_folder, style);
gtk_widget_set_style(summaryview->statlabel_select, style);
gtk_widget_set_style(summaryview->statlabel_msgs, style);
summary_clear_list(summaryview);
summary_set_column_titles(summaryview);
- if (!is_refresh)
- messageview_clear(summaryview->messageview);
buf = NULL;
if (!item || !item->path || !item->parent || item->no_select) {
g_free(buf);
debug_print("empty folder\n\n");
summary_set_hide_read_msgs_menu(summaryview, FALSE);
- if (is_refresh)
- messageview_clear(summaryview->messageview);
summary_clear_all(summaryview);
summaryview->folder_item = item;
gtk_clist_thaw(GTK_CLIST(ctree));
}
g_free(buf);
+ if (!is_refresh)
+ messageview_clear(summaryview->messageview);
+
summaryview->folder_item = item;
item->opened = TRUE;
if (prefs_common.open_unread_on_enter ||
prefs_common.always_show_msg) {
summary_unlock(summaryview);
- summary_select_node(summaryview, node, TRUE, TRUE);
+ summary_select_node(summaryview, node,
+ messageview_is_visible(summaryview->messageview),
+ TRUE);
summary_lock(summaryview);
} else
summary_select_node(summaryview, node, FALSE, TRUE);
void summary_clear_all(SummaryView *summaryview)
{
+ messageview_clear(summaryview->messageview);
summary_clear_list(summaryview);
summary_set_menu_sensitive(summaryview);
toolbar_main_set_sensitive(summaryview->mainwin);
menuitem = gtk_item_factory_get_widget(ifactory, "/View/All header");
gtk_check_menu_item_set_active
(GTK_CHECK_MENU_ITEM(menuitem),
- summaryview->messageview->textview->show_all_headers);
+ summaryview->messageview->mimeview->textview->show_all_headers);
summary_unlock(summaryview);
}
msginfo = gtk_ctree_node_get_row_data(ctree, node);
- if (MSG_IS_NEWS(msginfo->flags))
+ if (msginfo->folder && msginfo->folder->folder &&
+ msginfo->folder->folder->klass->type == F_NEWS)
news_flag_crosspost(msginfo);
if (MSG_IS_UNREAD(msginfo->flags) && !MSG_IS_IGNORE_THREAD(msginfo->flags)
if (!messageview_is_visible(msgview))
main_window_toggle_message_view(summaryview->mainwin);
messageview_show(msgview, msginfo, all_headers);
- if (msgview->type == MVIEW_TEXT ||
- (msgview->type == MVIEW_MIME &&
- (GTK_CLIST(msgview->mimeview->ctree)->row_list == NULL ||
- gtk_notebook_get_current_page
- (GTK_NOTEBOOK(msgview->mimeview->notebook)) == 0)))
+ if (GTK_CLIST(msgview->mimeview->ctree)->row_list == NULL)
gtk_widget_grab_focus(summaryview->ctree);
GTK_EVENTS_FLUSH();
gtkut_ctree_node_move_if_on_the_edge(ctree, row);
void summary_open_msg(SummaryView *summaryview)
{
if (!summaryview->selected) return;
-
+
+ /* CLAWS: if separate message view, don't open a new window
+ * but rather use the current separated message view */
summary_display_msg_full(summaryview, summaryview->selected,
- TRUE, FALSE);
+ prefs_common.sep_msg ? FALSE : TRUE,
+ FALSE);
}
void summary_view_source(SummaryView * summaryview)
GtkCTreeNode *node;
if (!item) return;
-#if 0
- if (!item || item->folder->type == F_NEWS) return;
-#endif
if (summary_is_locked(summaryview)) return;
#define BREAK_ON_MODIFIER_KEY() \
if ((event->state & (GDK_MOD1_MASK|GDK_CONTROL_MASK)) != 0) break
-#define RETURN_IF_LOCKED() \
- if (summaryview->mainwin->lock_count) return TRUE
-
static gint summary_key_pressed(GtkWidget *widget, GdkEventKey *event,
SummaryView *summaryview)
{
}
messageview = summaryview->messageview;
- if (messageview->type == MVIEW_MIME &&
- gtk_notebook_get_current_page
- (GTK_NOTEBOOK(messageview->mimeview->notebook)) == 1)
- textview = messageview->mimeview->textview;
- else
- textview = messageview->textview;
+ textview = messageview->mimeview->textview;
switch (event->keyval) {
case GDK_space: /* Page down or go to the next */
summary_mark_as_unread(summaryview);
break;
case GDK_Delete:
- RETURN_IF_LOCKED();
BREAK_ON_MODIFIER_KEY();
summary_delete(summaryview);
break;
GString *line;
gpointer key;
gpointer value;
- Folder *mff = msginfo->folder->folder;
+ Folder *mff;
+
+ g_return_if_fail(msginfo != NULL);
+ g_return_if_fail(msginfo->folder != NULL);
+ g_return_if_fail(msginfo->folder->folder != NULL);
+ mff = msginfo->folder->folder;
+ g_return_if_fail(mff->klass->type != F_NEWS);
- if (mff->account->mark_crosspost_read && MSG_IS_NEWS(msginfo->flags)) {
+ if (mff->account->mark_crosspost_read) {
line = g_string_sized_new(128);
g_string_sprintf(line, "%s:%d", msginfo->folder->path, msginfo->msgnum);
debug_print("nfcp: checking <%s>", line->str);