Add connection status message

CURA-7437
This commit is contained in:
Nino van Hooff 2020-05-26 13:50:15 +02:00
parent de5c6f9318
commit 4d5ef91c43

View file

@ -16,7 +16,7 @@ Cura.ExpandablePopup
property bool isCloudRegistered: Cura.MachineManager.activeMachineHasCloudRegistration
property bool isGroup: Cura.MachineManager.activeMachineIsGroup
property string connectionStatus: {
readonly property string connectionStatus: {
if (isNetworkPrinter)
{
return "printer_connected"
@ -35,6 +35,15 @@ Cura.ExpandablePopup
}
}
readonly property string connectionStatusMessage: {
if (connectionStatus == "printer_cloud_not_available")
{
return "The cloud connection is currently unavailable. Please check your internet connection and sign in to connect to the cloud printer"
} else {
return ""
}
}
contentPadding: UM.Theme.getSize("default_lining").width
contentAlignment: Cura.ExpandablePopup.ContentAlignment.AlignLeft
@ -113,8 +122,7 @@ Cura.ExpandablePopup
{
id: connectionStatusTooltipHoverArea
anchors.fill: parent
hoverEnabled: true
enabled: true // todo
hoverEnabled: connectionStatusMessage !== ""
acceptedButtons: Qt.NoButton // react to hover only, don't steal clicks
onEntered:
@ -122,8 +130,8 @@ Cura.ExpandablePopup
base.showTooltip(
connectionStatusImage,
Qt.point(0, 0),
"blaat blaat"
); //todo
connectionStatusMessage
); //todo: positioning
machineSelector.mouseArea.entered() // we want both this and the outer area to be entered
}
onExited: base.hideTooltip()