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

Projects
None yet
3 participants
@brenca
Copy link
Member

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 and codebytere Oct 31, 2018

@brenca brenca requested review from as code owners Oct 31, 2018


#### `downloadItem.getSaveDialogOptions()`

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

This comment has been minimized.

Copy link
@MarshallOfSound

MarshallOfSound Nov 1, 2018

Member

Does this return the defaults if they haven't been previously set?

This comment has been minimized.

Copy link
@brenca

brenca Nov 2, 2018

Author Member

The defaults are only set after the JS callback actually runs AFAIK, so nope.

@MarshallOfSound
Copy link
Member

left a comment

Can we add a spec for get and set ?

@brenca brenca force-pushed the brenca/download-custom-title branch from 8e28c11 to ab3fc3f Nov 2, 2018

@brenca brenca force-pushed the brenca/download-custom-title branch from 12c5291 to 652afe6 Nov 6, 2018

@brenca

This comment has been minimized.

Copy link
Member Author

commented Nov 7, 2018

@@ -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

This comment has been minimized.

Copy link
@MarshallOfSound

MarshallOfSound Nov 7, 2018

Member

This can be more specific, it isn't Object rather SaveDialogOptions

@MarshallOfSound
Copy link
Member

left a comment

Looking good 👍

@jkleinsc
Copy link
Contributor

left a comment

LGTM

@jkleinsc jkleinsc merged commit ca2d74e into master Nov 8, 2018

25 of 26 checks passed

Artifact Comparison Changes Detected
Details
Absolute Zero
Semantic Pull Request ready to be squashed
Details
WIP ready for review
Details
appveyor: win-ia32-debug AppVeyor build succeeded
Details
appveyor: win-ia32-testing AppVeyor build succeeded
Details
appveyor: win-ia32-testing-pr AppVeyor build succeeded
Details
appveyor: win-x64-debug AppVeyor build succeeded
Details
appveyor: win-x64-testing AppVeyor build succeeded
Details
appveyor: win-x64-testing-pr AppVeyor build succeeded
Details
ci/circleci: linux-arm-debug Your tests passed on CircleCI!
Details
ci/circleci: linux-arm-testing Your tests passed on CircleCI!
Details
ci/circleci: linux-arm64-debug Your tests passed on CircleCI!
Details
ci/circleci: linux-arm64-testing Your tests passed on CircleCI!
Details
ci/circleci: linux-checkout Your tests passed on CircleCI!
Details
ci/circleci: linux-ia32-debug Your tests passed on CircleCI!
Details
ci/circleci: linux-ia32-testing Your tests passed on CircleCI!
Details
ci/circleci: linux-ia32-testing-tests Your tests passed on CircleCI!
Details
ci/circleci: linux-x64-debug Your tests passed on CircleCI!
Details
ci/circleci: linux-x64-testing Your tests passed on CircleCI!
Details
electron-arm-testing Build #20181107.34 succeeded
Details
electron-arm64-testing Build #20181107.34 succeeded
Details
electron-lint Build #20181107.36 succeeded
Details
electron-mas-testing Build #20181107.42 succeeded
Details
electron-osx-testing Build #20181107.45 succeeded
Details
release-notes Release notes found
@release-clerk

This comment has been minimized.

Copy link

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 Nov 8, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.