Merge branch 'main' into fix_qml_py_re

This commit is contained in:
Erwan MATHIEU 2025-02-11 13:19:50 +01:00 committed by GitHub
commit 01fd82e8e5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8063 changed files with 78301 additions and 15031 deletions

View file

@ -62,7 +62,6 @@ Item
property alias showProfileFolder: showProfileFolderAction
property alias documentation: documentationAction
property alias showTroubleshooting: showTroubleShootingAction
property alias openSponsershipPage: openSponsershipPageAction
property alias reportBug: reportBugAction
property alias whatsNew: whatsNewAction
@ -78,6 +77,7 @@ Item
property alias paste: pasteAction
property alias copy: copyAction
property alias cut: cutAction
property alias exportProjectForSupport: exportProjectForSupportAction
readonly property bool copy_paste_enabled: {
const all_enabled_packages = CuraApplication.getPackageManager().allEnabledPackages;
@ -86,14 +86,6 @@ Item
UM.I18nCatalog{id: catalog; name: "cura"}
Action
{
id: showTroubleShootingAction
onTriggered: Qt.openUrlExternally("https://ultimaker.com/en/troubleshooting?utm_source=cura&utm_medium=software&utm_campaign=dropdown-troubleshooting")
text: catalog.i18nc("@action:inmenu", "Show Online Troubleshooting")
}
Action
{
id: openSponsershipPageAction
@ -558,4 +550,25 @@ Item
text: "&Marketplace"
icon.name: "plugins_browse"
}
Action
{
id: exportProjectForSupportAction
text: catalog.i18nc("@action:inmenu menubar:help", "Export Package For Technical Support")
onTriggered:
{
var exportName = Qt.formatDateTime(new Date(), "'export-'yyyyMMdd-HHmmss")
var args = {
"filter_by_machine": false,
"file_type": "workspace",
"preferred_mimetypes": "application/vnd.ms-package.3dmanufacturing-3dmodel+xml",
"limit_mimetypes": ["application/vnd.ms-package.3dmanufacturing-3dmodel+xml"],
"silent_save": true,
"writer_args": {
"include_log": true
}
};
UM.OutputDeviceManager.requestWriteToDevice("local_file", exportName, args)
}
}
}

View file

