Skip to content
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

Merged
merged 8 commits into from Nov 8, 2018

Conversation

brenca
Copy link
Contributor

@brenca brenca commented Oct 31, 2018

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 and defaultPath options by default).

Checklist

  • PR description included and stakeholders cc'd
  • npm test passes
  • relevant documentation is changed or added
  • PR title follows semantic commit guidelines

Release Notes

Notes: added methods to DownloadItem that enable customization of the save dialog options during will-download events

@brenca brenca requested review from nornagon, codebytere and a team October 31, 2018 12:53

#### `downloadItem.getSaveDialogOptions()`

Returns `Object` - Returns the object previously set by `downloadItem.setSaveDialogOptions(options)`.
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

@MarshallOfSound MarshallOfSound left a 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 ?

@brenca brenca force-pushed the brenca/download-custom-title branch from 8e28c11 to ab3fc3f Compare November 2, 2018 17:56
@brenca brenca force-pushed the brenca/download-custom-title branch from 12c5291 to 652afe6 Compare November 6, 2018 12:36
@brenca
Copy link
Contributor Author

brenca commented Nov 7, 2018

@MarshallOfSound done!

@@ -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
Copy link
Member

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

Copy link
Member

@MarshallOfSound MarshallOfSound left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good 👍

Copy link
Contributor

@jkleinsc jkleinsc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jkleinsc jkleinsc merged commit ca2d74e into master Nov 8, 2018
@release-clerk
Copy link

release-clerk bot commented Nov 8, 2018

Release Notes Persisted

added methods to DownloadItem that enable customization of the save dialog options during will-download events

@jkleinsc jkleinsc deleted the brenca/download-custom-title branch November 8, 2018 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants