aboutsummaryrefslogtreecommitdiffstats
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 07:59:33 +0800
commit0bc6624005e0d52a475243e9606e892d04ebe035 (patch)
tree7bd8fa67f33b6e99bece0b27ef8f9da28f0c8b5c
parent2d5f50c9b767c8c9fbd12fe5717cd379e9c5b019 (diff)
downloadgsoc2013-evolution-0bc6624005e0d52a475243e9606e892d04ebe035.tar
gsoc2013-evolution-0bc6624005e0d52a475243e9606e892d04ebe035.tar.gz
gsoc2013-evolution-0bc6624005e0d52a475243e9606e892d04ebe035.tar.bz2
gsoc2013-evolution-0bc6624005e0d52a475243e9606e892d04ebe035.tar.lz
gsoc2013-evolution-0bc6624005e0d52a475243e9606e892d04ebe035.tar.xz
gsoc2013-evolution-0bc6624005e0d52a475243e9606e892d04ebe035.tar.zst
gsoc2013-evolution-0bc6624005e0d52a475243e9606e892d04ebe035.zip
Bug 698487 - Contact Editor's Image's file chooser must show only images files
-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);