@ -12,20 +12,16 @@ import Cura 1.1 as Cura
//
// TextArea widget for editing Gcode in the Machine Settings dialog.
//
UM.TooltipArea
Item
{
id: control
UM.I18nCatalog { id: catalog; name: "cura"; }
text: tooltip
property alias containerStackId: propertyProvider.containerStackId
property alias settingKey: propertyProvider.key
property alias settingStoreIndex: propertyProvider.storeIndex
property string tooltip: propertyProvider.properties.description ? propertyProvider.properties.description : ""
property alias labelText: titleLabel.text
property alias labelFont: titleLabel.font

View file

@ -1,4 +1,4 @@
// Copyright (c) 2018 Ultimaker B.V.
// Copyright (c) 2025 UltiMaker
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.7
@ -12,7 +12,7 @@ Button
id: configurationItem
property var configuration: null
hoverEnabled: isValidMaterial
hoverEnabled: isValidMaterial && isValidCore
property bool isValidMaterial:
{
@ -25,7 +25,6 @@ Button
for (var index in extruderConfigurations)
{
var name = extruderConfigurations[index].material ? extruderConfigurations[index].material.name : ""
if (name == "" || name == "Unknown")
{
return false
@ -34,6 +33,25 @@ Button
return true
}
property bool isValidCore:
{
if (configuration === null)
{
return false
}
var extruderConfigurations = configuration.extruderConfigurations
var coresList = configuration.validCoresForPrinterType
for (var index in extruderConfigurations)
{
var name = extruderConfigurations[index].hotendID ? extruderConfigurations[index].hotendID : ""
if (name != "" && ! coresList.includes(name))
{
return false
}
}
return true
}
background: Rectangle
{
color: parent.hovered ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("action_button")
@ -60,7 +78,7 @@ Button
right: parent.right
rightMargin: UM.Theme.getSize("wide_margin").width
}
height: childrenRect.height
height: unknownMaterial.visible ? unknownMaterial.height : (repeater.count > 0 ? repeater.itemAt(0).height : 0)
spacing: UM.Theme.getSize("default_margin").width
Repeater
@ -72,21 +90,20 @@ Button
{
width: Math.round(parent.width / (configuration !== null ? configuration.extruderConfigurations.length : 1))
printCoreConfiguration: modelData
visible: configurationItem.isValidMaterial
visible: configurationItem.isValidMaterial && configurationItem.isValidCore
}
}
// Unknown material
// Unknown material or core ('variant')
Item
{
id: unknownMaterial
height: unknownMaterialMessage.height + UM.Theme.getSize("thin_margin").width / 2
height: unknownMaterialMessage.height
width: parent.width
anchors.top: parent.top
anchors.topMargin: UM.Theme.getSize("thin_margin").width / 2
visible: !configurationItem.isValidMaterial
visible: ! (configurationItem.isValidMaterial && configurationItem.isValidCore)
UM.ColorImage
{
@ -102,13 +119,9 @@ Button
UM.Label
{
id: unknownMaterialMessage
text:
{
if (configuration === null)
{
return ""
}
function whenUnknownMaterial()
{
var extruderConfigurations = configuration.extruderConfigurations
var unknownMaterials = []
for (var index in extruderConfigurations)
@ -135,9 +148,47 @@ Button
unknownMaterials = "<b>" + unknownMaterials + "</b>"
var draftResult = catalog.i18nc("@label", "This configuration is not available because %1 is not recognized. Please visit %2 to download the correct material profile.");
var result = draftResult.arg(unknownMaterials).arg("<a href=' '>" + catalog.i18nc("@label","Marketplace") + "</a> ")
return draftResult.arg(unknownMaterials).arg("<a href=' '>" + catalog.i18nc("@label","Marketplace") + "</a> ")
}
return result
function whenMismatchedCore()
{
var extruderConfigurations = configuration.extruderConfigurations
var coresList = configuration.validCoresForPrinterType
var mismatchedCores = []
for (var index in extruderConfigurations)
{
var name = extruderConfigurations[index].hotendID ? extruderConfigurations[index].hotendID : ""
if (name != "" && ! coresList.includes(name))
{
mismatchedCores.push(name)
}
}
mismatchedCores = "<b>" + mismatchedCores + "</b>"
var draftResult = catalog.i18nc("@label", "This configuration is not available because there is a mismatch or other problem with core-type %1. Please visit %2 to check which cores this printer-type supports w.r.t. new slices.");
return draftResult.arg(mismatchedCores).arg("<a href=' '>" + catalog.i18nc("@label","WEBSITE") + "</a> ")
}
text:
{
if (configuration === null)
{
return ""
}
var extruderConfigurations = configuration.extruderConfigurations
var perExtruder = []
for (var index in extruderConfigurations)
{
var matName = extruderConfigurations[index].material ? extruderConfigurations[index].material.name : ""
var coreName = extruderConfigurations[index].hotendID ? extruderConfigurations[index].hotendID : ""
perExtruder.push(` [${coreName}/${matName}]`)
}
var configsStr = "<i>" + perExtruder + "</i>"
var warnStr = isValidMaterial ? whenMismatchedCore() : whenUnknownMaterial()
return configsStr + "<br/>" + warnStr
}
width: extruderRow.width
@ -225,7 +276,7 @@ Button
onClicked:
{
if(isValidMaterial)
if (isValidMaterial && isValidCore)
{
toggleContent()
Cura.MachineManager.applyRemoteConfiguration(configuration)

View file

@ -18,6 +18,12 @@ Item
name: "cura"
}
UM.I18nCatalog
{
id: catalog_fdmprinter
name: "fdmprinter.def.json"
}
width: parent.width
height: childrenRect.height
@ -281,7 +287,7 @@ Item
UM.Label
{
text: Cura.MachineManager.activeDefinitionVariantsName
text: catalog_fdmprinter.i18nc("variant_name", Cura.MachineManager.activeDefinitionVariantsName)
height: parent.height
width: selectors.textWidth
}

View file

@ -14,11 +14,12 @@ Cura.Menu
title: catalog.i18nc("@title:menu menubar:toplevel", "&Help")
Cura.MenuItem { action: Cura.Actions.showProfileFolder }
Cura.MenuItem { action: Cura.Actions.showTroubleshooting}
Cura.MenuItem { action: Cura.Actions.documentation }
Cura.MenuItem { action: Cura.Actions.reportBug }
Cura.MenuItem { action: Cura.Actions.openSponsershipPage }
Cura.MenuSeparator { }
Cura.MenuItem { action: Cura.Actions.exportProjectForSupport }
Cura.MenuSeparator { }
Cura.MenuItem { action: Cura.Actions.whatsNew }
Cura.MenuItem { action: Cura.Actions.about }
}

View file

@ -109,6 +109,9 @@ UM.PreferencesPage
UM.Preferences.resetPreference("general/restore_window_geometry")
restoreWindowPositionCheckbox.checked = boolCheck(UM.Preferences.getValue("general/restore_window_geometry"))
UM.Preferences.resetPreference("tool/flip_y_axis_tool_handle")
flipToolhandleYCheckbox.checked = boolcheck(UM.Preferences.getValue("tool/flip_y_axis_tool_handle"))
UM.Preferences.resetPreference("general/camera_perspective_mode")
//var defaultCameraMode = UM.Preferences.getValue("general/camera_perspective_mode")
// /setDefaultCameraMode(defaultCameraMode)
@ -662,6 +665,21 @@ UM.PreferencesPage
}
}
}
UM.TooltipArea
{
width: childrenRect.width
height: childrenRect.height
text: catalog.i18nc("@info:tooltip", "Should the Y axis of the translate toolhandle be flipped? This will only affect model's Y coordinate, all other settings such as machine Printhead settings are unaffected and still behave as before.")
UM.CheckBox
{
id: flipToolhandleYCheckbox
text: catalog.i18nc("@option:check", "Flip model's toolhandle Y axis (restart required)")
checked: boolCheck(UM.Preferences.getValue("tool/flip_y_axis_tool_handle"))
onCheckedChanged: UM.Preferences.setValue("tool/flip_y_axis_tool_handle", checked)
}
}
Item
{

View file

@ -13,7 +13,7 @@ import "."
Item
{
id: base
height: enabled ? UM.Theme.getSize("section").height + UM.Theme.getSize("narrow_margin").height : 0
height: enabled ? Math.max(UM.Theme.getSize("section").height, label.height) + UM.Theme.getSize("narrow_margin").height : 0
anchors.left: parent.left
anchors.right: parent.right