Add cloud connection condition

Contributes to CL-1165
This commit is contained in:
Ian Paschal 2019-01-17 15:44:37 +01:00
parent 495115c9f7
commit f3d0010b87
2 changed files with 14 additions and 5 deletions

View file

@ -4,6 +4,7 @@
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import UM 1.3 as UM import UM 1.3 as UM
import Cura 1.0 as Cura
/** /**
* A Print Job Card is essentially just a filled-in Expandable Card item. All * A Print Job Card is essentially just a filled-in Expandable Card item. All
@ -21,6 +22,10 @@ Item
// The print job which all other data is derived from // The print job which all other data is derived from
property var printJob: null property var printJob: null
// If the printer is a cloud printer or not. Other items base their enabled state off of this boolean. In the future
// they might not need to though.
property bool cloudConnection: Cura.MachineManager.activeMachineHasActiveCloudConnection
width: parent.width width: parent.width
height: childrenRect.height height: childrenRect.height
@ -209,7 +214,7 @@ Item
} }
width: 32 * screenScaleFactor // TODO: Theme! width: 32 * screenScaleFactor // TODO: Theme!
height: 32 * screenScaleFactor // TODO: Theme! height: 32 * screenScaleFactor // TODO: Theme!
enabled: base.enabled // TODO: Add cloud logic here! enabled: !cloudConnection
onClicked: enabled ? contextMenu.switchPopupState() : {} onClicked: enabled ? contextMenu.switchPopupState() : {}
visible: visible:
{ {

View file

@ -5,6 +5,7 @@ import QtQuick 2.3
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import QtQuick.Dialogs 1.1 import QtQuick.Dialogs 1.1
import UM 1.3 as UM import UM 1.3 as UM
import Cura 1.0 as Cura
/** /**
* A Printer Card is has two main components: the printer portion and the print job portion, the latter being paired in * A Printer Card is has two main components: the printer portion and the print job portion, the latter being paired in
@ -27,6 +28,10 @@ Item
// camera while the printer card is not "in focus" // camera while the printer card is not "in focus"
property var enabled: true property var enabled: true
// If the printer is a cloud printer or not. Other items base their enabled state off of this boolean. In the future
// they might not need to though.
property bool cloudConnection: Cura.MachineManager.activeMachineHasActiveCloudConnection
width: 834 * screenScaleFactor // TODO: Theme! width: 834 * screenScaleFactor // TODO: Theme!
height: childrenRect.height height: childrenRect.height
@ -167,8 +172,8 @@ Item
} }
width: 36 * screenScaleFactor // TODO: Theme! width: 36 * screenScaleFactor // TODO: Theme!
height: 36 * screenScaleFactor // TODO: Theme! height: 36 * screenScaleFactor // TODO: Theme!
// enabled: base.enabled enabled: !cloudConnection
enabled: false
onClicked: enabled ? contextMenu.switchPopupState() : {} onClicked: enabled ? contextMenu.switchPopupState() : {}
visible: visible:
{ {
@ -216,8 +221,7 @@ Item
bottomMargin: 20 * screenScaleFactor // TODO: Theme! bottomMargin: 20 * screenScaleFactor // TODO: Theme!
} }
iconSource: "../svg/icons/camera.svg" iconSource: "../svg/icons/camera.svg"
// enabled: base.enabled enabled: !cloudConnection
enabled: false
visible: printer visible: printer
} }