View Issue Details

IDProjectCategoryView StatusLast Update
0005741DarkRadiantGUIpublic02.04.2022 05:55
ReporterDragofer Assigned Togreebo  
PrioritynormalSeveritynormalReproducibilityalways
Status closedResolutionfixed 
Product Version2.13.0 
Target Version2.14.0Fixed in Version2.14.0 
Summary0005741: Model Exporter: warn if Output Format and extension in File Path don't match
DescriptionThere are seemingly 2 ways for a mapper to specify what format of model he wants to export:
- Output Format: this determines the content of the exported file.
- File Path: whatever is behind the "." here will get used as the extension of the exported file.

Usually changing the Output Format updates the extension in File Path, but not vice versa. So it's possible for these 2 to get out of sync, potentially exporting a model file that can't be used without manually correcting the extension:

A) Change or even delete the extension in File Path. The Output Format doesn't get updated to match this, or complain if an invalid extension is specified. Potentially this can result in i.e. a Lightwave model with an .ase extension.
B) Change the Output Format when there's no extension in File Path. No extension is appended to the File Path, so a model file without any extension is exported.

Potential solutions:
- warn the user that there's a mismatch after the user has clicked on OK to export.
- use Output Format for both the model type and extension. Also, stop allowing file extensions ( "." symbols) in the File Path (however, some people might have periods elsewhere in their file path, i.e. D:\games\darkmod2.09\... ?)
- let changing the extension in File Path update Output Format. However, this could still break if the mapper enters an invalid extension. This approach might need a warning message?
TagsNo tags attached.

Activities

greebo

greebo

06.09.2021 15:00

administrator   ~0014335

I can see what's going on, but I want to question whether DR should forcefully correct a user who is typing the file extension on purpose. The file entry field itself is generic and can get its input from the File Selector dialog, so I can't restrict it to not allow extensions. You can also freely select a file extension in other apps like Photoshop, without affecting what gets written to the file. (I think I've seen GIMP doing it the other way around: entering the extension determines the format.) I can also see that MS Word has gone a similar route as you suggested and tied the file extension to the format, the entry field itself is not displaying any extension. The .docx extension will always be appended, regardless what the user types. Its file selection dialog is highly customised though, DR is using the native File Selection dialogs of the various operating systems, so it cannot influence what string is returned by that dialog and written to the entry box.

What about warning the user about a file extension mismatch, so they have to confirm to proceed exporting to an unusual extension?
Dragofer

Dragofer

06.09.2021 21:14

developer   ~0014337

Sure, the main aim is that the exporter shouldn't silently do something else than what the mapper is expecting. It'd be a bonus if it were more difficult to get such a desync (i.e. update Output Format if a valid extension is typed into File Path), but as you point out there are various technical hurdles.

What may also make sense is to fix case (B). Output Format usually updates the extension in the File Path, but does nothing if there was no file extension in the File Path. But it's a minor thing.

Related Changesets

DarkRadiant: master 63781516

09.09.2021 18:12

greebo


Details Diff
0005741: Model Export dialog: Set file extension on format selection even if the entry doesn't currently have any extension. Affected Issues
0005741
mod - radiant/ui/modelexport/ExportAsModelDialog.cpp Diff File

DarkRadiant: master 523da10d

09.09.2021 18:17

greebo


Details Diff
0005741: Model Export dialog: Let the user confirm if the selected output file extension is not matching the one specified by the format Affected Issues
0005741
mod - radiant/ui/modelexport/ExportAsModelDialog.cpp Diff File

Issue History

Date Modified Username Field Change
06.09.2021 07:54 Dragofer New Issue
06.09.2021 08:01 Dragofer Description Updated
06.09.2021 15:00 greebo Status new => feedback
06.09.2021 15:00 greebo Note Added: 0014335
06.09.2021 21:14 Dragofer Note Added: 0014337
06.09.2021 21:14 Dragofer Status feedback => new
06.09.2021 21:15 Dragofer Summary Model Exporter: Output Format and extension in File Path can get out of sync => Model Exporter: warn if Output Format and extension in File Path don't match
06.09.2021 21:15 Dragofer Description Updated
09.09.2021 18:09 greebo Status new => confirmed
09.09.2021 18:17 greebo Target Version => 2.14.0
09.09.2021 18:17 greebo Assigned To => greebo
09.09.2021 18:17 greebo Status confirmed => assigned
09.09.2021 18:18 greebo Changeset attached => DarkRadiant master 63781516
09.09.2021 18:18 greebo Changeset attached => DarkRadiant master 523da10d
09.09.2021 18:18 greebo Status assigned => resolved
09.09.2021 18:18 greebo Resolution open => fixed
09.09.2021 18:18 greebo Fixed in Version => 2.14.0
02.04.2022 05:55 greebo Status resolved => closed