diff --git a/src/printsupport/dialogs/qprintdialog.h b/src/printsupport/dialogs/qprintdialog.h index 5bd832bcb0..9bc133e059 100644 --- a/src/printsupport/dialogs/qprintdialog.h +++ b/src/printsupport/dialogs/qprintdialog.h @@ -55,28 +55,6 @@ class QPrintDialogPrivate; class QPushButton; class QPrinter; -#if defined (Q_OS_UNIX) && !defined(Q_OS_MAC) -class QUnixPrintWidgetPrivate; - -class Q_PRINTSUPPORT_EXPORT QUnixPrintWidget : public QWidget -{ - Q_OBJECT - -public: - explicit QUnixPrintWidget(QPrinter *printer, QWidget *parent = 0); - ~QUnixPrintWidget(); - void updatePrinter(); - -private: - friend class QPrintDialogPrivate; - friend class QUnixPrintWidgetPrivate; - QUnixPrintWidgetPrivate *d; - Q_PRIVATE_SLOT(d, void _q_printerChanged(int)) - Q_PRIVATE_SLOT(d, void _q_btnBrowseClicked()) - Q_PRIVATE_SLOT(d, void _q_btnPropertiesClicked()) -}; -#endif - class Q_PRINTSUPPORT_EXPORT QPrintDialog : public QAbstractPrintDialog { Q_OBJECT @@ -129,14 +107,14 @@ Q_SIGNALS: void accepted(QPrinter *printer); private: - Q_PRIVATE_SLOT(d_func(), void _q_chbPrintLastFirstToggled(bool)) #if defined (Q_OS_UNIX) && !defined(Q_OS_MAC) + Q_PRIVATE_SLOT(d_func(), void _q_chbPrintLastFirstToggled(bool)) Q_PRIVATE_SLOT(d_func(), void _q_collapseOrExpandDialog()) -#endif -# if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) && !defined(QT_NO_MESSAGEBOX) +# if !defined(QT_NO_MESSAGEBOX) Q_PRIVATE_SLOT(d_func(), void _q_checkFields()) -# endif +# endif // QT_NO_MESSAGEBOX friend class QUnixPrintWidget; +# endif // Q_OS_UNIX }; #endif // QT_NO_PRINTDIALOG diff --git a/src/printsupport/dialogs/qprintdialog_mac.mm b/src/printsupport/dialogs/qprintdialog_mac.mm index e1d85eed59..53be71191d 100644 --- a/src/printsupport/dialogs/qprintdialog_mac.mm +++ b/src/printsupport/dialogs/qprintdialog_mac.mm @@ -67,17 +67,6 @@ public: inline QPrintDialog *printDialog() { return q_func(); } - inline void _q_printToFileChanged(int) {} - inline void _q_rbPrintRangeToggled(bool) {} - inline void _q_printerChanged(int) {} -#ifndef QT_NO_MESSAGEBOX - inline void _q_checkFields() {} -#endif - inline void _q_chbPrintLastFirstToggled(bool) {} - inline void _q_paperSizeChanged(int) {} - inline void _q_btnBrowseClicked() {} - inline void _q_btnPropertiesClicked() {} - NSPrintInfo *printInfo; NSPrintPanel *printPanel; }; diff --git a/src/printsupport/dialogs/qprintdialog_unix.cpp b/src/printsupport/dialogs/qprintdialog_unix.cpp index 49d523e2eb..206ef7380b 100644 --- a/src/printsupport/dialogs/qprintdialog_unix.cpp +++ b/src/printsupport/dialogs/qprintdialog_unix.cpp @@ -68,6 +68,44 @@ # include #endif +/* + +Print dialog class declarations + + QPrintDialog: The main Print Dialog, nothing really held here. + + QUnixPrintWidget: + QUnixPrintWidgetPrivate: The real Unix Print Dialog implementation. + + Directly includes the upper half of the Print Dialog + containing the Printer Selection widgets and + Properties button. + + Embeds the Properties pop-up dialog from + QPrintPropertiesDialog + + Embeds the lower half from separate widget class + QPrintDialogPrivate + + Layout in qprintwidget.ui + + QPrintDialogPrivate: The lower half of the Print Dialog containing the + Copies and Options tabs that expands when the + Options button is selected. + + Layout in qprintsettingsoutput.ui + + QPrintPropertiesDialog: Dialog displayed when clicking on Properties button to + allow editing of Page and Advanced tabs. + + Layout in qprintpropertieswidget.ui + + QPPDOptionsModel: Holds the PPD Options for the printer. + + QPPDOptionsEditor: Edits the PPD Options for the printer. + +*/ + QT_BEGIN_NAMESPACE class QOptionTreeItem; @@ -104,38 +142,24 @@ private: #endif }; -class QPrintDialogPrivate : public QAbstractPrintDialogPrivate +class QUnixPrintWidgetPrivate; + +class QUnixPrintWidget : public QWidget { - Q_DECLARE_PUBLIC(QPrintDialog) - Q_DECLARE_TR_FUNCTIONS(QPrintDialog) + Q_OBJECT + public: - QPrintDialogPrivate(); - ~QPrintDialogPrivate(); + explicit QUnixPrintWidget(QPrinter *printer, QWidget *parent = 0); + ~QUnixPrintWidget(); + void updatePrinter(); - void init(); - /// copy printer properties to the widget - void applyPrinterProperties(QPrinter *p); - -#if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY) - void selectPrinter(QCUPSSupport *cups); -#endif - - void _q_chbPrintLastFirstToggled(bool); -#ifndef QT_NO_MESSAGEBOX - void _q_checkFields(); -#endif - void _q_collapseOrExpandDialog(); - - void setupPrinter(); - void updateWidgets(); - - virtual void setTabs(const QList &tabs); - - Ui::QPrintSettingsOutput options; - QUnixPrintWidget *top; - QWidget *bottom; - QDialogButtonBox *buttons; - QPushButton *collapseButton; +private: + friend class QPrintDialogPrivate; + friend class QUnixPrintWidgetPrivate; + QUnixPrintWidgetPrivate *d; + Q_PRIVATE_SLOT(d, void _q_printerChanged(int)) + Q_PRIVATE_SLOT(d, void _q_btnBrowseClicked()) + Q_PRIVATE_SLOT(d, void _q_btnPropertiesClicked()) }; class QUnixPrintWidgetPrivate @@ -176,6 +200,40 @@ private: #endif }; +class QPrintDialogPrivate : public QAbstractPrintDialogPrivate +{ + Q_DECLARE_PUBLIC(QPrintDialog) + Q_DECLARE_TR_FUNCTIONS(QPrintDialog) +public: + QPrintDialogPrivate(); + ~QPrintDialogPrivate(); + + void init(); + /// copy printer properties to the widget + void applyPrinterProperties(QPrinter *p); + +#if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY) + void selectPrinter(QCUPSSupport *cups); +#endif + + void _q_chbPrintLastFirstToggled(bool); +#ifndef QT_NO_MESSAGEBOX + void _q_checkFields(); +#endif + void _q_collapseOrExpandDialog(); + + void setupPrinter(); + void updateWidgets(); + + virtual void setTabs(const QList &tabs); + + Ui::QPrintSettingsOutput options; + QUnixPrintWidget *top; + QWidget *bottom; + QDialogButtonBox *buttons; + QPushButton *collapseButton; +}; + #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY) class QOptionTreeItem { @@ -248,7 +306,17 @@ private slots: #endif -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + +/* + + QPrintPropertiesDialog + + Dialog displayed when clicking on Properties button to allow editing of Page + and Advanced tabs. + +*/ QPrintPropertiesDialog::QPrintPropertiesDialog(QAbstractPrintDialog *parent) : QDialog(parent) @@ -365,6 +433,18 @@ void QPrintPropertiesDialog::addItemToOptions(QOptionTreeItem *parent, QList