Codestyle & Documentation

This commit is contained in:
Jaime van Kessel 2016-05-12 15:38:59 +02:00
parent 021bb97fc4
commit 0de4f466dc

View File

@ -295,7 +295,9 @@ class CuraApplication(QtApplication):
@pyqtSlot(str) @pyqtSlot(str)
def setJobName(self, name): def setJobName(self, name):
name = os.path.splitext(name)[0] #when a file is opened using the terminal; the filename comes from _onFileLoaded and still contains its extension. This cuts the extension off if nescessary. # when a file is opened using the terminal; the filename comes from _onFileLoaded and still contains its
# extension. This cuts the extension off if necessary.
name = os.path.splitext(name)[0]
if self._job_name != name: if self._job_name != name:
self._job_name = name self._job_name = name
self.jobNameChanged.emit() self.jobNameChanged.emit()
@ -384,7 +386,7 @@ class CuraApplication(QtApplication):
op = SetTransformOperation(node, Vector()) op = SetTransformOperation(node, Vector())
op.push() op.push()
## Delete all mesh data on the scene. ## Delete all nodes containing mesh data in the scene.
@pyqtSlot() @pyqtSlot()
def deleteAll(self): def deleteAll(self):
if not self.getController().getToolsEnabled(): if not self.getController().getToolsEnabled():
@ -513,7 +515,6 @@ class CuraApplication(QtApplication):
if not self.getMachineManager().getWorkingProfile(): if not self.getMachineManager().getWorkingProfile():
return None return None
return self.getMachineManager().getWorkingProfile().getSettingValue(key) return self.getMachineManager().getWorkingProfile().getSettingValue(key)
#return self.getActiveMachine().getSettingValueByKey(key)
## Change setting by key value pair ## Change setting by key value pair
@pyqtSlot(str, "QVariant") @pyqtSlot(str, "QVariant")
@ -561,7 +562,7 @@ class CuraApplication(QtApplication):
op.addOperation(SetParentOperation(node, group_node)) op.addOperation(SetParentOperation(node, group_node))
op.push() op.push()
# Deselect individual nodes and select the groupnode instead # Deselect individual nodes and select the group-node instead
for node in group_node.getChildren(): for node in group_node.getChildren():
Selection.remove(node) Selection.remove(node)
Selection.add(group_node) Selection.add(group_node)
@ -584,7 +585,8 @@ class CuraApplication(QtApplication):
child.callDecoration("setConvexHull", None) child.callDecoration("setConvexHull", None)
op.push() op.push()
# Note: The group removes itself from the scene once all its children have left it, see GroupDecorator._onChildrenChanged # Note: The group removes itself from the scene once all its children have left it,
# see GroupDecorator._onChildrenChanged
def _createSplashScreen(self): def _createSplashScreen(self):
return CuraSplashScreen.CuraSplashScreen() return CuraSplashScreen.CuraSplashScreen()
@ -625,9 +627,6 @@ class CuraApplication(QtApplication):
def _reloadMeshFinished(self, job): def _reloadMeshFinished(self, job):
# TODO; This needs to be fixed properly. We now make the assumption that we only load a single mesh! # TODO; This needs to be fixed properly. We now make the assumption that we only load a single mesh!
job._node.setMeshData(job.getResult().getMeshData()) job._node.setMeshData(job.getResult().getMeshData())
#job.getResult().setParent(self.getController().getScene().getRoot())
#job._node.setParent(self.getController().getScene().getRoot())
#job._node.meshDataChanged.emit(job._node)
def _openFile(self, file): def _openFile(self, file):
job = ReadMeshJob(os.path.abspath(file)) job = ReadMeshJob(os.path.abspath(file))