Fix machine settings page

CURA-6495
This commit is contained in:
Lipu Fei 2019-05-02 09:44:15 +02:00
parent b9d8b89113
commit 5fee82bcb7

View file

@ -35,6 +35,8 @@ class FirstStartMachineActionsModel(ListModel):
self._application = application
self._application.initializationFinished.connect(self._initialize)
self._previous_global_stack = None
def _initialize(self) -> None:
self._application.getMachineManager().globalContainerChanged.connect(self._update)
self._update()
@ -86,6 +88,12 @@ class FirstStartMachineActionsModel(ListModel):
self.setItems([])
return
# Do not update if the machine has not been switched. This can cause the SettingProviders on the Machine
# Setting page to do a force update, but they can use potential outdated cached values.
if self._previous_global_stack is not None and global_stack.getId() == self._previous_global_stack.getId():
return
self._previous_global_stack = global_stack
definition_id = global_stack.definition.getId()
first_start_actions = self._application.getMachineActionManager().getFirstStartActions(definition_id)