mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-13 17:29:03 +08:00
Merge branch '3.2'
This commit is contained in:
commit
36da402488
@ -49,9 +49,6 @@ class ExtruderManager(QObject):
|
|||||||
## Notify when the user switches the currently active extruder.
|
## Notify when the user switches the currently active extruder.
|
||||||
activeExtruderChanged = pyqtSignal()
|
activeExtruderChanged = pyqtSignal()
|
||||||
|
|
||||||
## The signal notifies subscribers if extruders are added
|
|
||||||
extrudersAdded = pyqtSignal()
|
|
||||||
|
|
||||||
## Gets the unique identifier of the currently active extruder stack.
|
## Gets the unique identifier of the currently active extruder stack.
|
||||||
#
|
#
|
||||||
# The currently active extruder stack is the stack that is currently being
|
# The currently active extruder stack is the stack that is currently being
|
||||||
@ -409,7 +406,6 @@ class ExtruderManager(QObject):
|
|||||||
|
|
||||||
if extruders_changed:
|
if extruders_changed:
|
||||||
self.extrudersChanged.emit(global_stack_id)
|
self.extrudersChanged.emit(global_stack_id)
|
||||||
self.extrudersAdded.emit()
|
|
||||||
self.setActiveExtruderIndex(0)
|
self.setActiveExtruderIndex(0)
|
||||||
|
|
||||||
## Get all extruder values for a certain setting.
|
## Get all extruder values for a certain setting.
|
||||||
|
@ -88,7 +88,6 @@ class CuraEngineBackend(QObject, Backend):
|
|||||||
#
|
#
|
||||||
self._global_container_stack = None
|
self._global_container_stack = None
|
||||||
Application.getInstance().globalContainerStackChanged.connect(self._onGlobalStackChanged)
|
Application.getInstance().globalContainerStackChanged.connect(self._onGlobalStackChanged)
|
||||||
Application.getInstance().getExtruderManager().extrudersAdded.connect(self._onGlobalStackChanged)
|
|
||||||
self._onGlobalStackChanged()
|
self._onGlobalStackChanged()
|
||||||
|
|
||||||
Application.getInstance().stacksValidationFinished.connect(self._onStackErrorCheckFinished)
|
Application.getInstance().stacksValidationFinished.connect(self._onStackErrorCheckFinished)
|
||||||
@ -722,7 +721,7 @@ class CuraEngineBackend(QObject, Backend):
|
|||||||
if self._global_container_stack:
|
if self._global_container_stack:
|
||||||
self._global_container_stack.propertyChanged.disconnect(self._onSettingChanged)
|
self._global_container_stack.propertyChanged.disconnect(self._onSettingChanged)
|
||||||
self._global_container_stack.containersChanged.disconnect(self._onChanged)
|
self._global_container_stack.containersChanged.disconnect(self._onChanged)
|
||||||
extruders = list(ExtruderManager.getInstance().getMachineExtruders(self._global_container_stack.getId()))
|
extruders = list(self._global_container_stack.extruders.values())
|
||||||
|
|
||||||
for extruder in extruders:
|
for extruder in extruders:
|
||||||
extruder.propertyChanged.disconnect(self._onSettingChanged)
|
extruder.propertyChanged.disconnect(self._onSettingChanged)
|
||||||
@ -733,7 +732,7 @@ class CuraEngineBackend(QObject, Backend):
|
|||||||
if self._global_container_stack:
|
if self._global_container_stack:
|
||||||
self._global_container_stack.propertyChanged.connect(self._onSettingChanged) # Note: Only starts slicing when the value changed.
|
self._global_container_stack.propertyChanged.connect(self._onSettingChanged) # Note: Only starts slicing when the value changed.
|
||||||
self._global_container_stack.containersChanged.connect(self._onChanged)
|
self._global_container_stack.containersChanged.connect(self._onChanged)
|
||||||
extruders = list(ExtruderManager.getInstance().getMachineExtruders(self._global_container_stack.getId()))
|
extruders = list(self._global_container_stack.extruders.values())
|
||||||
for extruder in extruders:
|
for extruder in extruders:
|
||||||
extruder.propertyChanged.connect(self._onSettingChanged)
|
extruder.propertyChanged.connect(self._onSettingChanged)
|
||||||
extruder.containersChanged.connect(self._onChanged)
|
extruder.containersChanged.connect(self._onChanged)
|
||||||
|
@ -72,7 +72,7 @@ TabView
|
|||||||
width: scrollView.columnWidth;
|
width: scrollView.columnWidth;
|
||||||
text: properties.name;
|
text: properties.name;
|
||||||
readOnly: !base.editingEnabled;
|
readOnly: !base.editingEnabled;
|
||||||
onEditingFinished: base.setName(properties.name, text)
|
onEditingFinished: base.updateMaterialDisplayName(properties.name, text)
|
||||||
}
|
}
|
||||||
|
|
||||||
Label { width: scrollView.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Brand") }
|
Label { width: scrollView.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Brand") }
|
||||||
@ -82,11 +82,7 @@ TabView
|
|||||||
width: scrollView.columnWidth;
|
width: scrollView.columnWidth;
|
||||||
text: properties.supplier;
|
text: properties.supplier;
|
||||||
readOnly: !base.editingEnabled;
|
readOnly: !base.editingEnabled;
|
||||||
onEditingFinished:
|
onEditingFinished: base.updateMaterialSupplier(properties.supplier, text)
|
||||||
{
|
|
||||||
base.setMetaDataEntry("brand", properties.supplier, text);
|
|
||||||
pane.objectList.currentIndex = pane.getIndexById(base.containerId);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Label { width: scrollView.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Material Type") }
|
Label { width: scrollView.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Material Type") }
|
||||||
@ -95,15 +91,10 @@ TabView
|
|||||||
width: scrollView.columnWidth;
|
width: scrollView.columnWidth;
|
||||||
text: properties.material_type;
|
text: properties.material_type;
|
||||||
readOnly: !base.editingEnabled;
|
readOnly: !base.editingEnabled;
|
||||||
onEditingFinished:
|
onEditingFinished: base.updateMaterialType(properties.material_type, text)
|
||||||
{
|
|
||||||
base.setMetaDataEntry("material", properties.material_type, text);
|
|
||||||
pane.objectList.currentIndex = pane.getIndexById(base.containerId)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Label { width: scrollView.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Color") }
|
Label { width: scrollView.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Color") }
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
width: scrollView.columnWidth
|
width: scrollView.columnWidth
|
||||||
height: parent.rowHeight
|
height: parent.rowHeight
|
||||||
@ -128,13 +119,6 @@ TabView
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// make sure the color stays connected after changing the color
|
|
||||||
Binding {
|
|
||||||
target: colorSelector
|
|
||||||
property: "color"
|
|
||||||
value: properties.color_code
|
|
||||||
}
|
|
||||||
|
|
||||||
// pretty color name text field
|
// pretty color name text field
|
||||||
ReadOnlyTextField {
|
ReadOnlyTextField {
|
||||||
id: colorLabel;
|
id: colorLabel;
|
||||||
@ -453,14 +437,28 @@ TabView
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
function setName(old_value, new_value)
|
// update the display name of the material
|
||||||
{
|
function updateMaterialDisplayName (old_name, new_name) {
|
||||||
if(old_value != new_value)
|
|
||||||
{
|
// don't change when new name is the same
|
||||||
Cura.ContainerManager.setContainerName(base.containerId, new_value);
|
if (old_name == new_name) {
|
||||||
// update material name label. not so pretty, but it works
|
return
|
||||||
materialProperties.name = new_value;
|
|
||||||
pane.objectList.currentIndex = pane.getIndexById(base.containerId)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// update the values
|
||||||
|
Cura.ContainerManager.setContainerName(base.containerId, new_name)
|
||||||
|
materialProperties.name = new_name
|
||||||
|
}
|
||||||
|
|
||||||
|
// update the type of the material
|
||||||
|
function updateMaterialType (old_type, new_type) {
|
||||||
|
base.setMetaDataEntry("material", old_type, new_type)
|
||||||
|
materialProperties.material_type = new_type
|
||||||
|
}
|
||||||
|
|
||||||
|
// update the supplier of the material
|
||||||
|
function updateMaterialSupplier (old_supplier, new_supplier) {
|
||||||
|
base.setMetaDataEntry("brand", old_supplier, new_supplier)
|
||||||
|
materialProperties.supplier = new_supplier
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -153,15 +153,6 @@ UM.ManagementPage
|
|||||||
forceActiveFocus()
|
forceActiveFocus()
|
||||||
Cura.ContainerManager.createMaterial()
|
Cura.ContainerManager.createMaterial()
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections
|
|
||||||
{
|
|
||||||
target: base.objectList.model
|
|
||||||
onItemsChanged:
|
|
||||||
{
|
|
||||||
base.objectList.currentIndex = base.getIndexById(Cura.MachineManager.activeMaterialId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// Duplicate button
|
// Duplicate button
|
||||||
|
Loading…
x
Reference in New Issue
Block a user