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

GuiPrinterDriverToXml Class Reference

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

Collaboration diagram for GuiPrinterDriverToXml:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class implements the underlying functionality of the printer driver to xml dialog. It provides means for parsing of PPD files saving the collected information to a file.

Author:
Konrad Wilhelm Kleine

Definition at line 53 of file guiprinterdrivertoxml.h.

Public Slots

Signals

Public Member Functions

Protected Slots

Private Types

Private Member Functions

Private Attributes


Member Enumeration Documentation

enum GuiPrinterDriverToXml::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 
ProgressFlag 
BuildFlag 
SaveFlag 
AllFlag 

Definition at line 222 of file guiprinterdrivertoxml.h.


Constructor & Destructor Documentation

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

Constructs a new printer driver 2 xml gui

Parameters:
parent a pointer to the parent widget
name the name of the widget
See also:
QWidget

Definition at line 63 of file guiprinterdrivertoxml.cpp.

References BuildFlag, enableWidgets(), LPS_CUPS_MODEL_DIR_DEFAULT, m_CupsModelDir, m_domDoc, and NoneFlag.

Here is the call graph for this function:

GuiPrinterDriverToXml::~GuiPrinterDriverToXml  ) 
 

This destructor takes care of manually allocated memory.

Definition at line 77 of file guiprinterdrivertoxml.cpp.

References m_domDoc.


Member Function Documentation

void GuiPrinterDriverToXml::addDriver const PpdInfo drv  )  [private]
 

Adds a driver to the internal XML DOM database.

Parameters:
drv the driver structure

Definition at line 504 of file guiprinterdrivertoxml.cpp.

References PrinterSetupDb::getDriverByModel(), PrinterSetupDb::getManufacturer(), PrinterSetupDb::getModel(), LinuxPrinterSetup::ppd_info::languageVersion, m_domDoc, LinuxPrinterSetup::ppd_info::manufacturer, LinuxPrinterSetup::ppd_info::modelName, LinuxPrinterSetup::ppd_info::nickName, LinuxPrinterSetup::ppd_info::ppdFilePath, and LinuxPrinterSetup::ppd_info::product.

Referenced by parseFile().

Here is the call graph for this function:

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

void GuiPrinterDriverToXml::closeEvent QCloseEvent *  e  )  [slot]
 

This slot method is called when the widget recieves a close signal. Eventually running build processes are aborted!

Definition at line 108 of file guiprinterdrivertoxml.cpp.

References on_pushButton_abort_clicked().

void GuiPrinterDriverToXml::enableWidgets int  wf  )  [private]
 

This method enables widgets according to the appropriate bitmask.

Parameters:
wf see WidgetFlag for orable widget flags

Definition at line 557 of file guiprinterdrivertoxml.cpp.

References BuildFlag, ProgressFlag, and SaveFlag.

Referenced by GuiPrinterDriverToXml(), on_pushButton_abort_clicked(), and on_pushButton_build_clicked().

void GuiPrinterDriverToXml::logMessage const QString &  msg,
bool  isError = false
[private]
 

This method is called when at some state some program part wants to report something. It appends the message to the log widget.

Parameters:
msg the message to log
isError whether the message is an error or not

Definition at line 262 of file guiprinterdrivertoxml.cpp.

Referenced by on_pushButton_build_clicked(), on_pushButton_save_clicked(), parseFile(), show(), and traverseDir().

void GuiPrinterDriverToXml::on_pushButton_abort_clicked  )  [protected, virtual, slot]
 

This slot method is called, when the user clicks on the abort button to abort the building of the XML db and it does what says.

Definition at line 215 of file guiprinterdrivertoxml.cpp.

References BuildFlag, enableWidgets(), m_buildCanceled, and NoneFlag.

Referenced by closeEvent(), and on_pushButton_back_clicked().

void GuiPrinterDriverToXml::on_pushButton_back_clicked  )  [protected, virtual, slot]
 

This slot method is called, when the user clicks on the back button to return to the main program. (This is MoneyPenny specific)

Definition at line 225 of file guiprinterdrivertoxml.cpp.

References back(), and on_pushButton_abort_clicked().

void GuiPrinterDriverToXml::on_pushButton_browseCupsDir_clicked  )  [protected, virtual, slot]
 

