mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-07-06 13:25:10 +08:00
Simplify GlobalStacksModel
CURA-6483
This commit is contained in:
parent
ed8127777c
commit
d6f4ddc322
@ -5,6 +5,7 @@ from PyQt5.QtCore import Qt, QTimer
|
|||||||
|
|
||||||
from UM.Qt.ListModel import ListModel
|
from UM.Qt.ListModel import ListModel
|
||||||
from UM.i18n import i18nCatalog
|
from UM.i18n import i18nCatalog
|
||||||
|
from UM.Util import parseBool
|
||||||
|
|
||||||
from cura.PrinterOutput.PrinterOutputDevice import ConnectionType
|
from cura.PrinterOutput.PrinterOutputDevice import ConnectionType
|
||||||
from cura.Settings.CuraContainerRegistry import CuraContainerRegistry
|
from cura.Settings.CuraContainerRegistry import CuraContainerRegistry
|
||||||
@ -54,7 +55,6 @@ class GlobalStacksModel(ListModel):
|
|||||||
items = []
|
items = []
|
||||||
|
|
||||||
container_stacks = CuraContainerRegistry.getInstance().findContainerStacks(type = "machine")
|
container_stacks = CuraContainerRegistry.getInstance().findContainerStacks(type = "machine")
|
||||||
|
|
||||||
for container_stack in container_stacks:
|
for container_stack in container_stacks:
|
||||||
has_remote_connection = False
|
has_remote_connection = False
|
||||||
|
|
||||||
@ -62,7 +62,7 @@ class GlobalStacksModel(ListModel):
|
|||||||
has_remote_connection |= connection_type in [ConnectionType.NetworkConnection.value,
|
has_remote_connection |= connection_type in [ConnectionType.NetworkConnection.value,
|
||||||
ConnectionType.CloudConnection.value]
|
ConnectionType.CloudConnection.value]
|
||||||
|
|
||||||
if container_stack.getMetaDataEntry("hidden", False) in ["True", True]:
|
if parseBool(container_stack.getMetaDataEntry("hidden", False)):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
section_name = "Network enabled printers" if has_remote_connection else "Local printers"
|
section_name = "Network enabled printers" if has_remote_connection else "Local printers"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user