-
Notifications
You must be signed in to change notification settings - Fork 15.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add methods to allow customization of save dialog during will-download event #15497
Conversation
docs/api/download-item.md
Outdated
|
||
#### `downloadItem.getSaveDialogOptions()` | ||
|
||
Returns `Object` - Returns the object previously set by `downloadItem.setSaveDialogOptions(options)`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this return the defaults if they haven't been previously set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The defaults are only set after the JS callback actually runs AFAIK, so nope.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a spec for get
and set
?
8e28c11
to
ab3fc3f
Compare
12c5291
to
652afe6
Compare
@MarshallOfSound done! |
docs/api/download-item.md
Outdated
@@ -88,6 +88,19 @@ Returns `String` - The save path of the download item. This will be either the p | |||
set via `downloadItem.setSavePath(path)` or the path selected from the shown | |||
save dialog. | |||
|
|||
#### `downloadItem.setSaveDialogOptions(options)` | |||
|
|||
* `options` Object - Set the save file dialog options. This object has the same |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be more specific, it isn't Object
rather SaveDialogOptions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Release Notes Persisted
|
Description of Change
This implements the request made in #15021. You can set the dialog options during the request, and those override the default values (we set the
window
,title
anddefaultPath
options by default).Checklist
npm test
passesRelease Notes
Notes: added methods to
DownloadItem
that enable customization of the save dialog options duringwill-download
events