diff options
author | fieldOfView <aldo@fieldofview.com> | 2018-10-09 17:26:45 +0300 |
---|---|---|
committer | fieldOfView <aldo@fieldofview.com> | 2018-10-09 17:26:45 +0300 |
commit | a36deea651b6139f9290d585bb8945a29058c408 (patch) | |
tree | fc5781006034c41fc20d2b52dc18c60ea98bcc0b /plugins/FirmwareUpdater | |
parent | 04bca109ba67404081f069da488832c027a51571 (diff) |
Move updateFirmware to PrinterOutputDevice...
along with codestyle and typing fixes
Diffstat (limited to 'plugins/FirmwareUpdater')
-rw-r--r-- | plugins/FirmwareUpdater/FirmwareUpdaterMachineAction.py | 7 | ||||
-rw-r--r-- | plugins/FirmwareUpdater/FirmwareUpdaterMachineAction.qml | 4 |
2 files changed, 6 insertions, 5 deletions
diff --git a/plugins/FirmwareUpdater/FirmwareUpdaterMachineAction.py b/plugins/FirmwareUpdater/FirmwareUpdaterMachineAction.py index 981fb819eb..0a3e3a0ff0 100644 --- a/plugins/FirmwareUpdater/FirmwareUpdaterMachineAction.py +++ b/plugins/FirmwareUpdater/FirmwareUpdaterMachineAction.py @@ -15,6 +15,7 @@ MYPY = False if MYPY: from cura.PrinterOutput.FirmwareUpdater import FirmwareUpdater from cura.PrinterOutput.PrinterOutputDevice import PrinterOutputDevice + from UM.Settings.ContainerInterface import ContainerInterface catalog = i18nCatalog("cura") @@ -25,15 +26,15 @@ class FirmwareUpdaterMachineAction(MachineAction): self._qml_url = "FirmwareUpdaterMachineAction.qml" ContainerRegistry.getInstance().containerAdded.connect(self._onContainerAdded) - self._active_output_device = None #type: Optional[PrinterOutputDevice] - self._active_firmware_updater = None #type: Optional[FirmwareUpdater] + self._active_output_device = None # type: Optional[PrinterOutputDevice] + self._active_firmware_updater = None # type: Optional[FirmwareUpdater] CuraApplication.getInstance().engineCreatedSignal.connect(self._onEngineCreated) def _onEngineCreated(self) -> None: CuraApplication.getInstance().getMachineManager().outputDevicesChanged.connect(self._onOutputDevicesChanged) - def _onContainerAdded(self, container) -> None: + def _onContainerAdded(self, container: "ContainerInterface") -> None: # Add this action as a supported action to all machine definitions if they support USB connection if isinstance(container, DefinitionContainer) and container.getMetaDataEntry("type") == "machine" and container.getMetaDataEntry("supports_usb_connection"): CuraApplication.getInstance().getMachineActionManager().addSupportedAction(container.getId(), self.getKey()) diff --git a/plugins/FirmwareUpdater/FirmwareUpdaterMachineAction.qml b/plugins/FirmwareUpdater/FirmwareUpdaterMachineAction.qml index ab5bb89347..9a56dbb20a 100644 --- a/plugins/FirmwareUpdater/FirmwareUpdaterMachineAction.qml +++ b/plugins/FirmwareUpdater/FirmwareUpdaterMachineAction.qml @@ -16,7 +16,7 @@ Cura.MachineAction anchors.fill: parent; property bool printerConnected: Cura.MachineManager.printerConnected property var activeOutputDevice: printerConnected ? Cura.MachineManager.printerOutputDevices[0] : null - property var canUpdateFirmware: activeOutputDevice ? activeOutputDevice.activePrinter.canUpdateFirmware : false + property bool canUpdateFirmware: activeOutputDevice ? activeOutputDevice.activePrinter.canUpdateFirmware : false Column { @@ -51,7 +51,7 @@ Cura.MachineAction anchors.horizontalCenter: parent.horizontalCenter width: childrenRect.width spacing: UM.Theme.getSize("default_margin").width - property var firmwareName: Cura.MachineManager.activeMachine.getDefaultFirmwareName() + property string firmwareName: Cura.MachineManager.activeMachine.getDefaultFirmwareName() Button { id: autoUpgradeButton |