Update material_diameter when editing the material in MaterialView.qml

This commit is contained in:
fieldOfView 2017-05-30 14:54:02 +02:00 committed by Ghostkeeper
parent 5550fe0da8
commit 1f49a87acb
No known key found for this signature in database
GPG key ID: C5F96EE2BC0F7E75
2 changed files with 30 additions and 1 deletions

View file

@ -235,6 +235,31 @@ class ContainerManager(QObject):
return True
## Set a metadata entry of the specified container.
#
# \param container_id \type{str} The ID of the container to change.
# \param setting_key \type{str} The key of the setting.
# \param property_name \type{str} The name of the property, eg "value".
# \param property_value \type{str} The new value of the property.
#
# \return True if successful, False if not.
@pyqtSlot(str, str, str, str, result = bool)
def setContainerProperty(self, container_id, setting_key, property_name, value_value):
containers = self._container_registry.findContainers(None, id = container_id)
if not containers:
Logger.log("w", "Could not set properties of container %s because it was not found.", container_id)
return False
container = containers[0]
if container.isReadOnly():
Logger.log("w", "Cannot set properties of read-only container %s.", container_id)
return False
container.setProperty(setting_key, property_name, value_value)
return True
## Set the name of the specified container.
@pyqtSlot(str, str, result = bool)
def setContainerName(self, container_id, new_name):