Revision 3246 src/messageview.c

View differences:

messageview.c
908 908
	gchar *filename = NULL;
909 909
	MsgInfo *msginfo;
910 910
	gchar *src, *dest;
911
	GSList *types;
912
	gint selected_type = 0;
913
	gint result;
914
	gboolean all_headers;
911 915

  
912 916
	if (!messageview->msginfo) return;
913 917
	msginfo = messageview->msginfo;
......
919 923
	}
920 924
	subst_for_filename(filename);
921 925

  
922
	dest = filesel_save_as(filename);
926
	types = g_slist_append(NULL, _("Original (EML/RFC 822)"));
927
	types = g_slist_append(types, _("Text"));
928
	types = g_slist_append(types, _("Text (UTF-8)"));
929
	dest = filesel_save_as_type(filename, types, 0, &selected_type);
930
	g_slist_free(types);
923 931

  
924 932
	g_free(filename);
925 933
	if (!dest)
926 934
		return;
927 935

  
928
	src = procmsg_get_message_file(msginfo);
929
	if (copy_file(src, dest, TRUE) < 0) {
936
	all_headers = messageview->textview->show_all_headers;
937

  
938
	if (selected_type == 1) {
939
		result = procmsg_save_message_as_text(msginfo, dest, conv_get_locale_charset_str(), all_headers);
940
	} else if (selected_type == 2) {
941
		result = procmsg_save_message_as_text(msginfo, dest, NULL, all_headers);
942
	} else {
943
		src = procmsg_get_message_file(msginfo);
944
		result = copy_file(src, dest, TRUE);
945
		g_free(src);
946
	}
947

  
948
	if (result < 0) {
930 949
		gchar *utf8_dest;
931 950

  
932 951
		utf8_dest = conv_filename_to_utf8(dest);
......
934 953
				 g_basename(utf8_dest));
935 954
		g_free(utf8_dest);
936 955
	}
937
	g_free(src);
938 956

  
939 957
	g_free(dest);
940 958
}

Also available in: Unified diff