Changeset 769 for trunk/src/gui/dialogs/qprintdialog_unix.cpp
- Timestamp:
- Aug 2, 2010, 9:27:30 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.3 (added) merged: 768 /branches/vendor/nokia/qt/current merged: 767 /branches/vendor/nokia/qt/4.6.2 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/dialogs/qprintdialog_unix.cpp
r762 r769 155 155 void setupPrinter(); 156 156 void setOptionsPane(QPrintDialogPrivate *pane); 157 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY) 158 void setCupsProperties(); 159 #endif 157 160 158 161 // slots … … 970 973 void QUnixPrintWidgetPrivate::_q_btnPropertiesClicked() 971 974 { 972 if ( propertiesDialog == 0) {975 if (!propertiesDialog) { 973 976 propertiesDialog = new QPrintPropertiesDialog(q); 974 977 propertiesDialog->setResult(QDialog::Rejected); … … 989 992 propertiesDialog->exec(); 990 993 } 994 995 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY) 996 void QUnixPrintWidgetPrivate::setCupsProperties() 997 { 998 if (cups && QCUPSSupport::isAvailable() && cups->pageSizes()) { 999 QPrintEngine *engine = printer->printEngine(); 1000 const ppd_option_t* pageSizes = cups->pageSizes(); 1001 QByteArray cupsPageSize; 1002 for (int i = 0; i < pageSizes->num_choices; ++i) { 1003 if (static_cast<int>(pageSizes->choices[i].marked) == 1) 1004 cupsPageSize = pageSizes->choices[i].choice; 1005 } 1006 engine->setProperty(PPK_CupsStringPageSize, QString::fromLatin1(cupsPageSize)); 1007 engine->setProperty(PPK_CupsOptions, cups->options()); 1008 1009 QRect pageRect = cups->pageRect(cupsPageSize); 1010 engine->setProperty(PPK_CupsPageRect, pageRect); 1011 1012 QRect paperRect = cups->paperRect(cupsPageSize); 1013 engine->setProperty(PPK_CupsPaperRect, paperRect); 1014 1015 for (int ps = 0; ps < QPrinter::NPaperSize; ++ps) { 1016 QPdf::PaperSize size = QPdf::paperSize(QPrinter::PaperSize(ps)); 1017 if (size.width == paperRect.width() && size.height == paperRect.height()) 1018 printer->setPaperSize(static_cast<QPrinter::PaperSize>(ps)); 1019 } 1020 } 1021 } 1022 #endif 991 1023 992 1024 void QUnixPrintWidgetPrivate::setupPrinter() … … 1018 1050 if (propertiesDialog && propertiesDialog->result() == QDialog::Accepted) 1019 1051 propertiesDialog->setupPrinter(); 1052 #if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY) 1053 if (!propertiesDialog) 1054 setCupsProperties(); 1055 #endif 1020 1056 } 1021 1057
Note:
See TracChangeset
for help on using the changeset viewer.