From cf668bd306a6d272d6af53781324ab07838147c0 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Fri, 15 Feb 2002 23:34:13 +0000 Subject: Don't display a down-arrow if the attachment is undisplayable. Fixes bug 2002-02-15 Jeffrey Stedfast * mail-display.c (do_attachment_header): Don't display a down-arrow if the attachment is undisplayable. Fixes bug #6919. svn path=/trunk/; revision=15746 --- mail/mail-display.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'mail/mail-display.c') diff --git a/mail/mail-display.c b/mail/mail-display.c index f88c3b8924..98f083d1f1 100644 --- a/mail/mail-display.c +++ b/mail/mail-display.c @@ -893,6 +893,12 @@ do_attachment_header (GtkHTML *html, GtkHTMLEmbedded *eb, gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (button_press), part); + handler = mail_lookup_handler (eb->type); + if (handler && handler->builtin) + gtk_widget_set_sensitive (button, TRUE); + else + gtk_widget_set_sensitive (button, FALSE); + /* Drag & Drop */ gtk_drag_source_set (button, GDK_BUTTON1_MASK, drag_types, num_drag_types, @@ -905,7 +911,7 @@ do_attachment_header (GtkHTML *html, GtkHTMLEmbedded *eb, hbox = gtk_hbox_new (FALSE, 2); gtk_container_set_border_width (GTK_CONTAINER (hbox), 2); - if (mail_part_is_displayed_inline (part, md)) + if (handler && mail_part_is_displayed_inline (part, md)) arrow = gnome_stock_new_with_icon (GNOME_STOCK_PIXMAP_DOWN); else arrow = gnome_stock_new_with_icon (GNOME_STOCK_PIXMAP_FORWARD); @@ -930,12 +936,6 @@ do_attachment_header (GtkHTML *html, GtkHTMLEmbedded *eb, gtk_box_pack_start (GTK_BOX (mainbox), popup, TRUE, TRUE, 0); gtk_widget_show_all (mainbox); - handler = mail_lookup_handler (eb->type); - if (handler && handler->builtin) - gtk_widget_set_sensitive (button, TRUE); - else - gtk_widget_set_sensitive (button, FALSE); - gtk_container_add (GTK_CONTAINER (eb), mainbox); return TRUE; -- cgit