mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-18 20:28:01 -06:00
Added handling for if there is no global stack
CURA-2475
This commit is contained in:
parent
ec63d6931e
commit
f71b23c72a
1 changed files with 5 additions and 1 deletions
|
@ -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:
|
||||||
|
if Application.getInstance().getGlobalContainerStack():
|
||||||
global_printer_type = Application.getInstance().getGlobalContainerStack().getBottom().getId()
|
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…
Add table
Add a link
Reference in a new issue