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

Allow confirmation when user opts to replace existing file for export or save as - p1 #17

Closed
ghost opened this issue Apr 8, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@ghost
Copy link

ghost commented Apr 8, 2021

The JavaFX FileChooser provides build-in functionality to confirm replacing a file. Porting this behaviour would be useful. This relates to #7 (comment)

For example:

  1. Open File chooser in "SAVE AS" or "EXPORT" mode as per comment (e.g., FileAccess.SAVE_AS, or FileAccess.EXPORT)
  2. Double-click a file
  3. File chooser opens a "Confirmation Dialog"
  4. Confirmation Dialog prompts user to overwrite (has OK and Cancel buttons, as per ButtonBar order)
  5. Click OK for Confirmation Dialog to close, File chooser to close, and then return selected file name; or
  6. Click Cancel (or press Esc, or click "X" in dialog window) to close Confirmation Dialog but keep File chooser dialog open
@ghost ghost changed the title Allow confirmation when user opts to replace existing file for export or save as Allow confirmation when user opts to replace existing file for export or save as - p1 Apr 9, 2021
@io7m
Copy link
Owner

io7m commented Apr 9, 2021

I've generally been handling this in the application itself, because this kind of code is subject to "time of check, time of use" issues. I suppose it's harmless enough to perform an extra check in the dialog, but I'd like a way to opt-out.

@io7m io7m self-assigned this Apr 11, 2021
@ghost ghost added the enhancement New feature or request label Apr 11, 2021
io7m added a commit that referenced this issue May 1, 2021
This implements two APIs:

  * An API for requiring the confirmation of selections
    of existing files when the chooser is in CREATE
    mode.

  * An API for providing overrides of button strings.

Affects: #17
Affects: #7
@io7m
Copy link
Owner

io7m commented May 2, 2021

Completed as of 1c8fcbb.

@io7m io7m closed this as completed May 2, 2021
io7m added a commit that referenced this issue May 18, 2021
Release: com.io7m.jwheatsheaf 3.0.0

A big thanks to @DaveJarvis for suggestions, bug reports, and some
code contributions!

Change: Add the ability to specify custom strings (Ticket: #7)
Change: Add the ability to confirm file selections (Ticket: #17)
Change: Allow for including ".." in directory listings (Ticket: #23)
Change: Improve "select directly" dialog behaviour (Ticket: #29)
Change: Fix the size formatter (Ticket: #30)
Change: Use the default filesystem by default (Ticket: #21)
Change: Add support for glob-based filters (Ticket: #19)
Change: Improve filename field behaviour (Ticket: #28)
Change: Add an optional home directory button (Ticket: #12)
Change: Enable sorting of directory items (Ticket: #22)
Change: Allow for setting a default file filter (Ticket: #9)
Change: Allow the escape key to close file choosers (Ticket: #14)
Change: Allow for specifying an initial filename in choosers (Ticket: #15)
Change: Allow for specifying custom dialog titles (Ticket: #8)
Change: Make the default filters part of the public API (Ticket: #10)
io7m added a commit that referenced this issue May 18, 2021
Release: com.io7m.jwheatsheaf 3.0.0

A big thanks to @DaveJarvis for suggestions, bug reports, and some
code contributions!

Change: Add the ability to specify custom strings (Ticket: #7)
Change: Add the ability to confirm file selections (Ticket: #17)
Change: Allow for including ".." in directory listings (Ticket: #23)
Change: Improve "select directly" dialog behaviour (Ticket: #29)
Change: Fix the size formatter (Ticket: #30)
Change: Use the default filesystem by default (Ticket: #21)
Change: Add support for glob-based filters (Ticket: #19)
Change: Improve filename field behaviour (Ticket: #28)
Change: Add an optional home directory button (Ticket: #12)
Change: Enable sorting of directory items (Ticket: #22)
Change: Allow for setting a default file filter (Ticket: #9)
Change: Allow the escape key to close file choosers (Ticket: #14)
Change: Allow for specifying an initial filename in choosers (Ticket: #15)
Change: Allow for specifying custom dialog titles (Ticket: #8)
Change: Make the default filters part of the public API (Ticket: #10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant