mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-15 16:35:57 +08:00
Merge branch 'master' of https://github.com/Ultimaker/JediWifiPrintingPlugin
This commit is contained in:
commit
89f4224a46
@ -39,6 +39,11 @@ class DiscoverUM3Action(MachineAction):
|
|||||||
self._network_plugin.printerListChanged.connect(self._onPrinterDiscoveryChanged)
|
self._network_plugin.printerListChanged.connect(self._onPrinterDiscoveryChanged)
|
||||||
self.printersChanged.emit()
|
self.printersChanged.emit()
|
||||||
|
|
||||||
|
## Re-filters the list of printers.
|
||||||
|
@pyqtSlot()
|
||||||
|
def reset(self):
|
||||||
|
self.printersChanged.emit()
|
||||||
|
|
||||||
@pyqtSlot()
|
@pyqtSlot()
|
||||||
def restartDiscovery(self):
|
def restartDiscovery(self):
|
||||||
# Ensure that there is a bit of time after a printer has been discovered.
|
# Ensure that there is a bit of time after a printer has been discovered.
|
||||||
@ -75,7 +80,14 @@ 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()
|
||||||
|
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.
|
||||||
|
printers = [printer for printer in printers if printer.printerType == global_printer_type or printer.printerType == "unknown"]
|
||||||
printers.sort(key = lambda k: k.name)
|
printers.sort(key = lambda k: k.name)
|
||||||
return printers
|
return printers
|
||||||
else:
|
else:
|
||||||
|
@ -228,7 +228,26 @@ Cura.MachineAction
|
|||||||
{
|
{
|
||||||
width: parent.width * 0.5
|
width: parent.width * 0.5
|
||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
text: true ? catalog.i18nc("@label", "Ultimaker 3") : catalog.i18nc("@label", "Ultimaker 3 Extended")
|
text:
|
||||||
|
{
|
||||||
|
if(base.selectedPrinter)
|
||||||
|
{
|
||||||
|
if(base.selectedPrinter.printerType == "ultimaker3")
|
||||||
|
{
|
||||||
|
return catalog.i18nc("@label", "Ultimaker 3")
|
||||||
|
} else if(base.selectedPrinter.printerType == "ultimaker3_extended")
|
||||||
|
{
|
||||||
|
return catalog.i18nc("@label", "Ultimaker 3 Extended")
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
return catalog.i18nc("@label", "Unknown") // We have no idea what type it is. Should not happen 'in the field'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
|
@ -167,10 +167,10 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
|||||||
self._compressing_print = False
|
self._compressing_print = False
|
||||||
|
|
||||||
printer_type = self._properties.get(b"machine", b"").decode("utf-8")
|
printer_type = self._properties.get(b"machine", b"").decode("utf-8")
|
||||||
if printer_type == "9511.0":
|
if printer_type.startswith("9511"):
|
||||||
self._updatePrinterType("UM3Extended")
|
self._updatePrinterType("ultimaker3_extended")
|
||||||
elif printer_type == "9066.0":
|
elif printer_type.startswith("9066"):
|
||||||
self._updatePrinterType("UM3")
|
self._updatePrinterType("ultimaker3")
|
||||||
else:
|
else:
|
||||||
self._updatePrinterType("unknown")
|
self._updatePrinterType("unknown")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user