[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#757363: marked as done (libqtgui4: Qt print dialog's duplex setting not inferred from CUPS properties)



Your message dated Sun, 04 Aug 2024 10:02:39 -0700
with message-id <6e026f41062fe34c56aaf7fa9ef69b8b@carsoncit.xyz>
and subject line Greeting
has caused the Debian Bug report #757363,
regarding libqtgui4: Qt print dialog's duplex setting not inferred from CUPS properties
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
757363: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=757363
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: libqtgui4
Version: 4:4.8.2+dfsg-11
Severity: normal
Tags: upstream patch

Qt's printing dialog (as used, for example, by Iceweasel) does not infer the duplex setting from CUPS's printer options.
This is a known bug in Qt, see https://bugs.kde.org/180051.
A patch is available at http://bugsfiles.kde.org/attachment.cgi?id=41187.
We've been using this pÃatch for ages, I include a revised version for 4.8.2.

-- System Information:
Debian Release: 7.6
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.10.42.wap (SMP w/2 CPU cores)
Locale: LANG=de_DE@euro, LC_CTYPE=de_DE@euro (charmap=ISO-8859-15)
Shell: /bin/sh linked to /bin/dash

Versions of packages libqtgui4 depends on:
ii  fontconfig         2.9.0-7.1
ii  libaudio2          1.9.3-5wheezy1
ii  libc6              2.13-38+deb7u3
ii  libfontconfig1     2.9.0-7.1
ii  libfreetype6       2.4.9-1.1
ii  libgcc1            1:4.7.2-5
ii  libglib2.0-0       2.33.12+really2.32.4-5
ii  libice6            2:1.0.8-2
ii  libjpeg8           8d-1+deb7u1
ii  libmng1            1.0.10-3
ii  libpng12-0         1.2.49-1
ii  libqtcore4         4:4.8.2+dfsg-11
ii  libsm6             2:1.2.1-2
ii  libstdc++6         4.7.2-5
ii  libtiff4           3.9.6-11
ii  libx11-6           2:1.5.0-1+deb7u1
ii  libxext6           2:1.3.1-2+deb7u1
ii  libxrender1        1:0.9.7-1+deb7u1
ii  multiarch-support  2.13-38+deb7u3
ii  zlib1g             1:1.2.7.dfsg-13

Versions of packages libqtgui4 recommends:
ii  libcups2  1.5.3-5+deb7u4

Versions of packages libqtgui4 suggests:
pn  qt4-qtconfig  <none>

-- no debconf information
Index: src/gui/dialogs/qprintdialog_unix.cpp
===================================================================
--- src/gui/dialogs/qprintdialog_unix.cpp	(revision 3625)
+++ src/gui/dialogs/qprintdialog_unix.cpp	(revision 3626)
@@ -579,6 +579,32 @@
 void QPrintDialogPrivate::selectPrinter(QCUPSSupport *cups)
 {
     options.duplex->setEnabled(cups && cups->ppdOption("Duplex"));
+
+    if (cups) {
+        const ppd_option_t* duplex = cups->ppdOption("Duplex");
+        if (duplex) {
+            // copy default ppd duplex to qt dialog
+            if (qstrcmp(duplex->defchoice, "DuplexTumble") == 0)
+                options.duplexShort->setChecked(true);
+            else if (qstrcmp(duplex->defchoice, "DuplexNoTumble") == 0)
+                options.duplexLong->setChecked(true);
+            else
+                options.noDuplex->setChecked(true);
+        }
+
+        if (cups->currentPPD()) {
+            // set default color
+            if (cups->currentPPD()->color_device)
+                options.color->setChecked(true);
+            else
+                options.grayscale->setChecked(true);
+        }
+
+        // set collation
+        const ppd_option_t *collate = cups->ppdOption("Collate");
+        if (collate)
+            options.collate->setChecked(qstrcmp(collate->defchoice, "True")==0);
+    }
 }
 #endif
 
Index: src/gui/painting/qprinter.cpp
===================================================================
--- src/gui/painting/qprinter.cpp	(revision 3625)
+++ src/gui/painting/qprinter.cpp	(revision 3626)
@@ -609,6 +609,44 @@
                && d_ptr->paintEngine->type() != QPaintEngine::MacPrinter) {
         setOutputFormat(QPrinter::PdfFormat);
     }
+
+#if !defined(QT_NO_CUPS) && !defined(QT_NO_LIBRARY)
+    // fill in defaults from ppd file
+    QCUPSSupport cups;
+
+    int printernum = -1;
+    for (int i = 0; i < cups.availablePrintersCount(); i++) {
+        if (printerName().toLocal8Bit() == cups.availablePrinters()[i].name)
+            printernum = i;
+    }
+    if (printernum >= 0) {
+        cups.setCurrentPrinter(printernum);
+
+        const ppd_option_t* duplex = cups.ppdOption("Duplex");
+        if (duplex) {
+            // copy default ppd duplex to qt dialog
+            if (qstrcmp(duplex->defchoice, "DuplexTumble") == 0)
+                setDuplex(DuplexShortSide);
+            else if (qstrcmp(duplex->defchoice, "DuplexNoTumble") == 0)
+                setDuplex(DuplexLongSide);
+            else
+                setDuplex(DuplexNone);
+        }
+
+        if (cups.currentPPD()) {
+            // set default color
+            if (cups.currentPPD()->color_device)
+                setColorMode(Color);
+            else
+                setColorMode(GrayScale);
+        }
+
+        // set collation
+        const ppd_option_t *collate = cups.ppdOption("Collate");
+        if (collate)
+            setCollateCopies(qstrcmp(collate->defchoice, "True")==0);
+    }
+#endif
 }
 
 /*!

--- End Message ---
--- Begin Message ---


--
Greeting,

I have access to very vital information that can be used to
move huge amounts of money.

If it was possible for me to do it alone I would not
have bothered contacting you. Ultimately I need you to play an
important role in the completion of this business transaction.

Regards,
Mr Alexander Bulyanda

--- End Message ---

Reply to: