Fixed some QML errors

This commit is contained in:
Jaime van Kessel 2018-08-24 17:08:32 +02:00
parent 39b12fed77
commit 1749a6f9d5

View file

@ -323,7 +323,7 @@ Component
Controls2.Button Controls2.Button
{ {
id: pauseButton id: pauseButton
text: modelData.activePrintJob.state == "paused" ? catalog.i18nc("@label", "Resume") : catalog.i18nc("@label", "Pause") text: modelData.activePrintJob != null && modelData.activePrintJob.state == "paused" ? catalog.i18nc("@label", "Resume") : catalog.i18nc("@label", "Pause")
onClicked: onClicked:
{ {
if(modelData.activePrintJob.state == "paused") if(modelData.activePrintJob.state == "paused")
@ -337,7 +337,7 @@ Component
popup.close() popup.close()
} }
width: parent.width width: parent.width
enabled: ["paused", "printing"].indexOf(modelData.activePrintJob.state) >= 0 enabled: modelData.activePrintJob != null && ["paused", "printing"].indexOf(modelData.activePrintJob.state) >= 0
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 10 anchors.topMargin: 10
hoverEnabled: true hoverEnabled: true
@ -360,7 +360,7 @@ Component
width: parent.width width: parent.width
anchors.top: pauseButton.bottom anchors.top: pauseButton.bottom
hoverEnabled: true hoverEnabled: true
enabled: ["paused", "printing", "pre_print"].indexOf(modelData.activePrintJob.state) >= 0 enabled: modelData.activePrintJob != null && ["paused", "printing", "pre_print"].indexOf(modelData.activePrintJob.state) >= 0
background: Rectangle background: Rectangle
{ {
opacity: abortButton.down || abortButton.hovered ? 1 : 0 opacity: abortButton.down || abortButton.hovered ? 1 : 0