mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-14 18:27:51 -06:00
CURA-4895 Connect timer signal just if CuraApplication has been previously created and started
This commit is contained in:
parent
e1bca1ca5d
commit
915bb2e450
1 changed files with 1 additions and 10 deletions
|
@ -23,7 +23,6 @@ class AutoSave(Extension):
|
|||
self._change_timer = QTimer()
|
||||
self._change_timer.setInterval(Preferences.getInstance().getValue("cura/autosave_delay"))
|
||||
self._change_timer.setSingleShot(True)
|
||||
self._change_timer.timeout.connect(self._onTimeout)
|
||||
|
||||
self._saving = False
|
||||
|
||||
|
@ -46,6 +45,7 @@ class AutoSave(Extension):
|
|||
self._init_timer.start()
|
||||
return
|
||||
|
||||
self._change_timer.timeout.connect(self._onTimeout)
|
||||
Application.getInstance().globalContainerStackChanged.connect(self._onGlobalStackChanged)
|
||||
self._onGlobalStackChanged()
|
||||
|
||||
|
@ -67,15 +67,6 @@ class AutoSave(Extension):
|
|||
self._global_stack.containersChanged.connect(self._triggerTimer)
|
||||
|
||||
def _onTimeout(self):
|
||||
# only initialise if the application is created and has started
|
||||
from cura.CuraApplication import CuraApplication
|
||||
if not CuraApplication.Created:
|
||||
self._change_timer.start()
|
||||
return
|
||||
if not CuraApplication.getInstance().started:
|
||||
self._change_timer.start()
|
||||
return
|
||||
|
||||
self._saving = True # To prevent the save process from triggering another autosave.
|
||||
Logger.log("d", "Autosaving preferences, instances and profiles")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue