From aac380aa49a4d78ea7ae82ad883f5d4d665fa410 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 18 Jan 2022 14:45:46 +0100 Subject: Simplify the machineErrorChecker --- cura/CuraApplication.py | 9 +-------- cura/Machines/MachineErrorChecker.py | 4 +--- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index c83153cbc1..e62ec97849 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Ultimaker B.V. +# Copyright (c) 2022 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. import os @@ -11,7 +11,6 @@ import numpy from PyQt5.QtCore import QObject, QTimer, QUrl, pyqtSignal, pyqtProperty, QEvent, Q_ENUMS from PyQt5.QtGui import QColor, QIcon from PyQt5.QtQml import qmlRegisterUncreatableType, qmlRegisterSingletonType, qmlRegisterType -from PyQt5.QtWidgets import QMessageBox import UM.Util import cura.Settings.cura_empty_instance_containers @@ -717,11 +716,6 @@ class CuraApplication(QtApplication): ContainerRegistry.getInstance().saveDirtyContainers() self.savePreferences() - def saveStack(self, stack): - if not self._enable_save: - return - ContainerRegistry.getInstance().saveContainer(stack) - @pyqtSlot(str, result = QUrl) def getDefaultPath(self, key): default_path = self.getPreferences().getValue("local_file/%s" % key) @@ -781,7 +775,6 @@ class CuraApplication(QtApplication): Logger.log("i", "Initializing machine error checker") self._machine_error_checker = MachineErrorChecker(self) - self._machine_error_checker.initialize() self.processEvents() Logger.log("i", "Initializing machine manager") diff --git a/cura/Machines/MachineErrorChecker.py b/cura/Machines/MachineErrorChecker.py index 8213734348..58ca8e49ef 100644 --- a/cura/Machines/MachineErrorChecker.py +++ b/cura/Machines/MachineErrorChecker.py @@ -50,12 +50,10 @@ class MachineErrorChecker(QObject): self._error_check_timer = QTimer(self) self._error_check_timer.setInterval(100) self._error_check_timer.setSingleShot(True) + self._error_check_timer.timeout.connect(self._rescheduleCheck) self._keys_to_check = set() # type: Set[str] - def initialize(self) -> None: - self._error_check_timer.timeout.connect(self._rescheduleCheck) - # Reconnect all signals when the active machine gets changed. self._machine_manager.globalContainerChanged.connect(self._onMachineChanged) -- cgit v1.2.3