Reenable Per Object Settings tool in simple mode if the current printer has multiextrusion

and tweak Per Object Settings panel size

CURA-333
This commit is contained in:
fieldOfView 2016-06-22 18:46:24 +02:00
parent a6bb0c804a
commit 08411e943c
2 changed files with 31 additions and 5 deletions

View file

@ -16,10 +16,17 @@ class PerObjectSettingsTool(Tool):
self.setExposedProperties("SelectedObjectId", "ContainerID", "SelectedActiveExtruder")
Preferences.getInstance().preferenceChanged.connect(self._onPreferenceChanged)
self._advanced_mode = False
self._multi_extrusion = False
Selection.selectionChanged.connect(self.propertyChanged)
Preferences.getInstance().preferenceChanged.connect(self._onPreferenceChanged)
self._onPreferenceChanged("cura/active_mode")
Application.getInstance().globalContainerStackChanged.connect(self._onGlobalContainerChanged)
self._onGlobalContainerChanged()
def event(self, event):
return False
@ -55,5 +62,14 @@ class PerObjectSettingsTool(Tool):
def _onPreferenceChanged(self, preference):
if preference == "cura/active_mode":
enabled = Preferences.getInstance().getValue(preference)==1
Application.getInstance().getController().toolEnabledChanged.emit(self._plugin_id, enabled)
self._advanced_mode = Preferences.getInstance().getValue(preference) == 1
self._updateEnabled()
def _onGlobalContainerChanged(self):
global_container_stack = Application.getInstance().getGlobalContainerStack()
if global_container_stack:
self._multi_extrusion = global_container_stack.getProperty("machine_extruder_count", "value") > 1
self._updateEnabled()
def _updateEnabled(self):
Application.getInstance().getController().toolEnabledChanged.emit(self._plugin_id, self._advanced_mode or self._multi_extrusion)