Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKostas Karmas <konskarm@gmail.com>2020-10-30 14:44:59 +0300
committerKostas Karmas <konskarm@gmail.com>2020-10-30 14:44:59 +0300
commitadc80729918470c9f096e759eefcc794a5398365 (patch)
tree9f48ec68a0fbf5c694962dec71a4c609d94f0d71 /plugins/UM3NetworkPrinting
parente8e90e398abb12d3e74d53c46b3a676d0c38b1a9 (diff)
Hide queue in Monitor page if printer does not support it
CURA-7784
Diffstat (limited to 'plugins/UM3NetworkPrinting')
-rw-r--r--plugins/UM3NetworkPrinting/resources/qml/MonitorStage.qml1
-rw-r--r--plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py6
-rw-r--r--plugins/UM3NetworkPrinting/src/Models/Http/CloudClusterResponse.py6
3 files changed, 11 insertions, 2 deletions
diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorStage.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorStage.qml
index 47c45f8b11..dc69d89fed 100644
--- a/plugins/UM3NetworkPrinting/resources/qml/MonitorStage.qml
+++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorStage.qml
@@ -72,6 +72,7 @@ Component
top: printers.bottom
topMargin: 48 * screenScaleFactor // TODO: Theme!
}
+ visible: OutputDevice.supportsPrintJobQueue
}
PrinterVideoStream
diff --git a/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py b/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py
index 9314e067a2..0c6ed4548a 100644
--- a/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py
+++ b/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py
@@ -287,6 +287,12 @@ class CloudOutputDevice(UltimakerNetworkedPrinterOutputDevice):
firmware_version = Version([version_number[0], version_number[1], version_number[2]])
return firmware_version >= self.PRINT_JOB_ACTIONS_MIN_VERSION
+ @pyqtProperty(bool)
+ def supportsPrintJobQueue(self) -> bool:
+ """Gets whether the printer supports a queue"""
+
+ return "queue" in self._cluster.capabilities if self._cluster.capabilities else False
+
def setJobState(self, print_job_uuid: str, state: str) -> None:
"""Set the remote print job state."""
diff --git a/plugins/UM3NetworkPrinting/src/Models/Http/CloudClusterResponse.py b/plugins/UM3NetworkPrinting/src/Models/Http/CloudClusterResponse.py
index a9107db3c8..1af3d83964 100644
--- a/plugins/UM3NetworkPrinting/src/Models/Http/CloudClusterResponse.py
+++ b/plugins/UM3NetworkPrinting/src/Models/Http/CloudClusterResponse.py
@@ -1,6 +1,6 @@
# Copyright (c) 2019 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
-from typing import Optional
+from typing import Optional, List
from ..BaseModel import BaseModel
@@ -11,7 +11,8 @@ class CloudClusterResponse(BaseModel):
def __init__(self, cluster_id: str, host_guid: str, host_name: str, is_online: bool, status: str,
host_internal_ip: Optional[str] = None, host_version: Optional[str] = None,
- friendly_name: Optional[str] = None, printer_type: str = "ultimaker3", printer_count: int = 1, **kwargs) -> None:
+ friendly_name: Optional[str] = None, printer_type: str = "ultimaker3", printer_count: int = 1,
+ capabilities: Optional[List[str]] = None, **kwargs) -> None:
"""Creates a new cluster response object.
:param cluster_id: The secret unique ID, e.g. 'kBEeZWEifXbrXviO8mRYLx45P8k5lHVGs43XKvRniPg='.
@@ -36,6 +37,7 @@ class CloudClusterResponse(BaseModel):
self.friendly_name = friendly_name
self.printer_type = printer_type
self.printer_count = printer_count
+ self.capabilities = capabilities
super().__init__(**kwargs)
# Validates the model, raising an exception if the model is invalid.