diff options
author | Devashish Sharma <dsharma@src.gnome.org> | 2006-03-05 19:04:23 +0800 |
---|---|---|
committer | Devashish Sharma <dsharma@src.gnome.org> | 2006-03-05 19:04:23 +0800 |
commit | 2759c4651d03e29448c391cd0ab390ac05dfbdba (patch) | |
tree | b9e725def08a7e7cccc9c0f7a98fa1a29e474afe /addressbook | |
parent | 79f2cd110fceb4c23507eb9f848779beedba122f (diff) | |
download | gsoc2013-evolution-2759c4651d03e29448c391cd0ab390ac05dfbdba.tar.gz gsoc2013-evolution-2759c4651d03e29448c391cd0ab390ac05dfbdba.tar.zst gsoc2013-evolution-2759c4651d03e29448c391cd0ab390ac05dfbdba.zip |
Static image preview in contact-editor image selector.
svn path=/trunk/; revision=31646
Diffstat (limited to 'addressbook')
-rw-r--r-- | addressbook/gui/contact-editor/e-contact-editor.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index 75e4cd2712..311370087c 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -2746,24 +2746,25 @@ static void update_preview_cb (GtkFileChooser *file_chooser, gpointer data) { GtkWidget *preview; - char *filename; + char *filename = NULL; GdkPixbuf *pixbuf; - gboolean have_preview; + gtk_file_chooser_set_preview_widget_active (file_chooser, TRUE); preview = GTK_WIDGET (data); filename = gtk_file_chooser_get_preview_filename (file_chooser); - if (filename == NULL) + if (filename == NULL) return; pixbuf = gdk_pixbuf_new_from_file_at_size (filename, 128, 128, NULL); - have_preview = (pixbuf != NULL); + if (!pixbuf) { + filename = e_icon_factory_get_icon_filename ("stock_person",E_ICON_SIZE_DIALOG); + pixbuf = gdk_pixbuf_new_from_file_at_size (filename, 128, 128, NULL); + } g_free (filename); gtk_image_set_from_pixbuf (GTK_IMAGE (preview), pixbuf); if (pixbuf) gdk_pixbuf_unref (pixbuf); - - gtk_file_chooser_set_preview_widget_active (file_chooser, have_preview); } static void |