mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 23:17:32 -06: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
1 changed files with 9 additions and 1 deletions
|
@ -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:
|
||||||
printer_connection.updateFirmware(Resources.getPath(Resources.FirmwareLocation, self._getDefaultFirmwareName()))
|
try:
|
||||||
|
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…
Add table
Add a link
Reference in a new issue