mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-15 02:37:49 -06:00
Start work on cloud icon
This commit is contained in:
parent
25caf1a087
commit
0588c54035
4 changed files with 23 additions and 5 deletions
|
@ -56,6 +56,7 @@ class PrinterOutputDevice(QObject, OutputDevice):
|
||||||
|
|
||||||
# Put ConnectionType here with Q_ENUMS() so it can be registered as a QML type and accessible via QML, and there is
|
# Put ConnectionType here with Q_ENUMS() so it can be registered as a QML type and accessible via QML, and there is
|
||||||
# no need to remember what those Enum integer values mean.
|
# no need to remember what those Enum integer values mean.
|
||||||
|
ConnectionType = ConnectionType
|
||||||
Q_ENUMS(ConnectionType)
|
Q_ENUMS(ConnectionType)
|
||||||
|
|
||||||
printersChanged = pyqtSignal()
|
printersChanged = pyqtSignal()
|
||||||
|
@ -133,7 +134,11 @@ class PrinterOutputDevice(QObject, OutputDevice):
|
||||||
def getConnectionType(self) -> "ConnectionType":
|
def getConnectionType(self) -> "ConnectionType":
|
||||||
return self._connection_type
|
return self._connection_type
|
||||||
|
|
||||||
@pyqtProperty(str, notify = connectionStateChanged)
|
@pyqtProperty(int, constant = True)
|
||||||
|
def connectionType(self) -> "ConnectionType":
|
||||||
|
return self._connection_type
|
||||||
|
|
||||||
|
@pyqtProperty(int, notify = connectionStateChanged)
|
||||||
def connectionState(self) -> "ConnectionState":
|
def connectionState(self) -> "ConnectionState":
|
||||||
return self._connection_state
|
return self._connection_state
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,7 @@ from UM.Scene.SceneNode import SceneNode
|
||||||
from cura.CuraApplication import CuraApplication
|
from cura.CuraApplication import CuraApplication
|
||||||
from cura.PrinterOutput.NetworkedPrinterOutputDevice import AuthState, NetworkedPrinterOutputDevice
|
from cura.PrinterOutput.NetworkedPrinterOutputDevice import AuthState, NetworkedPrinterOutputDevice
|
||||||
from cura.PrinterOutput.PrinterOutputModel import PrinterOutputModel
|
from cura.PrinterOutput.PrinterOutputModel import PrinterOutputModel
|
||||||
|
from cura.PrinterOutputDevice import ConnectionType
|
||||||
from plugins.UM3NetworkPrinting.src.Cloud.CloudOutputController import CloudOutputController
|
from plugins.UM3NetworkPrinting.src.Cloud.CloudOutputController import CloudOutputController
|
||||||
from ..MeshFormatHandler import MeshFormatHandler
|
from ..MeshFormatHandler import MeshFormatHandler
|
||||||
from ..UM3PrintJobOutputModel import UM3PrintJobOutputModel
|
from ..UM3PrintJobOutputModel import UM3PrintJobOutputModel
|
||||||
|
@ -86,7 +87,8 @@ class CloudOutputDevice(NetworkedPrinterOutputDevice):
|
||||||
# \param cluster: The device response received from the cloud API.
|
# \param cluster: The device response received from the cloud API.
|
||||||
# \param parent: The optional parent of this output device.
|
# \param parent: The optional parent of this output device.
|
||||||
def __init__(self, api_client: CloudApiClient, cluster: CloudClusterResponse, parent: QObject = None) -> None:
|
def __init__(self, api_client: CloudApiClient, cluster: CloudClusterResponse, parent: QObject = None) -> None:
|
||||||
super().__init__(device_id = cluster.cluster_id, address = "", properties = {}, parent = parent)
|
super().__init__(device_id = cluster.cluster_id, address = "",
|
||||||
|
connection_type = ConnectionType.CloudConnection, properties = {}, parent = parent)
|
||||||
self._api = api_client
|
self._api = api_client
|
||||||
self._cluster = cluster
|
self._cluster = cluster
|
||||||
|
|
||||||
|
|
|
@ -11,9 +11,10 @@ Cura.ExpandablePopup
|
||||||
{
|
{
|
||||||
id: machineSelector
|
id: machineSelector
|
||||||
|
|
||||||
property bool isNetworkPrinter: Cura.MachineManager.activeMachineHasRemoteConnection
|
|
||||||
property bool isPrinterConnected: Cura.MachineManager.printerConnected
|
|
||||||
property var outputDevice: Cura.MachineManager.printerOutputDevices.length >= 1 ? Cura.MachineManager.printerOutputDevices[0] : null
|
property var outputDevice: Cura.MachineManager.printerOutputDevices.length >= 1 ? Cura.MachineManager.printerOutputDevices[0] : null
|
||||||
|
property bool isNetworkPrinter: Cura.MachineManager.activeMachineHasRemoteConnection
|
||||||
|
property bool isCloudPrinter: machineSelector.outputDevice.connectionType == Cura.PrinterOutputDevice.CloudConnection
|
||||||
|
property bool isPrinterConnected: Cura.MachineManager.printerConnected
|
||||||
|
|
||||||
contentPadding: UM.Theme.getSize("default_lining").width
|
contentPadding: UM.Theme.getSize("default_lining").width
|
||||||
contentAlignment: Cura.ExpandablePopup.ContentAlignment.AlignLeft
|
contentAlignment: Cura.ExpandablePopup.ContentAlignment.AlignLeft
|
||||||
|
@ -52,7 +53,7 @@ Cura.ExpandablePopup
|
||||||
leftMargin: UM.Theme.getSize("thick_margin").width
|
leftMargin: UM.Theme.getSize("thick_margin").width
|
||||||
}
|
}
|
||||||
|
|
||||||
source: UM.Theme.getIcon("printer_connected")
|
source: machineSelector.isCloudPrinter ? UM.Theme.getIcon("printer_connected") : UM.Theme.getIcon("printer_connected")
|
||||||
width: UM.Theme.getSize("printer_status_icon").width
|
width: UM.Theme.getSize("printer_status_icon").width
|
||||||
height: UM.Theme.getSize("printer_status_icon").height
|
height: UM.Theme.getSize("printer_status_icon").height
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="14px" height="14px" viewBox="0 0 14 14" version="1.1" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<!-- Generator: Sketch 52.2 (67145) - http://www.bohemiancoding.com/sketch -->
|
||||||
|
<title>Artboard Copy 2</title>
|
||||||
|
<desc>Created with Sketch.</desc>
|
||||||
|
<g id="Artboard-Copy-2" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||||
|
<circle id="Oval-Copy" stroke="#FFFFFF" fill="#3282FF" cx="7" cy="7" r="6.5"></circle>
|
||||||
|
<path d="M9.8,6.08333333 C9.72,5.375 9.12,4.83333333 8.4,4.83333333 C8.2,4.83333333 8.04,4.875 7.88,4.95833333 C7.52,4.375 6.88,4 6.2,4 C5.08,4 4.2,4.91666667 4.2,6.08333333 C4.2,6.08333333 4.2,6.08333333 4.2,6.125 C3.52,6.20833333 3,6.83333333 3,7.54166667 C3,8.33333333 3.64,9 4.4,9 C5,9 8.88,9 9.6,9 C10.36,9 11,8.33333333 11,7.54166667 C11,6.79166667 10.48,6.20833333 9.8,6.08333333 Z" id="Path" fill="#FFFFFF"></path>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 930 B |
Loading…
Add table
Add a link
Reference in a new issue