2020-05-06 21:46:41 +03:00
|
|
|
import QtQuick 2.0
|
|
|
|
import Sailfish.Silica 1.0
|
|
|
|
import "utils.js" as Utils
|
|
|
|
|
|
|
|
Page {
|
|
|
|
property var printer
|
|
|
|
backNavigation: false
|
|
|
|
Connections {
|
|
|
|
target: printer
|
|
|
|
onJobFinished: {
|
2020-05-17 13:30:54 +03:00
|
|
|
var msg = qsTr("Unknown")
|
2020-05-06 21:46:41 +03:00
|
|
|
if (printer.jobAttrs.hasOwnProperty("job-state-message") && printer.jobAttrs["job-state-message"].value != "") {
|
|
|
|
msg = printer.jobAttrs["job-state-message"].value
|
|
|
|
}
|
2020-05-17 13:30:54 +03:00
|
|
|
else if (printer.jobAttrs.hasOwnProperty("status-message") && printer.jobAttrs["status-message"].value != "") {
|
|
|
|
msg = printer.jobAttrs["status-message"].value
|
|
|
|
}
|
|
|
|
else if (printer.jobAttrs.hasOwnProperty("job-state") && printer.jobAttrs["job-state"].value != "") {
|
2020-05-06 21:46:41 +03:00
|
|
|
msg = Utils.ippName("job-state", printer.jobAttrs["job-state"].value)
|
|
|
|
}
|
2020-05-09 15:05:34 +03:00
|
|
|
pageStack.pop()
|
2020-05-06 21:46:41 +03:00
|
|
|
if(status == true) {
|
|
|
|
notifier.notify(qsTr("Print success: ") + msg)
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
notifier.notify(qsTr("Print failed: ") + msg)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
BusyLabel {
|
2020-06-03 21:42:18 +03:00
|
|
|
text: printer.busyMessage+"\n"+printer.progress;
|
2020-05-06 21:46:41 +03:00
|
|
|
running: true
|
|
|
|
}
|
|
|
|
}
|