diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | configure.ac | 12 | ||||
-rw-r--r-- | embed/mozilla/FilePicker.cpp | 15 |
3 files changed, 28 insertions, 6 deletions
@@ -1,3 +1,10 @@ +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. + 2005-09-27 Christian Persch <chpe@cvs.gnome.org> * data/default-prefs-common.js: diff --git a/configure.ac b/configure.ac index 991c025fd..9a2180854 100644 --- a/configure.ac +++ b/configure.ac @@ -492,16 +492,16 @@ dnl Check whether to enable our filepicker component AC_MSG_CHECKING([whether to enable native gtk+ filepicker]) AC_ARG_ENABLE([filepicker], AS_HELP_STRING([--enable-filepicker],[Whether to enable the gtk+ native filepicker; not needed when the mozilla build itself has native gtk+ filepicker enabled (default:enabled)]), - [filepicker=$enableval], + [], [if test "$gecko_version_major" = "1" -a "$gecko_version_minor" -ge "8"; then - filepicker=no + enable_filepicker=no else - filepicker=yes + enable_filepicker=yes fi]) -AC_MSG_RESULT([$filepicker]) +AC_MSG_RESULT([$enable_filepicker]) -AM_CONDITIONAL([ENABLE_FILEPICKER],[test "x$filepicker" = "xyes"]) -if test "x$filepicker" = "xyes"; then +AM_CONDITIONAL([ENABLE_FILEPICKER],[test "x$enable_filepicker" = "xyes"]) +if test "x$enable_filepicker" = "xyes"; then AC_DEFINE([ENABLE_FILEPICKER],[1],[Define to enable the native filepicker]) fi 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; |