summaryrefslogtreecommitdiffstats
path: root/src/printsupport/dialogs
diff options
context:
space:
mode:
authorMartin Klapetek <mklapetek@kde.org>2013-09-06 18:32:41 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-10 16:11:15 +0200
commitad46d5b82b1bc4ce931b62907cd41356de294f5a (patch)
treee5a8fa3fd89e79cbf2087f38f72af97b5ee77b0a /src/printsupport/dialogs
parentf3b3b014604c070cd1836035e53fffae87f7adda (diff)
Add CUPS options widget to print support
This adds new tab 'Job Options' into Properties dialog in print dialog. In this tab it's possible to set some advanced printing job options such as print schedule, job priority or job billing. Patch also adds new utility methods into QCUPSSupport, which are used to set particular CUPS job options. [ChangeLog][QtPrintSupport][QPrintDialog] Added support for setting CUPS job options in the print dialog. Change-Id: If2640eedb3d83f50cbb20491f7ec50b325f54f22 Reviewed-by: John Layt <jlayt@kde.org>
Diffstat (limited to 'src/printsupport/dialogs')
-rw-r--r--src/printsupport/dialogs/qprintdialog_unix.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/printsupport/dialogs/qprintdialog_unix.cpp b/src/printsupport/dialogs/qprintdialog_unix.cpp
index 961cfd9613..3b45410e6f 100644
--- a/src/printsupport/dialogs/qprintdialog_unix.cpp
+++ b/src/printsupport/dialogs/qprintdialog_unix.cpp
@@ -64,6 +64,7 @@
#if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
# include <private/qcups_p.h>
+# include "qcupsjobwidget_p.h"
#else
# include <QtCore/qlibrary.h>
# include <private/qprintengine_pdf_p.h>
@@ -127,6 +128,9 @@ protected:
private:
Ui::QPrintPropertiesWidget widget;
QDialogButtonBox *m_buttons;
+#if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
+ QCupsJobWidget *m_jobOptions;
+#endif
};
class QUnixPrintWidgetPrivate;
@@ -237,6 +241,13 @@ QPrintPropertiesDialog::QPrintPropertiesDialog(QAbstractPrintDialog *parent)
connect(m_buttons->button(QDialogButtonBox::Ok), SIGNAL(clicked()), this, SLOT(accept()));
connect(m_buttons->button(QDialogButtonBox::Cancel), SIGNAL(clicked()), this, SLOT(reject()));
+
+#if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
+ if (QCUPSSupport::isAvailable()) {
+ m_jobOptions = new QCupsJobWidget();
+ widget.tabs->addTab(m_jobOptions, tr("Job Options"));
+ }
+#endif
}
QPrintPropertiesDialog::~QPrintPropertiesDialog()
@@ -246,11 +257,21 @@ QPrintPropertiesDialog::~QPrintPropertiesDialog()
void QPrintPropertiesDialog::applyPrinterProperties(QPrinter *p)
{
widget.pageSetup->setPrinter(p);
+#if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
+ if (QCUPSSupport::isAvailable()) {
+ m_jobOptions->setPrinter(p);
+ }
+#endif
}
void QPrintPropertiesDialog::setupPrinter() const
{
widget.pageSetup->setupPrinter();
+#if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
+ if (QCUPSSupport::isAvailable()) {
+ m_jobOptions->setupPrinter();
+ }
+#endif
}
void QPrintPropertiesDialog::selectPrinter()