r20467 by jghali -

scribus-commit scribus-commit at lists.scribus.net
Sat Oct 17 10:40:57 UTC 2015


Author: jghali
Date: Sat Oct 17 10:40:57 2015
New Revision: 20467

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=20467
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:
    trunk/Scribus/scribus/ui/printdialog.cpp

Modified: trunk/Scribus/scribus/ui/printdialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20467&path=/trunk/Scribus/scribus/ui/printdialog.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/printdialog.cpp	(original)
+++ trunk/Scribus/scribus/ui/printdialog.cpp	Sat Oct 17 10:40:57 2015
@@ -181,6 +181,7 @@
 #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
@@ -192,6 +193,16 @@
 						DM_IN_BUFFER | DM_IN_PROMPT | DM_OUT_BUFFER);
 	// Free the printer 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