Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API

From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
There should be a checkbox controlling whether or not the default extension is added to file names without it. The checkbox should be enabled by default and changing it should persist across uses of the dialog.
No need to invent behavior when the decision can be punted to the user.
To directly answer the question, I'd say B, the expected output is the filename with the extension appended. -
[A] because extension filter could have more than one extension and it would be weird if the extension was added for one entry in filter but not for multiple.
Principle of least surprise. -
Root775315d[D] Add the extension only if no extension is present in the typed file name, otherwise [A]
-
[B] seems to be the standard behavior, from what I've seen in software on Windows.
... I do like the [C] option, though. It looks tempting. -
Windows does B by default.
But I have a pet peeves with it being called "save as", because save for me means save the work I've done in this app in the format that makes sense for this app. In which case the extension is already known and you wouldn't need a filter.
In case we are taking about *exporting* to a publishing format, like PNG or such, then B is the way to go IMO. -
BordedDev173120h@Lensflare On windows people don't see the extension so it's the way to pick the save format
-
Lensflare1949319h@BordedDev yes I know. It‘s kind of a hack. Filter abused for saving in a specific format.
-
Lensflare1949319h@BordedDev besides, shouldn’t the file format be chosen before the file dialog opens?
Like first you pick the format and then the location and file name.
Why cramming everything into the file picker dialog and making it more complicated?
It‘s also easier to implement because you don’t need to check for the actually selected extension after the dialog has been confirmed to know what format to save as.
This is what I mean, it‘s just stupid. -
@BordedDev because two small, focused dialogs is better than 1 convoluted huge one.
Consider:
For a "Save As" dialog, you pipe into an external util from your application, passing in directory and an extension filter, something like `|` separated "Description (*.ext)".
Your code waits as the user picks. When they press OK, you get back a filename.
---
Quick poll:
If the user chose an extension/filter, but wrote the filename _without_ an extension, then what is the expected output?
[A] The filename as-is, no extension.
[B] The filename with the extension added, according to the selected filter, unless the filter was just "All Files (*.*)".
[C] "\1\0\0\0" and errno set to `EDEADLOCK`.
question
option c is there to fuck with you