mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 23:53:56 -06:00
Merge branch 'master' of github.com:Ultimaker/Cura
This commit is contained in:
commit
5f023d1efa
2 changed files with 9 additions and 5 deletions
|
@ -17,9 +17,10 @@ class SettingInheritanceManager(QObject):
|
||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
Application.getInstance().globalContainerStackChanged.connect(self._onGlobalContainerChanged)
|
Application.getInstance().globalContainerStackChanged.connect(self._onGlobalContainerChanged)
|
||||||
self._global_container_stack = None
|
self._global_container_stack = None
|
||||||
self._onGlobalContainerChanged()
|
|
||||||
self._settings_with_inheritance_warning = []
|
self._settings_with_inheritance_warning = []
|
||||||
self._active_container_stack = None
|
self._active_container_stack = None
|
||||||
|
self._onGlobalContainerChanged()
|
||||||
|
|
||||||
cura.Settings.ExtruderManager.getInstance().activeExtruderChanged.connect(self._onActiveExtruderChanged)
|
cura.Settings.ExtruderManager.getInstance().activeExtruderChanged.connect(self._onActiveExtruderChanged)
|
||||||
self._onActiveExtruderChanged()
|
self._onActiveExtruderChanged()
|
||||||
|
|
||||||
|
@ -58,12 +59,11 @@ class SettingInheritanceManager(QObject):
|
||||||
if new_active_stack != self._active_container_stack:
|
if new_active_stack != self._active_container_stack:
|
||||||
# Check if changed
|
# Check if changed
|
||||||
self._active_container_stack = new_active_stack
|
self._active_container_stack = new_active_stack
|
||||||
self._update() # Ensure that the settings_with_inheritance_warning list is populated.
|
|
||||||
self._active_container_stack.propertyChanged.connect(self._onPropertyChanged)
|
self._active_container_stack.propertyChanged.connect(self._onPropertyChanged)
|
||||||
|
self._update() # Ensure that the settings_with_inheritance_warning list is populated.
|
||||||
|
|
||||||
def _onPropertyChanged(self, key, property_name):
|
def _onPropertyChanged(self, key, property_name):
|
||||||
if property_name == "value" and self._global_container_stack:
|
if property_name == "value" and self._global_container_stack:
|
||||||
|
|
||||||
definitions = self._global_container_stack.getBottom().findDefinitions(key = key)
|
definitions = self._global_container_stack.getBottom().findDefinitions(key = key)
|
||||||
if not definitions:
|
if not definitions:
|
||||||
return
|
return
|
||||||
|
@ -149,7 +149,6 @@ class SettingInheritanceManager(QObject):
|
||||||
continue
|
continue
|
||||||
if has_setting_function:
|
if has_setting_function:
|
||||||
break # There is a setting function somewhere, stop looking deeper.
|
break # There is a setting function somewhere, stop looking deeper.
|
||||||
|
|
||||||
return has_setting_function and has_non_function_value
|
return has_setting_function and has_non_function_value
|
||||||
|
|
||||||
def _update(self):
|
def _update(self):
|
||||||
|
@ -170,7 +169,12 @@ class SettingInheritanceManager(QObject):
|
||||||
self.settingsWithIntheritanceChanged.emit()
|
self.settingsWithIntheritanceChanged.emit()
|
||||||
|
|
||||||
def _onGlobalContainerChanged(self):
|
def _onGlobalContainerChanged(self):
|
||||||
|
if self._global_container_stack:
|
||||||
|
self._global_container_stack.propertyChanged.disconnect(self._onPropertyChanged)
|
||||||
self._global_container_stack = Application.getInstance().getGlobalContainerStack()
|
self._global_container_stack = Application.getInstance().getGlobalContainerStack()
|
||||||
|
if self._global_container_stack:
|
||||||
|
self._global_container_stack.propertyChanged.connect(self._onPropertyChanged)
|
||||||
|
self._onActiveExtruderChanged()
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def createSettingInheritanceManager(engine=None, script_engine=None):
|
def createSettingInheritanceManager(engine=None, script_engine=None):
|
||||||
|
|
|
@ -61,7 +61,7 @@ class SliceInfoJob(Job):
|
||||||
# The data is only sent when the user in question gave permission to do so. All data is anonymous and
|
# The data is only sent when the user in question gave permission to do so. All data is anonymous and
|
||||||
# no model files are being sent (Just a SHA256 hash of the model).
|
# no model files are being sent (Just a SHA256 hash of the model).
|
||||||
class SliceInfo(Extension):
|
class SliceInfo(Extension):
|
||||||
info_url = "http://stats.youmagine.com/curastats/slice"
|
info_url = "https://stats.youmagine.com/curastats/slice"
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue