Ensure that first start machine actions model gets initialized

CURA-6932
This commit is contained in:
Jaime van Kessel 2019-10-28 16:33:08 +01:00
parent 9906d454ce
commit 26ba0e645a
No known key found for this signature in database
GPG key ID: 3710727397403C91
2 changed files with 4 additions and 2 deletions

View file

@ -880,6 +880,8 @@ class CuraApplication(QtApplication):
def getFirstStartMachineActionsModel(self, *args) -> "FirstStartMachineActionsModel": def getFirstStartMachineActionsModel(self, *args) -> "FirstStartMachineActionsModel":
if self._first_start_machine_actions_model is None: if self._first_start_machine_actions_model is None:
self._first_start_machine_actions_model = FirstStartMachineActionsModel(self, parent = self) self._first_start_machine_actions_model = FirstStartMachineActionsModel(self, parent = self)
if self.started:
self._first_start_machine_actions_model.initialize()
return self._first_start_machine_actions_model return self._first_start_machine_actions_model
@pyqtSlot(result = QObject) @pyqtSlot(result = QObject)

View file

@ -33,11 +33,11 @@ class FirstStartMachineActionsModel(ListModel):
self._current_action_index = 0 self._current_action_index = 0
self._application = application self._application = application
self._application.initializationFinished.connect(self._initialize) self._application.initializationFinished.connect(self.initialize)
self._previous_global_stack = None self._previous_global_stack = None
def _initialize(self) -> None: def initialize(self) -> None:
self._application.getMachineManager().globalContainerChanged.connect(self._update) self._application.getMachineManager().globalContainerChanged.connect(self._update)
self._update() self._update()