Module for printer.
List of Global Functions
DeletedNames - get list of names of deleted printers.
Detect - Autodetect printers.
Export - Export module settings to map.
Import - Import module settings.
Propose - Autoconfigure all printers that haven't been configured yet.
Read - Read settings from disk or where.
Reset - Reset all settings...
SaveQueue - Save queue
Summary - Creates summary from autodetected printers and printcap.
Write - Write settings.
addToDeleted - Adds a queue to the deleted list
adjustQueueName - Check if queue name is OK. Otherwise adds number at the end.
alreadyConfigured - Has the printer been already configured?
assignDefault - Set implicit default queue if no queue is set as default
assignState - Assign states to a printer
checkGhostscript - Check if GhostScript is installed
checkSpooler - Detect spooler currently in use
cupsRead - Read the CUPS settings.
deleteDeletedPrinters - Delete printers marked for being deleted
deletePrinter - Delete currently selected printer.
doPrinterDetection - Check if it is safe, ask user if needed, and detect local printers
editDetected - Prepare detected printer to be configured.
fixPrinter - Add unpresent entries into a map
generateClassName - generate class name
generateQueueName - TODO: create test case
getArgsOfType - separates from config map only values of specified type
getForbiddenNames - Return list(set) of names that can not be used as printer name. There can be same name for more printers in /etc/printcap. It was impossible to add printer, because all names were invalid because size (union (forbidden_names, new_names)) != size (forbidden_names) + size (new_names).
getQueueSuffix - Get the suffix for the queue name.
getUriType - Get type of currently selected printer. Just a shortcut to Printerlib::getUriType (...)
queuesRead - Old read function, called from new Read function TODO: better integrate TODO: error handling
saveDefaultQueue - Save default queue to appropriate location
savePrinters - Save all queues
selectPrinter - Select printer to edit or something.
selectPrinterByName - Let print queue named name be currently edited. If printer is not found, then queue will be $[] and index -1
setDefaultPrinter - Set current printer as default printer
setUniqueKeys - Set unique keys after configuration reading
sortPrinters - Sorts entries of printcap
spoolerSpecQueuesRead - Read queues set for spooler
stateRead - Read the contents of /var/lib/YaST2/printers
storePrinter - Save currently edited printer.
testAbort - Test for abort.
updateConfig - Update configuration if cfg. saved by previous version
wipePrinter - deletes printers
List of Global Variables
autodetected - List of autodetected printers. For documentation see yast2-lib-printer.
conf_detected - Configuring printer, which is result of detection?
confmode - Current mode of configuration `det for configuring from detected printers dialog `adm for configuring from printer administration dialog
connection_subtype_selected - Selected item from 2nd-level connection type dialog
connection_type_selected - Selected item from main connection type dialog
default_queue - Default queue name
deleted - List of printers that were deleted during this configuration session.
detect - Shall be printers detected If nil, ask user
detection - Type of start, true if autodetection
dirty - Were settings changed?
hp_driver - Driver (backend) for HP all-in-one devices, one of "ptal" and "hp"
index - Index of printer we are working with.
inform_about_config - Inform user that using different driver may be possible
printcap - List of print queues. See description of map printer for members structure.
printcap_backup - Backup list of print queues. See description of map printer for members structure.
printer - Print queue we are currently working with.
read_done - Were settings read?
runAutoprobedListDialog__current - Selected item of the list of detected printers
save_all - Has to be saved all?
skip_autodetection - True if autodetection should be skipped
tested - At least one queue has been tested - because of hw proposal
version - Version of YaST2 printer module for updates handling
write_only - Don't run SuSEconfig, don't restart services if true and possible
Export module settings to map.
Return value
map<string, any> - Map of module settings.
Save queue
Function parameters
map<string,any> queue
Return value
boolean - sucefully save
Creates summary from autodetected printers and printcap.
Function parameters
list style
Return value
string - summary string
Adds a queue to the deleted list
Function parameters
string name
string printer_type
Return value
void
Check if queue name is OK. Otherwise adds number at the end.
Function parameters
string name
list forbidden_names
Return value
string - new queue name.
Has the printer been already configured?
Function parameters
string uk
Return value
boolean - true or false
Assign states to a printer
Function parameters
map<string,any> p
boolean changed
Return value
map<string,any> - a map printer with assigned states
Check if GhostScript is installed
Return value
boolean - true if is installed
Delete printers marked for being deleted
Return value
boolean - true on success
Check if it is safe, ask user if needed, and detect local printers
Return value
boolean - true on success TODO error checking
Prepare detected printer to be configured.
Function parameters
map det
Return value
void
Add unpresent entries into a map
Function parameters
map<string,any> p
Return value
map<string,any> - modified map
generate class name
Function parameters
list forbidden_names
Return value
string - new class name
TODO: create test case
Function parameters
string name
string uri
string vendor_name
string device_name
list<string> forbidden_names
Return value
string - new queue name
separates from config map only values of specified type
Function parameters
map config
string type
Return value
map - of selected values
Return list(set) of names that can not be used as printer name. There can be same name for more printers in /etc/printcap. It was impossible to add printer, because all names were invalid because size (union (forbidden_names, new_names)) != size (forbidden_names) + size (new_names).
Return value
list<string> - a list of already used names
Get the suffix for the queue name.
Function parameters
list<map<string,any> > queues
Return value
string - suffix
Get type of currently selected printer. Just a shortcut to Printerlib::getUriType (...)
Return value
string - printer type
Old read function, called from new Read function TODO: better integrate TODO: error handling
Return value
boolean - true on success
Save default queue to appropriate location
Return value
boolean - true on success
Select printer to edit or something.
Function parameters
integer i
Return value
void
Let print queue named name be currently edited. If printer is not found, then queue will be $[] and index -1
Function parameters
string name
Return value
void
Read queues set for spooler
Return value
list<map<string,any> > - a list of queues
Read the contents of /var/lib/YaST2/printers
Return value
boolean - true on success TODO error handling
Update configuration if cfg. saved by previous version
Function parameters
integer read_version
Return value
void
Current mode of configuration `det for configuring from detected printers dialog `adm for configuring from printer administration dialog
Backup list of print queues. See description of map printer for members structure.