mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-17 04:06:41 +08:00
Merge branch 'master' of github.com:Ultimaker/Cura
This commit is contained in:
commit
26612e17b6
@ -221,7 +221,18 @@ class ExtruderManager(QObject):
|
|||||||
|
|
||||||
container_registry.addContainer(container_stack)
|
container_registry.addContainer(container_stack)
|
||||||
|
|
||||||
## Generates extruders for a specific machine.
|
## Removes the container stack and user profile for the extruders for a specific machine.
|
||||||
|
#
|
||||||
|
# \param machine_id The machine to remove the extruders for.
|
||||||
|
def removeMachineExtruders(self, machine_id):
|
||||||
|
for extruder in self.getMachineExtruders(machine_id):
|
||||||
|
current_settings_id = extruder.getId() + "_current_settings"
|
||||||
|
containers = UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(id = current_settings_id)
|
||||||
|
for container in containers:
|
||||||
|
UM.Settings.ContainerRegistry.getInstance().removeContainer(container.getId())
|
||||||
|
UM.Settings.ContainerRegistry.getInstance().removeContainer(extruder.getId())
|
||||||
|
|
||||||
|
## Returns extruders for a specific machine.
|
||||||
#
|
#
|
||||||
# \param machine_id The machine to get the extruders of.
|
# \param machine_id The machine to get the extruders of.
|
||||||
def getMachineExtruders(self, machine_id):
|
def getMachineExtruders(self, machine_id):
|
||||||
|
@ -217,6 +217,8 @@ class MachineManager(QObject):
|
|||||||
quality.nameChanged.disconnect(self._onQualityNameChanged)
|
quality.nameChanged.disconnect(self._onQualityNameChanged)
|
||||||
|
|
||||||
self._global_container_stack = Application.getInstance().getGlobalContainerStack()
|
self._global_container_stack = Application.getInstance().getGlobalContainerStack()
|
||||||
|
self._active_container_stack = self._global_container_stack
|
||||||
|
|
||||||
self.globalContainerChanged.emit()
|
self.globalContainerChanged.emit()
|
||||||
|
|
||||||
if self._global_container_stack:
|
if self._global_container_stack:
|
||||||
@ -633,6 +635,11 @@ class MachineManager(QObject):
|
|||||||
# If the machine that is being removed is the currently active machine, set another machine as the active machine.
|
# If the machine that is being removed is the currently active machine, set another machine as the active machine.
|
||||||
activate_new_machine = (self._global_container_stack and self._global_container_stack.getId() == machine_id)
|
activate_new_machine = (self._global_container_stack and self._global_container_stack.getId() == machine_id)
|
||||||
|
|
||||||
|
stacks = UM.Settings.ContainerRegistry.getInstance().findContainerStacks(id = machine_id)
|
||||||
|
if not stacks:
|
||||||
|
return
|
||||||
|
ExtruderManager.getInstance().removeMachineExtruders(stacks[0].getBottom().getId())
|
||||||
|
|
||||||
current_settings_id = machine_id + "_current_settings"
|
current_settings_id = machine_id + "_current_settings"
|
||||||
containers = UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(id = current_settings_id)
|
containers = UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(id = current_settings_id)
|
||||||
for container in containers:
|
for container in containers:
|
||||||
|
@ -3,10 +3,12 @@
|
|||||||
|
|
||||||
from UM.Tool import Tool
|
from UM.Tool import Tool
|
||||||
from UM.Scene.Selection import Selection
|
from UM.Scene.Selection import Selection
|
||||||
|
from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator
|
||||||
from UM.Application import Application
|
from UM.Application import Application
|
||||||
from UM.Preferences import Preferences
|
from UM.Preferences import Preferences
|
||||||
from cura.Settings.SettingOverrideDecorator import SettingOverrideDecorator
|
from cura.Settings.SettingOverrideDecorator import SettingOverrideDecorator
|
||||||
|
|
||||||
|
|
||||||
## This tool allows the user to add & change settings per node in the scene.
|
## This tool allows the user to add & change settings per node in the scene.
|
||||||
# The settings per object are kept in a ContainerStack, which is linked to a node by decorator.
|
# The settings per object are kept in a ContainerStack, which is linked to a node by decorator.
|
||||||
class PerObjectSettingsTool(Tool):
|
class PerObjectSettingsTool(Tool):
|
||||||
@ -69,6 +71,11 @@ class PerObjectSettingsTool(Tool):
|
|||||||
global_container_stack = Application.getInstance().getGlobalContainerStack()
|
global_container_stack = Application.getInstance().getGlobalContainerStack()
|
||||||
if global_container_stack:
|
if global_container_stack:
|
||||||
self._multi_extrusion = global_container_stack.getProperty("machine_extruder_count", "value") > 1
|
self._multi_extrusion = global_container_stack.getProperty("machine_extruder_count", "value") > 1
|
||||||
|
if not self._multi_extrusion:
|
||||||
|
# Ensure that all extruder data is reset
|
||||||
|
root_node = Application.getInstance().getController().getScene().getRoot()
|
||||||
|
for node in DepthFirstIterator(root_node):
|
||||||
|
node.callDecoration("setActiveExtruder", global_container_stack.getId())
|
||||||
self._updateEnabled()
|
self._updateEnabled()
|
||||||
|
|
||||||
def _updateEnabled(self):
|
def _updateEnabled(self):
|
||||||
|
@ -51,7 +51,13 @@ UM.ManagementPage
|
|||||||
detailsVisible: true
|
detailsVisible: true
|
||||||
|
|
||||||
section.property: "section"
|
section.property: "section"
|
||||||
section.delegate: Label { text: section }
|
section.delegate: Label
|
||||||
|
{
|
||||||
|
text: section
|
||||||
|
font.bold: true
|
||||||
|
anchors.left: parent.left;
|
||||||
|
anchors.leftMargin: UM.Theme.getSize("default_lining").width;
|
||||||
|
}
|
||||||
|
|
||||||
buttons: [
|
buttons: [
|
||||||
Button
|
Button
|
||||||
|
@ -114,7 +114,8 @@ Item {
|
|||||||
elide: Text.ElideMiddle;
|
elide: Text.ElideMiddle;
|
||||||
|
|
||||||
color: UM.Theme.getColor("setting_control_text");
|
color: UM.Theme.getColor("setting_control_text");
|
||||||
font: UM.Theme.getFont("default");
|
// emphasize the setting if it has a value in the user or quality profile
|
||||||
|
font: base.stackLevel != undefined && base.stackLevel <= 1 ? UM.Theme.getFont("default_italic") : UM.Theme.getFont("default")
|
||||||
}
|
}
|
||||||
|
|
||||||
Row
|
Row
|
||||||
|
@ -14,6 +14,11 @@
|
|||||||
"bold": true,
|
"bold": true,
|
||||||
"family": "Open Sans"
|
"family": "Open Sans"
|
||||||
},
|
},
|
||||||
|
"default_italic": {
|
||||||
|
"size": 1.15,
|
||||||
|
"italic": true,
|
||||||
|
"family": "Open Sans"
|
||||||
|
},
|
||||||
"small": {
|
"small": {
|
||||||
"size": 1.0,
|
"size": 1.0,
|
||||||
"bold": true,
|
"bold": true,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user