Document Design of the YaST2 Printer Configurator
Author Jan Holesovsky <kendy@suse.cz>
Id $Id: des_common.html,v 1.1.1.1 2002/06/27 08:53:19 jsrain Exp $

Desired work progress

I think, that the Printer Configurator should be implemented in this order:

  1. Common functionality (done)
  2. Parallel printers (done)
  3. USB printers (done)
  4. Serial printers
  5. Remote printers
  6. Infrared printers
  7. Deleting end editing of the printers
  8. Samba (SMB) printers
  9. NetWare (NCP) printers
  10. Direct printers
  11. Printer Access protocol (PAP) printers
  12. Internet Printing Protocol (IPP) printers

Programming language

According to the documentation, the YCP seems to be strong enough to implement the Configurator.

Autodetection

All autodetection is done by the libhd library. Details about the autodetection can be additionally found in the Possible printer connection document and in particular design documents.

Note: If the printer is already configured, the configurator shouldn't ask user (again) whether to install it.

The Printer Database

See Filter Requirements Document, section The printer Database.

The database is written as a ascii file. It is converted to the YCP using a Perl script. The structure of the YCP form is:

  1. The database is a list of manufacturer records.
  2. A manufacturer record is a map containing manufacturer's name (string), his id (string) and a product list (a list of printer records).
  3. A printer record is a map containing printer's name (string), its id (string) and a ps2printer record.
  4. A ps2printer record is a map containing a name of program that converts PostScript to the specific printer (string), rpm packages necessary for its function (a list of strings), program's necessary parameters (a list of strings) and its options (a list of option records).
  5. An option record is a map contaning a name of the option for user (string), its default value (string) and a map with possible values (where the key is the option and the value is its name).

Of course, variables should be used for common parts (usual paper sizes and so).

An example of the database:

// The YaST2 printer database
[                                      // A list of manufacturers
  $[                                   // One manufacturer
    "name" : "Hewlett-Packard",
    "1284id" : "HEWLETT-PACKARD",      // According to IEEE 1284
    "printers" : [                     // A list of products
      $[
        "name" : "HP LaserJet 5/5M",
        "1284id" : "HP_LAE238",        // According to IEEE 1284
	"ps2printer" : $[
	  "exec" : "gs",
	  "packages" : [ "gs_both", "gs_fonts", "gs_lib" ],
	  "params" : [ "-sDEVICE=ljet4" ],
	  "options" : [
	    $[
	      "name" : "Quality",
	      "default" : "-r=300x300",
	      "values" : $[
	        "-r=300x300" : "Letter quality",
		"-r=600x600" : "Letter quality 600x600 DPI"
	      ],
	    ], $[
	      "name" : "Paper size",
	      "default" : "-SIZE=a4",
	      "values" : $[
		"-SIZE=legal" : "Legal",
	        "-SIZE=a4" : "A4",
	        "-SIZE=a5" : "A5"
	      ]                        // end of values
	    ]
	  ]                            // end of options
	],                             // end of ps2printer
      ], $[
	// Another printer by HP
      ]
    ]
  ], $[
    // Epson or what...
  ]
]

Adding a printer to the spooling system

See Printer (Auto)configurator, section Adding a printer to the spooling system.

In the first step of updating of the spooling system:

Common dialog boxes

See The Printer (Auto)configurator document, section The Configuration Wizard and Filter requirements document, section The Filter Setup Tool.

The Wizard dialogs:

  1. There is no interaction with the user at this point.
  2. There is no interaction with the user at this point.
  3. Dialog box: I have found printer <printer> by <manufacturer> on <connection>. Do you want to use it in your system? Buttons: Yes, Next, Back.
  4. Dialog box: I have found a printer on <connection>, but I can't decide its type. Do you want to use it in your system? Buttons: Yes, Next, Back.
    1. Dialog box with a listbox containing possible connections (parallel, USB, serial, ...): Please, choose the printer type you want to add: Buttons: Add, Finish (instead of Next), Back. Help: Please, choose only printers you haven't already configured...
    2. This dialog box depends on the type of connection and will be described in related design documents.
    3. Printer name dialog: The name is shown. When the "Change" button is pressed, an input line appears and the user can enter the new name. Buttons: Change, Next, Back.
    4. Filter setup dialog: Two listboxes---one for the names of the options with their current values and the second one with all possible values of the currently selected option. Buttons: Test, Next, Back.
  5. Dialog box with a list of configured printers: Summary: You have configured these printers: Button: OK

Make and model dialog: Two listboxes (one for a list of manufacturers and one for his printers). Please, choose make and model of your printer. Buttons: Next, Back.