summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--FL/Fl_Native_File_Chooser.H3
-rw-r--r--src/Fl_Native_File_Chooser_MAC.mm8
2 files changed, 7 insertions, 4 deletions
diff --git a/FL/Fl_Native_File_Chooser.H b/FL/Fl_Native_File_Chooser.H
index 442f03958..2ec4878f0 100644
--- a/FL/Fl_Native_File_Chooser.H
+++ b/FL/Fl_Native_File_Chooser.H
@@ -116,7 +116,8 @@ public:
NO_OPTIONS = 0x0000, ///< no options enabled
SAVEAS_CONFIRM = 0x0001, ///< Show native 'Save As' overwrite confirm dialog (if supported)
NEW_FOLDER = 0x0002, ///< Show 'New Folder' icon (if supported)
- PREVIEW = 0x0004 ///< enable preview mode
+ PREVIEW = 0x0004, ///< enable preview mode
+ USE_FILTER_EXT = 0x0008 ///< Chooser filter pilots the output file extension
};
/** Localizable message */
static const char *file_exists_message;
diff --git a/src/Fl_Native_File_Chooser_MAC.mm b/src/Fl_Native_File_Chooser_MAC.mm
index c6efb7277..1c2a874b4 100644
--- a/src/Fl_Native_File_Chooser_MAC.mm
+++ b/src/Fl_Native_File_Chooser_MAC.mm
@@ -621,9 +621,11 @@ int Fl_Native_File_Chooser::post() {
char *t = prepareMacFilter(_filt_total, _filter, _filt_patt);
popup = createPopupAccessory((NSSavePanel*)_panel, t, [[(NSSavePanel*)_panel nameFieldLabel] UTF8String], _filt_value);
delete[] t;
- [popup setAction:@selector(changedPopup:)];
- [popup setTarget:saveDelegate];
- [saveDelegate panel:(NSSavePanel*)_panel];
+ if (_options & USE_FILTER_EXT) {
+ [popup setAction:@selector(changedPopup:)];
+ [popup setTarget:saveDelegate];
+ [saveDelegate panel:(NSSavePanel*)_panel];
+ }
[(NSSavePanel*)_panel setCanSelectHiddenExtension:YES];
}
}