This slot method pops up a file dialog for setting the CUPS model directory. You should select a directory that contains folders of printer manufacturers (e.g. Alps, HP, ...). One of the most common folders on Debian/Ubuntu is: /usr/share/cups/model/ Until we haven't found a mechanism to determine a this path automatically, you must find it yourself if you have other distributions.

Todo:
automatically determine the path to the CUPS model dir

Definition at line 195 of file guiprinterdrivertoxml.cpp.

References LPS_CUPS_MODEL_DIR_DEFAULT.

void GuiPrinterDriverToXml::on_pushButton_browseSavePath_clicked  )  [protected, virtual, slot]
 

This slot method pops up a file dialog for setting the save path of the XML db. If the file you select or enter does not exist, it will be created on-the-fly.

Definition at line 170 of file guiprinterdrivertoxml.cpp.

void GuiPrinterDriverToXml::on_pushButton_build_clicked  )  [protected, virtual, slot]
 

This slot method is called, when the user clicks on the "Build" button. It initiates the parsing of all PPD files located under the previously set CUPS model directory.

Definition at line 120 of file guiprinterdrivertoxml.cpp.

References AllFlag, BuildFlag, enableWidgets(), logMessage(), LPS_DB_DOCUMENT_NAME, m_buildCanceled, m_CupsModelDir, m_domDoc, NoneFlag, ProgressFlag, and traverseDir().

void GuiPrinterDriverToXml::on_pushButton_save_clicked  )  [protected, slot]
 

This slot method is called when the user clicks on the "Save" button. It saves the DOM datastructure to a XML file previously selected by the user. If the file specified does not exists, it will be created on-the-fly.

Definition at line 236 of file guiprinterdrivertoxml.cpp.

References logMessage(), and m_domDoc.

void GuiPrinterDriverToXml::parseFile const QString &  filePath  )  [private]
 

Trys to figure out if it is a Postscript Printer Description (PPD). If it is a PPD-file, it is decompressed and read for further processing with addDriver().

Parameters:
filePath 
Exceptions:
LpsError if an error occured (wrong PPD-file-signature, popen failed, not all needed information found)
See also:
addDriver()

Definition at line 377 of file guiprinterdrivertoxml.cpp.

References addDriver(), LinuxPrinterSetup::ppd_info::languageVersion, logMessage(), m_CupsModelDir, LinuxPrinterSetup::ppd_info::manufacturer, LinuxPrinterSetup::ppd_info::modelName, LinuxPrinterSetup::ppd_info::nickName, LinuxPrinterSetup::ppd_info::ppdFilePath, and LinuxPrinterSetup::ppd_info::product.

Referenced by traverseDir().

Here is the call graph for this function:

void GuiPrinterDriverToXml::show  )  [slot]
 

This slot method is called when this dialog is shown. In initializes all widgets located in this dialog with sensable state (e.g. Saving is diabled).

Definition at line 91 of file guiprinterdrivertoxml.cpp.

References logMessage(), LPS_DB_FILE, and m_CupsModelDir.

void GuiPrinterDriverToXml::traverseDir const QString &  dir  )  [private]
 

Runs recursively through all subdirectories in "dir" and parses every file it founds.

Parameters:
dir the entry point (CUPS model dir) for recursion
Exceptions:
LpsError when an error occured or the user hitted the abort-button (this will end the recursion)
See also:
parseFile()

Definition at line 287 of file guiprinterdrivertoxml.cpp.

References logMessage(), m_buildCanceled, and parseFile().

Referenced by on_pushButton_build_clicked().

Here is the call graph for this function:


Member Data Documentation

bool GuiPrinterDriverToXml::m_buildCanceled [private]
 

Useful for influencing the build process.

Definition at line 230 of file guiprinterdrivertoxml.h.

Referenced by on_pushButton_abort_clicked(), on_pushButton_build_clicked(), and traverseDir().

QString GuiPrinterDriverToXml::m_CupsModelDir [private]
 

The directory containing the PPD files. This may have subdirectories.

Definition at line 232 of file guiprinterdrivertoxml.h.

Referenced by GuiPrinterDriverToXml(), on_pushButton_build_clicked(), parseFile(), and show().

PrinterSetupDb* GuiPrinterDriverToXml::m_domDoc [private]
 

The DOM document used for XML db building/saving.

Definition at line 234 of file guiprinterdrivertoxml.h.

Referenced by addDriver(), GuiPrinterDriverToXml(), on_pushButton_build_clicked(), on_pushButton_save_clicked(), and ~GuiPrinterDriverToXml().


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)