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 {
|
||||
target: printer
|
||||
onJobAttrsFinished: {
|
||||
var msg = printer.jobAttrs["job-state-message"] && printer.jobAttrs["job-state-message"].value != ""
|
||||
? printer.jobAttrs["job-state-message"].value : Utils.ippName("job-state", printer.jobAttrs["job-state"].value)
|
||||
var msg = ""
|
||||
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) {
|
||||
notifier.notify(qsTr("Print success: ") + msg)
|
||||
pageStack.pop() //or replace?
|
||||
|
|
Loading…
Reference in a new issue