Main Page · Namespace List · Alphabetical List · Class List · File List · Namespace Members · Class Members · File Members · Related Pages

GuiPrinterAutoSetup Class Reference

#include <Entwicklung/moneypenny/src/guiprinterautosetup.h>

Collaboration diagram for GuiPrinterAutoSetup:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class implements the underlying functionality of the automatic printer setup dialog. It can autodetect and setup printers and print test pages on them. Simply call the show() method and the rest is done by the class itself.
Note:
There are some signal/slots, that are directly connected to the MoneyPenny GUI ( helpRequest() , back() , showSmallHelp() , on_pushButton_help_clicked() ).
Author:
Konrad Wilhelm Kleine

Definition at line 62 of file guiprinterautosetup.h.

Public Slots

Signals

Public Member Functions

Protected Slots

Private Types

Private Member Functions

Private Attributes

Friends


Member Enumeration Documentation

enum GuiPrinterAutoSetup::WidgetFlag [private]
 

ORable bitmasks for en-/disabling widgets. You can use enableWidgets() with any combination of this widget flags. E.g.: enableWidgets(AllFlags^SaveSettingsButtonFlag); will enable all widgets of the automatic printer setup dialog except the "Save settings button".

See also:
enableWidgets()
Enumerator:
NoneFlag 
DriversFlag 
PrintersFlag 
SaveSettingsButtonFlag 
HelpButtonFlag 
RestartButtonFlag 
ManualSetupButtonFlag 
BackButtonFlag 
AllFlags 

Definition at line 293 of file guiprinterautosetup.h.


Constructor & Destructor Documentation

GuiPrinterAutoSetup::GuiPrinterAutoSetup QWidget *  parent = 0,
const char *  name = 0
 

Constructs a new printer auto setup dialog

See also:
QWidget for parameter documentation

Definition at line 63 of file guiprinterautosetup.cpp.

References back(), LPS_DB_DOCUMENT_NAME, m_domDoc, and m_translationRecommended.

GuiPrinterAutoSetup::~GuiPrinterAutoSetup  ) 
 

This destructor 'takes care' of manually allocated memory

Definition at line 78 of file guiprinterautosetup.cpp.

References m_domDoc.


Member Function Documentation

void GuiPrinterAutoSetup::back  )  [signal]
 

This signal is fired, when the user clicks on the "Back" button. It is handled by the sourrounding UI and shall bring the user back to the page that she/he visited before.

Referenced by GuiPrinterAutoSetup().

void GuiPrinterAutoSetup::enableWidgets int  wf  )  [private]
 

This method en-/disables widgets according to the appropriate bitmask.

Parameters:
wf any combination of WidgetFlag flags
See also:
WidgetFlag

Definition at line 700 of file guiprinterautosetup.cpp.

References BackButtonFlag, DriversFlag, HelpButtonFlag, ManualSetupButtonFlag, PrintersFlag, RestartButtonFlag, and SaveSettingsButtonFlag.

Referenced by on_listBox_printers_highlighted(), on_pushButton_restart_clicked(), and show().

int GuiPrinterAutoSetup::findParPortPrinters  )  [private]
 

This function finds all connected parallel port printers and shows them in the printer list box.

Returns:
the number of found parallel port printers
See also:
findUsbPrinters

Definition at line 576 of file guiprinterautosetup.cpp.

References LinuxPrinterSetup::PrinterDevice::connectionType, LinuxPrinterSetup::PrinterDevice::drivers, fixManufacturer(), PrinterSetupDb::getDrivers(), LPS_PARPORT_DEVICE_DIR, m_domDoc, m_printerMap, PrinterSetupDb::manufacturerExists(), LinuxPrinterSetup::PrinterDevice::nativeManufacturer, LinuxPrinterSetup::PrinterDevice::nativeProduct, and LinuxPrinterSetup::ParPortConnection.

Referenced by on_pushButton_restart_clicked().

Here is the call graph for this function:

int GuiPrinterAutoSetup::findUsbPrinters  )  [private]
 

This function finds all connected USB printers and shows them in the printer list box.

Returns:
the number of found USB printers
See also:
findParPortPrinters

Definition at line 477 of file guiprinterautosetup.cpp.

References LinuxPrinterSetup::PrinterDevice::connectionType, LinuxPrinterSetup::PrinterDevice::drivers, fixManufacturer(), PrinterSetupDb::getDrivers(), LPS_USB_DEVICE_PATH, m_domDoc, m_printerMap, PrinterSetupDb::manufacturerExists(), LinuxPrinterSetup::PrinterDevice::nativeManufacturer, LinuxPrinterSetup::PrinterDevice::nativeProduct, and LinuxPrinterSetup::UsbConnection.

