Add forceIncluDeDocumentFormat option
...because my printer is stupid
This commit is contained in:
parent
b7b587d099
commit
ce67e42720
3 changed files with 12 additions and 5 deletions
|
@ -17,6 +17,13 @@ Page {
|
|||
defaultValue: false
|
||||
}
|
||||
|
||||
ConfigurationValue
|
||||
{
|
||||
id: forceIncluDeDocumentFormat
|
||||
key: "/apps/harbour-seaprint/settings/force_include_document_format"
|
||||
defaultValue: false
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
console.log(JSON.stringify(printer.attrs))
|
||||
}
|
||||
|
@ -33,7 +40,7 @@ Page {
|
|||
console.log(JSON.stringify(jobParams))
|
||||
pageStack.replace(Qt.resolvedUrl("BusyPage.qml"),{printer:printer},
|
||||
PageStackAction.Immediate)
|
||||
printer.print(jobParams, page.selectedFile, alwaysConvert.value)
|
||||
printer.print(jobParams, page.selectedFile, alwaysConvert.value, forceIncluDeDocumentFormat.value)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -298,9 +298,9 @@ QString targetFormatIfAuto(QString documentFormat, QString mimeType, QJsonArray
|
|||
}
|
||||
|
||||
// TODO: make alwaysConvert force ratser format
|
||||
void IppPrinter::print(QJsonObject attrs, QString filename, bool alwaysConvert)
|
||||
void IppPrinter::print(QJsonObject attrs, QString filename, bool alwaysConvert, bool forceIncluDeDocumentFormat)
|
||||
{
|
||||
qDebug() << "printing" << filename << attrs;
|
||||
qDebug() << "printing" << filename << attrs << alwaysConvert << forceIncluDeDocumentFormat;
|
||||
|
||||
_progress = "";
|
||||
emit progressChanged();
|
||||
|
@ -344,7 +344,7 @@ void IppPrinter::print(QJsonObject attrs, QString filename, bool alwaysConvert)
|
|||
return;
|
||||
}
|
||||
|
||||
if(!jobCreationAttributes.contains("document-format"))
|
||||
if(!jobCreationAttributes.contains("document-format") && !forceIncluDeDocumentFormat)
|
||||
{ // Only include if printer supports it
|
||||
attrs.remove("document-format");
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ signals:
|
|||
void progressChanged();
|
||||
|
||||
public slots:
|
||||
void print(QJsonObject attrs, QString file, bool alwaysConvert);
|
||||
void print(QJsonObject attrs, QString file, bool alwaysConvert, bool forceIncluDeDocumentFormat);
|
||||
|
||||
|
||||
void onUrlChanged();
|
||||
|
|
Loading…
Reference in a new issue