Merge branch '5.0' of github.com:Ultimaker/Cura

This commit is contained in:
Jaime van Kessel 2022-05-03 13:48:31 +02:00
commit 7265509054
19 changed files with 40 additions and 28 deletions

View file

@ -119,8 +119,8 @@ Item
topPadding: UM.Theme.getSize("narrow_margin").width topPadding: UM.Theme.getSize("narrow_margin").width
bottomPadding: UM.Theme.getSize("narrow_margin").width bottomPadding: UM.Theme.getSize("narrow_margin").width
Layout.preferredWidth: UM.Theme.getSize("card_tiny_icon").width + 2 * padding width: UM.Theme.getSize("card_tiny_icon").width + 2 * padding
Layout.preferredHeight: UM.Theme.getSize("card_tiny_icon").width + 2 * padding height: UM.Theme.getSize("card_tiny_icon").width + 2 * padding
contentItem: UM.ColorImage contentItem: UM.ColorImage
{ {
source: UM.Theme.getIcon("LinkExternal") source: UM.Theme.getIcon("LinkExternal")

View file

@ -232,7 +232,7 @@ UM.Dialog
} }
onObjectAdded: function(index, object) { scriptsMenu.insertItem(index, object)} onObjectAdded: function(index, object) { scriptsMenu.insertItem(index, object)}
onObjectRemoved: function(object) { scriptsMenu.removeItem(object) } onObjectRemoved: function(index, object) { scriptsMenu.removeItem(object) }
} }
} }

View file

@ -155,6 +155,7 @@ Button
height: parent.height height: parent.height
visible: false visible: false
running: visible
RotationAnimator RotationAnimator
{ {

View file

@ -46,7 +46,7 @@ Cura.Menu
} }
// Add it to the fifth position (and above) as we want it to be added after the extruder header. // Add it to the fifth position (and above) as we want it to be added after the extruder header.
onObjectAdded: function(index, object) { base.insertItem(index + 5, object) } onObjectAdded: function(index, object) { base.insertItem(index + 5, object) }
onObjectRemoved: function(object) { base.removeItem(object) } onObjectRemoved: function(index, object) { base.removeItem(object) }
} }
// Global actions // Global actions
@ -134,6 +134,7 @@ Cura.Menu
from: 1 from: 1
to: 99 to: 99
width: 2 * UM.Theme.getSize("button").width width: 2 * UM.Theme.getSize("button").width
value: 1
} }
} }
} }

View file

@ -54,11 +54,11 @@ Cura.Menu
} }
onObjectAdded: function(index, object) { sub_menu.insertItem(index, object.item)} onObjectAdded: function(index, object) { sub_menu.insertItem(index, object.item)}
onObjectRemoved: function(object) { sub_menu.removeItem(object.item)} onObjectRemoved: function(index, object) { sub_menu.removeItem(object.item)}
} }
} }
onObjectAdded: function(index, object) { extensionMenu.insertMenu(index, object) } onObjectAdded: function(index, object) { extensionMenu.insertMenu(index, object) }
onObjectRemoved: function(object) { extensionMenu.removeMenu(object)} onObjectRemoved: function(index, object) { extensionMenu.removeMenu(object)}
} }
} }

View file

@ -33,6 +33,7 @@ Cura.Menu
id: openFilesMenu id: openFilesMenu
shouldBeVisible: base.fileProviderModel.count > 1 shouldBeVisible: base.fileProviderModel.count > 1
enabled: shouldBeVisible
} }
RecentFilesMenu { } RecentFilesMenu { }

View file

@ -67,7 +67,7 @@ Cura.Menu
onTriggered: Cura.MachineManager.setMaterial(extruderIndex, model.container_node) onTriggered: Cura.MachineManager.setMaterial(extruderIndex, model.container_node)
} }
onObjectAdded: function(index, object) { materialMenu.insertItem(index + 1, object) } onObjectAdded: function(index, object) { materialMenu.insertItem(index + 1, object) }
onObjectRemoved: function(object) { materialMenu.removeItem(index) } onObjectRemoved: function(index, object) { materialMenu.removeItem(index) }
} }
Cura.MenuSeparator { visible: favoriteMaterialsModel.items.length > 0} Cura.MenuSeparator { visible: favoriteMaterialsModel.items.length > 0}
@ -89,7 +89,7 @@ Cura.Menu
onTriggered: Cura.MachineManager.setMaterial(extruderIndex, model.container_node) onTriggered: Cura.MachineManager.setMaterial(extruderIndex, model.container_node)
} }
onObjectAdded: function(index, object) { genericMenu.insertItem(index, object)} onObjectAdded: function(index, object) { genericMenu.insertItem(index, object)}
onObjectRemoved: function(object) {genericMenu.removeItem(index) } onObjectRemoved: function(index, object) {genericMenu.removeItem(index) }
} }
} }
@ -103,7 +103,7 @@ Cura.Menu
materialTypesModel: model materialTypesModel: model
} }
onObjectAdded: function(index, object) { materialMenu.insertItem(index + 4, object)} onObjectAdded: function(index, object) { materialMenu.insertItem(index + 4, object)}
onObjectRemoved: function(object) { materialMenu.removeItem(index) } onObjectRemoved: function(index, object) { materialMenu.removeItem(index) }
} }
Cura.MenuSeparator {} Cura.MenuSeparator {}

