Skip to content

add subset of electron dialog methods#106

Open
sethvincent wants to merge 1 commit intomainfrom
dialog-methods
Open

add subset of electron dialog methods#106
sethvincent wants to merge 1 commit intomainfrom
dialog-methods

Conversation

@sethvincent
Copy link
Copy Markdown

This adds the following dialog methods to the ipc/api:

  • electron.dialog.showOpenDialog()
  • electron.dialog.showSaveDialog()
  • electron.dialog.showMessageBox()
  • electron.dialog.showErrorBox()

The main use case I have is showOpenDialog/showSaveDialog to avoid needing File System APIs and be able to easily do some localdrive->mirror-drive->hyperdrive stuff based on user input.

Otherwise it's File System API -> stream from ui to pear-end -> stream to somewhere -> ...

Unless there's another option I'm missing!

I skipped the sync methods and showCertificateTrustDialog as they seem a lot less likely to be used but could add them.

I didn't get super far because I got confused about the build process. Followed the npm pack instructions but after install never saw the methods show up. I'm clearly doing something wrong 😅

Anyway, I can make changes, add docs, etc. if this is something you're looking to add.

@geordangesink
Copy link
Copy Markdown
Contributor

@sethvincent gui/ipc.js is part of preload, same as api.js... api.js is the ui api exposed to the "frontend" when importing in an app, while gui/ipc.js is the ipc that connects from preload to main... so you need a handler in gui/gui.js (main process) and call the electron methods there.

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.

2 participants