mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 17:39:03 +08:00
Do not show a firmware update window if there are no printers connected
Contributes to Ultimaker/Uranium#8
This commit is contained in:
parent
8b9dbec188
commit
a604f2041a
@ -7,6 +7,7 @@ from UM.Application import Application
|
|||||||
from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator
|
from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator
|
||||||
from UM.Scene.SceneNode import SceneNode
|
from UM.Scene.SceneNode import SceneNode
|
||||||
from UM.Resources import Resources
|
from UM.Resources import Resources
|
||||||
|
from UM.Logger import Logger
|
||||||
import threading
|
import threading
|
||||||
import platform
|
import platform
|
||||||
import glob
|
import glob
|
||||||
@ -110,9 +111,16 @@ class USBPrinterManager(QObject, SignalEmitter, Extension):
|
|||||||
time.sleep(5) # Throttle, as we don"t need this information to be updated every single second.
|
time.sleep(5) # Throttle, as we don"t need this information to be updated every single second.
|
||||||
|
|
||||||
def updateAllFirmware(self):
|
def updateAllFirmware(self):
|
||||||
|
if not self._printer_connections:
|
||||||
|
Logger.log("e", "No printer connected to update firmware of!")
|
||||||
|
return
|
||||||
|
|
||||||
self.spawnFirmwareInterface("")
|
self.spawnFirmwareInterface("")
|
||||||
for printer_connection in self._printer_connections:
|
for printer_connection in self._printer_connections:
|
||||||
|
try:
|
||||||
printer_connection.updateFirmware(Resources.getPath(Resources.FirmwareLocation, self._getDefaultFirmwareName()))
|
printer_connection.updateFirmware(Resources.getPath(Resources.FirmwareLocation, self._getDefaultFirmwareName()))
|
||||||
|
except FileNotFoundError:
|
||||||
|
continue
|
||||||
|
|
||||||
def updateFirmwareBySerial(self, serial_port):
|
def updateFirmwareBySerial(self, serial_port):
|
||||||
printer_connection = self.getConnectionByPort(serial_port)
|
printer_connection = self.getConnectionByPort(serial_port)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user