View file

@ -50,7 +50,7 @@ Cura.Menu
} }
onObjectAdded: function(index, object) { nozzleMenu.insertItem(index, object) } onObjectAdded: function(index, object) { nozzleMenu.insertItem(index, object) }
onObjectRemoved: function(object) {nozzleMenu.removeItem(object)} onObjectRemoved: function(index, object) {nozzleMenu.removeItem(object)}
} }
} }

View file

@ -36,6 +36,6 @@ Cura.Menu
} }
onObjectAdded: function(index, object) { openFilesMenu.insertItem(index, object)} onObjectAdded: function(index, object) { openFilesMenu.insertItem(index, object)}
onObjectRemoved: function(object) { openFilesMenu.removeItem(object) } onObjectRemoved: function(index, object) { openFilesMenu.removeItem(object) }
} }
} }

View file

@ -39,7 +39,7 @@ Cura.Menu
onTriggered: Cura.MachineManager.setActiveMachine(model.id) onTriggered: Cura.MachineManager.setActiveMachine(model.id)
} }
onObjectAdded: function(index, object) { menu.insertItem(2, object)} onObjectAdded: function(index, object) { menu.insertItem(2, object)}
onObjectRemoved: function(object) { menu.removeItem(object)} onObjectRemoved: function(index, object) { menu.removeItem(object)}
} }
Cura.MenuSeparator { visible: networKPrinterInstantiator.count > 0 } Cura.MenuSeparator { visible: networKPrinterInstantiator.count > 0 }
@ -67,7 +67,7 @@ Cura.Menu
} }
// A bit hackish, but we have 2 items at the end, put them before that // A bit hackish, but we have 2 items at the end, put them before that
onObjectAdded: function(index, object) { menu.insertItem(menu.count - 2, object) } onObjectAdded: function(index, object) { menu.insertItem(menu.count - 2, object) }
onObjectRemoved: function(object) { menu.removeItem(object) } onObjectRemoved: function(index, object) { menu.removeItem(object) }
} }
Cura.MenuSeparator { visible: localPrinterInstantiator.count > 0 } Cura.MenuSeparator { visible: localPrinterInstantiator.count > 0 }

View file

@ -29,6 +29,6 @@ Cura.Menu
} }
} }
onObjectAdded: function(index, object) { return menu.insertItem(index, object); } onObjectAdded: function(index, object) { return menu.insertItem(index, object); }
onObjectRemoved: function(object) { return menu.removeItem(object); } onObjectRemoved: function(index, object) { return menu.removeItem(object); }
} }
} }

View file

@ -44,7 +44,7 @@ Cura.Menu
enabled: saveProjectMenu.shouldBeVisible enabled: saveProjectMenu.shouldBeVisible
} }
onObjectAdded: function(index, object) { saveProjectMenu.insertItem(index, object)} onObjectAdded: function(index, object) { saveProjectMenu.insertItem(index, object)}
onObjectRemoved: function(object) { saveProjectMenu.removeItem(object)} onObjectRemoved: function(index, object) { saveProjectMenu.removeItem(object)}
} }
WorkspaceSummaryDialog WorkspaceSummaryDialog

View file

@ -33,7 +33,7 @@ Cura.Menu
} }
onObjectAdded: function(index, object) { menu.insertItem(index, object) } onObjectAdded: function(index, object) { menu.insertItem(index, object) }
onObjectRemoved: function(object) { menu.removeItem(object)} onObjectRemoved: function(index, object) { menu.removeItem(object)}
} }
Cura.MenuSeparator {} Cura.MenuSeparator {}

View file

@ -68,7 +68,7 @@ Cura.Menu
} }
} }
onObjectAdded: function(index, object) { base.insertMenu(index, object) } onObjectAdded: function(index, object) { base.insertMenu(index, object) }
onObjectRemoved:function(object) { base.removeMenu(object)} onObjectRemoved: function(index, object) { base.removeMenu(object);}
} }
Cura.MenuSeparator { } Cura.MenuSeparator { }

View file

