YaST2 Developers Documentation: Printer configurator

Printer configurator

misc.ycp
Miscelaneous defines.

This module has an unstable interface.

Miscelaneous defines.

Imports

  • CUPS
  • Encoding
  • Label
  • Mode
  • PackageSystem
  • Popup
  • Printer
  • Printerdb
  • Printerlib
  • Report
  • Spooler
  • Wizard

Local Functions

local GetPpdFileDescription (string nick, string language, string filename) -> string

Get description of the PPD file

Parameters:
nick string the nick name of the PPD file
language string langauge of the PPD file
filename string file name of the PPD file
Return value:
description of the PPD file
local getFoomaticAutoQueues (string vendor, string model, string ppdfile_orig) -> list<map<string,any> >

Get auto queues for printer when using foomatic database

Parameters:
vendor string vendor db key
model string model db key
ppdfile_orig string choosen ppd file, nil = auto
Return value:
a list of PPD files
local sortitems (map<string,string> items) -> list<term>

Sort items according to locale

Parameters:
items map items (item key -> item label)
Return value:
a list of items to be used for selectionbox
local adjustPaperSize (map<string,any> p) -> map<string,any>

Check if paper size is set and if not, then set the defaul Don't change if already set

Parameters:
p map of printer to adjust paper size
Return value:
a map of printer with adjusted paper size
local getConfiguredPrinters () -> list<map>

Get printers (physical devices), which are configured

Return value:
a list of printers maps (one queue of each printer)
local isPrinterConfigured (string manuf, string model, string uri, string unique_key) -> boolean

Has a printer (physical) been already configured (contains at least one queue?

Parameters:
manuf string manufacturer of the printer
model string model of the printer
uri string URI of the printer
unique_key string unique_key of the printer
Return value:
true if already configured
local CleanAndUnmountAgents () -> void

Clean and unmount agents

local reinstallAll () -> boolean

Reinstall all printing related packages using package-manager

Return value:
true if success
local getHostnames (string type) -> list<string>

Get hosts available on local network. Reads from .net.hostnames. Shows popup window: Wait please.

Parameters:
type "ipp", "samba", "lpd" or ""
Return value:
a list Sorted list of hosts.
local DeleteItem (list source, any item) -> list

Return list without item.

Parameters:
source source list
item item to delete
Return value:
List without item. If item was not present in list, list is unchanged.
local testBaudRate (integer brate) -> boolean

Displays message when baud rate is 0.

Parameters:
brate Baud rate.
Return value:
Is baud rate ok?
local checkHostName (string name) -> boolean

Is the hostname correct? Check it for allowed characters. Display message if bad hostname.

Parameters:
name Hostname to check
Return value:
true if hostname is correct.
local checkUserName (string name) -> boolean

Is the username correct? Check it for allowed characters. Display message if bad username.

Parameters:
name Username to check
Return value:
true if username is correct.
local checkPassword (string name) -> boolean

Is the password correct? Check it for allowed characters. Display message if bad password.

Parameters:
name password to check
Return value:
true if hostname is correct.
local reallyAbort () -> boolean

Ask if really abort. Uses boolean Printer::dirty. Sets boolean do_abort_now.

Return value:
true if user really wants to abort
local reallyExit () -> boolean

Ask if really exit. Uses boolean Printer::dirty. Sets boolean do_abort_now.

Return value:
true if user really wants to abort
local getDevicesItems (list<string> devices, string device) -> list

Get list of available devices in nice-names.

Parameters:
devices list of devices to show
device device that should be selected. If "" then first device will be selected.
Return value:
Items for selection box. One of the items is selected.
local printcapTable () -> list

Create the content of table of all entries in the printcap.

Return value:
List of items. Item id is index of printer in printcap.
local CheckLocalQueueName (string name, list forbidden_names) -> boolean

Is the name of local queue correct? If not, display message.

Parameters:
name string queue name
forbidden_names list of forbidden names
Return value:
true if correct
local checkRemoteQueueName (string name) -> boolean

Is the name of the remote printer correct? If not, display message.

Parameters:
name Hostname to check
Return value:
true if hostname is correct.
local checkIppQueueName (string name) -> boolean

Check IPP queue name Uses CheckQueueName, just remove leading printers/ or classes/ from the queue name before

Parameters:
name string
Return value:
correct name of remote printer
local getWidgetForOption (string option_type, list values) -> term

Creates UI widgets from values.

Parameters:
option_type string type of the option (pick_one, pick_many, boolean)
values list values
Return value:
UI representation of vals