gtk: get-file' and put-file' replace "*.*" filter with "*"

Closes PR 11593
This commit is contained in:
Matthew Flatt 2011-01-08 07:45:01 -07:00
parent 9ffb204682
commit 9417beb7bd
2 changed files with 9 additions and 7 deletions

View File

@ -86,8 +86,11 @@
(for ([f (in-list filters)])
(match f
[(list name glob)
(let ([ff (gtk_file_filter_new)])
(gtk_file_filter_set_name ff name)
(let ([ff (gtk_file_filter_new)]
[glob (if (equal? glob "*.*") "*" glob)])
(gtk_file_filter_set_name ff (if (equal? glob "*")
name
(format "~a (~a)" name glob)))
(gtk_file_filter_add_pattern ff glob)
(gtk_file_chooser_add_filter dlg ff))]))
(define ans (and (eq? 'accept (show-dialog dlg))

View File

@ -57,6 +57,7 @@ Under Windows and X, @scheme[filters] determines a set of filters from
which the user can choose in the dialog. Each element of the
@scheme[filters] list contains two strings: a description of the filter
as seen by the user, and a filter pattern matched against file names.
Under X, a @racket["*.*"] pattern is implicitly replaced with @racket["*"].
See also @scheme[path-dialog%].
@ -115,7 +116,7 @@ Under Windows, if @scheme[extension] is not @scheme[#f], the returned path
@scheme[extension] is used as the default extension when the user's
@scheme[filters] choice has the pattern @scheme["*.*"]. Meanwhile, the
@scheme[filters] argument has the same format and auxiliary role as for
@scheme[get-file]. In particular, if the only pattern in @scheme[filters]
@scheme[get-file]. In particular, if the only pattern in @scheme[filters]
is @scheme[(string-append "*." extension)], then the result pathname is guaranteed
to have an extension mapping @scheme[extension].
@ -136,8 +137,8 @@ Under Mac OS X versions before 10.5, the returned path will get a
@scheme[filters] contains only @scheme[(string-append "*."
extension)].
The @scheme[extension] argument is ignored under X, and
@scheme[filters] can be used to specify glob-patterns.
Under X, @racket[extension] is ignored, and @racket[filters] is used
to filter the visible list of files as in @racket[get-file].
The @scheme[style] list is treated as for @scheme[get-file].
@ -171,8 +172,6 @@ specified. The latter
``.app'') that the Finder normally displays like a file.
See also @scheme[path-dialog%].
}
@defproc[(message-box [title label-string?]