mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-23 22:54:01 -06:00
Fix merge conflicts with master
This commit is contained in:
commit
94e89ad4ac
89 changed files with 1283 additions and 928 deletions
|
@ -55,8 +55,8 @@ UM.Dialog
|
|||
// See http://stackoverflow.com/questions/7659442/listelement-fields-as-properties
|
||||
Component.onCompleted:
|
||||
{
|
||||
append({"key": "override", "label": catalog.i18nc("@action:ComboBox option", "Update existing")});
|
||||
append({"key": "new", "label": catalog.i18nc("@action:ComboBox option", "Create new")});
|
||||
append({"key": "override", "label": catalog.i18nc("@action:ComboBox Update/override existing profile", "Update existing")});
|
||||
append({"key": "new", "label": catalog.i18nc("@action:ComboBox Save settings in a new profile", "Create new")});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -834,9 +834,8 @@ class CuraEngineBackend(QObject, Backend):
|
|||
if self._global_container_stack:
|
||||
self._global_container_stack.propertyChanged.disconnect(self._onSettingChanged)
|
||||
self._global_container_stack.containersChanged.disconnect(self._onChanged)
|
||||
extruders = list(self._global_container_stack.extruders.values())
|
||||
|
||||
for extruder in extruders:
|
||||
for extruder in self._global_container_stack.extruderList:
|
||||
extruder.propertyChanged.disconnect(self._onSettingChanged)
|
||||
extruder.containersChanged.disconnect(self._onChanged)
|
||||
|
||||
|
@ -845,8 +844,8 @@ class CuraEngineBackend(QObject, Backend):
|
|||
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.containersChanged.connect(self._onChanged)
|
||||
extruders = list(self._global_container_stack.extruders.values())
|
||||
for extruder in extruders:
|
||||
|
||||
for extruder in self._global_container_stack.extruderList:
|
||||
extruder.propertyChanged.connect(self._onSettingChanged)
|
||||
extruder.containersChanged.connect(self._onChanged)
|
||||
self._onChanged()
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
import QtQuick 2.10
|
||||
import QtQuick.Controls 2.3
|
||||
import QtQuick.Layouts 1.3
|
||||
|
||||
import UM 1.3 as UM
|
||||
import Cura 1.1 as Cura
|
||||
|
@ -16,10 +17,6 @@ Item
|
|||
id: base
|
||||
UM.I18nCatalog { id: catalog; name: "cura" }
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
|
||||
property int columnWidth: ((parent.width - 2 * UM.Theme.getSize("default_margin").width) / 2) | 0
|
||||
property int columnSpacing: 3 * screenScaleFactor
|
||||
property int propertyStoreIndex: manager ? manager.storeContainerIndex : 1 // definition_changes
|
||||
|
@ -32,24 +29,25 @@ Item
|
|||
|
||||
property var forceUpdateFunction: manager.forceUpdate
|
||||
|
||||
Item
|
||||
RowLayout
|
||||
{
|
||||
id: upperBlock
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.margins: UM.Theme.getSize("default_margin").width
|
||||
|
||||
height: childrenRect.height
|
||||
|
||||
anchors
|
||||
{
|
||||
top: parent.top
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
margins: UM.Theme.getSize("default_margin").width
|
||||
}
|
||||
spacing: UM.Theme.getSize("default_margin").width
|
||||
|
||||
// =======================================
|
||||
// Left-side column for "Printer Settings"
|
||||
// =======================================
|
||||
Column
|
||||
{
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
width: base.columnWidth
|
||||
Layout.fillWidth: true
|
||||
Layout.alignment: Qt.AlignTop
|
||||
|
||||
spacing: base.columnSpacing
|
||||
|
||||
|
@ -177,9 +175,8 @@ Item
|
|||
// =======================================
|
||||
Column
|
||||
{
|
||||
anchors.top: parent.top
|
||||
anchors.right: parent.right
|
||||
width: base.columnWidth
|
||||
Layout.fillWidth: true
|
||||
Layout.alignment: Qt.AlignTop
|
||||
|
||||
spacing: base.columnSpacing
|
||||
|
||||
|
@ -208,6 +205,7 @@ Item
|
|||
axisName: "x"
|
||||
axisMinOrMax: "min"
|
||||
allowNegativeValue: true
|
||||
allowPositiveValue: false
|
||||
|
||||
forceUpdateOnChangeFunction: forceUpdateFunction
|
||||
}
|
||||
|
@ -227,6 +225,7 @@ Item
|
|||
axisName: "y"
|
||||
axisMinOrMax: "min"
|
||||
allowNegativeValue: true
|
||||
allowPositiveValue: false
|
||||
|
||||
forceUpdateOnChangeFunction: forceUpdateFunction
|
||||
}
|
||||
|
@ -245,7 +244,8 @@ Item
|
|||
|
||||
axisName: "x"
|
||||
axisMinOrMax: "max"
|
||||
allowNegativeValue: true
|
||||
allowNegativeValue: false
|
||||
allowPositiveValue: true
|
||||
|
||||
forceUpdateOnChangeFunction: forceUpdateFunction
|
||||
}
|
||||
|
@ -266,7 +266,8 @@ Item
|
|||
|
||||
axisName: "y"
|
||||
axisMinOrMax: "max"
|
||||
allowNegativeValue: true
|
||||
allowNegativeValue: false
|
||||
allowPositiveValue: true
|
||||
|
||||
forceUpdateOnChangeFunction: forceUpdateFunction
|
||||
}
|
||||
|
@ -333,22 +334,23 @@ Item
|
|||
}
|
||||
}
|
||||
|
||||
Item // Start and End G-code
|
||||
RowLayout // Start and End G-code
|
||||
{
|
||||
id: lowerBlock
|
||||
anchors.top: upperBlock.bottom
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.margins: UM.Theme.getSize("default_margin").width
|
||||
spacing: UM.Theme.getSize("default_margin").width
|
||||
anchors
|
||||
{
|
||||
top: upperBlock.bottom
|
||||
bottom: parent.bottom
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
margins: UM.Theme.getSize("default_margin").width
|
||||
}
|
||||
|
||||
Cura.GcodeTextArea // "Start G-code"
|
||||
{
|
||||
anchors.top: parent.top
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: UM.Theme.getSize("default_margin").height
|
||||
anchors.left: parent.left
|
||||
width: base.columnWidth - UM.Theme.getSize("default_margin").width
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
|
||||
labelText: catalog.i18nc("@title:label", "Start G-code")
|
||||
containerStackId: machineStackId
|
||||
|
@ -358,11 +360,8 @@ Item
|
|||
|
||||
Cura.GcodeTextArea // "End G-code"
|
||||
{
|
||||
anchors.top: parent.top
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: UM.Theme.getSize("default_margin").height
|
||||
anchors.right: parent.right
|
||||
width: base.columnWidth - UM.Theme.getSize("default_margin").width
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
|
||||
labelText: catalog.i18nc("@title:label", "End G-code")
|
||||
containerStackId: machineStackId
|
||||
|
|
|
@ -76,7 +76,9 @@ class ModelChecker(QObject, Extension):
|
|||
|
||||
# This function can be triggered in the middle of a machine change, so do not proceed if the machine change
|
||||
# has not done yet.
|
||||
if str(node_extruder_position) not in global_container_stack.extruders:
|
||||
try:
|
||||
extruder = global_container_stack.extruderList[int(node_extruder_position)]
|
||||
except IndexError:
|
||||
Application.getInstance().callLater(lambda: self.onChanged.emit())
|
||||
return False
|
||||
|
||||
|
@ -131,9 +133,9 @@ class ModelChecker(QObject, Extension):
|
|||
|
||||
material_shrinkage = {}
|
||||
# Get all shrinkage values of materials used
|
||||
for extruder_position, extruder in global_container_stack.extruders.items():
|
||||
for extruder_position, extruder in enumerate(global_container_stack.extruderList):
|
||||
shrinkage = extruder.material.getProperty("material_shrinkage_percentage", "value")
|
||||
if shrinkage is None:
|
||||
shrinkage = 0
|
||||
material_shrinkage[extruder_position] = shrinkage
|
||||
material_shrinkage[str(extruder_position)] = shrinkage
|
||||
return material_shrinkage
|
||||
|
|
|
@ -12,7 +12,7 @@ def getMetaData():
|
|||
return {
|
||||
"stage": {
|
||||
"name": i18n_catalog.i18nc("@item:inmenu", "Monitor"),
|
||||
"weight": 2
|
||||
"weight": 30
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4,22 +4,68 @@
|
|||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.2
|
||||
import QtQuick.Controls.Styles 1.2
|
||||
import QtQuick.Window 2.2
|
||||
|
||||
import UM 1.2 as UM
|
||||
import Cura 1.0 as Cura
|
||||
import ".."
|
||||
|
||||
Item {
|
||||
id: base;
|
||||
|
||||
UM.I18nCatalog { id: catalog; name: "cura"; }
|
||||
|
||||
width: childrenRect.width;
|
||||
height: childrenRect.height;
|
||||
property var all_categories_except_support: [ "machine_settings", "resolution", "shell", "infill", "material", "speed",
|
||||
Item
|
||||
{
|
||||
id: base
|
||||
width: childrenRect.width
|
||||
height: childrenRect.height
|
||||
property var allCategoriesExceptSupport: [ "machine_settings", "resolution", "shell", "infill", "material", "speed",
|
||||
"travel", "cooling", "platform_adhesion", "dual", "meshfix", "blackmagic", "experimental"]
|
||||
|
||||
readonly property string normalMeshType: ""
|
||||
readonly property string supportMeshType: "support_mesh"
|
||||
readonly property string cuttingMeshType: "cutting_mesh"
|
||||
readonly property string infillMeshType: "infill_mesh"
|
||||
readonly property string antiOverhangMeshType: "anti_overhang_mesh"
|
||||
|
||||
property var currentMeshType: UM.ActiveTool.properties.getValue("MeshType")
|
||||
|
||||
// Update the view every time the currentMeshType changes
|
||||
onCurrentMeshTypeChanged:
|
||||
{
|
||||
var type = currentMeshType
|
||||
|
||||
// set checked state of mesh type buttons
|
||||
normalButton.checked = type === normalMeshType
|
||||
supportMeshButton.checked = type === supportMeshType
|
||||
overhangMeshButton.checked = type === infillMeshType || type === cuttingMeshType
|
||||
antiOverhangMeshButton.checked = type === antiOverhangMeshType
|
||||
|
||||
// update active type label
|
||||
for (var button in meshTypeButtons.children)
|
||||
{
|
||||
if (meshTypeButtons.children[button].checked){
|
||||
meshTypeLabel.text = catalog.i18nc("@label", "Mesh Type") + ": " + meshTypeButtons.children[button].text
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function setOverhangsMeshType()
|
||||
{
|
||||
if (infillOnlyCheckbox.checked)
|
||||
{
|
||||
setMeshType(infillMeshType)
|
||||
}
|
||||
else
|
||||
{
|
||||
setMeshType(cuttingMeshType)
|
||||
}
|
||||
}
|
||||
|
||||
function setMeshType(type)
|
||||
{
|
||||
UM.ActiveTool.setProperty("MeshType", type)
|
||||
}
|
||||
|
||||
UM.I18nCatalog { id: catalog; name: "uranium"}
|
||||
|
||||
Column
|
||||
{
|
||||
id: items
|
||||
|
@ -28,123 +74,97 @@ Item {
|
|||
|
||||
spacing: UM.Theme.getSize("default_margin").height
|
||||
|
||||
Row
|
||||
Row // Mesh type buttons
|
||||
{
|
||||
id: meshTypeButtons
|
||||
spacing: UM.Theme.getSize("default_margin").width
|
||||
|
||||
Label
|
||||
Button
|
||||
{
|
||||
text: catalog.i18nc("@label","Mesh Type")
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("text")
|
||||
height: UM.Theme.getSize("setting").height
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
id: normalButton
|
||||
text: catalog.i18nc("@label", "Normal model")
|
||||
iconSource: UM.Theme.getIcon("pos_normal");
|
||||
property bool needBorder: true
|
||||
checkable: true
|
||||
onClicked: setMeshType(normalMeshType);
|
||||
style: UM.Theme.styles.tool_button;
|
||||
z: 4
|
||||
}
|
||||
|
||||
UM.SettingPropertyProvider
|
||||
Button
|
||||
{
|
||||
id: meshTypePropertyProvider
|
||||
containerStack: Cura.MachineManager.activeMachine
|
||||
watchedProperties: [ "enabled" ]
|
||||
id: supportMeshButton
|
||||
text: catalog.i18nc("@label", "Print as support")
|
||||
iconSource: UM.Theme.getIcon("pos_print_as_support");
|
||||
property bool needBorder: true
|
||||
checkable:true
|
||||
onClicked: setMeshType(supportMeshType)
|
||||
style: UM.Theme.styles.tool_button;
|
||||
z: 3
|
||||
}
|
||||
|
||||
ComboBox
|
||||
Button
|
||||
{
|
||||
id: meshTypeSelection
|
||||
style: UM.Theme.styles.combobox
|
||||
onActivated: {
|
||||
UM.ActiveTool.setProperty("MeshType", model.get(index).type)
|
||||
}
|
||||
model: ListModel
|
||||
{
|
||||
id: meshTypeModel
|
||||
Component.onCompleted: meshTypeSelection.populateModel()
|
||||
}
|
||||
|
||||
function populateModel()
|
||||
{
|
||||
meshTypeModel.append({
|
||||
type: "",
|
||||
text: catalog.i18nc("@label", "Normal model")
|
||||
});
|
||||
meshTypePropertyProvider.key = "support_mesh";
|
||||
if(meshTypePropertyProvider.properties.enabled == "True")
|
||||
{
|
||||
meshTypeModel.append({
|
||||
type: "support_mesh",
|
||||
text: catalog.i18nc("@label", "Print as support")
|
||||
});
|
||||
}
|
||||
meshTypePropertyProvider.key = "anti_overhang_mesh";
|
||||
if(meshTypePropertyProvider.properties.enabled == "True")
|
||||
{
|
||||
meshTypeModel.append({
|
||||
type: "anti_overhang_mesh",
|
||||
text: catalog.i18nc("@label", "Don't support overlap with other models")
|
||||
});
|
||||
}
|
||||
meshTypePropertyProvider.key = "cutting_mesh";
|
||||
if(meshTypePropertyProvider.properties.enabled == "True")
|
||||
{
|
||||
meshTypeModel.append({
|
||||
type: "cutting_mesh",
|
||||
text: catalog.i18nc("@label", "Modify settings for overlap with other models")
|
||||
});
|
||||
}
|
||||
meshTypePropertyProvider.key = "infill_mesh";
|
||||
if(meshTypePropertyProvider.properties.enabled == "True")
|
||||
{
|
||||
meshTypeModel.append({
|
||||
type: "infill_mesh",
|
||||
text: catalog.i18nc("@label", "Modify settings for infill of other models")
|
||||
});
|
||||
}
|
||||
|
||||
meshTypeSelection.updateCurrentIndex();
|
||||
}
|
||||
|
||||
function updateCurrentIndex()
|
||||
{
|
||||
var mesh_type = UM.ActiveTool.properties.getValue("MeshType");
|
||||
meshTypeSelection.currentIndex = -1;
|
||||
for(var index=0; index < meshTypeSelection.model.count; index++)
|
||||
{
|
||||
if(meshTypeSelection.model.get(index).type == mesh_type)
|
||||
{
|
||||
meshTypeSelection.currentIndex = index;
|
||||
return;
|
||||
}
|
||||
}
|
||||
meshTypeSelection.currentIndex = 0;
|
||||
}
|
||||
id: overhangMeshButton
|
||||
text: catalog.i18nc("@label", "Modify settings for overlaps")
|
||||
iconSource: UM.Theme.getIcon("pos_modify_overlaps");
|
||||
property bool needBorder: true
|
||||
checkable:true
|
||||
onClicked: setMeshType(infillMeshType)
|
||||
style: UM.Theme.styles.tool_button;
|
||||
z: 2
|
||||
}
|
||||
|
||||
Connections
|
||||
Button
|
||||
{
|
||||
target: Cura.MachineManager
|
||||
onGlobalContainerChanged:
|
||||
{
|
||||
meshTypeSelection.model.clear();
|
||||
meshTypeSelection.populateModel();
|
||||
}
|
||||
}
|
||||
|
||||
Connections
|
||||
{
|
||||
target: UM.Selection
|
||||
onSelectionChanged: meshTypeSelection.updateCurrentIndex()
|
||||
id: antiOverhangMeshButton
|
||||
text: catalog.i18nc("@label", "Don't support overlaps")
|
||||
iconSource: UM.Theme.getIcon("pos_modify_dont_support_overlap");
|
||||
property bool needBorder: true
|
||||
checkable: true
|
||||
onClicked: setMeshType(antiOverhangMeshType)
|
||||
style: UM.Theme.styles.tool_button;
|
||||
z: 1
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Column
|
||||
Label
|
||||
{
|
||||
id: meshTypeLabel
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("text")
|
||||
height: UM.Theme.getSize("setting").height
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
|
||||
CheckBox
|
||||
{
|
||||
id: infillOnlyCheckbox
|
||||
|
||||
text: catalog.i18nc("@action:checkbox", "Infill only");
|
||||
|
||||
style: UM.Theme.styles.checkbox;
|
||||
|
||||
visible: currentMeshType === infillMeshType || currentMeshType === cuttingMeshType
|
||||
onClicked: setOverhangsMeshType()
|
||||
|
||||
Binding
|
||||
{
|
||||
target: infillOnlyCheckbox
|
||||
property: "checked"
|
||||
value: currentMeshType === infillMeshType
|
||||
}
|
||||
}
|
||||
|
||||
Column // Settings Dialog
|
||||
{
|
||||
// This is to ensure that the panel is first increasing in size up to 200 and then shows a scrollbar.
|
||||
// It kinda looks ugly otherwise (big panel, no content on it)
|
||||
id: currentSettings
|
||||
property int maximumHeight: 200 * screenScaleFactor
|
||||
height: Math.min(contents.count * (UM.Theme.getSize("section").height + UM.Theme.getSize("default_lining").height), maximumHeight)
|
||||
visible: meshTypeSelection.model.get(meshTypeSelection.currentIndex).type != "anti_overhang_mesh"
|
||||
visible: currentMeshType != "anti_overhang_mesh"
|
||||
|
||||
ScrollView
|
||||
{
|
||||
|
@ -159,26 +179,26 @@ Item {
|
|||
|
||||
model: UM.SettingDefinitionsModel
|
||||
{
|
||||
id: addedSettingsModel;
|
||||
id: addedSettingsModel
|
||||
containerId: Cura.MachineManager.activeMachine != null ? Cura.MachineManager.activeMachine.definition.id: ""
|
||||
expanded: [ "*" ]
|
||||
filter:
|
||||
{
|
||||
if (printSequencePropertyProvider.properties.value == "one_at_a_time")
|
||||
{
|
||||
return {"settable_per_meshgroup": true};
|
||||
return {"settable_per_meshgroup": true}
|
||||
}
|
||||
return {"settable_per_mesh": true};
|
||||
return {"settable_per_mesh": true}
|
||||
}
|
||||
exclude:
|
||||
{
|
||||
var excluded_settings = [ "support_mesh", "anti_overhang_mesh", "cutting_mesh", "infill_mesh" ];
|
||||
var excluded_settings = [ "support_mesh", "anti_overhang_mesh", "cutting_mesh", "infill_mesh" ]
|
||||
|
||||
if(meshTypeSelection.model.get(meshTypeSelection.currentIndex).type == "support_mesh")
|
||||
if (currentMeshType == "support_mesh")
|
||||
{
|
||||
excluded_settings = excluded_settings.concat(base.all_categories_except_support);
|
||||
excluded_settings = excluded_settings.concat(base.allCategoriesExceptSupport)
|
||||
}
|
||||
return excluded_settings;
|
||||
return excluded_settings
|
||||
}
|
||||
|
||||
visibilityHandler: Cura.PerObjectSettingVisibilityHandler
|
||||
|
@ -188,8 +208,9 @@ Item {
|
|||
|
||||
// For some reason the model object is updated after removing him from the memory and
|
||||
// it happens only on Windows. For this reason, set the destroyed value manually.
|
||||
Component.onDestruction: {
|
||||
setDestroyed(true);
|
||||
Component.onDestruction:
|
||||
{
|
||||
setDestroyed(true)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -213,7 +234,8 @@ Item {
|
|||
//causing nasty issues when selecting different options. So disable asynchronous loading of enum type completely.
|
||||
asynchronous: model.type != "enum" && model.type != "extruder"
|
||||
|
||||
onLoaded: {
|
||||
onLoaded:
|
||||
{
|
||||
settingLoader.item.showRevertButton = false
|
||||
settingLoader.item.showInheritButton = false
|
||||
settingLoader.item.showLinkedSettingIcon = false
|
||||
|
@ -299,7 +321,7 @@ Item {
|
|||
target: inheritStackProvider
|
||||
onPropertiesChanged:
|
||||
{
|
||||
provider.forcePropertiesChanged();
|
||||
provider.forcePropertiesChanged()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -312,22 +334,22 @@ Item {
|
|||
// so here we connect to the signal and update the those values.
|
||||
if (typeof UM.ActiveTool.properties.getValue("SelectedObjectId") !== "undefined")
|
||||
{
|
||||
const selectedObjectId = UM.ActiveTool.properties.getValue("SelectedObjectId");
|
||||
const selectedObjectId = UM.ActiveTool.properties.getValue("SelectedObjectId")
|
||||
if (addedSettingsModel.visibilityHandler.selectedObjectId != selectedObjectId)
|
||||
{
|
||||
addedSettingsModel.visibilityHandler.selectedObjectId = selectedObjectId;
|
||||
addedSettingsModel.visibilityHandler.selectedObjectId = selectedObjectId
|
||||
}
|
||||
}
|
||||
if (typeof UM.ActiveTool.properties.getValue("ContainerID") !== "undefined")
|
||||
{
|
||||
const containerId = UM.ActiveTool.properties.getValue("ContainerID");
|
||||
const containerId = UM.ActiveTool.properties.getValue("ContainerID")
|
||||
if (provider.containerStackId != containerId)
|
||||
{
|
||||
provider.containerStackId = containerId;
|
||||
provider.containerStackId = containerId
|
||||
}
|
||||
if (inheritStackProvider.containerStackId != containerId)
|
||||
{
|
||||
inheritStackProvider.containerStackId = containerId;
|
||||
inheritStackProvider.containerStackId = containerId
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -337,7 +359,7 @@ Item {
|
|||
}
|
||||
}
|
||||
|
||||
Button
|
||||
Cura.SecondaryButton
|
||||
{
|
||||
id: customiseSettingsButton;
|
||||
height: UM.Theme.getSize("setting_control").height;
|
||||
|
@ -345,33 +367,12 @@ Item {
|
|||
|
||||
text: catalog.i18nc("@action:button", "Select settings");
|
||||
|
||||
style: ButtonStyle
|
||||
{
|
||||
background: Rectangle
|
||||
{
|
||||
width: control.width;
|
||||
height: control.height;
|
||||
border.width: UM.Theme.getSize("default_lining").width;
|
||||
border.color: control.pressed ? UM.Theme.getColor("action_button_active_border") :
|
||||
control.hovered ? UM.Theme.getColor("action_button_hovered_border") : UM.Theme.getColor("action_button_border")
|
||||
color: control.pressed ? UM.Theme.getColor("action_button_active") :
|
||||
control.hovered ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("action_button")
|
||||
}
|
||||
label: Label
|
||||
{
|
||||
text: control.text;
|
||||
color: UM.Theme.getColor("setting_control_text");
|
||||
font: UM.Theme.getFont("default")
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
}
|
||||
|
||||
onClicked:
|
||||
{
|
||||
settingPickDialog.visible = true;
|
||||
if (meshTypeSelection.model.get(meshTypeSelection.currentIndex).type == "support_mesh")
|
||||
if (currentMeshType == "support_mesh")
|
||||
{
|
||||
settingPickDialog.additional_excluded_settings = base.all_categories_except_support;
|
||||
settingPickDialog.additional_excluded_settings = base.allCategoriesExceptSupport;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -379,138 +380,12 @@ Item {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
UM.Dialog {
|
||||
SettingPickDialog
|
||||
{
|
||||
id: settingPickDialog
|
||||
|
||||
title: catalog.i18nc("@title:window", "Select Settings to Customize for this model")
|
||||
width: screenScaleFactor * 360
|
||||
|
||||
property var additional_excluded_settings
|
||||
|
||||
onVisibilityChanged:
|
||||
{
|
||||
// force updating the model to sync it with addedSettingsModel
|
||||
if(visible)
|
||||
{
|
||||
// Set skip setting, it will prevent from resetting selected mesh_type
|
||||
contents.model.visibilityHandler.addSkipResetSetting(meshTypeSelection.model.get(meshTypeSelection.currentIndex).type)
|
||||
listview.model.forceUpdate()
|
||||
|
||||
updateFilter()
|
||||
}
|
||||
}
|
||||
|
||||
function updateFilter()
|
||||
{
|
||||
var new_filter = {};
|
||||
new_filter["settable_per_mesh"] = true;
|
||||
// Don't filter on "settable_per_meshgroup" any more when `printSequencePropertyProvider.properties.value`
|
||||
// is set to "one_at_a_time", because the current backend architecture isn't ready for that.
|
||||
|
||||
if(filterInput.text != "")
|
||||
{
|
||||
new_filter["i18n_label"] = "*" + filterInput.text;
|
||||
}
|
||||
|
||||
listview.model.filter = new_filter;
|
||||
}
|
||||
|
||||
TextField {
|
||||
id: filterInput
|
||||
|
||||
anchors {
|
||||
top: parent.top
|
||||
left: parent.left
|
||||
right: toggleShowAll.left
|
||||
rightMargin: UM.Theme.getSize("default_margin").width
|
||||
}
|
||||
|
||||
placeholderText: catalog.i18nc("@label:textbox", "Filter...");
|
||||
|
||||
onTextChanged: settingPickDialog.updateFilter()
|
||||
}
|
||||
|
||||
CheckBox
|
||||
{
|
||||
id: toggleShowAll
|
||||
|
||||
anchors {
|
||||
top: parent.top
|
||||
right: parent.right
|
||||
}
|
||||
|
||||
text: catalog.i18nc("@label:checkbox", "Show all")
|
||||
checked: listview.model.showAll
|
||||
onClicked:
|
||||
{
|
||||
listview.model.showAll = checked;
|
||||
}
|
||||
}
|
||||
|
||||
ScrollView
|
||||
{
|
||||
id: scrollView
|
||||
|
||||
anchors
|
||||
{
|
||||
top: filterInput.bottom;
|
||||
left: parent.left;
|
||||
right: parent.right;
|
||||
bottom: parent.bottom;
|
||||
}
|
||||
ListView
|
||||
{
|
||||
id:listview
|
||||
model: UM.SettingDefinitionsModel
|
||||
{
|
||||
id: definitionsModel;
|
||||
containerId: Cura.MachineManager.activeMachine != null ? Cura.MachineManager.activeMachine.definition.id: ""
|
||||
visibilityHandler: UM.SettingPreferenceVisibilityHandler {}
|
||||
expanded: [ "*" ]
|
||||
exclude:
|
||||
{
|
||||
var excluded_settings = [ "machine_settings", "command_line_settings", "support_mesh", "anti_overhang_mesh", "cutting_mesh", "infill_mesh" ];
|
||||
excluded_settings = excluded_settings.concat(settingPickDialog.additional_excluded_settings);
|
||||
return excluded_settings;
|
||||
}
|
||||
}
|
||||
delegate:Loader
|
||||
{
|
||||
id: loader
|
||||
|
||||
width: parent.width
|
||||
height: model.type != undefined ? UM.Theme.getSize("section").height : 0;
|
||||
|
||||
property var definition: model
|
||||
property var settingDefinitionsModel: definitionsModel
|
||||
|
||||
asynchronous: true
|
||||
source:
|
||||
{
|
||||
switch(model.type)
|
||||
{
|
||||
case "category":
|
||||
return "PerObjectCategory.qml"
|
||||
default:
|
||||
return "PerObjectItem.qml"
|
||||
}
|
||||
}
|
||||
}
|
||||
Component.onCompleted: settingPickDialog.updateFilter()
|
||||
}
|
||||
}
|
||||
|
||||
rightButtons: [
|
||||
Button {
|
||||
text: catalog.i18nc("@action:button", "Close");
|
||||
onClicked: {
|
||||
settingPickDialog.visible = false;
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
UM.SettingPropertyProvider
|
||||
|
@ -533,25 +408,25 @@ Item {
|
|||
storeIndex: 0
|
||||
}
|
||||
|
||||
SystemPalette { id: palette; }
|
||||
SystemPalette { id: palette }
|
||||
|
||||
Component
|
||||
{
|
||||
id: settingTextField;
|
||||
id: settingTextField
|
||||
|
||||
Cura.SettingTextField { }
|
||||
}
|
||||
|
||||
Component
|
||||
{
|
||||
id: settingComboBox;
|
||||
id: settingComboBox
|
||||
|
||||
Cura.SettingComboBox { }
|
||||
}
|
||||
|
||||
Component
|
||||
{
|
||||
id: settingExtruder;
|
||||
id: settingExtruder
|
||||
|
||||
Cura.SettingExtruder { }
|
||||
}
|
||||
|
@ -565,22 +440,23 @@ Item {
|
|||
|
||||
Component
|
||||
{
|
||||
id: settingCheckBox;
|
||||
id: settingCheckBox
|
||||
|
||||
Cura.SettingCheckBox { }
|
||||
}
|
||||
|
||||
Component
|
||||
{
|
||||
id: settingCategory;
|
||||
id: settingCategory
|
||||
|
||||
Cura.SettingCategory { }
|
||||
}
|
||||
|
||||
Component
|
||||
{
|
||||
id: settingUnknown;
|
||||
id: settingUnknown
|
||||
|
||||
Cura.SettingUnknown { }
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Copyright (c) 2016 Ultimaker B.V.
|
||||
# Uranium is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
from UM.Logger import Logger
|
||||
from UM.Tool import Tool
|
||||
from UM.Scene.Selection import Selection
|
||||
from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator
|
||||
|
@ -20,15 +20,11 @@ class PerObjectSettingsTool(Tool):
|
|||
|
||||
self.setExposedProperties("SelectedObjectId", "ContainerID", "SelectedActiveExtruder", "MeshType")
|
||||
|
||||
self._advanced_mode = False
|
||||
self._multi_extrusion = False
|
||||
self._single_model_selected = False
|
||||
|
||||
Selection.selectionChanged.connect(self.propertyChanged)
|
||||
|
||||
Application.getInstance().getPreferences().preferenceChanged.connect(self._onPreferenceChanged)
|
||||
self._onPreferenceChanged("cura/active_mode")
|
||||
|
||||
Application.getInstance().globalContainerStackChanged.connect(self._onGlobalContainerChanged)
|
||||
self._onGlobalContainerChanged()
|
||||
Selection.selectionChanged.connect(self._updateEnabled)
|
||||
|
@ -70,8 +66,16 @@ class PerObjectSettingsTool(Tool):
|
|||
selected_object.addDecorator(SettingOverrideDecorator())
|
||||
selected_object.callDecoration("setActiveExtruder", extruder_stack_id)
|
||||
|
||||
def setMeshType(self, mesh_type):
|
||||
## Returns True when the mesh_type was changed, False when current mesh_type == mesh_type
|
||||
def setMeshType(self, mesh_type: str) -> bool:
|
||||
if self.getMeshType() == mesh_type:
|
||||
return False
|
||||
|
||||
selected_object = Selection.getSelectedObject(0)
|
||||
if selected_object is None:
|
||||
Logger.log("w", "Tried setting the mesh type of the selected object, but no object was selected")
|
||||
return False
|
||||
|
||||
stack = selected_object.callDecoration("getStack") #Don't try to get the active extruder since it may be None anyway.
|
||||
if not stack:
|
||||
selected_object.addDecorator(SettingOverrideDecorator())
|
||||
|
@ -90,6 +94,9 @@ class PerObjectSettingsTool(Tool):
|
|||
new_instance.resetState() # Ensure that the state is not seen as a user state.
|
||||
settings.addInstance(new_instance)
|
||||
|
||||
self.propertyChanged.emit()
|
||||
return True
|
||||
|
||||
def getMeshType(self):
|
||||
selected_object = Selection.getSelectedObject(0)
|
||||
stack = selected_object.callDecoration("getStack") #Don't try to get the active extruder since it may be None anyway.
|
||||
|
@ -103,11 +110,6 @@ class PerObjectSettingsTool(Tool):
|
|||
|
||||
return ""
|
||||
|
||||
def _onPreferenceChanged(self, preference):
|
||||
if preference == "cura/active_mode":
|
||||
self._advanced_mode = Application.getInstance().getPreferences().getValue(preference) == 1
|
||||
self._updateEnabled()
|
||||
|
||||
def _onGlobalContainerChanged(self):
|
||||
global_container_stack = Application.getInstance().getGlobalContainerStack()
|
||||
if global_container_stack:
|
||||
|
@ -140,4 +142,4 @@ class PerObjectSettingsTool(Tool):
|
|||
self._single_model_selected = False # Group is selected, so tool needs to be disabled
|
||||
else:
|
||||
self._single_model_selected = True
|
||||
Application.getInstance().getController().toolEnabledChanged.emit(self._plugin_id, self._advanced_mode and self._single_model_selected)
|
||||
Application.getInstance().getController().toolEnabledChanged.emit(self._plugin_id, self._single_model_selected)
|
||||
|
|
139
plugins/PerObjectSettingsTool/SettingPickDialog.qml
Normal file
139
plugins/PerObjectSettingsTool/SettingPickDialog.qml
Normal file
|
@ -0,0 +1,139 @@
|
|||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.2
|
||||
import QtQuick.Controls.Styles 1.2
|
||||
|
||||
import UM 1.2 as UM
|
||||
import Cura 1.0 as Cura
|
||||
import ".."
|
||||
|
||||
UM.Dialog
|
||||
{
|
||||
id: settingPickDialog
|
||||
|
||||
title: catalog.i18nc("@title:window", "Select Settings to Customize for this model")
|
||||
width: screenScaleFactor * 360
|
||||
|
||||
property var additional_excluded_settings
|
||||
|
||||
onVisibilityChanged:
|
||||
{
|
||||
// force updating the model to sync it with addedSettingsModel
|
||||
if (visible)
|
||||
{
|
||||
// Set skip setting, it will prevent from resetting selected mesh_type
|
||||
contents.model.visibilityHandler.addSkipResetSetting(currentMeshType)
|
||||
listview.model.forceUpdate()
|
||||
|
||||
updateFilter()
|
||||
}
|
||||
}
|
||||
|
||||
function updateFilter()
|
||||
{
|
||||
var new_filter = {}
|
||||
new_filter["settable_per_mesh"] = true
|
||||
// Don't filter on "settable_per_meshgroup" any more when `printSequencePropertyProvider.properties.value`
|
||||
// is set to "one_at_a_time", because the current backend architecture isn't ready for that.
|
||||
|
||||
if (filterInput.text != "")
|
||||
{
|
||||
new_filter["i18n_label"] = "*" + filterInput.text
|
||||
}
|
||||
|
||||
listview.model.filter = new_filter
|
||||
}
|
||||
|
||||
TextField {
|
||||
id: filterInput
|
||||
|
||||
anchors {
|
||||
top: parent.top
|
||||
left: parent.left
|
||||
right: toggleShowAll.left
|
||||
rightMargin: UM.Theme.getSize("default_margin").width
|
||||
}
|
||||
|
||||
placeholderText: catalog.i18nc("@label:textbox", "Filter...")
|
||||
|
||||
onTextChanged: settingPickDialog.updateFilter()
|
||||
}
|
||||
|
||||
CheckBox
|
||||
{
|
||||
id: toggleShowAll
|
||||
|
||||
anchors {
|
||||
top: parent.top
|
||||
right: parent.right
|
||||
}
|
||||
|
||||
text: catalog.i18nc("@label:checkbox", "Show all")
|
||||
checked: listview.model.showAll
|
||||
onClicked:
|
||||
{
|
||||
listview.model.showAll = checked
|
||||
}
|
||||
}
|
||||
|
||||
ScrollView
|
||||
{
|
||||
id: scrollView
|
||||
|
||||
anchors
|
||||
{
|
||||
top: filterInput.bottom
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
bottom: parent.bottom
|
||||
}
|
||||
ListView
|
||||
{
|
||||
id:listview
|
||||
model: UM.SettingDefinitionsModel
|
||||
{
|
||||
id: definitionsModel
|
||||
containerId: Cura.MachineManager.activeMachine != null ? Cura.MachineManager.activeMachine.definition.id: ""
|
||||
visibilityHandler: UM.SettingPreferenceVisibilityHandler {}
|
||||
expanded: [ "*" ]
|
||||
exclude:
|
||||
{
|
||||
var excluded_settings = [ "machine_settings", "command_line_settings", "support_mesh", "anti_overhang_mesh", "cutting_mesh", "infill_mesh" ]
|
||||
excluded_settings = excluded_settings.concat(settingPickDialog.additional_excluded_settings)
|
||||
return excluded_settings
|
||||
}
|
||||
}
|
||||
delegate:Loader
|
||||
{
|
||||
id: loader
|
||||
|
||||
width: parent.width
|
||||
height: model.type != undefined ? UM.Theme.getSize("section").height : 0
|
||||
|
||||
property var definition: model
|
||||
property var settingDefinitionsModel: definitionsModel
|
||||
|
||||
asynchronous: true
|
||||
source:
|
||||
{
|
||||
switch(model.type)
|
||||
{
|
||||
case "category":
|
||||
return "PerObjectCategory.qml"
|
||||
default:
|
||||
return "PerObjectItem.qml"
|
||||
}
|
||||
}
|
||||
}
|
||||
Component.onCompleted: settingPickDialog.updateFilter()
|
||||
}
|
||||
}
|
||||
|
||||
rightButtons: [
|
||||
Button {
|
||||
text: catalog.i18nc("@action:button", "Close")
|
||||
onClicked: {
|
||||
settingPickDialog.visible = false
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -1,3 +1,22 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30">
|
||||
<path d="M30 20L25.1 6.7 27.6 0H12.9l1.6 5H6.4l2.3 6H2.4l2.4 6.2L0 30h19.5l-1.7-4H26l-2.3-6H30zm-12.5 5l-2.8-7.5 2.4-6.5H9.6L7.7 6h14.7L20 12.4l2.9 7.6 2 5h-7.4z"/>
|
||||
</svg>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="30px" height="30px" viewBox="0 0 28 28" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 57.1 (83088) - https://sketch.com -->
|
||||
<title>per_model_settings</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs>
|
||||
<path d="M9.73076923,0 L9.226,1.345 L0.449,11 L0,11 L0.639,9.084 L8.896,0 L9.73076923,0 Z M8.49,3.472 L8.907,4.721 L3.199,11 L1.647,11 L8.49,3.472 Z M9.228,5.685 L9.645,6.935 L5.949,11 L4.397,11 L9.228,5.685 Z M9.966,7.899 L10.382,9.148 L8.699,11 L7.147,11 L9.966,7.899 Z M10.704,10.112 L11,11 L9.896,11 L10.704,10.112 Z M7.698,0 L1.332,7.004 L2.23,4.308 L6.146,0 L7.698,0 Z M4.948,0 L2.344,2.866 L1.89,1.656 L3.396,0 L4.948,0 Z M2.198,0 L1.54,0.724 L1.26923077,0 L2.198,0 Z" id="path-1"></path>
|
||||
</defs>
|
||||
<g id="per_model_settings" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="Per-model" transform="translate(2.000000, 2.000000)">
|
||||
<polygon id="Path-Copy-5" fill="#000" points="1.26923077 0 9.73076923 0 8.46153846 3.38461538 11 11 0 11 2.53846154 3.38461538"></polygon>
|
||||
<polygon id="Path-Copy-8" fill="#000" points="14.2692308 13 22.7307692 13 21.4615385 16.3846154 24 24 13 24 15.5384615 16.3846154"></polygon>
|
||||
<g id="stripe" transform="translate(13.000000, 0.000000)">
|
||||
<mask id="mask-2" fill="white">
|
||||
<use xlink:href="#path-1"></use>
|
||||
</mask>
|
||||
<use id="Combined-Shape" fill="#000" xlink:href="#path-1"></use>
|
||||
</g>
|
||||
<path d="M1.990731,13.5 L3.06878027,16.374798 L0.693712943,23.5 L10.3062871,23.5 L7.93121973,16.374798 L9.009269,13.5 L1.990731,13.5 Z" id="Path-Copy-7" stroke="#000"></path>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 240 B After Width: | Height: | Size: 1.8 KiB |
|
@ -367,6 +367,8 @@ class ChangeAtZ(Script):
|
|||
modified_gcode = ""
|
||||
lines = active_layer.split("\n")
|
||||
for line in lines:
|
||||
if line.strip() == "":
|
||||
continue
|
||||
if ";Generated with Cura_SteamEngine" in line:
|
||||
TWinstances += 1
|
||||
modified_gcode += ";ChangeAtZ instances: %d\n" % TWinstances
|
||||
|
|
|
@ -10,7 +10,7 @@ def getMetaData():
|
|||
return {
|
||||
"stage": {
|
||||
"name": i18n_catalog.i18nc("@item:inmenu", "Prepare"),
|
||||
"weight": 0
|
||||
"weight": 10
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ def getMetaData():
|
|||
return {
|
||||
"stage": {
|
||||
"name": i18n_catalog.i18nc("@item:inmenu", "Preview"),
|
||||
"weight": 1
|
||||
"weight": 20
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -57,9 +57,12 @@ class SolidView(View):
|
|||
# As the rendering is called a *lot* we really, dont want to re-evaluate the property every time. So we store em!
|
||||
global_container_stack = Application.getInstance().getGlobalContainerStack()
|
||||
if global_container_stack:
|
||||
support_extruder_nr = global_container_stack.getExtruderPositionValueWithDefault("support_extruder_nr")
|
||||
support_angle_stack = global_container_stack.extruders.get(str(support_extruder_nr))
|
||||
if support_angle_stack:
|
||||
support_extruder_nr = int(global_container_stack.getExtruderPositionValueWithDefault("support_extruder_nr"))
|
||||
try:
|
||||
support_angle_stack = global_container_stack.extruderList[support_extruder_nr]
|
||||
except IndexError:
|
||||
pass
|
||||
else:
|
||||
self._support_angle = support_angle_stack.getProperty("support_angle", "value")
|
||||
|
||||
def beginRendering(self):
|
||||
|
|
|
@ -1,11 +1,14 @@
|
|||
<svg width="30px" height="30px" viewBox="0 0 30 30" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 48.2 (47327) - http://www.bohemiancoding.com/sketch -->
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="30px" height="30px" viewBox="0 0 28 28" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 57.1 (83088) - https://sketch.com -->
|
||||
<title>support_blocker</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="Cura-Icon" fill="#000000">
|
||||
<path d="M19,27 L12,27 L3,27 L3,3 L12,3 L12,11 L19,11 L19,19 L27,19 L27,27 L19,27 Z M4,4 L4,26 L11,26 L11,4 L4,4 Z" id="Combined-Shape"></path>
|
||||
<polygon id="Path" points="10 17.1441441 9.18918919 17.954955 7.52252252 16.3333333 5.85585586 18 5.04504505 17.1891892 6.66666667 15.4774775 5 13.8558559 5.81081081 13.045045 7.52252252 14.6666667 9.18918919 13 10 13.8108108 8.33333333 15.4774775"></polygon>
|
||||
<g id="support_blocker" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="Group-3" transform="translate(3.000000, 2.000000)">
|
||||
<g id="Print-as-support-Copy" fill="#000">
|
||||
<path d="M0.833,19.65 L0.833,22.342 L0,22.3428571 L0.833,19.65 Z M4.166,8.879 L4.166,22.342 L2.499,22.342 L2.499,14.266 L4.166,8.879 Z M7.5,0.8 L7.5,22.342 L5.833,22.342 L5.833,0.8 L7.5,0.8 Z M10.833,0.8 L10.833,22.342 L9.166,22.342 L9.166,0.8 L10.833,0.8 Z M14.166,0.8 L14.166,14 L12.499,14 L12.499,0.8 L14.166,0.8 Z M15.833,8.879 L17.418,14 L15.833,14 L15.833,8.879 Z M4.166,0.8 L4.166,6.139 L2.499,1.351 L2.499,0.8 L4.166,0.8 Z M17.5,0.8 L17.5,1.351 L15.833,6.139 L15.833,0.8 L17.5,0.8 Z" id="Combined-Shape"></path>
|
||||
</g>
|
||||
<path d="M12,14 L22,14 L22,24 L12,24 L12,14 Z" id="Rectangle" stroke="#000" stroke-dasharray="1,1"></path>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
</svg>
|
Before Width: | Height: | Size: 866 B After Width: | Height: | Size: 1.2 KiB |
|
@ -128,7 +128,7 @@ Item
|
|||
TableViewColumn
|
||||
{
|
||||
role: "print_core"
|
||||
title: catalog.i18nc("@label:table_header", "Print Core")
|
||||
title: "Print Core" //This term should not be translated.
|
||||
width: Math.floor(table.width * 0.2)
|
||||
}
|
||||
TableViewColumn
|
||||
|
|
|
@ -12,7 +12,7 @@ def getMetaData():
|
|||
"mesh_reader": [
|
||||
{
|
||||
"extension": "ctm",
|
||||
"description": i18n_catalog.i18nc("@item:inlistbox", "Open Compressed Triangle Mesh")
|
||||
"description": i18n_catalog.i18nc("@item:inlistbox 'Open' is part of the name of this file format.", "Open Compressed Triangle Mesh")
|
||||
},
|
||||
{
|
||||
"extension": "dae",
|
||||
|
|
|
@ -38,7 +38,11 @@ class UFPWriter(MeshWriter):
|
|||
def _createSnapshot(self, *args):
|
||||
# must be called from the main thread because of OpenGL
|
||||
Logger.log("d", "Creating thumbnail image...")
|
||||
self._snapshot = Snapshot.snapshot(width = 300, height = 300)
|
||||
try:
|
||||
self._snapshot = Snapshot.snapshot(width = 300, height = 300)
|
||||
except Exception:
|
||||
Logger.logException("w", "Failed to create snapshot image")
|
||||
self._snapshot = None # Failing to create thumbnail should not fail creation of UFP
|
||||
|
||||
# This needs to be called on the main thread (Qt thread) because the serialization of material containers can
|
||||
# trigger loading other containers. Because those loaded containers are QtObjects, they must be created on the
|
||||
|
|
|
@ -28,7 +28,7 @@ class CloudFlowMessage(Message):
|
|||
lifetime=0,
|
||||
dismissable=True,
|
||||
option_state=False,
|
||||
image_source=image_path,
|
||||
image_source=QUrl.fromLocalFile(image_path),
|
||||
image_caption=I18N_CATALOG.i18nc("@info:status Ultimaker Cloud should not be translated.",
|
||||
"Connect to Ultimaker Cloud"),
|
||||
)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# Cura is released under the terms of the LGPLv3 or higher.
|
||||
from UM import i18nCatalog
|
||||
from UM.Message import Message
|
||||
|
||||
from cura.CuraApplication import CuraApplication
|
||||
|
||||
I18N_CATALOG = i18nCatalog("cura")
|
||||
|
||||
|
@ -13,16 +13,25 @@ class CloudPrinterDetectedMessage(Message):
|
|||
# Singleton used to prevent duplicate messages of this type at the same time.
|
||||
__is_visible = False
|
||||
|
||||
# Store in preferences to hide this message in the future.
|
||||
_preference_key = "cloud/block_new_printers_popup"
|
||||
|
||||
def __init__(self) -> None:
|
||||
super().__init__(
|
||||
title=I18N_CATALOG.i18nc("@info:title", "New cloud printers found"),
|
||||
text=I18N_CATALOG.i18nc("@info:message", "New printers have been found connected to your account, "
|
||||
"you can find them in your list of discovered printers."),
|
||||
lifetime=10,
|
||||
dismissable=True
|
||||
lifetime=0,
|
||||
dismissable=True,
|
||||
option_state=False,
|
||||
option_text=I18N_CATALOG.i18nc("@info:option_text", "Do not show this message again")
|
||||
)
|
||||
self.optionToggled.connect(self._onDontAskMeAgain)
|
||||
CuraApplication.getInstance().getPreferences().addPreference(self._preference_key, False)
|
||||
|
||||
def show(self) -> None:
|
||||
if CuraApplication.getInstance().getPreferences().getValue(self._preference_key):
|
||||
return
|
||||
if CloudPrinterDetectedMessage.__is_visible:
|
||||
return
|
||||
super().show()
|
||||
|
@ -31,3 +40,6 @@ class CloudPrinterDetectedMessage(Message):
|
|||
def hide(self, send_signal = True) -> None:
|
||||
super().hide(send_signal)
|
||||
CloudPrinterDetectedMessage.__is_visible = False
|
||||
|
||||
def _onDontAskMeAgain(self, checked: bool) -> None:
|
||||
CuraApplication.getInstance().getPreferences().setValue(self._preference_key, checked)
|
||||
|
|
|
@ -12,6 +12,15 @@ _renamed_container_id_map = {
|
|||
"ultimaker2_extended_0.4": "ultimaker2_extended_olsson_0.4",
|
||||
"ultimaker2_extended_0.6": "ultimaker2_extended_olsson_0.6",
|
||||
"ultimaker2_extended_0.8": "ultimaker2_extended_olsson_0.8",
|
||||
# HMS434 "extra coarse", "super coarse", and "ultra coarse" are removed.
|
||||
"hms434_global_Extra_Coarse_Quality": "hms434_global_Normal_Quality",
|
||||
"hms434_global_Super_Coarse_Quality": "hms434_global_Normal_Quality",
|
||||
"hms434_global_Ultra_Coarse_Quality": "hms434_global_Normal_Quality",
|
||||
# HMS434 "0.25", "0.6", "1.2", and "1.5" nozzles are removed.
|
||||
"hms434_0.25tpnozzle": "hms434_0.4tpnozzle",
|
||||
"hms434_0.6tpnozzle": "hms434_0.4tpnozzle",
|
||||
"hms434_1.2tpnozzle": "hms434_0.4tpnozzle",
|
||||
"hms434_1.5tpnozzle": "hms434_0.4tpnozzle",
|
||||
}
|
||||
|
||||
|
||||
|
@ -42,7 +51,7 @@ class VersionUpgrade43to44(VersionUpgrade):
|
|||
#
|
||||
# This renames the renamed settings in the containers.
|
||||
def upgradeInstanceContainer(self, serialized: str, filename: str) -> Tuple[List[str], List[str]]:
|
||||
parser = configparser.ConfigParser(interpolation=None)
|
||||
parser = configparser.ConfigParser(interpolation = None)
|
||||
parser.read_string(serialized)
|
||||
|
||||
# Update version number.
|
||||
|
@ -58,12 +67,13 @@ class VersionUpgrade43to44(VersionUpgrade):
|
|||
|
||||
## Upgrades stacks to have the new version number.
|
||||
def upgradeStack(self, serialized: str, filename: str) -> Tuple[List[str], List[str]]:
|
||||
parser = configparser.ConfigParser(interpolation=None)
|
||||
parser = configparser.ConfigParser(interpolation = None)
|
||||
parser.read_string(serialized)
|
||||
|
||||
# Update version number.
|
||||
if "metadata" in parser:
|
||||
parser["metadata"]["setting_version"] = "10"
|
||||
if "metadata" not in parser:
|
||||
parser["metadata"] = {}
|
||||
parser["metadata"]["setting_version"] = "10"
|
||||
|
||||
if "containers" in parser:
|
||||
# With the ContainerTree refactor, UM2 with Olsson block got moved to a separate definition.
|
||||
|
|
|
@ -59,4 +59,3 @@ def getMetaData() -> Dict[str, Any]:
|
|||
|
||||
def register(app: "Application") -> Dict[str, Any]:
|
||||
return {"version_upgrade": upgrade}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue