mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Add connection status message
CURA-7437
This commit is contained in:
parent
de5c6f9318
commit
4d5ef91c43
1 changed files with 13 additions and 5 deletions
|
@ -16,7 +16,7 @@ Cura.ExpandablePopup
|
||||||
property bool isCloudRegistered: Cura.MachineManager.activeMachineHasCloudRegistration
|
property bool isCloudRegistered: Cura.MachineManager.activeMachineHasCloudRegistration
|
||||||
property bool isGroup: Cura.MachineManager.activeMachineIsGroup
|
property bool isGroup: Cura.MachineManager.activeMachineIsGroup
|
||||||
|
|
||||||
property string connectionStatus: {
|
readonly property string connectionStatus: {
|
||||||
if (isNetworkPrinter)
|
if (isNetworkPrinter)
|
||||||
{
|
{
|
||||||
return "printer_connected"
|
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
|
contentPadding: UM.Theme.getSize("default_lining").width
|
||||||
contentAlignment: Cura.ExpandablePopup.ContentAlignment.AlignLeft
|
contentAlignment: Cura.ExpandablePopup.ContentAlignment.AlignLeft
|
||||||
|
|
||||||
|
@ -113,8 +122,7 @@ Cura.ExpandablePopup
|
||||||
{
|
{
|
||||||
id: connectionStatusTooltipHoverArea
|
id: connectionStatusTooltipHoverArea
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
hoverEnabled: true
|
hoverEnabled: connectionStatusMessage !== ""
|
||||||
enabled: true // todo
|
|
||||||
acceptedButtons: Qt.NoButton // react to hover only, don't steal clicks
|
acceptedButtons: Qt.NoButton // react to hover only, don't steal clicks
|
||||||
|
|
||||||
onEntered:
|
onEntered:
|
||||||
|
@ -122,8 +130,8 @@ Cura.ExpandablePopup
|
||||||
base.showTooltip(
|
base.showTooltip(
|
||||||
connectionStatusImage,
|
connectionStatusImage,
|
||||||
Qt.point(0, 0),
|
Qt.point(0, 0),
|
||||||
"blaat blaat"
|
connectionStatusMessage
|
||||||
); //todo
|
); //todo: positioning
|
||||||
machineSelector.mouseArea.entered() // we want both this and the outer area to be entered
|
machineSelector.mouseArea.entered() // we want both this and the outer area to be entered
|
||||||
}
|
}
|
||||||
onExited: base.hideTooltip()
|
onExited: base.hideTooltip()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue