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

Show a warning prompt when closing main window #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

towerofnix
Copy link

@towerofnix towerofnix commented Dec 28, 2018

Resolves #9 by showing a warning prompt when the user tries to close the window:

A prompt dialog: "Really quit Snap? Unsaved changes will be lost!"

The main thing I'm worried about with this change is translation -- this message is hard-coded. But I don't think there's currently any way to access translations in the Snap! app, and implementing something like that would be out of the scope of this PR.

Note - this prompt shows up no matter how the window is closed - even if it's from pressing Ctrl-C at the command line. This makes development a little more involved (since you have to click "close" each time you reload). Snap! (in the browser) doesn't seem to have a condition for whether or not to warn before closing (it always warns), so we can't make use of anything like that. And Electron doesn't seem to tell us whether the event came from pressing quit or Ctrl-C - so I don't see any obvious way to make it not prompt on Ctrl-C.

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.

Show close warning like normal snap!
1 participant