mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 15:07:28 -06:00
CURA-5090 added timer to SettingInheritanceManager._update
This commit is contained in:
parent
b983a50bcd
commit
9f40e3925d
1 changed files with 7 additions and 4 deletions
|
@ -1,7 +1,7 @@
|
|||
# Copyright (c) 2017 Ultimaker B.V.
|
||||
# Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
from PyQt5.QtCore import QObject, pyqtProperty, pyqtSignal
|
||||
from PyQt5.QtCore import QObject, QTimer, pyqtProperty, pyqtSignal
|
||||
from UM.FlameProfiler import pyqtSlot
|
||||
from UM.Application import Application
|
||||
from UM.Logger import Logger
|
||||
|
@ -30,6 +30,11 @@ class SettingInheritanceManager(QObject):
|
|||
ExtruderManager.getInstance().activeExtruderChanged.connect(self._onActiveExtruderChanged)
|
||||
self._onActiveExtruderChanged()
|
||||
|
||||
self._update_timer = QTimer()
|
||||
self._update_timer.setInterval(500)
|
||||
self._update_timer.setSingleShot(True)
|
||||
self._update_timer.timeout.connect(self._update)
|
||||
|
||||
settingsWithIntheritanceChanged = pyqtSignal()
|
||||
|
||||
## Get the keys of all children settings with an override.
|
||||
|
@ -226,9 +231,7 @@ class SettingInheritanceManager(QObject):
|
|||
self._onActiveExtruderChanged()
|
||||
|
||||
def _onContainersChanged(self, container):
|
||||
# TODO: Multiple container changes in sequence now cause quite a few recalculations.
|
||||
# This isn't that big of an issue, but it could be in the future.
|
||||
self._update()
|
||||
self._update_timer.start()
|
||||
|
||||
@staticmethod
|
||||
def createSettingInheritanceManager(engine=None, script_engine=None):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue