From cbd9a09e9f4972122b205c8a5d865e31df097c21 Mon Sep 17 00:00:00 2001 From: Colin Leroy Date: Sat, 18 Mar 2006 19:33:43 +0000 Subject: [PATCH] 2006-03-18 [colin] 2.0.0cvs152 * src/summaryview.c Set cursor to watch for execution (fixes lack of watch-cursor when dnd'ing hundreds of mails) * src/gtk/filesel.c Check that mime type is 'image/*' before updating the preview (maybe fix crashes on Solaris+gtk2.8.4 ?) --- ChangeLog | 9 +++++++++ PATCHSETS | 1 + configure.ac | 2 +- src/gtk/filesel.c | 21 ++++++++++++++------- src/summaryview.c | 6 +++++- 5 files changed, 30 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 33084c0e7..26374a14b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2006-03-18 [colin] 2.0.0cvs152 + + * src/summaryview.c + Set cursor to watch for execution (fixes lack + of watch-cursor when dnd'ing hundreds of mails) + * src/gtk/filesel.c + Check that mime type is 'image/*' before updating + the preview (maybe fix crashes on Solaris+gtk2.8.4 ?) + 2006-03-18 [colin] 2.0.0cvs151 * src/mainwindow.c diff --git a/PATCHSETS b/PATCHSETS index b0b2d6278..d826f3a16 100644 --- a/PATCHSETS +++ b/PATCHSETS @@ -1337,3 +1337,4 @@ ( cvs diff -u -r 1.274.2.102 -r 1.274.2.103 src/mainwindow.c; cvs diff -u -r 1.39.2.14 -r 1.39.2.15 src/mainwindow.h; cvs diff -u -r 1.1.2.17 -r 1.1.2.18 src/prefs_msg_colors.c; cvs diff -u -r 1.395.2.182 -r 1.395.2.183 src/summaryview.c; cvs diff -u -r 1.68.2.19 -r 1.68.2.20 src/summaryview.h; cvs diff -u -r 1.2.2.11 -r 1.2.2.12 src/gtk/colorlabel.c; cvs diff -u -r 1.1.4.3 -r 1.1.4.4 src/gtk/colorlabel.h; ) > 2.0.0cvs149.patchset ( cvs diff -u -r 1.213.2.86 -r 1.213.2.87 src/folder.c; ) > 2.0.0cvs150.patchset ( cvs diff -u -r 1.274.2.103 -r 1.274.2.104 src/mainwindow.c; cvs diff -u -r 1.96.2.102 -r 1.96.2.103 src/textview.c; cvs diff -u -r 1.12.2.10 -r 1.12.2.11 src/textview.h; ) > 2.0.0cvs151.patchset +( cvs diff -u -r 1.395.2.183 -r 1.395.2.184 src/summaryview.c; cvs diff -u -r 1.2.2.22 -r 1.2.2.23 src/gtk/filesel.c; ) > 2.0.0cvs152.patchset diff --git a/configure.ac b/configure.ac index 39c010f0a..9e00660ea 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ MINOR_VERSION=0 MICRO_VERSION=0 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=151 +EXTRA_VERSION=152 EXTRA_RELEASE= EXTRA_GTK2_VERSION= diff --git a/src/gtk/filesel.c b/src/gtk/filesel.c index d3ed92c48..5b92a5aa9 100644 --- a/src/gtk/filesel.c +++ b/src/gtk/filesel.c @@ -40,15 +40,16 @@ #include "gtkutils.h" #include "utils.h" #include "codeconv.h" +#include "procmime.h" #include "prefs_common.h" static void update_preview_cb (GtkFileChooser *file_chooser, gpointer data) { GtkWidget *preview; - char *filename; - GdkPixbuf *pixbuf; - gboolean have_preview; + char *filename = NULL, *type = NULL; + GdkPixbuf *pixbuf = NULL; + gboolean have_preview = FALSE; preview = GTK_WIDGET (data); filename = gtk_file_chooser_get_preview_filename (file_chooser); @@ -56,13 +57,19 @@ update_preview_cb (GtkFileChooser *file_chooser, gpointer data) if (filename == NULL) return; - pixbuf = gdk_pixbuf_new_from_file_at_size (filename, 128, 128, NULL); - have_preview = (pixbuf != NULL); + type = procmime_get_mime_type(filename); + + if (type && !strncmp(type, "image/", 6)) + pixbuf = gdk_pixbuf_new_from_file_at_size (filename, 128, 128, NULL); + + g_free(type); g_free (filename); - gtk_image_set_from_pixbuf (GTK_IMAGE (preview), pixbuf); - if (pixbuf) + if (pixbuf) { + have_preview = TRUE; + gtk_image_set_from_pixbuf (GTK_IMAGE (preview), pixbuf); gdk_pixbuf_unref (pixbuf); + } gtk_file_chooser_set_preview_widget_active (file_chooser, have_preview); } diff --git a/src/summaryview.c b/src/summaryview.c index 2ec755c18..084bcc3d1 100644 --- a/src/summaryview.c +++ b/src/summaryview.c @@ -3835,6 +3835,8 @@ gboolean summary_execute(SummaryView *summaryview) gtk_clist_freeze(clist); + main_window_cursor_wait(summaryview->mainwin); + if (summaryview->threaded) summary_unthread_for_exec(summaryview); @@ -3903,7 +3905,9 @@ gboolean summary_execute(SummaryView *summaryview) gtk_ctree_node_moveto(ctree, summaryview->selected, 0, 0.5, 0); summary_unlock(summaryview); - + + main_window_cursor_normal(summaryview->mainwin); + if (move_val < 0) summary_show(summaryview, summaryview->folder_item); return TRUE; -- 2.25.1