Referenced by on_pushButton_restart_clicked().

Here is the call graph for this function:

void GuiPrinterAutoSetup::fixManufacturer QString &  manufacturer  )  [private]
 

Some PPD files are known to contain unusable manufacturer names that need to be renamed due to compatibility with the printer driver database. A famous example: Hewlett-Packard will be renamed to HP .

Parameters:
manufacturer the manufacturer name that needs to be renamed

Definition at line 728 of file guiprinterautosetup.cpp.

Referenced by findParPortPrinters(), and findUsbPrinters().

void GuiPrinterAutoSetup::helpRequest const QString &  page  )  [signal]
 

This signal is fired, when the user clicks on the "Help" button. The user will be presented with a help page where afore the printer auto setup dialog could be seen.

Parameters:
page the HTML filename of the help page to be displayed

Referenced by on_pushButton_help_clicked().

void GuiPrinterAutoSetup::on_checkBox_showAllDevices_stateChanged int  state  )  [protected, virtual, slot]
 

This slot method is called when the user clicks on the "Show all devices" check box. From now on, calls to on_pushButton_restart_clicked will effect that all devices are shown in the printers list box and not only those regarded as printers.

Parameters:
state the checkbox's state after the user has clicked on it (checked or unchecked)

Definition at line 423 of file guiprinterautosetup.cpp.

References LPS_APP_NAME, and on_pushButton_restart_clicked().

void GuiPrinterAutoSetup::on_listBox_drivers_highlighted QListBoxItem *  item  )  [protected, virtual, slot]
 

This slot method is called when the user changes the selection in the driver list box. This event enables certain features of the program like the "Save Settings" button.

Parameters:
item a pointer to the driver item that has been selected or NULL

Definition at line 249 of file guiprinterautosetup.cpp.

void GuiPrinterAutoSetup::on_listBox_printers_highlighted QListBoxItem *  item  )  [protected, virtual, slot]
 

This slot method is called when the user changes the selection in the printer list box. The reaction to this event is, that the driver list box gets filled with appropriate drivers that might work with the selected printer.

Parameters:
item a pointer to the printer item that has been selected or NULL

Definition at line 273 of file guiprinterautosetup.cpp.

References AllFlags, DriversFlag, enableWidgets(), PrinterSetupDb::getDrivers(), m_domDoc, m_printerMap, m_translationRecommended, and SaveSettingsButtonFlag.

void GuiPrinterAutoSetup::on_pushButton_driverDetails_clicked  )  [protected, virtual, slot]
 

This slot method is called when the user clicks on the push button "More Driver Information". It opens a popup with details about the selected driver.

See also:
LinuxPrinterSetup::showPrinterDriverDetails

Definition at line 446 of file guiprinterautosetup.cpp.

References m_translationRecommended, and showPrinterDriverDetails.

void GuiPrinterAutoSetup::on_pushButton_help_clicked  )  [protected, virtual, slot]
 

This slot method sends a signal to the surrounding GUI that the help page for automatic printer setup shall be displayed.

Definition at line 236 of file guiprinterautosetup.cpp.

References helpRequest().

void GuiPrinterAutoSetup::on_pushButton_manualSetup_clicked  )  [protected, virtual, slot]
 

This slot method sends a signal to the surrounding GUI that the manual printer setup dialog shall be shown

Definition at line 464 of file guiprinterautosetup.cpp.

References raiseWidget().

void GuiPrinterAutoSetup::on_pushButton_restart_clicked  )  [protected, virtual, slot]
 

This slot method is called when the user clicks on the "Restart Autodetection" button. On the other side, this method is also always called from within the show function to initialize the printer detection process.

Definition at line 354 of file guiprinterautosetup.cpp.

References AllFlags, DriversFlag, enableWidgets(), findParPortPrinters(), findUsbPrinters(), m_printerMap, NoneFlag, PrintersFlag, and SaveSettingsButtonFlag.

Referenced by on_checkBox_showAllDevices_stateChanged(), and show().

void GuiPrinterAutoSetup::on_pushButton_saveSettings_clicked  )  [protected, virtual, slot]
 

This slot method is called, when the user clicks on the "Save Settings" button. The current printer configuration is 'saved' and the user is presented with the opportunity to print a test page.

See also:
LinuxPrinterSetup::installPrinter

LinuxPrinterSetup::testPrintRequest

Definition at line 154 of file guiprinterautosetup.cpp.

References PrinterSetupDb::getModel(), installPrinter, LPS_PRINTER_NAME, m_domDoc, m_printerMap, m_translationRecommended, LinuxPrinterSetup::ParPortConnection, and testPrintRequest.

