evolution r37250 - branches/kill-bonobo/mail



Author: mbarnes
Date: Thu Feb 12 04:13:26 2009
New Revision: 37250
URL: http://svn.gnome.org/viewvc/evolution?rev=37250&view=rev

Log:
Make saving attachments work.


Modified:
   branches/kill-bonobo/mail/em-format-html-display.c
   branches/kill-bonobo/mail/em-utils.c

Modified: branches/kill-bonobo/mail/em-format-html-display.c
==============================================================================
--- branches/kill-bonobo/mail/em-format-html-display.c	(original)
+++ branches/kill-bonobo/mail/em-format-html-display.c	Thu Feb 12 04:13:26 2009
@@ -2158,19 +2158,23 @@
 {
 	GSList *attachment_parts;
 	guint n_attachment_parts;
+	gpointer parent;
 
 	attachment_parts = e_attachment_bar_get_parts (
 		E_ATTACHMENT_BAR (efhd->priv->attachment_bar));
 	n_attachment_parts = g_slist_length (attachment_parts);
 	g_return_if_fail (n_attachment_parts > 0);
 
+	parent = gtk_widget_get_toplevel (widget);
+	parent = GTK_WIDGET_TOPLEVEL (parent) ? parent : NULL;
+
 	if (n_attachment_parts == 1)
 		em_utils_save_part (
-			widget, _("Save attachment as"),
+			parent, _("Save attachment as"),
 			attachment_parts->data);
 	else
 		em_utils_save_parts (
-			widget, _("Select folder to save all attachments"),
+			parent, _("Select folder to save all attachments"),
 			attachment_parts);
 
         g_slist_free (attachment_parts);

Modified: branches/kill-bonobo/mail/em-utils.c
==============================================================================
--- branches/kill-bonobo/mail/em-utils.c	(original)
+++ branches/kill-bonobo/mail/em-utils.c	Thu Feb 12 04:13:26 2009
@@ -398,7 +398,7 @@
 	const gchar *utf8_filename;
 	gchar *uri = NULL, *filename;
 
-	g_return_if_fail (GTK_IS_WINDOW (parent));
+	g_return_if_fail (parent == NULL || GTK_IS_WINDOW (parent));
 
 	utf8_filename = emu_save_get_filename_for_part (part);
 	filename = g_filename_from_utf8 (utf8_filename, -1, NULL, NULL, NULL);
@@ -515,6 +515,8 @@
 	gchar *path_uri;
 	GSList *iter, *file_names, *iter_file;
 
+	g_return_if_fail (parent == NULL || GTK_IS_WINDOW (parent));
+
 	file_chooser = e_file_get_save_filesel (
 		parent, prompt, NULL, GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]