Opened 3 years ago

Closed 2 years ago

#7813 closed defect (fixed)

Complain when multiple default openers exist for a suffix

Reported by: pett Owned by: pett
Priority: moderate Milestone:
Component: Input/Output Version:
Keywords: Cc: chimerax-programmers
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

Multiple default openers results in an arbitrary opener being used. Should also say which opener gets used in this case.

Change History (4)

comment:1 by pett, 3 years ago

Status: assignedaccepted

comment:2 by pett, 3 years ago

The current scheme where the opener declares whether it is default for a format is not workable when it might want to be default for some suffixes declared by the format (e.g. .mmcif) but not necessarily others (e.g. .cif).

So the plan is to deprecate the is_default provider attribute of openers and add a "default_for" provider attribute for formats, where the value is a list of suffixes that the format should be considered "default" for. For most formats you would not specify "default_for" for a couple of reasons. First, most suffixes corresponding to only one format, so it's superfluous. Second, if multiple formats use a suffix and there is no strong indication which one the user wants, you should let the file-opening machinery alert the user to choose a format rather than send input to an opener that has a 50% chance of being wrong / causing an error. Only suffixes that have a > 90% chance of most users wanting a particular format (e.g. .pdb, .mmcif, perhaps a few others) would be declared as "default_for" for that format.

Also there will be a command/mechanism for users to declare that a particular format should be default for a suffix, so the "default_for" attribute is just a convenience so that most users don't have to do this for certain well-known suffixes, if those suffixes are ambiguous.

comment:3 by pett, 3 years ago

Noted in the programmer's documentation that is_default is deprecated, and pointed at this ticket.

comment:4 by pett, 2 years ago

Resolution: fixed
Status: acceptedclosed

Didn't add an interface for undoing user designation of a default format, since there is only one possible such conflict right now that I know of (the obscure .nc trajectory format vs. the obscure .nc map format). Didn't seem worth adding yet another Preference tab for this. For now, the settings file would need to be nuked to undo.

Note: See TracTickets for help on using tickets.