void GuiPrinterAutoSetup::raiseWidget int  widgetNumber  )  [signal]
 

This signal is fired when the user clicks on the button to switch to the manual printer setup. It is a hint at the sourrounding GUI to open the manual printer setup dialog. The widgetNumber argument will be PRINTER_MANUALSETUP_WIDGET .

Parameters:
widgetNumber an integer number that globally identifies widgets
See also:
globals.h

Referenced by on_pushButton_manualSetup_clicked().

void GuiPrinterAutoSetup::show  )  [virtual, slot]
 

Shows the widget and its child widgets. This method might take a while until it returns because the XML printer driver database is loaded and the printer detection is performed.

Definition at line 93 of file guiprinterautosetup.cpp.

References BackButtonFlag, enableWidgets(), HelpButtonFlag, LPS_DB_FILE, m_domDoc, NoneFlag, on_pushButton_restart_clicked(), and showSmallHelp().

void GuiPrinterAutoSetup::showSmallHelp const QString &  page  )  [signal]
 

This signal is fired, whenever this GUI is shown. A small help/info will be seen in the bottom left corner.

Parameters:
page the HTML filename of the help page to be displayed

Referenced by show().


Friends And Related Function Documentation

void installPrinter QWidget *  widget,
const QString &  printerName,
const QString &  deviceUri,
const QString &  ppdFilePath
[friend]
 

This function installs a printer with the name printerName , connected to the device deviceUri and the driver file ppdFilePath .

Parameters:
widget calling widget
printerName the name of the new printer on CUPS level
deviceUri the connection type already formatted for use with lpadmin
ppdFilePath the file path to the driver file
Exceptions:
LpsError if something CUPS' lpadmin command fails
Build install command string and replace the blanks in m_printername with underscores, otherwise lpadmin will fail.
Todo:
find out on which systems sudo() is really needed (SuSE is gay)

Definition at line 312 of file globalsprintersetup.cpp.

Referenced by on_pushButton_saveSettings_clicked().

void showPrinterDriverDetails const QString &  driverName  )  [friend]
 

This function tries to find the appropriate XML information file for the driverName in the filesystem. If the file exists, it's information is extracted and presentated in a message box. Such information includes detailed information of the driver capabilities.

See also:
LPS_DRIVER_DETAILS_DIR
Parameters:
driverName 
Exceptions:
LpsError if xsltproc command fails
This is how we present the XML driver information file: We pass parameters to a system call to xsltproc which does the transformation of the XML file into a displayable string.

Definition at line 187 of file globalsprintersetup.cpp.

Referenced by on_pushButton_driverDetails_clicked().

void testPrintRequest QWidget *  widget,
const QString &  printerName
[friend]
 

This function pops up a yes/no message box, that asks if one wants to print test page. If "yes" is chosen, the page is send to the printer that's supposed to actually print it. You must supply the widget from which this function is called, because it's mouse cursor is set to a sandclock/wait symbol.

See also:
LPS_TESTPAGE_PS_SRC
Parameters:
widget calling widget
printerName the name of the printer on CUPS level
Exceptions:
LpsError if something lpr command fails

Definition at line 252 of file globalsprintersetup.cpp.

Referenced by on_pushButton_saveSettings_clicked().


Member Data Documentation

PrinterSetupDb* GuiPrinterAutoSetup::m_domDoc [private]
 

a pointer to the DOM object that handles the underlying DB

Definition at line 329 of file guiprinterautosetup.h.

Referenced by findParPortPrinters(), findUsbPrinters(), GuiPrinterAutoSetup(), on_listBox_printers_highlighted(), on_pushButton_saveSettings_clicked(), show(), and ~GuiPrinterAutoSetup().

PrinterMap GuiPrinterAutoSetup::m_printerMap [private]
 

contains all printers found during autodetection

Definition at line 328 of file guiprinterautosetup.h.

Referenced by findParPortPrinters(), findUsbPrinters(), on_listBox_printers_highlighted(), on_pushButton_restart_clicked(), and on_pushButton_saveSettings_clicked().

QString GuiPrinterAutoSetup::m_translationRecommended [private]
 

Definition at line 330 of file guiprinterautosetup.h.

Referenced by GuiPrinterAutoSetup(), on_listBox_printers_highlighted(), on_pushButton_driverDetails_clicked(), and on_pushButton_saveSettings_clicked().


The documentation for this class was generated from the following files:

To get more information, please visit our project site hosted at SourceForge.net Logo
To support this project, please click on this image: Support This Project

Copyright © 2005-2006 Linux Printer Setup Documentation generated by Doxygen 1.4.4 LPS 1.0 (Disclaimer)