Home » U++ Library support » U++ Library : Other (not classified elsewhere) » PrinterDlg changes defaultprinter on Linux
PrinterDlg changes defaultprinter on Linux [message #47577] |
Tue, 31 January 2017 16:55 |
|
Alboni
Messages: 214 Registered: January 2012 Location: Deventer, Netherlands
|
Experienced Member |
|
|
I am looking at this code in PrinterJob.cpp (CtrlLib)
void PrinterDlg::SyncPrinterOptions()
{
Vector<String> l = Split(System("lpoptions -d " + String(~printer) + " -l"), '\n');
paper.Disable();
paper.Clear();
slot.Disable();
slot.Clear();
for(int i = 0; i < l.GetCount(); i++) {
FillOpt(l[i], "pagesize", paper, true);
FillOpt(l[i], "inputslot", slot, false);
}
}
and I think that "lpoptions -d " should be "lpoptions -p " to avoid changing the default printer for all programs of that user, but then it stops working.
[Updated on: Sat, 04 February 2017 19:55] Report message to a moderator
|
|
|
|
Re: PrinterDlg changes defaultprinter on Linux [message #47686 is a reply to message #47685] |
Tue, 07 March 2017 03:16 |
|
Alboni
Messages: 214 Registered: January 2012 Location: Deventer, Netherlands
|
Experienced Member |
|
|
Ah, sorry it seems I didn't quote the original code.
It is
Vector<String> l = Split(System("lpoptions -l -d " + String(~printer)), '\n');
that seems to first list the options and then change the defaultprinter.
Not correct I think as you get the options of the previous printer.
If I change it like I wrote in the first message then it works correctly but still changes the default printer when used.
the -p works ok on the commandline but then the dialog doesn't return the correct printer as it seems to rely on changing the default printer.
[Updated on: Tue, 07 March 2017 03:21] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Fri Sep 20 21:14:46 CEST 2024
Total time taken to generate the page: 0.06870 seconds
|