r20468 by jghali -
scribus-commit
scribus-commit at lists.scribus.net
Sat Oct 17 10:42:28 UTC 2015
Author: jghali
Date: Sat Oct 17 10:42:28 2015
New Revision: 20468
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=20468
Log:
set back number of copies to GUI on Windows in the rare case where one can do so in the driver specific option dialog
Modified:
branches/Version14x/Scribus/scribus/printdialog.cpp
Modified: branches/Version14x/Scribus/scribus/printdialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20468&path=/branches/Version14x/Scribus/scribus/printdialog.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/printdialog.cpp (original)
+++ branches/Version14x/Scribus/scribus/printdialog.cpp Sat Oct 17 10:42:28 2015
@@ -180,17 +180,28 @@
#elif defined(_WIN32)
bool done;
Qt::HANDLE handle = NULL;
+ DEVMODEW* devMode = (DEVMODEW*) DevMode.data();
// Retrieve the selected printer
QString printerS = PrintDest->currentText();
// Get a printer handle
done = OpenPrinterW( (LPWSTR) printerS.utf16(), &handle, NULL );
- if(!done)
+ if (!done)
return;
// Merge stored settings, prompt user and return user settings
DocumentPropertiesW( winId(), handle, (LPWSTR) printerS.utf16(), (DEVMODEW*) DevMode.data(), (DEVMODEW*) DevMode.data(),
DM_IN_BUFFER | DM_IN_PROMPT | DM_OUT_BUFFER);
// Free the printer handle
- ClosePrinter( handle );
+ ClosePrinter(handle);
+
+ // With some drivers, one can set the number of copies in print option dialog
+ // Set it back to Copies widget in this case
+ devMode->dmCopies = qMax(1, qMin((int) devMode->dmCopies, Copies->maximum()));
+ if (devMode->dmCopies != numCopies())
+ {
+ bool sigBlocked = Copies->blockSignals(true);
+ Copies->setValue(devMode->dmCopies);
+ Copies->blockSignals(false);
+ }
#endif
}
More information about the scribus-commit
mailing list