diff options
author | Jaime van Kessel <nallath@gmail.com> | 2019-05-03 15:10:21 +0300 |
---|---|---|
committer | Jaime van Kessel <nallath@gmail.com> | 2019-05-03 15:10:21 +0300 |
commit | e363f1af948b013d5a15005847986826638ac78d (patch) | |
tree | 22982da1debd5019d6197d724dda8e0e466833db /plugins/MonitorStage | |
parent | 2e90078ec705f04daa0ebfbec84577434a1948a3 (diff) |
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.
Diffstat (limited to 'plugins/MonitorStage')
-rw-r--r-- | plugins/MonitorStage/MonitorMain.qml | 43 |
1 files changed, 14 insertions, 29 deletions
diff --git a/plugins/MonitorStage/MonitorMain.qml b/plugins/MonitorStage/MonitorMain.qml index 88193737bb..9e719ddb43 100644 --- a/plugins/MonitorStage/MonitorMain.qml +++ b/plugins/MonitorStage/MonitorMain.qml @@ -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 } } } |