Revision 3245 src/summaryview.c

View differences:

summaryview.c
1 1
/*
2 2
 * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3
 * Copyright (C) 1999-2012 Hiroyuki Yamamoto
3
 * Copyright (C) 1999-2013 Hiroyuki Yamamoto
4 4
 *
5 5
 * This program is free software; you can redistribute it and/or modify
6 6
 * it under the terms of the GNU General Public License as published by
......
3891 3891
	MsgInfo *msginfo = NULL;
3892 3892
	gchar *filename;
3893 3893
	gchar *src, *dest;
3894
	GSList *types;
3895
	gint selected_type = 0;
3896
	gint result;
3897
	gboolean all_headers;
3894 3898

  
3895 3899
	if (!summaryview->selected) return;
3896 3900
	if (!gtkut_tree_row_reference_get_iter
......
3908 3912
	}
3909 3913
	subst_for_filename(filename);
3910 3914

  
3911
	dest = filesel_save_as(filename);
3915
	types = g_slist_append(NULL, _("Original (EML/RFC 822)"));
3916
	types = g_slist_append(types, _("Text"));
3917
	types = g_slist_append(types, _("Text (UTF-8)"));
3918
	dest = filesel_save_as_type(filename, types, 0, &selected_type);
3919
	g_slist_free(types);
3912 3920

  
3913 3921
	g_free(filename);
3914 3922
	if (!dest)
3915 3923
		return;
3916 3924

  
3917
	src = procmsg_get_message_file(msginfo);
3918
	if (copy_file(src, dest, TRUE) < 0) {
3925
	debug_print("summary_save_as: selected_type: %d\n", selected_type);
3926

  
3927
	all_headers = summaryview->messageview->textview->show_all_headers;
3928

  
3929
	if (selected_type == 1) {
3930
		result = procmsg_save_message_as_text(msginfo, dest, conv_get_locale_charset_str(), all_headers);
3931
	} else if (selected_type == 2) {
3932
		result = procmsg_save_message_as_text(msginfo, dest, NULL, all_headers);
3933
	} else {
3934
		src = procmsg_get_message_file(msginfo);
3935
		result = copy_file(src, dest, TRUE);
3936
		g_free(src);
3937
	}
3938

  
3939
	if (result < 0) {
3919 3940
		gchar *utf8_dest;
3920 3941

  
3921 3942
		utf8_dest = conv_filename_to_utf8(dest);
......
3923 3944
				 g_basename(utf8_dest));
3924 3945
		g_free(utf8_dest);
3925 3946
	}
3926
	g_free(src);
3927 3947

  
3928 3948
	g_free(dest);
3929 3949
}

Also available in: Unified diff