From 1947d773a3f59b2421db9c977096181e795c3ab4 Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Wed, 5 Aug 2015 20:12:29 +0200 Subject: [PATCH] Update all usage of activeMachine to the new API --- cura/CuraApplication.py | 2 +- cura/PrintInformation.py | 4 ++-- plugins/CuraEngineBackend/CuraEngineBackend.py | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 2a62cbaa2e..690229220c 100644 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -83,7 +83,7 @@ class CuraApplication(QtApplication): self._previous_active_tool = None self._platform_activity = False - self.activeMachineChanged.connect(self._onActiveMachineChanged) + self.getMachineManager().activeMachineInstanceChanged.connect(self._onActiveMachineChanged) Resources.addType(self.ResourceTypes.QmlFiles, "qml") Resources.addType(self.ResourceTypes.Firmware, "firmware") diff --git a/cura/PrintInformation.py b/cura/PrintInformation.py index 6df4ae04f6..f4a574c0b9 100644 --- a/cura/PrintInformation.py +++ b/cura/PrintInformation.py @@ -66,7 +66,7 @@ class PrintInformation(QObject): self._slice_pass = None self._slice_reason = None - Application.getInstance().activeMachineChanged.connect(self._onActiveMachineChanged) + Application.getInstance().getMachineManager().activeMachineInstanceChanged.connect(self._onActiveMachineChanged) self._onActiveMachineChanged() Application.getInstance().getController().getScene().sceneChanged.connect(self._onSceneChanged) @@ -179,7 +179,7 @@ class PrintInformation(QObject): if self._current_settings: self._current_settings.settingChanged.disconnect(self._onSettingChanged) - self._current_settings = Application.getInstance().getActiveMachine() + self._current_settings = Application.getInstance().getMachineManager().getActiveMachineInstance() if self._current_settings: self._current_settings.settingChanged.connect(self._onSettingChanged) diff --git a/plugins/CuraEngineBackend/CuraEngineBackend.py b/plugins/CuraEngineBackend/CuraEngineBackend.py index e204285e23..d3f7ec8bbe 100644 --- a/plugins/CuraEngineBackend/CuraEngineBackend.py +++ b/plugins/CuraEngineBackend/CuraEngineBackend.py @@ -45,7 +45,7 @@ class CuraEngineBackend(Backend): self._stored_layer_data = None self._settings = None - Application.getInstance().activeMachineChanged.connect(self._onActiveMachineChanged) + Application.getInstance().getMachineManager().activeMachineInstanceChanged.connect(self._onActiveMachineChanged) self._onActiveMachineChanged() self._change_timer = QTimer() @@ -71,7 +71,7 @@ class CuraEngineBackend(Backend): self.backendConnected.connect(self._onBackendConnected) def getEngineCommand(self): - return [Preferences.getInstance().getValue("backend/location"), "connect", "127.0.0.1:{0}".format(self._port), "-j", Resources.getPath(Resources.Settings, "fdmprinter.json"), "-vv"] + return [Preferences.getInstance().getValue("backend/location"), "connect", "127.0.0.1:{0}".format(self._port), "-j", Resources.getPath(Resources.MachineDefinitions, "fdmprinter.json"), "-vv"] ## Emitted when we get a message containing print duration and material amount. This also implies the slicing has finished. # \param time The amount of time the print will take. @@ -194,7 +194,7 @@ class CuraEngineBackend(Backend): if self._settings: self._settings.settingChanged.disconnect(self._onSettingChanged) - self._settings = Application.getInstance().getActiveMachine() + self._settings = Application.getInstance().getMachineManager().getActiveMachineInstance() if self._settings: self._settings.settingChanged.connect(self._onSettingChanged) self._onChanged()