harbour-seaprint/qml/pages/BusyPage.qml

56 lines
1.6 KiB
QML
Raw Normal View History

2021-07-11 15:27:03 +03:00
import QtQuick 2.6
2020-05-06 21:46:41 +03:00
import Sailfish.Silica 1.0
import "utils.js" as Utils
Page {
2023-02-17 23:29:12 +03:00
property bool busyPage: true
2020-08-06 18:34:14 +03:00
allowedOrientations: Orientation.All
2021-02-07 16:55:20 +03:00
Component.onCompleted: {
appWin.busyMessage = printer.busyMessage
}
2020-05-06 21:46:41 +03:00
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)
}
}
2021-02-07 16:55:20 +03:00
onBusyMessageChanged: {
appWin.busyMessage = printer.busyMessage
}
onProgressChanged: {
appWin.progress = printer.progress
}
2020-05-06 21:46:41 +03:00
}
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
}
2021-02-07 16:55:20 +03:00
Component.onDestruction: {
appWin.busyMessage = ""
appWin.progress = ""
}
2020-05-06 21:46:41 +03:00
}