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

Prompt to confirm saving when file already exists #989

Closed
merilec opened this issue Mar 6, 2022 · 4 comments · Fixed by #1248
Closed

Prompt to confirm saving when file already exists #989

merilec opened this issue Mar 6, 2022 · 4 comments · Fixed by #1248
Assignees
Labels
desktop The issue applies to Windows, Linux or MacOS implementations. feature-candidate This issue might result in a feature to be implemented suggestion New feature or request

Comments

@merilec
Copy link

merilec commented Mar 6, 2022

When selecting a location and file name to save a file to (via saveFile), a file with that file name might already exist. The picker should then prompt the user to confirm saving and replace it, similar to how it is done in many other programs.

image

@merilec merilec added the suggestion New feature or request label Mar 6, 2022
@philenius philenius self-assigned this Mar 6, 2022
@philenius philenius added feature-candidate This issue might result in a feature to be implemented desktop The issue applies to Windows, Linux or MacOS implementations. labels Mar 6, 2022
@bhlin790
Copy link

bhlin790 commented Mar 3, 2023

Is there any version of this feature planned to be implemented?

@philenius
Copy link
Collaborator

@bhlin790, sorry for keeping you waiting so long. Contributing to open-source has been a low priority for me for the last 12 months.
The Linux implementation is ready. Now, I'm working on the macOS and Windows implementation.

@philenius
Copy link
Collaborator

philenius commented Mar 21, 2023

I just realized that macOS and Kubuntu (+ other Linux distributions that come with the CLI tool kdialog) always prompt the user to confirm overwriting an existing file.
image
image

Only on other Linux distributions that ship with the CLI tool zenity (e.g. Ubuntu) and on Windows, it is possible to enable/disable this additional prompt dialog when the user chooses an already existing file.

Initially, I planned to add a new parameter confirmOverwrite to FilePicker.saveFile() to enable/disable this behavior. Now that I know that we cannot control the behavior on macOS nor on Kubuntu, we could also decide to enable the confirm dialog on all platforms. Most probably it is still best to let users of our library decide which behavior they want? Even though it cannot be disabled on macOS and Kubuntu?

@miguelpruivo , @bhlin790 what would be your preferred approach?

Update: I made the decision to adapt only the Windows implementation so that it behaves identical to the macOS and Linux implementation. As we cannot enable / disable the confirmation prompt on macOS nor on some Linux distributions, it doesn't make sense to make this behavior configurable. Instead, I think it's best to make all platforms show this confirmation dialog.

@philenius
Copy link
Collaborator

Will be implemented with v5.2.7. Now, we're waiting for approval from Miguel 😉

miguelpruivo pushed a commit that referenced this issue Apr 4, 2023
…firm-overwrite-if-file-already-exists

#989: save file on Windows: prompt user for confirmation when selecting an already existing file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
desktop The issue applies to Windows, Linux or MacOS implementations. feature-candidate This issue might result in a feature to be implemented suggestion New feature or request
Projects
None yet
3 participants