Ignore:
Timestamp:
Feb 17, 2010, 8:53:20 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

gui: Implemented support for printing through CUPS on OS/2.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gui/dialogs/qprintdialog_unix.cpp

    r561 r573  
    6161#include "ui_qprintwidget.h"
    6262
    63 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
     63#if !defined(QT_NO_CUPS) && (!defined(QT_NO_LIBRARY) || defined (Q_WS_PM))
    6464#  include <private/qcups_p.h>
    6565#  include <cups/cups.h>
     
    8585    ~QPrintPropertiesDialog();
    8686
    87 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
     87#if !defined(QT_NO_CUPS) && (!defined(QT_NO_LIBRARY) || defined (Q_WS_PM))
    8888    void setCups(QCUPSSupport *cups) { m_cups = cups; }
    8989    void addItemToOptions(QOptionTreeItem *parent, QList<const ppd_option_t*>& options, QList<const char*>& markedOptions) const;
     
    103103    Ui::QPrintPropertiesWidget widget;
    104104    QDialogButtonBox *m_buttons;
    105 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
     105#if !defined(QT_NO_CUPS) && (!defined(QT_NO_LIBRARY) || defined (Q_WS_PM))
    106106    QCUPSSupport *m_cups;
    107107    QPPDOptionsModel *m_cupsOptionsModel;
     
    121121    void applyPrinterProperties(QPrinter *p);
    122122
    123 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
     123#if !defined(QT_NO_CUPS) && (!defined(QT_NO_LIBRARY) || defined (Q_WS_PM))
    124124    void selectPrinter(QCUPSSupport *cups);
    125125#endif
     
    143143};
    144144
    145 #if defined (Q_OS_UNIX)
     145#if defined (Q_OS_UNIX) || defined (Q_WS_PM)
    146146class QUnixPrintWidgetPrivate
    147147{
     
    172172    QPrintDialogPrivate *optionsPane;
    173173    bool filePrintersAdded;
    174 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
     174#if !defined(QT_NO_CUPS) && (!defined(QT_NO_LIBRARY) || defined (Q_WS_PM))
    175175    QCUPSSupport* cups;
    176176    int cupsPrinterCount;
     
    181181#endif
    182182
    183 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
     183#if !defined(QT_NO_CUPS) && (!defined(QT_NO_LIBRARY) || defined (Q_WS_PM))
    184184class QOptionTreeItem
    185185{
     
    257257QPrintPropertiesDialog::QPrintPropertiesDialog(QAbstractPrintDialog *parent)
    258258    : QDialog(parent)
    259 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
     259#if !defined(QT_NO_CUPS) && (!defined(QT_NO_LIBRARY) || defined (Q_WS_PM))
    260260    , m_cups(0), m_cupsOptionsModel(0)
    261261#endif
     
    275275QPrintPropertiesDialog::~QPrintPropertiesDialog()
    276276{
    277 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
     277#if !defined(QT_NO_CUPS) && (!defined(QT_NO_LIBRARY) || defined (Q_WS_PM))
    278278    delete m_cupsOptionsModel;
    279279#else
     
    291291    widget.pageSetup->setupPrinter();
    292292
    293 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
     293#if !defined(QT_NO_CUPS) && (!defined(QT_NO_LIBRARY) || defined (Q_WS_PM))
    294294    QPPDOptionsModel* model = static_cast<QPPDOptionsModel*>(widget.treeView->model());
    295295    if (model) {
     
    306306void QPrintPropertiesDialog::selectPrinter()
    307307{
    308 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
     308#if !defined(QT_NO_CUPS) && (!defined(QT_NO_LIBRARY) || defined (Q_WS_PM))
    309309    widget.pageSetup->selectPrinter(m_cups);
    310310    widget.treeView->setModel(0);
     
    352352}
    353353
    354 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
     354#if !defined(QT_NO_CUPS) && (!defined(QT_NO_LIBRARY) || defined (Q_WS_PM))
    355355void QPrintPropertiesDialog::addItemToOptions(QOptionTreeItem *parent, QList<const ppd_option_t*>& options, QList<const char*>& markedOptions) const
    356356{
     
    566566}
    567567
    568 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
     568#if !defined(QT_NO_CUPS) && (!defined(QT_NO_LIBRARY) || defined (Q_WS_PM))
    569569void QPrintDialogPrivate::selectPrinter(QCUPSSupport *cups)
    570570{
     
    644644#endif // QT3_SUPPORT
    645645
    646 #if defined (Q_OS_UNIX)
     646#if defined (Q_OS_UNIX) || defined (Q_WS_PM)
    647647
    648648/*! \internal
     
    650650QUnixPrintWidgetPrivate::QUnixPrintWidgetPrivate(QUnixPrintWidget *p)
    651651    : parent(p), propertiesDialog(0), printer(0), optionsPane(0), filePrintersAdded(false)
    652 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
     652#if !defined(QT_NO_CUPS) && (!defined(QT_NO_LIBRARY) || defined (Q_WS_PM))
    653653    , cups(0), cupsPrinterCount(0), cupsPrinters(0), cupsPPD(0)
    654654#endif
     
    661661
    662662    int currentPrinterIndex = 0;
    663 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
     663#if !defined(QT_NO_CUPS) && (!defined(QT_NO_LIBRARY) || defined (Q_WS_PM))
    664664    cups = new QCUPSSupport;
    665665    if (QCUPSSupport::isAvailable()) {
     
    685685    } else {
    686686#endif
     687#ifndef Q_WS_PM
    687688        currentPrinterIndex = qt_getLprPrinters(lprPrinters);
    688689        // populating printer combo
     
    690691        for(; i != lprPrinters.constEnd(); ++i)
    691692            widget.printers->addItem((*i).name);
    692 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
     693#endif
     694#if !defined(QT_NO_CUPS) && (!defined(QT_NO_LIBRARY) || defined (Q_WS_PM))
    693695    }
    694696#endif
     
    749751QUnixPrintWidgetPrivate::~QUnixPrintWidgetPrivate()
    750752{
    751 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
     753#if !defined(QT_NO_CUPS) && (!defined(QT_NO_LIBRARY) || defined (Q_WS_PM))
    752754    delete cups;
    753755#endif
     
    781783            if (propertiesDialog)
    782784                propertiesDialog->selectPdfPsPrinter(printer);
    783 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
     785#if !defined(QT_NO_CUPS) && (!defined(QT_NO_LIBRARY) || defined (Q_WS_PM))
    784786            if (optionsPane)
    785787                optionsPane->selectPrinter(0);
     
    790792
    791793    widget.location->setText(QString());
    792 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
     794#if !defined(QT_NO_CUPS) && (!defined(QT_NO_LIBRARY) || defined (Q_WS_PM))
    793795    if (QCUPSSupport::isAvailable()) {
    794796        cups->setCurrentPrinter(index);
     
    822824                propertiesDialog->selectPrinter();
    823825        }
    824 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
     826#if !defined(QT_NO_CUPS) && (!defined(QT_NO_LIBRARY) || defined (Q_WS_PM))
    825827    }
    826828#endif
     
    949951
    950952    if (propertiesDialog->result() == QDialog::Rejected) {
    951 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
     953#if !defined(QT_NO_CUPS) && (!defined(QT_NO_LIBRARY) || defined (Q_WS_PM))
    952954        propertiesDialog->setCups(cups);
    953955#endif
     
    10171019
    10181020////////////////////////////////////////////////////////////////////////////////
    1019 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
     1021
     1022#if !defined(QT_NO_CUPS) && (!defined(QT_NO_LIBRARY) || defined (Q_WS_PM))
    10201023
    10211024QPPDOptionsModel::QPPDOptionsModel(QCUPSSupport *c, QObject *parent)
Note: See TracChangeset for help on using the changeset viewer.