Per model settings panel is now closed when the tool gets disabled. CURA-2287

This commit is contained in:
Jack Ha 2016-11-16 09:42:04 +01:00
parent 707b38431b
commit a68d96fb60

View file

@ -573,11 +573,17 @@ class CuraApplication(QtApplication):
def onSelectionChanged(self):
if Selection.hasSelection():
if not self.getController().getActiveTool():
if self.getController().getActiveTool():
# If the tool has been disabled by the new selection
if not self.getController().getActiveTool().getEnabled():
# Default
self.getController().setActiveTool("TranslateTool")
else:
if self._previous_active_tool:
self.getController().setActiveTool(self._previous_active_tool)
self._previous_active_tool = None
else:
# Default
self.getController().setActiveTool("TranslateTool")
if Preferences.getInstance().getValue("view/center_on_select"):
self._center_after_select = True