@ -246,7 +246,7 @@ UM.ManagementPage
break; break;
} }
messageDialog.open(); messageDialog.open();
CuraApplication.setDefaultPath("dialog_material_path", folder); CuraApplication.setDefaultPath("dialog_material_path", currentFolder);
} }
} }
@ -259,7 +259,9 @@ UM.ManagementPage
currentFolder: CuraApplication.getDefaultPath("dialog_material_path") currentFolder: CuraApplication.getDefaultPath("dialog_material_path")
onAccepted: onAccepted:
{ {
const result = Cura.ContainerManager.exportContainer(base.currentItem.root_material_id, selectedNameFilter, selectedFile); const nameFilterString = selectedNameFilter.index >= 0 ? nameFilters[selectedNameFilter.index] : nameFilters[0];
const result = Cura.ContainerManager.exportContainer(base.currentItem.root_material_id, nameFilterString, selectedFile);
const messageDialog = Qt.createQmlObject("import Cura 1.5 as Cura; Cura.MessageDialog { onClosed: destroy() }", base); const messageDialog = Qt.createQmlObject("import Cura 1.5 as Cura; Cura.MessageDialog { onClosed: destroy() }", base);
messageDialog.title = catalog.i18nc("@title:window", "Export Material"); messageDialog.title = catalog.i18nc("@title:window", "Export Material");
@ -275,7 +277,7 @@ UM.ManagementPage
} }
messageDialog.open(); messageDialog.open();
CuraApplication.setDefaultPath("dialog_material_path", folder); CuraApplication.setDefaultPath("dialog_material_path", currentFolder);
} }
} }
} }

View file

@ -574,11 +574,11 @@ Item
elide: Text.ElideRight elide: Text.ElideRight
verticalAlignment: Qt.AlignVCenter verticalAlignment: Qt.AlignVCenter
} }
Cura.SpinBox Cura.NumericTextFieldWithUnit
{ {
id: spinBox id: spinBox
anchors.left: label.right anchors.left: label.right
value: valueText:
{ {
// In case the setting is not in the material... // In case the setting is not in the material...
if (!isNaN(parseFloat(materialPropertyProvider.properties.value))) if (!isNaN(parseFloat(materialPropertyProvider.properties.value)))
@ -598,11 +598,11 @@ Item
return 0; return 0;
} }
width: settingsPage.columnWidth width: settingsPage.columnWidth
suffix: " " + model.unit maximum: 99999
to: 99999 unitText: model.unit
decimals: model.unit == "mm" ? 2 : 0 decimals: model.unit == "mm" ? 2 : 0
onEditingFinished: materialPropertyProvider.setPropertyValue("value", value) editingFinishedFunction: materialPropertyProvider.setPropertyValue("value", value)
} }
UM.ContainerPropertyProvider UM.ContainerPropertyProvider

View file

@ -354,8 +354,13 @@ UM.ManagementPage
currentFolder: CuraApplication.getDefaultPath("dialog_profile_path") currentFolder: CuraApplication.getDefaultPath("dialog_profile_path")
onAccepted: onAccepted:
{ {
// If nameFilters contains only 1 item, the index of selectedNameFilter will always be -1
// This fetches the nameFilter at index selectedNameFilter.index if it is positive
const nameFilterString = selectedNameFilter.index >= 0 ? nameFilters[selectedNameFilter.index] : nameFilters[0];
var result = Cura.ContainerManager.exportQualityChangesGroup(base.currentItem.quality_changes_group, var result = Cura.ContainerManager.exportQualityChangesGroup(base.currentItem.quality_changes_group,
selectedFile, selectedNameFilter); selectedFile, nameFilterString);
if (result && result.status == "error") if (result && result.status == "error")
{ {
@ -365,7 +370,7 @@ UM.ManagementPage
} }
// else pop-up Message thing from python code // else pop-up Message thing from python code
CuraApplication.setDefaultPath("dialog_profile_path", folder); CuraApplication.setDefaultPath("dialog_profile_path", currentFolder);
} }
} }

View file

@ -17,6 +17,8 @@ UM.PointingRectangle
arrowSize: UM.Theme.getSize("default_arrow").width arrowSize: UM.Theme.getSize("default_arrow").width
opacity: 0 opacity: 0
// This should be disabled when invisible, otherwise it will catch mouse events.
enabled: opacity > 0
Behavior on opacity Behavior on opacity
{ {

View file

@ -154,7 +154,7 @@ SettingItem
background: Rectangle background: Rectangle
{ {
id: swatch id: swatch
height: Math.round(parent.height / 2) height: UM.Theme.getSize("standard_arrow").width
width: height width: height
radius: Math.round(width / 2) radius: Math.round(width / 2)
anchors.right: parent.right anchors.right: parent.right