mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 23:46:22 -06:00
Fix typing
This commit is contained in:
parent
9e92a186ec
commit
cf5fd1c355
2 changed files with 11 additions and 5 deletions
|
@ -1,11 +1,13 @@
|
||||||
# Copyright (c) 2017 Ultimaker B.V.
|
# Copyright (c) 2017 Ultimaker B.V.
|
||||||
# Cura is released under the terms of the LGPLv3 or higher.
|
# Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
|
from typing import Optional
|
||||||
|
|
||||||
from PyQt5.QtCore import pyqtProperty, QObject
|
from PyQt5.QtCore import pyqtProperty, QObject
|
||||||
|
|
||||||
|
|
||||||
class MaterialOutputModel(QObject):
|
class MaterialOutputModel(QObject):
|
||||||
def __init__(self, guid: str, type: str, color: str, brand: str, name: str, parent = None) -> None:
|
def __init__(self, guid: Optional[str], type: str, color: str, brand: str, name: str, parent = None) -> None:
|
||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
self._guid = guid
|
self._guid = guid
|
||||||
self._type = type
|
self._type = type
|
||||||
|
@ -15,7 +17,7 @@ class MaterialOutputModel(QObject):
|
||||||
|
|
||||||
@pyqtProperty(str, constant = True)
|
@pyqtProperty(str, constant = True)
|
||||||
def guid(self) -> str:
|
def guid(self) -> str:
|
||||||
return self._guid
|
return self._guid if self._guid else ""
|
||||||
|
|
||||||
@pyqtProperty(str, constant = True)
|
@pyqtProperty(str, constant = True)
|
||||||
def type(self) -> str:
|
def type(self) -> str:
|
||||||
|
|
|
@ -25,7 +25,11 @@ from UM.Version import Version
|
||||||
from . import ClusterUM3OutputDevice, LegacyUM3OutputDevice
|
from . import ClusterUM3OutputDevice, LegacyUM3OutputDevice
|
||||||
from .Cloud.CloudOutputDeviceManager import CloudOutputDeviceManager
|
from .Cloud.CloudOutputDeviceManager import CloudOutputDeviceManager
|
||||||
|
|
||||||
from typing import Optional
|
from typing import Optional, TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from cura.Settings.GlobalStack import GlobalStack
|
||||||
|
|
||||||
|
|
||||||
i18n_catalog = i18nCatalog("cura")
|
i18n_catalog = i18nCatalog("cura")
|
||||||
|
|
||||||
|
@ -431,7 +435,7 @@ class UM3OutputDevicePlugin(OutputDevicePlugin):
|
||||||
Logger.log("d", "Checking if cloud connection is possible...")
|
Logger.log("d", "Checking if cloud connection is possible...")
|
||||||
|
|
||||||
# Pre-Check: Skip if active machine already has been cloud connected or you said don't ask again
|
# Pre-Check: Skip if active machine already has been cloud connected or you said don't ask again
|
||||||
active_machine = self._application.getMachineManager().activeMachine # type: Optional["GlobalStack"]
|
active_machine = self._application.getMachineManager().activeMachine # type: Optional[GlobalStack]
|
||||||
if active_machine:
|
if active_machine:
|
||||||
|
|
||||||
# Check 1A: Printer isn't already configured for cloud
|
# Check 1A: Printer isn't already configured for cloud
|
||||||
|
@ -519,7 +523,7 @@ class UM3OutputDevicePlugin(OutputDevicePlugin):
|
||||||
return
|
return
|
||||||
|
|
||||||
def _onDontAskMeAgain(self, checked: bool) -> None:
|
def _onDontAskMeAgain(self, checked: bool) -> None:
|
||||||
active_machine = self._application.getMachineManager().activeMachine # type: Optional["GlobalStack"]
|
active_machine = self._application.getMachineManager().activeMachine # type: Optional[GlobalStack]
|
||||||
if active_machine:
|
if active_machine:
|
||||||
active_machine.setMetaDataEntry("do_not_show_cloud_message", checked)
|
active_machine.setMetaDataEntry("do_not_show_cloud_message", checked)
|
||||||
if checked:
|
if checked:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue