aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook
diff options
context:
space:
mode:
authorFabiano FidĂȘncio <fidencio@redhat.com>2013-04-21 01:56:37 +0800
committerFabiano FidĂȘncio <fidencio@redhat.com>2013-04-26 08:06:29 +0800
commitbb3e7286a285213ec8c33d4b32cabce970f8b7e3 (patch)
tree7369a4a3be415ff040f9b7bd652f2a201cfa00a3 /addressbook
parentd9d67b677a7c5b9b6e7f04144131086dfec4c924 (diff)
downloadgsoc2013-evolution-bb3e7286a285213ec8c33d4b32cabce970f8b7e3.tar
gsoc2013-evolution-bb3e7286a285213ec8c33d4b32cabce970f8b7e3.tar.gz
gsoc2013-evolution-bb3e7286a285213ec8c33d4b32cabce970f8b7e3.tar.bz2
gsoc2013-evolution-bb3e7286a285213ec8c33d4b32cabce970f8b7e3.tar.lz
gsoc2013-evolution-bb3e7286a285213ec8c33d4b32cabce970f8b7e3.tar.xz
gsoc2013-evolution-bb3e7286a285213ec8c33d4b32cabce970f8b7e3.tar.zst
gsoc2013-evolution-bb3e7286a285213ec8c33d4b32cabce970f8b7e3.zip
Bug 698487 - Contact Editor's Image's file chooser must show only images files
Diffstat (limited to 'addressbook')
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c
index 0d994f8c49..a72d783095 100644
--- a/addressbook/gui/contact-editor/e-contact-editor.c
+++ b/addressbook/gui/contact-editor/e-contact-editor.c
@@ -3473,11 +3473,12 @@ static void
image_clicked (GtkWidget *button,
EContactEditor *editor)
{
- const gchar *title = _("Please select an image for this contact");
- const gchar *no_image = _("_No image");
- GtkImage *preview;
-
if (!editor->file_selector) {
+ const gchar *title = _("Please select an image for this contact");
+ const gchar *no_image = _("_No image");
+ GtkImage *preview;
+ GtkFileFilter *filter;
+
editor->file_selector = gtk_file_chooser_dialog_new (
title, GTK_WINDOW (editor->app),
GTK_FILE_CHOOSER_ACTION_OPEN,
@@ -3485,6 +3486,13 @@ image_clicked (GtkWidget *button,
GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
no_image, GTK_RESPONSE_NO,
NULL);
+
+ filter = gtk_file_filter_new ();
+ gtk_file_filter_add_mime_type (filter, "image/*");
+ gtk_file_chooser_set_filter (
+ GTK_FILE_CHOOSER (editor->file_selector),
+ filter);
+
preview = GTK_IMAGE (gtk_image_new ());
gtk_file_chooser_set_preview_widget (
GTK_FILE_CHOOSER (editor->file_selector),
@@ -3492,6 +3500,7 @@ image_clicked (GtkWidget *button,
g_signal_connect (
editor->file_selector, "update-preview",
G_CALLBACK (update_preview_cb), preview);
+
gtk_dialog_set_default_response (
GTK_DIALOG (editor->file_selector),
GTK_RESPONSE_ACCEPT);