aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2005-09-28 21:31:22 +0800
committerChristian Persch <chpe@src.gnome.org>2005-09-28 21:31:22 +0800
commit135b0e0d1f8dc462f7e5d9450609685352667186 (patch)
tree60194cac7bd87f349768af7cbfb0019814cb375c /embed/mozilla
parente117b8225e399cc1a57d5c8e63782251d6b44dae (diff)
downloadgsoc2013-epiphany-135b0e0d1f8dc462f7e5d9450609685352667186.tar
gsoc2013-epiphany-135b0e0d1f8dc462f7e5d9450609685352667186.tar.gz
gsoc2013-epiphany-135b0e0d1f8dc462f7e5d9450609685352667186.tar.bz2
gsoc2013-epiphany-135b0e0d1f8dc462f7e5d9450609685352667186.tar.lz
gsoc2013-epiphany-135b0e0d1f8dc462f7e5d9450609685352667186.tar.xz
gsoc2013-epiphany-135b0e0d1f8dc462f7e5d9450609685352667186.tar.zst
gsoc2013-epiphany-135b0e0d1f8dc462f7e5d9450609685352667186.zip
Hide the filters combo if there's only the "All" filter.
2005-09-28 Christian Persch <chpe@cvs.gnome.org> * configure.ac: * embed/mozilla/FilePicker.cpp: Hide the filters combo if there's only the "All" filter.
Diffstat (limited to 'embed/mozilla')
-rw-r--r--embed/mozilla/FilePicker.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/embed/mozilla/FilePicker.cpp b/embed/mozilla/FilePicker.cpp
index 261318515..9159e72ac 100644
--- a/embed/mozilla/FilePicker.cpp
+++ b/embed/mozilla/FilePicker.cpp
@@ -435,6 +435,21 @@ NS_IMETHODIMP GFilePicker::Show(PRInt16 *_retval)
gtk_window_set_modal (GTK_WINDOW (mDialog), TRUE);
gtk_window_set_destroy_with_parent (GTK_WINDOW (mDialog), FALSE);
+ /* If there's just the "ALL" filter, it's no use showing the filters! */
+ GSList *filters = gtk_file_chooser_list_filters (GTK_FILE_CHOOSER (mDialog));
+ if (g_slist_length (filters) == 1)
+ {
+ GtkFileFilter *filter = GTK_FILE_FILTER (filters->data);
+ const char *name = gtk_file_filter_get_name (filter);
+
+ if (!name || strcmp (name, _("All files")) == 0)
+ {
+ gtk_file_chooser_remove_filter (GTK_FILE_CHOOSER (mDialog),
+ filter);
+ }
+ }
+ g_slist_free (filters);
+
gtk_widget_show (GTK_WIDGET (mDialog));
int response;