This allows combining the capability negotiation with the application program with the user interface.
# Capability values ignored with User Interface
The recent patch to save sanner parameters from the twain user interface to the registry restores these parameters from the registry while displaying the dialog box.
Settings performed by the application program via the capabilities mechanism are thus overwritten from the registry and ignored.
So negotiated parameters are only honoured if the Twain user Interface is not being displayed. In that case _all_ old settings from the previous scan with UI displayed are ignored.
# Solution in this merge request
The TWAIN 2.4 specification says on Page 4-2 (PDF-Page 76):
``` At the time of loading the data source, all current values for the appropriate capabilities would be set to values that have either been restored from a previous session, or those that are “preferred” by the data source. This current value will remain until it has been explicitly changed by the calling application, or that application issues a MSG_RESET. ```
This is the approach choosen for this merge request:
The new function SANE_LoadOptions loads parameter values from the registry when the data source is being opened and transfers them to the sane parameter store.
The code in InitializeDialog, that loaded data from the registry, is restored to an older version and does not handle the registry at all. Instead dialog controls are filled based on the information in the SANE parameter database.
Saving changed parameters remains as before.