Checking first if the user has enabled the 'check for updates' preference - CURA-4224

This commit is contained in:
Diego Prado Gesto 2017-09-13 10:22:07 +02:00
parent 80992dd44c
commit aa2c7c2ff6

View File

@ -26,8 +26,11 @@ class FirmwareUpdateChecker(Extension):
# checked for the UM3. In the future if we need to check other printers' firmware
Preferences.getInstance().addPreference("info/latest_checked_firmware", "")
# Listen to a Signal that indicates a change in the active printer
ContainerRegistry.getInstance().containerAdded.connect(self._onContainerAdded)
# Listen to a Signal that indicates a change in the list of printers, just if the user has enabled the
# 'check for updates' option
Preferences.getInstance().addPreference("info/automatic_update_check", True)
if Preferences.getInstance().getValue("info/automatic_update_check"):
ContainerRegistry.getInstance().containerAdded.connect(self._onContainerAdded)
def _onContainerAdded(self, container):
# Only take care when a new GlobaStack was added