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. -
Root775329d[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. -
@Lensflare On windows people don't see the extension so it's the way to pick the save format
-
@BordedDev yes I know. It‘s kind of a hack. Filter abused for saving in a specific format.
-
@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.
-
@BordedDev > 'On windows people don't see the extension'
True, but only because of the default setting.
...fortunately we can turn it off.
Personally, I've understood the idea behind that one. I _want_ to see the extensions.
Never really liked the whole AutoRun, either.
'You just insert a disc into the drive && it all magically runs by itself.'
Really? Fuck, can't even click a few times, huh? -
-
@D-4got10-01 Good examples to illustrate how Windows is designed for the dumbest user possible.
-
@Lensflare The design does make sense, though.
...I would be curious how macOS does it.
Edit:
Also, I think GIMP has something similar for the Export feature. -
@D-4got10-01 checked on macOS:
For TextEdit, it opens a dialog where you can select the file name and location.
You can pick one (rather than multiple like with the filter) text format and it then appends the appropriate file extension to the file name.
But this seems to be app specific.
I also checked sublime and it just opens a file picker where I need to enter the extension myself. No format/extension picker. -
@D-4got10-01 I agree, the reason they're hidden is because otherwise people will remove them by accident and since windows doesn't use mimetypes...
-
@BordedDev I am reminded of that story I heard about someone who started organizing files...
...located on the C drive...
...into folders...
...per extension...
...didn't do well for the OS's health.
That was during the time of some early Windows, like 95 or 98.
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