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

GuiPrinterManualSetup Class Reference

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

Collaboration diagram for GuiPrinterManualSetup:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class implements the underlying functionality of the manual printer setup dialog. It can setup a printer 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:
Jens Lukowski

Definition at line 53 of file guiprintermanualsetup.h.

Public Slots

Signals

Public Member Functions

Protected Slots

Private Types

Private Member Functions

Private Attributes

Friends


Member Enumeration Documentation

enum GuiPrinterManualSetup::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 manual printer setup dialog except the "Save settings button".

See also:
enableWidgets()
Enumerator:
NoneFlag 
ManufacturersFlag 
ModelsFlag 
DriversFlag 
DetailsFlag 
PortsFlag 
SaveSettingsFlag 
AllFlags 

Definition at line 259 of file guiprintermanualsetup.h.


Constructor & Destructor Documentation

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

Constructs a new printer manual setup dialog.

See also:
QWidget for parameter documentation

Definition at line 60 of file guiprintermanualsetup.cpp.

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

GuiPrinterManualSetup::~GuiPrinterManualSetup  ) 
 

This destructor 'takes care' of manually allocated memory.

Definition at line 73 of file guiprintermanualsetup.cpp.

References m_db.


Member Function Documentation

void GuiPrinterManualSetup::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 GuiPrinterManualSetup().

void GuiPrinterManualSetup::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 88 of file guiprintermanualsetup.cpp.

References DetailsFlag, DriversFlag, ManufacturersFlag, ModelsFlag, PortsFlag, and SaveSettingsFlag.

Referenced by on_comboBox_ports_activated(), on_listBox_drivers_highlighted(), on_listBox_manufacturers_highlighted(), on_listBox_models_highlighted(), and show().

void GuiPrinterManualSetup::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 GuiPrinterManualSetup::on_comboBox_ports_activated const QString &  itemtext  )  [protected, virtual, slot]
 

This slot is called if comboBox_ports is activated. It enables the pushButton_saveSettings.

Parameters:
itemtext The selected text in the comboBox_ports as QString.

Definition at line 402 of file guiprintermanualsetup.cpp.

References AllFlags, enableWidgets(), and SaveSettingsFlag.

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

This slot is called if an item in listBox_drivers is highlighted. It fills the comboBox_ports with the on this machine founded ports to connect a printer.

Parameters:
item The highlighted item in listBox_drivers.

Definition at line 219 of file guiprintermanualsetup.cpp.

References AllFlags, enableWidgets(), and SaveSettingsFlag.

void GuiPrinterManualSetup::on_listBox_manufacturers_highlighted QListBoxItem *  item  )  [protected, virtual, slot]
 

This slot is called if an item in listBox_manufacturers is highlighted. It fills the listBox_models with the associated models outof the database.

Parameters:
item The highlighted item in listBox_manufacturers.

Definition at line 115 of file guiprintermanualsetup.cpp.

References AllFlags, DetailsFlag, DriversFlag, enableWidgets(), PrinterSetupDb::getModels(), m_db, ModelsFlag, PortsFlag, and SaveSettingsFlag.

void GuiPrinterManualSetup::on_listBox_models_highlighted QListBoxItem *  item  )  [protected, virtual, slot]
 

This slot is called if an item in listBox_models is highlighted. It fills the listBox_drivers with the associated drivers outof the database.

Parameters:
item The highlighted item in on_listBox_models.

Definition at line 158 of file guiprintermanualsetup.cpp.

References AllFlags, DetailsFlag, DriversFlag, enableWidgets(), PrinterSetupDb::getDriversByModel(), m_db, m_translationRecommended, PortsFlag, and SaveSettingsFlag.

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

This slot is called when the user clicks on pushButton_driverDetails ("More Driver Information"). It opens a popup with details about the selected driver.

Definition at line 423 of file guiprintermanualsetup.cpp.

References m_translationRecommended, and showPrinterDriverDetails.

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

This slot calls the right help page for manual printer setup.

Definition at line 249 of file guiprintermanualsetup.cpp.

References helpRequest().

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

This slot is called, when the user clicks on the "Save Settings" button. Then the current printer configuration is saved and the user may decide whether to print a test page or not.

Exceptions:
LpsNotice if no printername is given.
LpsError if the driver element is null.

Definition at line 263 of file guiprintermanualsetup.cpp.

References PrinterSetupDb::getDriverByModel(), installPrinter, m_db, m_translationRecommended, and testPrintRequest.

void GuiPrinterManualSetup::readPorts  )  [private]
 

Reads the ports using lpinfo and puts the results into comboBoxPorts.

Exceptions:
LpsError if the ports could not be read

Definition at line 442 of file guiprintermanualsetup.cpp.

References LinuxPrinterSetup::sudo().

Referenced by show().

Here is the call graph for this function:

void GuiPrinterManualSetup::show  )  [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.

Exceptions:
LpsError if the xml db could not been opened
LpsError if the content of the databes could not been set

Definition at line 324 of file guiprintermanualsetup.cpp.

References enableWidgets(), PrinterSetupDb::getManufacturers(), LPS_DB_FILE, LPS_PRINTER_NAME, m_db, ManufacturersFlag, NoneFlag, readPorts(), and showSmallHelp().

void GuiPrinterManualSetup::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* GuiPrinterManualSetup::m_db [private]
 

A pointer to a QDom document for our database.

Definition at line 274 of file guiprintermanualsetup.h.

Referenced by GuiPrinterManualSetup(), on_listBox_manufacturers_highlighted(), on_listBox_models_highlighted(), on_pushButton_saveSettings_clicked(), show(), and ~GuiPrinterManualSetup().

QString GuiPrinterManualSetup::m_translationRecommended [private]
 

The translation of the word "recommended". Set on show.

Definition at line 280 of file guiprintermanualsetup.h.

Referenced by GuiPrinterManualSetup(), on_listBox_models_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)