You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A Choose dialog is just like an Open dialog, but not only does it have a custom title, it also has a custom name for the “Open” button. Two examples where it is helpful:
choosing a directory where downloaded files should be saved – you “Choose” the directory
using a dialog to “Import” a file in a different format, not to “Open” a file in your app’s format
The simplest way to support it would be accepting another option in the options parameter of dialog.showOpenDialog. The property name would be something like buttonLabel, openButtonLabel, or prompt (which is OS X’s name for it). The property should contain a string that the button will be renamed to.
And also change SetupDialog and its callers to pass prompt in, which would be extracted from the options of showOpenDialog.
I can imagine that this might be useful for Save dialogs, too – you could change the button to “Save As” or “Export” instead of “Save”. You can probably implement it for dialog.showSaveDialog in exactly the same way as for showOpenDialog. It would make sense that users could pass the same option to customize the button, since those two functions already support mostly the same options.
The text was updated successfully, but these errors were encountered:
I also have a similar use-case, I want to save multiple files to a directory. Currently using showOpenDialog with the openDirectory property which works fine but the action button on the dialog says 'Open' which is confusing for the user as the app is performing a 'Save' operation.
Haha wow didn't realize both @jstejada and I had both filed dups about this. Guess it's about time for a fix! I'll submit a PR when I get time next week.
A Choose dialog is just like an Open dialog, but not only does it have a custom title, it also has a custom name for the “Open” button. Two examples where it is helpful:
It is used in OS X apps: OS X Human Interface Guidelines – The Choose Dialog. I don’t know if other platforms have an equivalent.
The simplest way to support it would be accepting another option in the
options
parameter ofdialog.showOpenDialog
. The property name would be something likebuttonLabel
,openButtonLabel
, orprompt
(which is OS X’s name for it). The property should contain a string that the button will be renamed to.To implement this for OS X, you just need to add this code to
SetupDialog
infile_dialog_mac.mm
:And also change
SetupDialog
and its callers to passprompt
in, which would be extracted from theoptions
ofshowOpenDialog
.I can imagine that this might be useful for Save dialogs, too – you could change the button to “Save As” or “Export” instead of “Save”. You can probably implement it for
dialog.showSaveDialog
in exactly the same way as forshowOpenDialog
. It would make sense that users could pass the same option to customize the button, since those two functions already support mostly the same options.The text was updated successfully, but these errors were encountered: