Imported
from the mailing list archives.
I generally do not like when software is too smart and make guesses, so I
made it optional and added some logics so that it doesn't outsmart the
user:
- it has a checkbox so it can be disabled
- the initial/default value of this checkbox is coming from config
(plugins/dialogs/file_select_dialog/save_as_format_guess); it's on by
default but can be disabled e.g. from the user config. THe config is not
automatically updated from the 'save as' dialog, so changing the checkbox
there has temporary effect (intentionally). The default config value is
on, for enabling the new feature.
- it triggers only if you change the file name; it does _not_
automatically select a format when the dialog is open. This is to avoid a
corner case: when load a file from a format that mismatches the file name
and do a 'save as', it doesn't go and try to fix the format for you but
preserves the format that was learned during load. If you edit the
relevant part of the file, it will make a guess
- if you ever manually select a file format (from the combo box), it is
automatically disabled so changing the file name will not override your
manually selected format
- when it does a guess, it picks the highest priority format if multiple
formats match the file name; the file formats in the format selection
combo box are ordered by priority, from top (most preferred) to bottom,
so you can see what it would pick.
- if it is not enabled and you click on it to enable it, it automatically
makes a guess shortly after the click
- there is an explicit warning that appears right to the checkbox if
guessing fails. This is important becuse if you have a typo on the file
name, the format will be left in its last state. This label obviously can
show up temporarily if you type in some longish name, like
"foo.kicad_pcb", but once you finish typing and you have a file name that
is recognized, the warning is gone
- whenever the guess suceeds it does update the combo box, so you always
see what it picked for you