mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-07-26 14:34:26 +08:00
Added handling for if there is no global stack
CURA-2475
This commit is contained in:
parent
ec63d6931e
commit
f71b23c72a
@ -75,7 +75,11 @@ class DiscoverUM3Action(MachineAction):
|
|||||||
@pyqtProperty("QVariantList", notify = printersChanged)
|
@pyqtProperty("QVariantList", notify = printersChanged)
|
||||||
def foundDevices(self):
|
def foundDevices(self):
|
||||||
if self._network_plugin:
|
if self._network_plugin:
|
||||||
global_printer_type = Application.getInstance().getGlobalContainerStack().getBottom().getId()
|
if Application.getInstance().getGlobalContainerStack():
|
||||||
|
global_printer_type = Application.getInstance().getGlobalContainerStack().getBottom().getId()
|
||||||
|
else:
|
||||||
|
global_printer_type = "unknown"
|
||||||
|
|
||||||
printers = list(self._network_plugin.getPrinters().values())
|
printers = list(self._network_plugin.getPrinters().values())
|
||||||
# TODO; There are still some testing printers that don't have a correct printer type, so don't filter out unkown ones just yet.
|
# TODO; There are still some testing printers that don't have a correct printer type, so don't filter out unkown ones just yet.
|
||||||
printers = [printer for printer in printers if printer.printerType == global_printer_type or printer.printerType == "unknown"]
|
printers = [printer for printer in printers if printer.printerType == global_printer_type or printer.printerType == "unknown"]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user