mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-02 16:54:23 +08:00
Move backend location preference into the backend class and use the new api
This commit is contained in:
parent
27f475dc79
commit
4e6322d94e
@ -17,6 +17,8 @@ class CuraEngineBackend(Backend):
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
||||||
|
Preferences.getInstance().addPreference('backend/location', '../PinkUnicornEngine/CuraEngine')
|
||||||
|
|
||||||
self._scene = Application.getInstance().getController().getScene()
|
self._scene = Application.getInstance().getController().getScene()
|
||||||
self._scene.sceneChanged.connect(self._onSceneChanged)
|
self._scene.sceneChanged.connect(self._onSceneChanged)
|
||||||
|
|
||||||
@ -34,7 +36,7 @@ class CuraEngineBackend(Backend):
|
|||||||
self._center = None
|
self._center = None
|
||||||
|
|
||||||
def getEngineCommand(self):
|
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):
|
def _onSceneChanged(self, source):
|
||||||
if (type(source) is not SceneNode) or (source is self._scene.getRoot()):
|
if (type(source) is not SceneNode) or (source is self._scene.getRoot()):
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
#Shoopdawoop
|
#Shoopdawoop
|
||||||
from . import CuraEngineBackend
|
from . import CuraEngineBackend
|
||||||
|
|
||||||
from UM.Preferences import Preferences
|
|
||||||
|
|
||||||
def getMetaData():
|
def getMetaData():
|
||||||
return {
|
return {
|
||||||
'type': 'backend',
|
'type': 'backend',
|
||||||
@ -12,6 +10,5 @@ def getMetaData():
|
|||||||
}
|
}
|
||||||
|
|
||||||
def register(app):
|
def register(app):
|
||||||
Preferences.addPreference("BackendLocation","../PinkUnicornEngine/CuraEngine")
|
|
||||||
return CuraEngineBackend.CuraEngineBackend()
|
return CuraEngineBackend.CuraEngineBackend()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user