Merge branch '15.06'

* 15.06:
  Fix poor visibility of MessageStack against grid
  Fix USB printer detection and reconnect after firmware update on MacOSX
  Correct the icon for the Cura .desktop file
  Bump version
  support defaults to ZigZag instead of Lines
  Fix the platform activity check
This commit is contained in:
Arjen Hiemstra 2015-08-18 17:59:16 +02:00
commit a425036c4c
3 changed files with 58 additions and 26 deletions

View file

@ -79,6 +79,7 @@ class CuraApplication(QtApplication):
self._platform_activity = False
self.activeMachineChanged.connect(self._onActiveMachineChanged)
self.getController().getScene().sceneChanged.connect(self.updatePlatformActivity)
Preferences.getInstance().addPreference("cura/active_machine", "")
Preferences.getInstance().addPreference("cura/active_mode", "simple")
@ -214,24 +215,15 @@ class CuraApplication(QtApplication):
def getPlatformActivity(self):
return self._platform_activity
@pyqtSlot(bool)
def setPlatformActivity(self, activity):
##Sets the _platform_activity variable on true or false depending on whether there is a mesh on the platform
if activity == True:
self._platform_activity = activity
elif activity == False:
nodes = []
for node in DepthFirstIterator(self.getController().getScene().getRoot()):
if type(node) is not SceneNode or not node.getMeshData():
continue
nodes.append(node)
i = 0
for node in nodes:
if not node.getMeshData():
continue
i += 1
if i <= 1: ## i == 0 when the meshes are removed using the deleteAll function; i == 1 when the last remaining mesh is removed using the deleteObject function
self._platform_activity = activity
def updatePlatformActivity(self, node = None):
count = 0
for node in DepthFirstIterator(self.getController().getScene().getRoot()):
if type(node) is not SceneNode or not node.getMeshData():
continue
count += 1
self._platform_activity = True if count > 0 else False
self.activityChanged.emit()
## Remove an object from the scene
@ -252,8 +244,7 @@ class CuraApplication(QtApplication):
group_node = group_node.getParent()
op = RemoveSceneNodeOperation(group_node)
op.push()
self.setPlatformActivity(False)
## Create a number of copies of existing object.
@pyqtSlot("quint64", int)
def multiplyObject(self, object_id, count):
@ -300,8 +291,7 @@ class CuraApplication(QtApplication):
op.addOperation(RemoveSceneNodeOperation(node))
op.push()
self.setPlatformActivity(False)
## Reset all translation on nodes with mesh data.
@pyqtSlot()
def resetAllTranslation(self):