Skip to content

Commit

Permalink
Completed "Installable Options" support for manual setup
Browse files Browse the repository at this point in the history
After several further fixes in PAPPL it was possible to make the
support of the printer capabilities depending on installable hardware
accessories with their configuration being set on a separate web admin
interface page working.

The missing changes completed here are:

- ps_status() calls ps_driver_setup() to update the driver
  configuration, then writes back the new configuration into the
  printer data structure, and finally saves the changes into the state
  file. This needs a workaround of saving the vendor options and
  installable accessory configuration in a backup IPP structure as
  PAPPL's papplPrinterSetDriverData() function deletes the driver's
  IPP attributes. ps_status() gets called after each printer entry in
  the state file is loaded and when doing changes on the "Device
  Settings" web interface page.
- Call ps_status() from the ps_printer_web_device_config() function
  when the "Installable Options" settings got changed.
- In ps_driver_setup() only take into account conflicts of options and
  choices with the installable accessory configuration in Update Mode
  (when called via ps_status() after loading state file or changing
  accessory configuration in web interface). This way on initial setup
  of the driver (Init mode) all option choices of the PPD are added
  and so any user defaul setting from the state file is accepted,
  without yet knowing the user's accessory configuration (which is the
  last entry in the state file).
- In ps_driver_setup() make sure that in Update mode none of the user
  default settings get lost, including which media are loaded into the
  trays. If trays are (accidentally) removed via the installable
  accessory configuration settings and later re-added, the
  configuration of loaded media gets restored. Here unused
  media-col-ready slots of the driver data structure are used as
  "Undo" space.
- In ps_driver_setup() the PPD cache did not get linked in Update mode
  which caused crashes.
- Many now not needed any more TODO ("XXX") comments got removed and
  many comments explaining the new functionality got added.
- The name of the state file is in a constant now, it gets already
  used at three places.
  • Loading branch information
tillkamppeter committed Dec 22, 2020
1 parent 2809481 commit a7e2507
Showing 1 changed file with 245 additions and 82 deletions.
Loading

0 comments on commit a7e2507

Please sign in to comment.