/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2009 Hiroyuki Yamamoto and the Claws Mail team
+ * Copyright (C) 1999-2011 Hiroyuki Yamamoto and the Claws Mail 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
#include "hooks.h"
#include "filtering.h"
#include "partial_download.h"
-#include "gedit-print.h"
#include "uri_opener.h"
#include "inc.h"
#include "log.h"
MsgInfo *msginfo);
static void save_as_cb (GtkAction *action,
gpointer data);
-#if GTK_CHECK_VERSION(2,10,0) && !defined(USE_GNOMEPRINT)
static void page_setup_cb (GtkAction *action,
gpointer data);
-#endif
static void print_cb (GtkAction *action,
gpointer data);
static void close_cb (GtkAction *action,
static void goto_folder_cb (GtkAction *action,
gpointer data);
+static void scroll_prev_line_cb (GtkAction *action,
+ gpointer data);
+static void scroll_next_line_cb (GtkAction *action,
+ gpointer data);
+static void scroll_next_page_cb (GtkAction *action,
+ gpointer data);
+static void scroll_prev_page_cb (GtkAction *action,
+ gpointer data);
+
static void set_charset_cb (GtkAction *action, GtkRadioAction *current, gpointer data);
static void set_decode_cb (GtkAction *action, GtkRadioAction *current, gpointer data);
/* File menu */
{"File/SaveAs", NULL, N_("_Save as..."), "<control>S", NULL, G_CALLBACK(save_as_cb) },
-#if GTK_CHECK_VERSION(2,10,0) && !defined(USE_GNOMEPRINT)
{"File/PageSetup", NULL, N_("Page setup..."), NULL, NULL, G_CALLBACK(page_setup_cb) },
-#endif
{"File/Print", NULL, N_("_Print..."), "<control>P", NULL, G_CALLBACK(print_cb) },
{"File/---", NULL, "---", NULL, NULL, NULL },
{"File/Close", NULL, N_("_Close"), "<control>W", NULL, G_CALLBACK(close_cb) },
{"View/Goto/NextUnreadFolder", NULL, N_("Next unread _folder"), "<shift>G", NULL, G_CALLBACK(goto_unread_folder_cb) },
{"View/Goto/OtherFolder", NULL, N_("_Other folder..."), "G", NULL, G_CALLBACK(goto_folder_cb) },
/* {"View/Goto/---", NULL, "---", NULL, NULL, NULL }, */
+ {"View/Scroll", NULL, N_("Message scroll") },
+ {"View/Scroll/PrevLine", NULL, N_("Previous line"), NULL, NULL, G_CALLBACK(scroll_prev_line_cb) },
+ {"View/Scroll/NextLine", NULL, N_("Next line"), NULL, NULL, G_CALLBACK(scroll_next_line_cb) },
+ {"View/Scroll/PrevPage", NULL, N_("Previous page"), NULL, NULL, G_CALLBACK(scroll_prev_page_cb) },
+ {"View/Scroll/NextPage", NULL, N_("Next page"), NULL, NULL, G_CALLBACK(scroll_next_page_cb) },
+ /* {"View/Scroll/---", NULL, "---", NULL, NULL, NULL }, */
{"View/Encoding", NULL, N_("Character _encoding") }, /* set_charset_cb */
{"View/Encoding/---", NULL, "---" },
static GtkToggleActionEntry msgview_toggle_entries[] =
{
{"View/AllHeaders", NULL, N_("Show all _headers"), "<control>H", NULL, G_CALLBACK(show_all_header_cb) }, /* toggle */
- {"View/Quotes/FoldAll", NULL, N_("_Fold all"), "<control><shift>Q", NULL, G_CALLBACK(msg_hide_quotes_cb) }, /* 1 toggle */
- {"View/Quotes/Fold2", NULL, N_("Fold from level _2"), NULL, NULL, G_CALLBACK(msg_hide_quotes_cb) }, /* 2 toggle */
- {"View/Quotes/Fold3", NULL, N_("Fold from level _3"), NULL, NULL, G_CALLBACK(msg_hide_quotes_cb) }, /* 3 toggle */
+ {"View/Quotes/CollapseAll", NULL, N_("_Collapse all"), "<control><shift>Q", NULL, G_CALLBACK(msg_hide_quotes_cb) }, /* 1 toggle */
+ {"View/Quotes/Collapse2", NULL, N_("Collapse from level _2"), NULL, NULL, G_CALLBACK(msg_hide_quotes_cb) }, /* 2 toggle */
+ {"View/Quotes/Collapse3", NULL, N_("Collapse from level _3"), NULL, NULL, G_CALLBACK(msg_hide_quotes_cb) }, /* 3 toggle */
};
static GtkRadioActionEntry msgview_radio_enc_entries[] =
ENC_ACTION("Japanese/"CS_ISO_2022_JP_2, C_ISO_2022_JP_2, "ISO-2022-JP-_2"), /* RADIO set_charset_cb */
ENC_ACTION("Japanese/"CS_EUC_JP, C_EUC_JP, "_EUC-JP"), /* RADIO set_charset_cb */
ENC_ACTION("Japanese/"CS_SHIFT_JIS, C_SHIFT_JIS, "_Shift-JIS"), /* RADIO set_charset_cb */
+ ENC_ACTION("Chinese/"CS_GB18030, C_GB18030, "_GB18030"), /* RADIO set_charset_cb */
ENC_ACTION("Chinese/"CS_GB2312, C_GB2312, "_GB2312"), /* RADIO set_charset_cb */
ENC_ACTION("Chinese/"CS_GBK, C_GBK, "GB_K"), /* RADIO set_charset_cb */
ENC_ACTION("Chinese/"CS_BIG5, C_BIG5, "_Big5-JP"), /* RADIO set_charset_cb */
/* File menu */
MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/File", "SaveAs", "File/SaveAs", GTK_UI_MANAGER_MENUITEM)
-#if GTK_CHECK_VERSION(2,10,0) && !defined(USE_GNOMEPRINT)
MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/File", "PageSetup", "File/PageSetup", GTK_UI_MANAGER_MENUITEM)
-#endif
MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/File", "Print", "File/Print", GTK_UI_MANAGER_MENUITEM)
MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/File", "Separator1", "File/---", GTK_UI_MANAGER_SEPARATOR)
MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/File", "Close", "File/Close", GTK_UI_MANAGER_MENUITEM)
MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View", "Goto", "View/Goto", GTK_UI_MANAGER_MENU)
MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Goto", "Prev", "View/Goto/Prev", GTK_UI_MANAGER_MENUITEM)
MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Goto", "Next", "View/Goto/Next", GTK_UI_MANAGER_MENUITEM)
- MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Goto", "Separator1", "View/Goto/---", GTK_UI_MANAGER_MENUITEM)
+ MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Goto", "Separator1", "View/Goto/---", GTK_UI_MANAGER_SEPARATOR)
MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Goto", "PrevUnread", "View/Goto/PrevUnread", GTK_UI_MANAGER_MENUITEM)
MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Goto", "NextUnread", "View/Goto/NextUnread", GTK_UI_MANAGER_MENUITEM)
- MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Goto", "Separator2", "View/Goto/---", GTK_UI_MANAGER_MENUITEM)
+ MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Goto", "Separator2", "View/Goto/---", GTK_UI_MANAGER_SEPARATOR)
MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Goto", "PrevNew", "View/Goto/PrevNew", GTK_UI_MANAGER_MENUITEM)
MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Goto", "NextNew", "View/Goto/NextNew", GTK_UI_MANAGER_MENUITEM)
- MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Goto", "Separator3", "View/Goto/---", GTK_UI_MANAGER_MENUITEM)
+ MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Goto", "Separator3", "View/Goto/---", GTK_UI_MANAGER_SEPARATOR)
MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Goto", "PrevMarked", "View/Goto/PrevMarked", GTK_UI_MANAGER_MENUITEM)
MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Goto", "NextMarked", "View/Goto/NextMarked", GTK_UI_MANAGER_MENUITEM)
- MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Goto", "Separator4", "View/Goto/---", GTK_UI_MANAGER_MENUITEM)
+ MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Goto", "Separator4", "View/Goto/---", GTK_UI_MANAGER_SEPARATOR)
MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Goto", "PrevLabeled", "View/Goto/PrevLabeled", GTK_UI_MANAGER_MENUITEM)
MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Goto", "NextLabeled", "View/Goto/NextLabeled", GTK_UI_MANAGER_MENUITEM)
- MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Goto", "Separator5", "View/Goto/---", GTK_UI_MANAGER_MENUITEM)
+ MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Goto", "Separator5", "View/Goto/---", GTK_UI_MANAGER_SEPARATOR)
MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Goto", "LastRead", "View/Goto/LastRead", GTK_UI_MANAGER_MENUITEM)
MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Goto", "ParentMessage", "View/Goto/ParentMessage", GTK_UI_MANAGER_MENUITEM)
- MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Goto", "Separator6", "View/Goto/---", GTK_UI_MANAGER_MENUITEM)
+ MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Goto", "Separator6", "View/Goto/---", GTK_UI_MANAGER_SEPARATOR)
MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Goto", "NextUnreadFolder", "View/Goto/NextUnreadFolder", GTK_UI_MANAGER_MENUITEM)
MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Goto", "OtherFolder", "View/Goto/OtherFolder", GTK_UI_MANAGER_MENUITEM)
+ MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View", "Scroll", "View/Scroll", GTK_UI_MANAGER_MENU)
+ MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Scroll", "PrevLine", "View/Scroll/PrevLine", GTK_UI_MANAGER_MENUITEM)
+ MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Scroll", "NextLine", "View/Scroll/NextLine", GTK_UI_MANAGER_MENUITEM)
+ MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Scroll", "PrevPage", "View/Scroll/PrevPage", GTK_UI_MANAGER_MENUITEM)
+ MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Scroll", "NextPage", "View/Scroll/NextPage", GTK_UI_MANAGER_MENUITEM)
+
MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View", "Separator1", "View/---", GTK_UI_MANAGER_SEPARATOR)
MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View", "Encoding", "View/Encoding", GTK_UI_MANAGER_MENU)
MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Encoding/Japanese", CS_SHIFT_JIS, "View/Encoding/Japanese/"CS_SHIFT_JIS, GTK_UI_MANAGER_MENUITEM)
MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Encoding", "Chinese", "View/Encoding/Chinese", GTK_UI_MANAGER_MENU)
+ MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Encoding/Chinese", CS_GB18030, "View/Encoding/Chinese/"CS_GB18030, GTK_UI_MANAGER_MENUITEM)
MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Encoding/Chinese", CS_GB2312, "View/Encoding/Chinese/"CS_GB2312, GTK_UI_MANAGER_MENUITEM)
MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Encoding/Chinese", CS_GBK, "View/Encoding/Chinese/"CS_GBK, GTK_UI_MANAGER_MENUITEM)
MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Encoding/Chinese", CS_BIG5, "View/Encoding/Chinese/"CS_BIG5, GTK_UI_MANAGER_MENUITEM)
MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View", "MessageSource", "View/MessageSource", GTK_UI_MANAGER_MENUITEM)
MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View", "AllHeaders", "View/AllHeaders", GTK_UI_MANAGER_MENUITEM)
MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View", "Quotes", "View/Quotes", GTK_UI_MANAGER_MENU)
- MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Quotes", "FoldAll", "View/Quotes/FoldAll", GTK_UI_MANAGER_MENUITEM)
- MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Quotes", "Fold2", "View/Quotes/Fold2", GTK_UI_MANAGER_MENUITEM)
- MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Quotes", "Fold3", "View/Quotes/Fold3", GTK_UI_MANAGER_MENUITEM)
+ MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Quotes", "CollapseAll", "View/Quotes/CollapseAll", GTK_UI_MANAGER_MENUITEM)
+ MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Quotes", "Collapse2", "View/Quotes/Collapse2", GTK_UI_MANAGER_MENUITEM)
+ MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Quotes", "Collapse3", "View/Quotes/Collapse3", GTK_UI_MANAGER_MENUITEM)
/* Message menu */
MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/Message", "Compose", "Message/Compose", GTK_UI_MANAGER_MENUITEM)
hildon_window_set_menu(HILDON_WINDOW(window), GTK_MENU(menubar));
#endif
+ cm_toggle_menu_set_active_full(msgview->ui_manager, "Menu/View/AllHeaders",
+ prefs_common.show_all_headers);
+
if (prefs_common.toolbar_detachable) {
handlebox = gtk_handle_box_new();
} else {
addrp = addr;
/* write queue headers */
- if (fprintf(fp, "AF:\n"
+ ok = fprintf(fp, "AF:\n"
"NF:0\n"
"PS:10\n"
"SRH:1\n"
"R:<%s>\n",
account->address,
account->smtp_server?account->smtp_server:"",
- addrp) < 0) {
- g_free(addrp);
- fclose(fp);
- claws_unlink(tmp);
- return -1;
- }
+ addrp);
g_free(addrp);
+ if (ok < 0)
+ goto FILE_ERROR;
/* check whether we need to save the message */
outbox = account_get_special_folder(account, F_OUTBOX);
outbox = NULL;
if (outbox) {
path = folder_item_get_identifier(outbox);
- if (fprintf(fp, "SCF:%s\n", path) < 0) {
- g_free(path);
- fclose(fp);
- claws_unlink(tmp);
- return -1;
- }
+ ok = fprintf(fp, "SCF:%s\n", path);
g_free(path);
+
+ if (ok < 0)
+ goto FILE_ERROR;
}
- if (fprintf(fp, "X-Claws-End-Special-Headers: 1\n") < 0) {
- fclose(fp);
- claws_unlink(tmp);
- return -1;
- }
+ if (fprintf(fp, "X-Claws-End-Special-Headers: 1\n") < 0)
+ goto FILE_ERROR;
/* Date */
get_rfc822_date(buf, sizeof(buf));
- if (fprintf(fp, "Date: %s\n", buf) < 0) {
- fclose(fp);
- claws_unlink(tmp);
- return -1;
- }
+ if (fprintf(fp, "Date: %s\n", buf) < 0)
+ goto FILE_ERROR;
/* From */
if (account->name && *account->name) {
notification_convert_header
(buf, sizeof(buf), account->name,
strlen("From: "));
- if (fprintf(fp, "From: %s <%s>\n", buf, account->address) < 0) {
- fclose(fp);
- claws_unlink(tmp);
- return -1;
- }
+ if (fprintf(fp, "From: %s <%s>\n", buf, account->address) < 0)
+ goto FILE_ERROR;
} else
- if (fprintf(fp, "From: %s\n", account->address) < 0) {
- fclose(fp);
- claws_unlink(tmp);
- return -1;
- }
+ if (fprintf(fp, "From: %s\n", account->address) < 0)
+ goto FILE_ERROR;
-
- if (fprintf(fp, "To: %s\n", to) < 0) {
- fclose(fp);
- claws_unlink(tmp);
- return -1;
- }
+ if (fprintf(fp, "To: %s\n", to) < 0)
+ goto FILE_ERROR;
/* Subject */
notification_convert_header(buf, sizeof(buf), msginfo->subject,
strlen("Subject: "));
- if (fprintf(fp, "Subject: Disposition notification: %s\n", buf) < 0) {
- fclose(fp);
- claws_unlink(tmp);
- return -1;
- }
+ if (fprintf(fp, "Subject: Disposition notification: %s\n", buf) < 0)
+ goto FILE_ERROR;
/* Message ID */
if (account->set_domain && account->domain) {
}
generate_msgid(buf, sizeof(buf), addr);
- if (fprintf(fp, "Message-ID: <%s>\n", buf) < 0) {
- fclose(fp);
- claws_unlink(tmp);
- return -1;
- }
+ if (fprintf(fp, "Message-ID: <%s>\n", buf) < 0)
+ goto FILE_ERROR;
}
boundary = generate_mime_boundary("DN");
qp_encode_line(enc_sub, (const guchar *)msginfo->subject);
g_strstrip(enc_sub);
}
- if (fprintf(fp, "MIME-Version: 1.0\n"
+ ok = fprintf(fp,"MIME-Version: 1.0\n"
"Content-Type: multipart/report; report-type=disposition-notification;\n"
" boundary=\"%s\"\n"
"\n"
orig_to?orig_to:"No To:",
account->address,
msginfo->msgid?msginfo->msgid:"NO MESSAGE ID",
- boundary) < 0) {
- fclose(fp);
- claws_unlink(tmp);
- g_free(boundary);
- return -1;
- }
+ boundary);
g_free(enc_sub);
g_free(orig_to);
g_free(date);
g_free(boundary);
+ if (ok < 0)
+ goto FILE_ERROR;
+
if (fclose(fp) == EOF) {
FILE_OP_ERROR(tmp, "fclose");
claws_unlink(tmp);
/* send it */
path = folder_item_fetch_msg(queue, num);
- ok = procmsg_send_message_queue(path, &foo, queue, num, &queued_removed);
+ ok = procmsg_send_message_queue_with_lock(path, &foo, queue, num, &queued_removed);
g_free(path);
g_free(foo);
if (ok == 0 && !queued_removed)
folder_item_remove_msg(queue, num);
return ok;
+
+FILE_ERROR:
+ fclose(fp);
+ claws_unlink(tmp);
+ return -1;
}
static gboolean find_encrypted_func(GNode *node, gpointer data)
{
gchar *text = NULL;
gchar *file;
- MimeInfo *mimeinfo, *encinfo, *brokeninfo;
+ MimeInfo *mimeinfo, *encinfo, *brokeninfo, *root;
gchar *subject = NULL;
cm_return_val_if_fail(msginfo != NULL, -1);
messageview_set_position(messageview, 0);
- textview_set_all_headers(messageview->mimeview->textview,
- messageview->all_headers);
-
#ifdef MAEMO
maemo_window_full_screen_if_needed(GTK_WINDOW(messageview->window));
#endif
noticeview_show(messageview->noticeview);
}
+ root = mimeinfo;
mimeinfo = procmime_mimeinfo_next(mimeinfo);
if (!all_headers && mimeinfo
&& (mimeinfo->type != MIMETYPE_TEXT ||
if (!mimeinfo)
mimeinfo = saved_mimeinfo;
- mimeview_show_part(messageview->mimeview,mimeinfo);
+ if (!mimeview_show_part(messageview->mimeview, mimeinfo))
+ mimeview_select_mimepart_icon(messageview->mimeview, root);
goto done;
} else if (prefs_common.invoke_plugin_on_html) {
mimeview_select_mimepart_icon(messageview->mimeview, mimeinfo);
mimeinfo = procmime_mimeinfo_next(mimeinfo);
}
}
+
+ mimeview_select_mimepart_icon(messageview->mimeview, root);
done:
/* plugins may hook in here to work with the message view */
hooks_invoke(MESSAGE_VIEW_SHOW_DONE_HOOKLIST, messageview);
static gboolean key_pressed(GtkWidget *widget, GdkEventKey *event,
MessageView *messageview)
{
- if (event && event->keyval == GDK_Escape && messageview->window) {
+ if (event && event->keyval == GDK_KEY_Escape && messageview->window) {
messageview_destroy(messageview);
return TRUE;
}
if (event && (event->state & (GDK_MOD1_MASK|GDK_CONTROL_MASK)) != 0)
return FALSE;
- if (event && (event->state & GDK_SHIFT_MASK) && event->keyval != GDK_space)
+ if (event && (event->state & GDK_SHIFT_MASK) && event->keyval != GDK_KEY_space)
return FALSE;
- g_signal_stop_emission_by_name(G_OBJECT(widget),
- "key_press_event");
- mimeview_pass_key_press_event(messageview->mimeview, event);
- return FALSE;
+ return mimeview_pass_key_press_event(messageview->mimeview, event);
}
#endif
messageview_save_as(messageview);
}
-#if defined(USE_GNOMEPRINT) || GTK_CHECK_VERSION(2,10,0)
static void print_mimeview(MimeView *mimeview, gint sel_start, gint sel_end, gint partnum)
{
-#if !defined(USE_GNOMEPRINT) && GTK_CHECK_VERSION(2,10,0)
MainWindow *mainwin;
-#endif
if (!mimeview
|| !mimeview->textview
|| !mimeview->textview->text)
gtk_text_buffer_get_iter_at_offset(buffer, &end, sel_end);
gtk_text_buffer_select_range(buffer, &start, &end);
}
-#if defined(USE_GNOMEPRINT)
- gedit_print(GTK_TEXT_VIEW(mimeview->textview->text));
-#else
/* TODO: Get the real parent window, not the main window */
mainwin = mainwindow_get_mainwindow();
printing_print(GTK_TEXT_VIEW(mimeview->textview->text),
mainwin ? GTK_WINDOW(mainwin->window) : NULL,
sel_start, sel_end);
-#endif
}
}
}
messageview_destroy(tmpview);
}
-#endif
-#if GTK_CHECK_VERSION(2,10,0) && !defined(USE_GNOMEPRINT)
static void page_setup_cb(GtkAction *action, gpointer data)
{
MessageView *messageview = (MessageView *)data;
printing_page_setup(messageview ?
GTK_WINDOW(messageview->window) : NULL);
}
-#endif
static void print_cb(GtkAction *action, gpointer data)
{
MessageView *messageview = (MessageView *)data;
-#if !defined(USE_GNOMEPRINT) && !GTK_CHECK_VERSION(2,10,0)
- gchar *cmdline = NULL;
- gchar *p;
-#else
gint sel_start = -1, sel_end = -1, partnum = 0;
-#endif
if (!messageview->msginfo) return;
-#if !defined(USE_GNOMEPRINT) && !GTK_CHECK_VERSION(2,10,0)
- cmdline = input_dialog(_("Print"),
- _("Enter the print command-line:\n"
- "('%s' will be replaced with file name)"),
- prefs_common.print_cmd);
- if (!cmdline) return;
- if (!(p = strchr(cmdline, '%')) || *(p + 1) != 's' ||
- strchr(p + 2, '%')) {
- alertpanel_error(_("Print command-line is invalid:\n'%s'"),
- cmdline);
- g_free(cmdline);
- return;
- }
- procmsg_print_message(messageview->msginfo, cmdline);
- g_free(cmdline);
-#else
partnum = mimeview_get_selected_part_num(messageview->mimeview);
textview_get_selection_offsets(messageview->mimeview->textview,
&sel_start, &sel_end);
messageview_print(messageview->msginfo, messageview->all_headers,
sel_start, sel_end, partnum);
-#endif
}
static void close_cb(GtkAction *action, gpointer data)
}
}
+static void scroll_prev_line_cb(GtkAction *action, gpointer data)
+{
+ MessageView *messageview = (MessageView *)data;
+ mimeview_scroll_one_line(messageview->mimeview,TRUE);
+}
+
+static void scroll_next_line_cb(GtkAction *action, gpointer data)
+{
+ MessageView *messageview = (MessageView *)data;
+ mimeview_scroll_one_line(messageview->mimeview,FALSE);
+}
+
+static void scroll_prev_page_cb(GtkAction *action, gpointer data)
+{
+ MessageView *messageview = (MessageView *)data;
+ mimeview_scroll_page(messageview->mimeview,TRUE);
+}
+
+static void scroll_next_page_cb(GtkAction *action, gpointer data)
+{
+ MessageView *messageview = (MessageView *)data;
+ mimeview_scroll_page(messageview->mimeview,FALSE);
+}
+
static void set_charset_cb(GtkAction *action, GtkRadioAction *current, gpointer data)
{
MessageView *messageview = (MessageView *)data;
if (messageview->updating)
return;
- messageview->all_headers =
+ messageview->all_headers = prefs_common.show_all_headers =
gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
if (!msginfo) return;
messageview->msginfo = NULL;
- messageview_show(messageview, msginfo,gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)));
+ messageview_show(messageview, msginfo, messageview->all_headers);
procmsg_msginfo_free(msginfo);
main_window_set_menu_sensitive(messageview->mainwin);
+ summary_redisplay_msg(messageview->mainwin->summaryview);
}
static void msg_hide_quotes_cb(GtkToggleAction *action, gpointer data)
return;
if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action))) {
const gchar *a_name = gtk_action_get_name(GTK_ACTION(action));
- if (!strcmp(a_name, "View/Quotes/FoldAll")) prefs_common.hide_quotes = 1;
- else if (!strcmp(a_name, "View/Quotes/Fold2")) prefs_common.hide_quotes = 2;
- else if (!strcmp(a_name, "View/Quotes/Fold3")) prefs_common.hide_quotes = 3;
+ if (!strcmp(a_name, "View/Quotes/CollapseAll")) prefs_common.hide_quotes = 1;
+ else if (!strcmp(a_name, "View/Quotes/Collapse2")) prefs_common.hide_quotes = 2;
+ else if (!strcmp(a_name, "View/Quotes/Collapse3")) prefs_common.hide_quotes = 3;
} else
prefs_common.hide_quotes = 0;
updating_menu=TRUE;
- cm_toggle_menu_set_active_full(messageview->ui_manager, "Menu/View/Quotes/FoldAll", (prefs_common.hide_quotes == 1));
- cm_toggle_menu_set_active_full(messageview->ui_manager, "Menu/View/Quotes/Fold2", (prefs_common.hide_quotes == 2));
- cm_toggle_menu_set_active_full(messageview->ui_manager, "Menu/View/Quotes/Fold3", (prefs_common.hide_quotes == 3));
+ cm_toggle_menu_set_active_full(messageview->ui_manager, "Menu/View/Quotes/CollapseAll", (prefs_common.hide_quotes == 1));
+ cm_toggle_menu_set_active_full(messageview->ui_manager, "Menu/View/Quotes/Collapse2", (prefs_common.hide_quotes == 2));
+ cm_toggle_menu_set_active_full(messageview->ui_manager, "Menu/View/Quotes/Collapse3", (prefs_common.hide_quotes == 3));
updating_menu=FALSE;
if (!msginfo) return;
if (item) {
ac = account_find_from_item(item);
if (ac && ac->protocol == A_NNTP &&
- item->stype == F_NEWS) {
+ FOLDER_TYPE(item->folder) == F_NEWS) {
compose_new(ac, item->path, NULL);
return;
}
full_msginfo->extradata &&
full_msginfo->extradata->xface) {
image = xface_get_from_header(full_msginfo->extradata->xface,
- &messageview->mainwin->summaryview->ctree->style->white,
- messageview->window->window);
+ &(gtk_widget_get_style(messageview->mainwin->summaryview->ctree)->white),
+ gtk_widget_get_window(messageview->window));
}
#endif
procmsg_msginfo_free(full_msginfo);
/* do some smart things */
if (!messageview->menubar) return;
- cm_toggle_menu_set_active_full(messageview->ui_manager, "Menu/View/Quotes/FoldAll", (prefs_common.hide_quotes == 1));
- cm_toggle_menu_set_active_full(messageview->ui_manager, "Menu/View/Quotes/Fold2", (prefs_common.hide_quotes == 2));
- cm_toggle_menu_set_active_full(messageview->ui_manager, "Menu/View/Quotes/Fold3", (prefs_common.hide_quotes == 3));
+ cm_toggle_menu_set_active_full(messageview->ui_manager, "Menu/View/Quotes/CollapseAll", (prefs_common.hide_quotes == 1));
+ cm_toggle_menu_set_active_full(messageview->ui_manager, "Menu/View/Quotes/Collapse2", (prefs_common.hide_quotes == 2));
+ cm_toggle_menu_set_active_full(messageview->ui_manager, "Menu/View/Quotes/Collapse3", (prefs_common.hide_quotes == 3));
}
void messageview_learn (MessageView *msgview, gboolean is_spam)