mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-14 18:27:51 -06:00
Remove hardcoded references to Ultimaker machines in QML
We shouldn't hardocode machines in QML in any case. It also created issues for other monitor / connection flows.
This commit is contained in:
parent
2e90078ec7
commit
e363f1af94
5 changed files with 22 additions and 30 deletions
|
@ -76,6 +76,10 @@ class GlobalStack(CuraContainerStack):
|
|||
def maxExtruderCount(self):
|
||||
return len(self.getMetaDataEntry("machine_extruder_trains"))
|
||||
|
||||
@pyqtProperty(bool, notify=configuredConnectionTypesChanged)
|
||||
def supportsNetworkConnection(self):
|
||||
return self.getMetaDataEntry("supports_network_connection", False)
|
||||
|
||||
@classmethod
|
||||
def getLoadingPriority(cls) -> int:
|
||||
return 2
|
||||
|
|
|
@ -12,7 +12,15 @@ Rectangle
|
|||
id: viewportOverlay
|
||||
|
||||
property bool isConnected: Cura.MachineManager.activeMachineHasNetworkConnection || Cura.MachineManager.activeMachineHasCloudConnection
|
||||
property bool isNetworkConfigurable: ["Ultimaker 3", "Ultimaker 3 Extended", "Ultimaker S5"].indexOf(Cura.MachineManager.activeMachineDefinitionName) > -1
|
||||
property bool isNetworkConfigurable:
|
||||
{
|
||||
if(Cura.MachineManager.activeMachine === null)
|
||||
{
|
||||
return false
|
||||
}
|
||||
return Cura.MachineManager.activeMachine.supportsNetworkConnection
|
||||
}
|
||||
|
||||
property bool isNetworkConfigured:
|
||||
{
|
||||
// Readability:
|
||||
|
@ -98,7 +106,6 @@ Rectangle
|
|||
width: contentWidth
|
||||
}
|
||||
|
||||
// CASE 3: CAN NOT MONITOR
|
||||
Label
|
||||
{
|
||||
id: noNetworkLabel
|
||||
|
@ -106,24 +113,8 @@ Rectangle
|
|||
{
|
||||
horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
visible: !isNetworkConfigured
|
||||
text: catalog.i18nc("@info", "Please select a network connected printer to monitor.")
|
||||
font: UM.Theme.getFont("medium")
|
||||
color: UM.Theme.getColor("monitor_text_primary")
|
||||
wrapMode: Text.WordWrap
|
||||
width: contentWidth
|
||||
lineHeight: UM.Theme.getSize("monitor_text_line_large").height
|
||||
lineHeightMode: Text.FixedHeight
|
||||
}
|
||||
Label
|
||||
{
|
||||
id: noNetworkUltimakerLabel
|
||||
anchors
|
||||
{
|
||||
horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
visible: !isNetworkConfigured && isNetworkConfigurable
|
||||
text: catalog.i18nc("@info", "Please connect your Ultimaker printer to your local network.")
|
||||
text: catalog.i18nc("@info", "Please connect your printer to the network.")
|
||||
font: UM.Theme.getFont("medium")
|
||||
color: UM.Theme.getColor("monitor_text_primary")
|
||||
wrapMode: Text.WordWrap
|
||||
|
@ -135,7 +126,7 @@ Rectangle
|
|||
{
|
||||
anchors
|
||||
{
|
||||
left: noNetworkUltimakerLabel.left
|
||||
left: noNetworkLabel.left
|
||||
}
|
||||
visible: !isNetworkConfigured && isNetworkConfigurable
|
||||
height: UM.Theme.getSize("monitor_text_line").height
|
||||
|
@ -160,7 +151,7 @@ Rectangle
|
|||
verticalCenter: externalLinkIcon.verticalCenter
|
||||
}
|
||||
color: UM.Theme.getColor("monitor_text_link")
|
||||
font: UM.Theme.getFont("medium") // 14pt, regular
|
||||
font: UM.Theme.getFont("medium")
|
||||
linkColor: UM.Theme.getColor("monitor_text_link")
|
||||
text: catalog.i18nc("@label link to technical assistance", "View user manuals online")
|
||||
renderType: Text.NativeRendering
|
||||
|
@ -170,14 +161,8 @@ Rectangle
|
|||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
onClicked: Qt.openUrlExternally("https://ultimaker.com/en/resources/manuals/ultimaker-3d-printers")
|
||||
onEntered:
|
||||
{
|
||||
manageQueueText.font.underline = true
|
||||
}
|
||||
onExited:
|
||||
{
|
||||
manageQueueText.font.underline = false
|
||||
}
|
||||
onEntered: manageQueueText.font.underline = true
|
||||
onExited: manageQueueText.font.underline = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,7 +17,8 @@
|
|||
{
|
||||
"0": "fdmextruder"
|
||||
},
|
||||
"supports_usb_connection": true
|
||||
"supports_usb_connection": true,
|
||||
"supports_network_connection": false
|
||||
},
|
||||
"settings":
|
||||
{
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
"first_start_actions": [ "DiscoverUM3Action" ],
|
||||
"supported_actions": [ "DiscoverUM3Action" ],
|
||||
"supports_usb_connection": false,
|
||||
"supports_network_connection": true,
|
||||
"firmware_update_info": {
|
||||
"id": 9066,
|
||||
"check_urls":
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
"first_start_actions": [ "DiscoverUM3Action" ],
|
||||
"supported_actions": [ "DiscoverUM3Action" ],
|
||||
"supports_usb_connection": false,
|
||||
"supports_network_connection": true,
|
||||
"weight": -1,
|
||||
"firmware_update_info": {
|
||||
"id": 9051,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue