btzy / circuit-sandbox

GNU General Public License v3.0
3 stars 1 forks source link

File save dialog on Windows uses filename without appended extension to check for overwrite #51

Closed btzy closed 6 years ago

btzy commented 6 years ago

To reproduce:

1) Create a file called test.ccsb. 2) Open Circuit Sandbox, draw on the canvas, and click the 'Save' button. 3) Type test in the file save dialog. 4) Click 'Save' in the dialog. It does not prompt that a file will be overwritten, but test.ccsb gets overwritten anyway. (Expected: The usual overwrite prompt should be displayed.)

The prompt is displayed if we instead typed test.ccsb in the file save dialog.

This is an annoyance because Windows users expect the application to fill in the file extension before doing the overwrite check. Other Windows applications do the check correctly.

This is probably an issue with Native File Dialog. I'm not sure if this issue manifests on platforms other than Windows.

xsot commented 6 years ago

I get this bug on Linux too.

btzy commented 6 years ago

6dc94eae26ca62ee4f17e0c85726317f20ed05a9 swaps the Native File Dialog library for an extended version that I made. Native File Dialog Extended appends the extension on Windows and Mac - usual applications exhibit this behaviour on those platforms. It does not append the extension on Linux - GTK doesn't have a proper way to set this behaviour.

Updated Circuit Sandbox behaviour is to never append the extension on its own - it directly uses what is returned by Native File Dialog Extended. This resolves this issue, and extensions are automatically filled in by the platform-native dialogs on Windows and Mac.

Not sure if users expect GTK applications to fill in the extension on Linux as well.

btzy commented 6 years ago

Dialog library now also appends the file extensions for Linux (GTK) applications. Circuit Sandbox commit 127650855fbdcec2b5292e1a82106cf893d560c0 interfaces with the updated dialog library.