mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Merge pull request #13848 from Ultimaker/CURA-9424_workspace_dialog_fixes
[CURA-9424] Workspace dialog fixes
This commit is contained in:
commit
ee75fa02aa
4 changed files with 38 additions and 8 deletions
|
@ -600,7 +600,6 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
||||||
self._dialog.setNumUserSettings(num_user_settings)
|
self._dialog.setNumUserSettings(num_user_settings)
|
||||||
self._dialog.setActiveMode(active_mode)
|
self._dialog.setActiveMode(active_mode)
|
||||||
self._dialog.setUpdatableMachines(updatable_machines)
|
self._dialog.setUpdatableMachines(updatable_machines)
|
||||||
self._dialog.setMachineToOverride(global_stack_id)
|
|
||||||
self._dialog.setMaterialLabels(material_labels)
|
self._dialog.setMaterialLabels(material_labels)
|
||||||
self._dialog.setMachineType(machine_type)
|
self._dialog.setMachineType(machine_type)
|
||||||
self._dialog.setExtruders(extruders)
|
self._dialog.setExtruders(extruders)
|
||||||
|
@ -616,6 +615,8 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
||||||
# The machine included in the project file exists locally already, no need to change selected printers.
|
# The machine included in the project file exists locally already, no need to change selected printers.
|
||||||
is_networked_machine = global_stack.hasNetworkedConnection()
|
is_networked_machine = global_stack.hasNetworkedConnection()
|
||||||
is_abstract_machine = parseBool(existing_global_stack.getMetaDataEntry("is_abstract_machine", False))
|
is_abstract_machine = parseBool(existing_global_stack.getMetaDataEntry("is_abstract_machine", False))
|
||||||
|
self._dialog.setMachineToOverride(global_stack.getId())
|
||||||
|
self._dialog.setResolveStrategy("machine", "override")
|
||||||
elif self._dialog.updatableMachinesModel.count > 0:
|
elif self._dialog.updatableMachinesModel.count > 0:
|
||||||
# The machine included in the project file does not exist. There is another machine of the same type.
|
# The machine included in the project file does not exist. There is another machine of the same type.
|
||||||
# This will always default to an abstract machine first.
|
# This will always default to an abstract machine first.
|
||||||
|
@ -623,13 +624,14 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
||||||
machine_name = machine["name"]
|
machine_name = machine["name"]
|
||||||
is_networked_machine = machine["isNetworked"]
|
is_networked_machine = machine["isNetworked"]
|
||||||
is_abstract_machine = machine["isAbstractMachine"]
|
is_abstract_machine = machine["isAbstractMachine"]
|
||||||
self._dialog.setResolveStrategy("machine", "override")
|
|
||||||
self._dialog.setMachineToOverride(machine["id"])
|
self._dialog.setMachineToOverride(machine["id"])
|
||||||
|
self._dialog.setResolveStrategy("machine", "override")
|
||||||
else:
|
else:
|
||||||
# The machine included in the project file does not exist. There are no other printers of the same type. Default to "Create New".
|
# The machine included in the project file does not exist. There are no other printers of the same type. Default to "Create New".
|
||||||
machine_name = i18n_catalog.i18nc("@button", "Create new")
|
machine_name = i18n_catalog.i18nc("@button", "Create new")
|
||||||
self._dialog.setIsAbstractMachine(False)
|
is_networked_machine = False
|
||||||
self._dialog.setIsNetworkedMachine(False)
|
is_abstract_machine = False
|
||||||
|
self._dialog.setMachineToOverride(None)
|
||||||
self._dialog.setResolveStrategy("machine", "new")
|
self._dialog.setResolveStrategy("machine", "new")
|
||||||
|
|
||||||
self._dialog.setIsNetworkedMachine(is_networked_machine)
|
self._dialog.setIsNetworkedMachine(is_networked_machine)
|
||||||
|
@ -730,7 +732,7 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
||||||
application.expandedCategoriesChanged.emit() # Notify the GUI of the change
|
application.expandedCategoriesChanged.emit() # Notify the GUI of the change
|
||||||
|
|
||||||
# If there are no machines of the same type, create a new machine.
|
# If there are no machines of the same type, create a new machine.
|
||||||
if self._resolve_strategies["machine"] != "override" or self._dialog.updatableMachinesModel.count <= 1:
|
if self._resolve_strategies["machine"] != "override" or self._dialog.updatableMachinesModel.count == 0:
|
||||||
# We need to create a new machine
|
# We need to create a new machine
|
||||||
machine_name = self._container_registry.uniqueName(self._machine_info.name)
|
machine_name = self._container_registry.uniqueName(self._machine_info.name)
|
||||||
|
|
||||||
|
|
|
@ -96,7 +96,7 @@ UM.Dialog
|
||||||
WorkspaceRow
|
WorkspaceRow
|
||||||
{
|
{
|
||||||
leftLabelText: catalog.i18nc("@action:label", manager.isPrinterGroup ? "Printer Group" : "Printer Name")
|
leftLabelText: catalog.i18nc("@action:label", manager.isPrinterGroup ? "Printer Group" : "Printer Name")
|
||||||
rightLabelText: manager.machineName
|
rightLabelText: manager.machineName == catalog.i18nc("@button", "Create new") ? "" : manager.machineName
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -195,6 +195,17 @@ UM.Dialog
|
||||||
model: resolveStrategiesModel
|
model: resolveStrategiesModel
|
||||||
textRole: "label"
|
textRole: "label"
|
||||||
visible: manager.qualityChangesConflict
|
visible: manager.qualityChangesConflict
|
||||||
|
contentLeftPadding: UM.Theme.getSize("default_margin").width
|
||||||
|
textFont: UM.Theme.getFont("medium")
|
||||||
|
|
||||||
|
background: Cura.RoundedRectangle
|
||||||
|
{
|
||||||
|
border.width: UM.Theme.getSize("default_lining").width
|
||||||
|
border.color: UM.Theme.getColor("lining")
|
||||||
|
color: qualityChangesResolveComboBox.hovered ? UM.Theme.getColor("expandable_hover") : UM.Theme.getColor("action_button")
|
||||||
|
cornerSide: Cura.RoundedRectangle.Direction.All
|
||||||
|
radius: UM.Theme.getSize("default_radius").width
|
||||||
|
}
|
||||||
|
|
||||||
// This is a hack. This will trigger onCurrentIndexChanged and set the index when this component in loaded
|
// This is a hack. This will trigger onCurrentIndexChanged and set the index when this component in loaded
|
||||||
currentIndex:
|
currentIndex:
|
||||||
|
@ -238,6 +249,17 @@ UM.Dialog
|
||||||
model: resolveStrategiesModel
|
model: resolveStrategiesModel
|
||||||
textRole: "label"
|
textRole: "label"
|
||||||
visible: manager.materialConflict
|
visible: manager.materialConflict
|
||||||
|
contentLeftPadding: UM.Theme.getSize("default_margin").width
|
||||||
|
textFont: UM.Theme.getFont("medium")
|
||||||
|
|
||||||
|
background: Cura.RoundedRectangle
|
||||||
|
{
|
||||||
|
border.width: UM.Theme.getSize("default_lining").width
|
||||||
|
border.color: UM.Theme.getColor("lining")
|
||||||
|
color: materialResolveComboBox.hovered ? UM.Theme.getColor("expandable_hover") : UM.Theme.getColor("action_button")
|
||||||
|
cornerSide: Cura.RoundedRectangle.Direction.All
|
||||||
|
radius: UM.Theme.getSize("default_radius").width
|
||||||
|
}
|
||||||
|
|
||||||
// This is a hack. This will trigger onCurrentIndexChanged and set the index when this component in loaded
|
// This is a hack. This will trigger onCurrentIndexChanged and set the index when this component in loaded
|
||||||
currentIndex:
|
currentIndex:
|
||||||
|
|
|
@ -36,6 +36,7 @@ Item
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
source: ""
|
source: ""
|
||||||
height: UM.Theme.getSize("medium_button_icon").height
|
height: UM.Theme.getSize("medium_button_icon").height
|
||||||
|
color: UM.Theme.getColor("text")
|
||||||
width: height
|
width: height
|
||||||
}
|
}
|
||||||
UM.Label
|
UM.Label
|
||||||
|
@ -95,6 +96,7 @@ Item
|
||||||
|
|
||||||
visible: comboboxTooltipText != ""
|
visible: comboboxTooltipText != ""
|
||||||
source: UM.Theme.getIcon("Help")
|
source: UM.Theme.getIcon("Help")
|
||||||
|
color: UM.Theme.getColor("text")
|
||||||
|
|
||||||
UM.ToolTip
|
UM.ToolTip
|
||||||
{
|
{
|
||||||
|
|
|
@ -20,6 +20,8 @@ ComboBox
|
||||||
property alias textFormat: contentLabel.textFormat
|
property alias textFormat: contentLabel.textFormat
|
||||||
property alias backgroundColor: background.color
|
property alias backgroundColor: background.color
|
||||||
property bool forceHighlight: false
|
property bool forceHighlight: false
|
||||||
|
property int contentLeftPadding: UM.Theme.getSize("setting_unit_margin").width
|
||||||
|
property var textFont: UM.Theme.getFont("default")
|
||||||
|
|
||||||
enabled: delegateModel.count > 0
|
enabled: delegateModel.count > 0
|
||||||
|
|
||||||
|
@ -104,9 +106,10 @@ ComboBox
|
||||||
contentItem: UM.Label
|
contentItem: UM.Label
|
||||||
{
|
{
|
||||||
id: contentLabel
|
id: contentLabel
|
||||||
leftPadding: UM.Theme.getSize("setting_unit_margin").width + UM.Theme.getSize("default_margin").width
|
leftPadding: contentLeftPadding + UM.Theme.getSize("default_margin").width
|
||||||
anchors.right: downArrow.left
|
anchors.right: downArrow.left
|
||||||
wrapMode: Text.NoWrap
|
wrapMode: Text.NoWrap
|
||||||
|
font: textFont
|
||||||
text:
|
text:
|
||||||
{
|
{
|
||||||
if (control.delegateModel.count == 0)
|
if (control.delegateModel.count == 0)
|
||||||
|
@ -176,11 +179,12 @@ ComboBox
|
||||||
id: delegateLabel
|
id: delegateLabel
|
||||||
// FIXME: Somehow the top/bottom anchoring is not correct on Linux and it results in invisible texts.
|
// FIXME: Somehow the top/bottom anchoring is not correct on Linux and it results in invisible texts.
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.leftMargin: UM.Theme.getSize("setting_unit_margin").width
|
anchors.leftMargin: contentLeftPadding
|
||||||
anchors.rightMargin: UM.Theme.getSize("setting_unit_margin").width
|
anchors.rightMargin: UM.Theme.getSize("setting_unit_margin").width
|
||||||
|
|
||||||
text: delegateItem.text
|
text: delegateItem.text
|
||||||
textFormat: control.textFormat
|
textFormat: control.textFormat
|
||||||
|
font: textFont
|
||||||
color: UM.Theme.getColor("setting_control_text")
|
color: UM.Theme.getColor("setting_control_text")
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
wrapMode: Text.NoWrap
|
wrapMode: Text.NoWrap
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue