mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-15 01:55:57 +08:00
Merge branch 'master' of github.com:Ultimaker/Cura
This commit is contained in:
commit
6362d5145e
@ -114,10 +114,14 @@ class USBPrinterOutputDeviceManager(QObject, OutputDevicePlugin):
|
|||||||
:param only_list_usb: If true, only usb ports are listed
|
:param only_list_usb: If true, only usb ports are listed
|
||||||
"""
|
"""
|
||||||
base_list = []
|
base_list = []
|
||||||
for port in serial.tools.list_ports.comports():
|
try:
|
||||||
|
port_list = serial.tools.list_ports.comports()
|
||||||
|
except TypeError: # Bug in PySerial causes a TypeError if port gets disconnected while processing.
|
||||||
|
port_list = []
|
||||||
|
for port in port_list:
|
||||||
if not isinstance(port, tuple):
|
if not isinstance(port, tuple):
|
||||||
port = (port.device, port.description, port.hwid)
|
port = (port.device, port.description, port.hwid)
|
||||||
if not port[2]: # HWID may be None if the port got disconnected while processing.
|
if not port[2]: # HWID may be None if the device is not USB or the system doesn't report the type.
|
||||||
continue
|
continue
|
||||||
if only_list_usb and not port[2].startswith("USB"):
|
if only_list_usb and not port[2].startswith("USB"):
|
||||||
continue
|
continue
|
||||||
|
@ -216,14 +216,5 @@ UM.Dialog
|
|||||||
base.hide()
|
base.hide()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Button
|
|
||||||
{
|
|
||||||
id: createNewProfileButton
|
|
||||||
text: catalog.i18nc("@action:button", "Create New Profile");
|
|
||||||
anchors.left: parent.left
|
|
||||||
action: Cura.Actions.addProfile
|
|
||||||
onClicked: base.hide()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user