summaryrefslogtreecommitdiffstats
path: root/src/printsupport/dialogs/qprintdialog_unix.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/printsupport/dialogs/qprintdialog_unix.cpp')
-rw-r--r--src/printsupport/dialogs/qprintdialog_unix.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/printsupport/dialogs/qprintdialog_unix.cpp b/src/printsupport/dialogs/qprintdialog_unix.cpp
index eb4ce6840f..882d76a041 100644
--- a/src/printsupport/dialogs/qprintdialog_unix.cpp
+++ b/src/printsupport/dialogs/qprintdialog_unix.cpp
@@ -126,6 +126,7 @@ protected:
void showEvent(QShowEvent* event);
private:
+ friend class QUnixPrintWidgetPrivate;
Ui::QPrintPropertiesWidget widget;
QDialogButtonBox *m_buttons;
#if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
@@ -862,6 +863,20 @@ bool QUnixPrintWidgetPrivate::checkFields()
}
}
+#if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
+ QCUPSSupport::PagesPerSheet pagesPerSheet = propertiesDialog->widget.pageSetup->widget.pagesPerSheetCombo->currentData().value<QCUPSSupport::PagesPerSheet>();
+
+ QCUPSSupport::PageSet pageSet = optionsPane->options.pageSetCombo->currentData().value<QCUPSSupport::PageSet>();
+
+ if (propertiesDialogShown
+ && pagesPerSheet != QCUPSSupport::OnePagePerSheet
+ && pageSet != QCUPSSupport::AllPages) {
+ QMessageBox::warning(q, q->windowTitle(),
+ QPrintDialog::tr("Options 'Pages Per Sheet' and 'Page Set' cannot be used together.\nPlease turn one of those options off."));
+ return false;
+ }
+#endif
+
// Every test passed. Accept the dialog.
return true;
}