summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXDialog.c
diff options
context:
space:
mode:
authorculler <culler>2017-11-25 17:17:57 (GMT)
committerculler <culler>2017-11-25 17:17:57 (GMT)
commit945ce561d3f680c8fea5981211b8afd2a2dc255d (patch)
tree62bf7d27e4d5fbf30260fb520810f8a52b76dc37 /macosx/tkMacOSXDialog.c
parentf9c9a4fdced6feae7223d9187fddc4003338fd87 (diff)
downloadtk-945ce561d3f680c8fea5981211b8afd2a2dc255d.zip
tk-945ce561d3f680c8fea5981211b8afd2a2dc255d.tar.gz
tk-945ce561d3f680c8fea5981211b8afd2a2dc255d.tar.bz2
Pass nil for allowedFileTypes rather than an empty array to select all files.
Diffstat (limited to 'macosx/tkMacOSXDialog.c')
-rw-r--r--macosx/tkMacOSXDialog.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c
index b728393..97a282d 100644
--- a/macosx/tkMacOSXDialog.c
+++ b/macosx/tkMacOSXDialog.c
@@ -268,27 +268,35 @@ static NSURL *getFileURL(NSString *directory, NSString *filename) {
}
- (void)selectFormat:(id)sender {
- NSPopUpButton *button = (NSPopUpButton *)sender;
- filterInfo.fileTypeIndex = [button indexOfSelectedItem];
+ NSPopUpButton *button = (NSPopUpButton *)sender;
+ filterInfo.fileTypeIndex = [button indexOfSelectedItem];
#ifdef __clang__
NSMutableArray *allowedtypes = filterInfo.fileTypeExtensions[filterInfo.fileTypeIndex];
#else
NSMutableArray *allowedtypes = nil;
#endif
- [openpanel setAllowedFileTypes:allowedtypes];
+ if (allowedtypes && [allowedtypes count] > 0) {
+ [openpanel setAllowedFileTypes:allowedtypes];
+ } else {
+ [openpanel setAllowedFileTypes:nil];
+ }
filterInfo.userHasSelectedFilter = true;
-
}
- (void)saveFormat:(id)sender {
- NSPopUpButton *button = (NSPopUpButton *)sender;
- filterInfo.fileTypeIndex = [button indexOfSelectedItem];
+ NSPopUpButton *button = (NSPopUpButton *)sender;
+ filterInfo.fileTypeIndex = [button indexOfSelectedItem];
#ifdef __clang__
NSMutableArray *allowedtypes = filterInfo.fileTypeExtensions[filterInfo.fileTypeIndex];
#else
NSMutableArray *allowedtypes = nil;
#endif
- [savepanel setAllowedFileTypes:allowedtypes];
+ if (allowedtypes && [allowedtypes count] > 0) {
+ [savepanel setAllowedFileTypes:allowedtypes];
+ } else {
+ [savepanel setAllowedFileTypes:nil];
+ }
+ filterInfo.userHasSelectedFilter = true;
}
@end