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) {
if (messageview->msginfo != msginfo) {
procmsg_msginfo_free(messageview->msginfo);
messageview->msginfo = procmsg_msginfo_get_full_info(msginfo);
+ if (!messageview->msginfo)
+ messageview->msginfo = procmsg_msginfo_copy(msginfo);
}
headerview_show(messageview->headerview, messageview->msginfo);
{
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);
}
noticeview_set_text(noticeview, _("This message asks for a return receipt."));
noticeview_set_button_text(noticeview, _("Send receipt"));
noticeview_set_button_press_callback(noticeview,
- GTK_SIGNAL_FUNC(return_receipt_send_clicked),
+ G_CALLBACK(return_receipt_send_clicked),
(gpointer) msginfo);
noticeview_show(noticeview);
}
g_free(text);
noticeview_set_button_text(noticeview, button1);
noticeview_set_button_press_callback(noticeview,
- GTK_SIGNAL_FUNC(button1_cb), (gpointer) msginfo);
+ G_CALLBACK(button1_cb), (gpointer) msginfo);
noticeview_set_2ndbutton_text(noticeview, button2);
noticeview_set_2ndbutton_press_callback(noticeview,
- GTK_SIGNAL_FUNC(button2_cb), (gpointer) msginfo);
+ G_CALLBACK(button2_cb), (gpointer) msginfo);
noticeview_show(noticeview);
}
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;
GtkItemFactory *ifactory;
GtkWidget *menuitem;
- if (!messageview && !messageview->new_window)
+ if (!messageview || !messageview->new_window)
return;
/* do some smart things */
if (!messageview->menubar) return;