Fix messages when there is no job-state-message at all
This commit is contained in:
parent
93b79cf37f
commit
27cc5a38e5
1 changed files with 7 additions and 2 deletions
|
@ -15,8 +15,13 @@ Page {
|
||||||
Connections {
|
Connections {
|
||||||
target: printer
|
target: printer
|
||||||
onJobAttrsFinished: {
|
onJobAttrsFinished: {
|
||||||
var msg = printer.jobAttrs["job-state-message"] && printer.jobAttrs["job-state-message"].value != ""
|
var msg = ""
|
||||||
? printer.jobAttrs["job-state-message"].value : Utils.ippName("job-state", printer.jobAttrs["job-state"].value)
|
if (printer.jobAttrs.hasOwnProperty("job-state-message") && printer.jobAttrs["job-state-message"].value != "") {
|
||||||
|
msg = printer.jobAttrs["job-state-message"].value
|
||||||
|
}
|
||||||
|
else if (printer.jobAttrs.hasOwnProperty("job-state")) {
|
||||||
|
msg = Utils.ippName("job-state", printer.jobAttrs["job-state"].value)
|
||||||
|
}
|
||||||
if(status == true) {
|
if(status == true) {
|
||||||
notifier.notify(qsTr("Print success: ") + msg)
|
notifier.notify(qsTr("Print success: ") + msg)
|
||||||
pageStack.pop() //or replace?
|
pageStack.pop() //or replace?
|
||||||
|
|
Loading…
Reference in a new issue