300 GSList *pixbuf_formats = NULL;
302 GtkFileFilter *filter, *supported_filter;
304 supported_filter = gtk_file_filter_new ();
305 gtk_file_filter_set_name (supported_filter,
_(
"Supported Image Files"));
306 gtk_file_chooser_add_filter (chooser, supported_filter);
308 filter = gtk_file_filter_new ();
309 gtk_file_filter_set_name (filter,
_(
"All Files"));
310 gtk_file_filter_add_pattern (filter,
"*");
311 gtk_file_chooser_add_filter (chooser, filter);
313 pixbuf_formats = gdk_pixbuf_get_formats ();
315 for (iter = pixbuf_formats; iter; iter = iter->next) {
316 GdkPixbufFormat *format = iter->data;
319 if (gdk_pixbuf_format_is_disabled (format) ||
320 !gdk_pixbuf_format_is_writable (format))
323 filter = gtk_file_filter_new ();
324 name = gdk_pixbuf_format_get_description (format);
325 gtk_file_filter_set_name (filter, name);
328 g_object_set_data (G_OBJECT(filter),
"pixbuf-format", format);
329 gtk_file_chooser_add_filter (chooser, filter);
332 g_slist_free (pixbuf_formats);