Actually perform the filtering based on machine type

CURA-2475
This commit is contained in:
Jaime van Kessel 2016-10-05 14:54:22 +02:00
parent 84defb27cf
commit ec63d6931e
2 changed files with 5 additions and 2 deletions

View file

@ -75,7 +75,10 @@ class DiscoverUM3Action(MachineAction):
@pyqtProperty("QVariantList", notify = printersChanged)
def foundDevices(self):
if self._network_plugin:
global_printer_type = Application.getInstance().getGlobalContainerStack().getBottom().getId()
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.
printers = [printer for printer in printers if printer.printerType == global_printer_type or printer.printerType == "unknown"]
printers.sort(key = lambda k: k.name)
return printers
else: