Move backend location preference into the backend class and use the new api

This commit is contained in:
Arjen Hiemstra 2015-03-11 18:10:44 +01:00
parent 27f475dc79
commit 4e6322d94e
2 changed files with 3 additions and 4 deletions

View file

@ -17,6 +17,8 @@ class CuraEngineBackend(Backend):
def __init__(self):
super().__init__()
Preferences.getInstance().addPreference('backend/location', '../PinkUnicornEngine/CuraEngine')
self._scene = Application.getInstance().getController().getScene()
self._scene.sceneChanged.connect(self._onSceneChanged)
@ -34,7 +36,7 @@ class CuraEngineBackend(Backend):
self._center = None
def getEngineCommand(self):
return [Preferences.getPreference("BackendLocation"), '--connect', "127.0.0.1:{0}".format(self._port)]
return [Preferences.getInstance().getValue("backend/location"), '--connect', "127.0.0.1:{0}".format(self._port)]
def _onSceneChanged(self, source):
if (type(source) is not SceneNode) or (source is self._scene.getRoot()):