Closed paucoma closed 3 years ago
Hi @paucoma! According to the description, I understood that it is about Desktop Editors, although the problem is located in the Document Server section.
The window you have shown is the system window (we call it after you click print). The settings should be taken by the system directly from the printserver or the user settings of the printer. The fact that the settings are not saved after restarting the application is normal, since this change is valid only for one printing session. When you print again, the default settings are loaded again (from the system or the print server).
So there are a few questions:
Moved this issue to DesktopEditors since seems this is a problem in DesktopEditosr
Hi LuckySpecialist, thanks for your reply. Sorry for opening this in the wrong spot.
a. Gedit (Gnome Desktop "notepad") it is by default Duplex Long Edge as system defaults (and changes when I change cups server setting)
b. Libre Office Calc, writer, etc.. as well as system defaults (and changes, after application restart, when I change it in the cups server)
c. Google Chrome as well as system defaults (and changes when I change it in the cups server)
d. Firefox apparently does not use system defaults, by default it was off. I go to about:config
config page and change the setting and it changes firefox settings.
print.printer_HPCLJ_M281.print_duplex
0
- Off
1
- Flip on long edge
2
- Flip on short edge
Any changes to Firefox settings do not influence other programs nor onlyoffice settings either.
Of course this bug is low priority as you can manually change it each time and it works as expected. Just a bother that you need to do these extra steps every time you want to print something double-sided. At first glance looks like "low hanging fruit" bug which would not be too difficult to solve.
If you require any more tests/research let me know.
I did a little bit of browsing and found that the PrinterDialog gets created here, the printer object passed onto this dialog is defined here derived from a wrapper class? QAscPrinterContext defined here, the Qprinter being declared in the header file
I did the following small test Code to see what it would return.
#include <QApplication>
#include <QPrinter>
#include <QPrintDialog>
int main( int argc, char **argv )
{
QApplication a( argc, argv );
QPrinter myPrinter;
QPrintDialog printDialog(&myPrinter,0);
if (printDialog.exec() == QDialog::Accepted)
printDialog.show();
return 0;
}
Compiled it with QT5 v5.12.8
$ make
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG -DQT_PRINTSUPPORT_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I. -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtPrintSupport -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -o main.o main.cpp
g++ -Wl,-O1 -o test main.o /usr/lib/x86_64-linux-gnu/libQt5PrintSupport.so /usr/lib/x86_64-linux-gnu/libQt5Widgets.so /usr/lib/x86_64-linux-gnu/libQt5Gui.so /usr/lib/x86_64-linux-gnu/libQt5Core.so /usr/lib/x86_64-linux-gnu/libGL.so -lpthread
This small test code works fine. Meaning that it uses the system defined defaults, and changes when I change the system defaults via CUPS
I did not go more into details but perhaps within the QAscPrinterContext something is removing the printer defined duplexMode ?
So I did some more tests and search and I noticed that in cef_types.h the internal enum gets defined for duplex modes
///
// Print job duplex mode values.
///
typedef enum {
DUPLEX_MODE_UNKNOWN = -1,
DUPLEX_MODE_SIMPLEX,
DUPLEX_MODE_LONG_EDGE,
DUPLEX_MODE_SHORT_EDGE,
} cef_duplex_mode_t;
This does not coincide with Qts' enum: enum QPrinter::DuplexMode
Constant Value
QPrinter::DuplexNone 0
QPrinter::DuplexAuto 1
QPrinter::DuplexLongSide 2
QPrinter::DuplexShortSide 3
But I think I may have found a source of the problem.
with my mini test code I added the following:
QPrinter myPrinter;
std::cout << myPrinter.duplex() <<std::endl;
QPrinterInfo myPrinterInfo(myPrinter);
std::cout << myPrinterInfo.defaultDuplexMode() <<std::endl;
QPrinter::duplex()
always returns 0, no matter what my default setting is.
QPrinterInfo::defaultDuplexMode()
returns the correct system setting following the enum QPrinter::DuplexMode.
Duplex set to None in System Settings
:~$ ./test
0
0
Duplex set to LongEdge in System Settings
:~$ ./test
0
2
Duplex set to ShortEdge in System Settings
:~$ ./test
0
3
So to properly get the system settings QPrinterInfo object must be used. I see that in the code a QPrinterInfo object does get created but a search for defaultDuplexMode
does not turn up anything, hinting towards that this function is not accessed.
I'll leave this issue opened until we release DesktopEditors v6.3.1
DocumentServer and DesktopEditors v6.3.1 is released. This issue should be fixed
Do you want to request a feature or report a bug? Bug What is the current behavior? Whenever a Print Dialog appears Clicking on " Options >>" --> " Options " Tab --> Duplex Printing always defaults to None:
Although the default for the printer is : Duplex : Long Side
I manually change it to "Long side" within the print dialog, but every time I print again it defaults back to "None"
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.
What is the expected behavior?
Ideally, this setting should get the default settings from the CUPS server. If there is system changes then these should also be there. If it is not possible, at a minimum, there should be persistance or option to save new default, across application restarts.
Did this work in previous versions of DocumentServer? Don't know, Guess Not
DocumentServer version: ONLYOFFICE Desktop Editors version 6.2.0.148
Operating System: Linux 5.8.0-48-generic ONLYOFFICE/DocumentServer#54~20.04.1-Ubuntu SMP Sat Mar 20 13:40:25 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Browser version: Firefox 87.0 (64-bit) Google Chrome Version 89.0.4389.114 (Official Build) (64-bit)