#include "prefs_account.h"
#include "gtkutils.h"
#include "utils.h"
-#include "rfc2015.h"
#include "send_message.h"
#include "stock_pixmap.h"
#include "hooks.h"
static void set_charset_cb (gpointer data,
guint action,
GtkWidget *widget);
+static void set_decode_cb (gpointer data,
+ guint action,
+ GtkWidget *widget);
static void view_source_cb (gpointer data,
guint action,
GtkWidget *widget);
#undef CODESET_SEPARATOR
#undef CODESET_ACTION
+#define DECODE_SEPARATOR \
+ {N_("/_View/Decode/---"), NULL, NULL, 0, "<Separator>"}
+#define DECODE_ACTION(action) \
+ NULL, set_decode_cb, action, "/View/Decode/Auto detect"
+ {N_("/_View/Decode"), NULL, NULL, 0, "<Branch>"},
+ {N_("/_View/Decode/_Auto detect"),
+ NULL, set_decode_cb, 0, "<RadioItem>"},
+ {N_("/_View/Decode/---"), NULL, NULL, 0, "<Separator>"},
+ {N_("/_View/Decode/_8bit"), DECODE_ACTION(ENC_8BIT)},
+ {N_("/_View/Decode/_Quoted printable"), DECODE_ACTION(ENC_QUOTED_PRINTABLE)},
+ {N_("/_View/Decode/_Base64"), DECODE_ACTION(ENC_BASE64)},
+ {N_("/_View/Decode/_Uuencode"), DECODE_ACTION(ENC_X_UUENCODE)},
+
+#undef DECODE_SEPARATOR
+#undef DECODE_ACTION
+
{N_("/_View/---"), NULL, NULL, 0, "<Separator>"},
{N_("/_View/Mess_age source"), NULL, view_source_cb, 0, NULL},
{N_("/_View/Show all _headers"),NULL, show_all_header_cb, 0, "<ToggleItem>"},
fprintf(fp, "Subject: Disposition notification: %s\n", buf);
/* Message ID */
- generate_msgid(account->address, buf, sizeof buf);
+ generate_msgid(buf, sizeof(buf));
fprintf(fp, "Message-ID: <%s>\n", buf);
if (fclose(fp) == EOF) {
{
gchar *filename = NULL;
MsgInfo *msginfo;
- gchar *src, *dest;
+ gchar *src, *dest, *tmp;
if (!messageview->msginfo) return;
msginfo = messageview->msginfo;
src = procmsg_get_message_file(msginfo);
if (copy_file(src, dest, TRUE) < 0) {
- alertpanel_error(_("Can't save the file `%s'."),
- g_basename(dest));
+ tmp = g_path_get_basename(dest);
+ alertpanel_error(_("Can't save the file `%s'."), tmp);
+ g_free(tmp);
}
+ g_free(dest);
g_free(src);
}
void *button2_cb = NULL;
if (!partial_msg_in_uidl_list(msginfo)) {
- /* in case it was there from previous mail */
- noticeview_hide(noticeview);
- return;
- }
-
- switch (msginfo->planned_download) {
- case POP3_PARTIAL_DLOAD_UNKN:
text = g_strdup_printf(_("This message has been partially "
- "retrieved;\nit is %s."),
- to_human_readable(
- (off_t)(msginfo->total_size)));
- button1 = _("Mark for download");
- button2 = _("Mark for deletion");
- button1_cb = partial_recv_dload_clicked;
- button2_cb = partial_recv_del_clicked;
- break;
- case POP3_PARTIAL_DLOAD_DLOAD:
- text = g_strdup_printf(_("This message has been partially "
- "retrieved;\nit is %s and will be downloaded."),
- to_human_readable(
- (off_t)(msginfo->total_size)));
- button1 = _("Unmark");
- button1_cb = partial_recv_unmark_clicked;
- button2 = _("Mark for deletion");
- button2_cb = partial_recv_del_clicked;
- break;
- case POP3_PARTIAL_DLOAD_DELE:
- text = g_strdup_printf(_("This message has been partially "
- "retrieved;\nit is %s and will be deleted."),
- to_human_readable(
- (off_t)(msginfo->total_size)));
- button1 = _("Mark for download");
- button1_cb = partial_recv_dload_clicked;
- button2 = _("Unmark");
- button2_cb = partial_recv_unmark_clicked;
- break;
- default:
- return;
+ "retrieved,\nand has been deleted from the "
+ "server."));
+ } else {
+ switch (msginfo->planned_download) {
+ case POP3_PARTIAL_DLOAD_UNKN:
+ text = g_strdup_printf(_("This message has been "
+ "partially retrieved;\nit is %s."),
+ to_human_readable(
+ (off_t)(msginfo->total_size)));
+ button1 = _("Mark for download");
+ button2 = _("Mark for deletion");
+ button1_cb = partial_recv_dload_clicked;
+ button2_cb = partial_recv_del_clicked;
+ break;
+ case POP3_PARTIAL_DLOAD_DLOAD:
+ text = g_strdup_printf(_("This message has been "
+ "partially retrieved;\nit is %s and "
+ "will be downloaded."),
+ to_human_readable(
+ (off_t)(msginfo->total_size)));
+ button1 = _("Unmark");
+ button1_cb = partial_recv_unmark_clicked;
+ button2 = _("Mark for deletion");
+ button2_cb = partial_recv_del_clicked;
+ break;
+ case POP3_PARTIAL_DLOAD_DELE:
+ text = g_strdup_printf(_("This message has been "
+ "partially retrieved;\nit is %s and "
+ "will be deleted."),
+ to_human_readable(
+ (off_t)(msginfo->total_size)));
+ button1 = _("Mark for download");
+ button1_cb = partial_recv_dload_clicked;
+ button2 = _("Unmark");
+ button2_cb = partial_recv_unmark_clicked;
+ break;
+ default:
+ return;
+ }
}
noticeview_set_text(noticeview, text);
static void select_account_cb(GtkWidget *w, gpointer data)
{
- *(gint*)data = GPOINTER_TO_INT(gtk_object_get_user_data(GTK_OBJECT(w)));
+ *(gint*)data = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(w), MENU_VAL_ID));
}
static PrefsAccount *select_account_from_list(GList *ac_list)
charset = conv_get_charset_str((CharSet)action);
g_free(messageview->forced_charset);
messageview->forced_charset = g_strdup(charset);
+ procmime_force_charset(charset);
+
+ messageview_show(messageview, messageview->msginfo, FALSE);
+ }
+}
+
+static void set_decode_cb(gpointer data, guint action, GtkWidget *widget)
+{
+ MessageView *messageview = (MessageView *)data;
+ if (GTK_CHECK_MENU_ITEM(widget)->active) {
+ messageview->forced_encoding = (EncodingType)action;
+
messageview_show(messageview, messageview->msginfo, FALSE);
+
+ debug_print("forced encoding: %d\n", action);
}
}
+
static void view_source_cb(gpointer data, guint action, GtkWidget *widget)
{
MessageView *messageview = (MessageView *)data;