*UIConstraints: *Option1 *Option0 value6 *UIConstraints: *Option1 *Option0 value7 *OpenUI *Option0/drivers (using macro 'bjc6100'): PickOne *DefaultOption0: value0 *Option0 value0/monochrome or color driver 'bjc600' at '360x360' dpi: "" *Option0 value6/color driver 'uniprint' at '360x360' dpi (using 'bjc6000a1.upp'): "" *Option0 value7/color driver 'uniprint' at '720x720' dpi (using 'bjc6000b1.upp'): "" *CloseUI: *Option0 *OpenUI *Option1/'bits per pixel' settings for the driver 'bjc600': PickOne *DefaultOption1: value1 *Option1 value1/monochrome printing (using '-dBitsPerPixel=1'): "" *Option1 value2/color printing (using '-dBitsPerPixel=8'): "" *CloseUI: *Option1Constraints say that that Option1 can not be used when Option0 value6 or Option0 value7 is used. Hence Option1 can be used only if Option0 value0 is selected. Option1 is suboption of Option0 value0.
Note: The complete development documentation is available in the autodocs/ directory.
Read (.cups.printers) --> list of printers Write (.cups.printers, list) |
Read (.cups.classes) --> list of classes Write (.cups.classes, list) |
List of printers | List of classes |
[ $[ "Name" : <string>, // printer name "Info" : <string>, "Location" : <string>, "Uri" : <string>, "State" : <string>, "StateMessage" : <string>, "Accepting" : <boolean>, "BannerStart" : <string>, "BannerEnd" : <string>, "AllowUsers" : [ <string> , <string> , ... ], "DenyUsers" : [ <string> , <string> , ... ], "ppd" : <string>, "options" : $[ <string> : <string> , ... ] ], ... ]; |
.cups.classes [ $[ "Name" : <string>, // class name "Info" : <string>, "Location" : <string>, "State" : <string>, "StateMessage" : <string>, "Accepting" : <boolean>, "BannerStart" : <string>, "BannerEnd" : <string>, "Printers" : [ <string> , <string> , ... ], "AllowUsers" : [ <string> , <string> , ... ], "DenyUsers" : [ <string> , <string> , ... ], "ppd" : <string>, "options" : $[ <string> : <string> , ... ] ], ... ]; |
if (SCR (`Read (.cups.ppd.changed))) SCR (`Write (.cups.ppd.createdb, true)); map printers_db = SCR (`Read (.target.ycp, "/var/lib/YaST2/ppd_db.ycp"));Example of database:
$[ "VENDOR" : $[ "MODEL" : $[ // drivers for that model "model nick" : [ "ppd file name", "1284 vendor id", "1284 model id" ] ] ], "CANON" : $[ "BJC-6100" : $[ "Canon BJC-6100, Foomatic + stp-4.0" : [ "/usr/share/cups/model/Canon/BJC-6100-stp.ppd", "", "" ], "Canon BJC-6100, SuSE" : [ "/usr/share/cups/model/suse/Canon/BJC-6100.ppd", "Canon", "BJC-6100" ] ] ], ]Options
$[ "charset" : string, // isolatin2, ... "ppd" : // list of options [ $[ "name" : "Readable name of option", "option" : "optionname", "default" : "optionname of default option", "marked" : "optionname of currently marked option", "type" : "boolean" | "pickone" | "pickmany", $[ "valuename" : _("Readable name of value"), "valuename" : _("..."), // there may be suboptions "valuename:sub" : [ //list of options (suboptions) ], ... ], ], ... ] ];We do not need Write because we do diff of currently marked options to defaults and we get map $[ value: option, ...] which we will save to printer/class: "options". Common options
[ // list of options $[ "name" : _("Readable name of option"), "option" : "optionname", "default" : "optionname of default option", "marked" : "optionname of currently marked option", "type" : "boolean" | "pickone" | "pickmany", $[ "valuename" : _("Readable name of value"), "valuename" : "...", // in theory there may be suboptions too but there are none "valuename:sub" : [ //list of options (suboptions) ], ... ], ], $[ "name" : "Readable name of option", "option" : "optionname", "default" : "optionname of default option", "marked" : "optionname of currently marked option", "type" : "slider" | "int", "lowermargin" : integer, "uppermargin" : integer, ], $[ "name" : "Readable name of option", "option" : "optionname", "default" : "optionname of default option", "marked" : "optionname of currently marked option", "type" : "yseno", ], ... ];We do not need Write because we do diff of currently marked options to defaults and we get map $[ value: option, ...] which we will save to printer/class: "options".
Path | Type | Result |
---|---|---|
.cups.printers | YCPList | all printers |
.cups.classes | YCPList | all classes |
.cups.default_dest | YCPString | default destination |
.cups.ppd.changed | YCPBoolean | has ppd db changed since last creation? |
.cups.ppd.options | YCPMap | options |
.cups.ppd.common_options | YCPMap | common options |
Path | Result |
---|---|
.cups.printers | all printers |
.cups.classes | all classes |
.cups.default_dest | default destination |
.cups.ppd.createdb | triggers db breation |