Commit c262ebf0 authored by John Layt's avatar John Layt

Read the Cups options set in the Printer Properties window and the KDE

Cups Page and Job Options tabs, and pass these on to lpr.

CCBUG: 160381

This needs to be backported to 4.0 but I don't have a checkout.

svn path=/trunk/KDE/kdegraphics/okular/; revision=817393
parent 830fcef5
...@@ -417,6 +417,8 @@ QStringList FilePrinter::cupsOptions( QPrinter &printer ) ...@@ -417,6 +417,8 @@ QStringList FilePrinter::cupsOptions( QPrinter &printer )
optionList << optionCollateCopies( printer ); optionList << optionCollateCopies( printer );
} }
optionList << optionCupsProperties( printer );
return optionList; return optionList;
} }
...@@ -541,3 +543,19 @@ QStringList FilePrinter::optionCollateCopies( QPrinter &printer ) ...@@ -541,3 +543,19 @@ QStringList FilePrinter::optionCollateCopies( QPrinter &printer )
return QStringList("-o") << "Collate=False"; return QStringList("-o") << "Collate=False";
} }
QStringList FilePrinter::optionCupsProperties( QPrinter &printer )
{
QStringList dialogOptions = printer.printEngine()->property(QPrintEngine::PrintEnginePropertyKey(0xfe00)).toStringList();
QStringList cupsOptions;
for ( int i = 0; i < dialogOptions.count(); i = i + 2 ) {
if ( dialogOptions[i+1].isEmpty() ) {
cupsOptions << "-o" << dialogOptions[i];
} else {
cupsOptions << "-o" << dialogOptions[i] + "=" + dialogOptions[i+1];
}
}
return cupsOptions;
}
...@@ -161,6 +161,7 @@ protected: ...@@ -161,6 +161,7 @@ protected:
QStringList optionDoubleSidedPrinting( QPrinter &printer ); QStringList optionDoubleSidedPrinting( QPrinter &printer );
QStringList optionPageOrder( QPrinter &printer ); QStringList optionPageOrder( QPrinter &printer );
QStringList optionCollateCopies( QPrinter &printer ); QStringList optionCollateCopies( QPrinter &printer );
QStringList optionCupsProperties( QPrinter &printer );
}; };
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment