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
|
defaultValue: false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ConfigurationValue
|
||||||
|
{
|
||||||
|
id: forceIncluDeDocumentFormat
|
||||||
|
key: "/apps/harbour-seaprint/settings/force_include_document_format"
|
||||||
|
defaultValue: false
|
||||||
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
console.log(JSON.stringify(printer.attrs))
|
console.log(JSON.stringify(printer.attrs))
|
||||||
}
|
}
|
||||||
|
@ -33,7 +40,7 @@ Page {
|
||||||
console.log(JSON.stringify(jobParams))
|
console.log(JSON.stringify(jobParams))
|
||||||
pageStack.replace(Qt.resolvedUrl("BusyPage.qml"),{printer:printer},
|
pageStack.replace(Qt.resolvedUrl("BusyPage.qml"),{printer:printer},
|
||||||
PageStackAction.Immediate)
|
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
|
// 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 = "";
|
_progress = "";
|
||||||
emit progressChanged();
|
emit progressChanged();
|
||||||
|
@ -344,7 +344,7 @@ void IppPrinter::print(QJsonObject attrs, QString filename, bool alwaysConvert)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!jobCreationAttributes.contains("document-format"))
|
if(!jobCreationAttributes.contains("document-format") && !forceIncluDeDocumentFormat)
|
||||||
{ // Only include if printer supports it
|
{ // Only include if printer supports it
|
||||||
attrs.remove("document-format");
|
attrs.remove("document-format");
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,7 @@ signals:
|
||||||
void progressChanged();
|
void progressChanged();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void print(QJsonObject attrs, QString file, bool alwaysConvert);
|
void print(QJsonObject attrs, QString file, bool alwaysConvert, bool forceIncluDeDocumentFormat);
|
||||||
|
|
||||||
|
|
||||||
void onUrlChanged();
|
void onUrlChanged();
|
||||||
|
|
Loading…
Reference in a new issue