mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-09-13 07:23:13 +08:00
Prevent crash when starting the firmware update twice
CURA-6Q
This commit is contained in:
parent
09f40c8f77
commit
1a04744679
@ -7,6 +7,8 @@ from enum import IntEnum
|
||||
from threading import Thread
|
||||
from typing import Union
|
||||
|
||||
from UM.Logger import Logger
|
||||
|
||||
MYPY = False
|
||||
if MYPY:
|
||||
from cura.PrinterOutput.PrinterOutputDevice import PrinterOutputDevice
|
||||
@ -38,8 +40,10 @@ class FirmwareUpdater(QObject):
|
||||
return
|
||||
|
||||
self._setFirmwareUpdateState(FirmwareUpdateState.updating)
|
||||
|
||||
self._update_firmware_thread.start()
|
||||
try:
|
||||
self._update_firmware_thread.start()
|
||||
except RuntimeError:
|
||||
Logger.warning("Could not start the update thread, since it's still running!")
|
||||
|
||||
def _updateFirmware(self) -> None:
|
||||
raise NotImplementedError("_updateFirmware needs to be implemented")
|
||||
|
Loading…
x
Reference in New Issue
Block a user