Merge branch 'master' into feature_intent

Conflicts:
	resources/bundled_packages/cura.json -> 4.1 to 4.2 upgrade package added simultaneously
	tests/TestMachineManager.py -> Due to changes in conftest.py
	tests/conftest.py -> Simultaneously expanding the magic mocks to have some correct properties
This commit is contained in:
Ghostkeeper 2019-08-13 14:43:28 +02:00
commit 20201c65e6
No known key found for this signature in database
GPG key ID: 86BEF881AE2CF276
1386 changed files with 33217 additions and 35219 deletions

View file

@ -100,6 +100,7 @@ Column
return totalWeights + "g · " + totalLengths.toFixed(2) + "m"
}
source: UM.Theme.getIcon("spool")
font: UM.Theme.getFont("default")
}
}
}

View file

@ -37,6 +37,9 @@ UM.RecolorImage
opacity: opened ? 1 : 0
Behavior on opacity { NumberAnimation { duration: 100 } }
contentWidth: printJobInformation.width
contentHeight: printJobInformation.implicitHeight
contentItem: PrintJobInformation
{
id: printJobInformation

View file

@ -65,6 +65,7 @@ Item
property alias about: aboutAction;
property alias toggleFullScreen: toggleFullScreenAction;
property alias exitFullScreen: exitFullScreenAction
property alias configureSettingVisibility: configureSettingVisibilityAction
@ -82,10 +83,18 @@ Item
Action
{
id:toggleFullScreenAction
shortcut: StandardKey.FullScreen;
text: catalog.i18nc("@action:inmenu", "Toggle Full Screen");
iconName: "view-fullscreen";
id: toggleFullScreenAction
shortcut: StandardKey.FullScreen
text: catalog.i18nc("@action:inmenu", "Toggle Full Screen")
iconName: "view-fullscreen"
}
Action
{
id: exitFullScreenAction
shortcut: StandardKey.Cancel
text: catalog.i18nc("@action:inmenu", "Exit Full Screen")
iconName: "view-fullscreen"
}
Action

View file

@ -573,7 +573,13 @@ UM.MainWindow
Connections
{
target: Cura.Actions.toggleFullScreen
onTriggered: base.toggleFullscreen();
onTriggered: base.toggleFullscreen()
}
Connections
{
target: Cura.Actions.exitFullScreen
onTriggered: base.exitFullscreen()
}
FileDialog
@ -585,7 +591,12 @@ UM.MainWindow
modality: Qt.WindowModal
selectMultiple: true
nameFilters: UM.MeshFileHandler.supportedReadFileTypes;
folder: CuraApplication.getDefaultPath("dialog_load_path")
folder:
{
//Because several implementations of the file dialog only update the folder when it is explicitly set.
folder = CuraApplication.getDefaultPath("dialog_load_path");
return CuraApplication.getDefaultPath("dialog_load_path");
}
onAccepted:
{
// Because several implementations of the file dialog only update the folder

View file

@ -225,6 +225,7 @@ Item
border.width: UM.Theme.getSize("default_lining").width
border.color: UM.Theme.getColor("lining")
radius: UM.Theme.getSize("default_radius").width
height: contentItem.implicitHeight || content.height
}
contentItem: Item {}

View file

@ -55,6 +55,7 @@ Item
delegate: Button
{
id: stageSelectorButton
text: model.name.toUpperCase()
checkable: true
checked: UM.Controller.activeStage !== null && model.id == UM.Controller.activeStage.stageId

View file

@ -29,6 +29,7 @@ Menu
MenuItem
{
id: saveWorkspaceMenu
shortcut: StandardKey.Save
text: catalog.i18nc("@title:menu menubar:file", "&Save...")
onTriggered:
{

View file

@ -31,6 +31,7 @@ Menu
return Cura.MachineManager.activeVariantNames[extruderIndex] == model.hotend_name
}
exclusiveGroup: group
onTriggered: {
Cura.MachineManager.setVariant(menu.extruderIndex, model.container_node);
}

View file

@ -15,15 +15,10 @@ Menu
PrinterMenu { title: catalog.i18nc("@title:menu menubar:settings", "&Printer") }
property var activeMachine: Cura.MachineManager.activeMachine
onAboutToShow: extruderInstantiator.active = true
onAboutToHide: extruderInstantiator.active = false
Instantiator
{
id: extruderInstantiator
model: activeMachine == null ? null : activeMachine.extruderList
active: false
asynchronous: true
Menu
{
title: modelData.name
@ -52,7 +47,7 @@ Menu
MenuItem
{
text: catalog.i18nc("@action:inmenu", "Disable Extruder")
onTriggered: Cura.MachineManager.setExtruderEnabled(model.index, false)
onTriggered: Cura.MachineManager.setExtruderEnabled(index, false)
visible: Cura.MachineManager.getExtruder(model.index).isEnabled
enabled: Cura.MachineManager.numberExtrudersEnabled > 1
}

View file

@ -58,11 +58,11 @@ Menu
{
text: catalog.i18nc("@action:inmenu menubar:view", "Orthographic")
checkable: true
checked: cameraViewMenu.cameraMode == "orthogonal"
checked: cameraViewMenu.cameraMode == "orthographic"
onTriggered:
{
UM.Preferences.setValue("general/camera_perspective_mode", "orthogonal")
checked = cameraViewMenu.cameraMode == "orthogonal"
UM.Preferences.setValue("general/camera_perspective_mode", "orthographic")
checked = cameraViewMenu.cameraMode == "orthographic"
}
exclusiveGroup: group
}

View file

@ -105,7 +105,12 @@ Item
// We use an extra property here, since we only want to to be informed about the content size changes.
onContentHeightChanged:
{
scroll.height = Math.min(contentHeight, maximumHeight) + scroll.topPadding + scroll.bottomPadding
// It can sometimes happen that (due to animations / updates) the contentHeight is -1.
// This can cause a bunch of updates to trigger oneother, leading to a weird loop.
if(contentHeight >= 0)
{
scroll.height = Math.min(contentHeight, maximumHeight) + scroll.topPadding + scroll.bottomPadding
}
}
Component.onCompleted:
@ -116,10 +121,15 @@ Item
delegate: ObjectItemButton
{
id: modelButton
Binding
{
target: modelButton
property: "checked"
value: model.selected
}
text: model.name
width: listView.width
checked: model.selected
}
}
}

View file

@ -158,7 +158,7 @@ UM.PreferencesPage
append({ text: "日本語", code: "ja_JP" })
append({ text: "한국어", code: "ko_KR" })
append({ text: "Nederlands", code: "nl_NL" })
append({ text: "Polski", code: "pl_PL" })
//Polish is disabled for being incomplete: append({ text: "Polski", code: "pl_PL" })
append({ text: "Português do Brasil", code: "pt_BR" })
append({ text: "Português", code: "pt_PT" })
append({ text: "Русский", code: "ru_RU" })
@ -368,7 +368,7 @@ UM.PreferencesPage
{
width: childrenRect.width;
height: childrenRect.height;
text: zoomToMouseCheckbox.enabled ? catalog.i18nc("@info:tooltip", "Should zooming move in the direction of the mouse?") : catalog.i18nc("@info:tooltip", "Zooming towards the mouse is not supported in the orthogonal perspective.")
text: zoomToMouseCheckbox.enabled ? catalog.i18nc("@info:tooltip", "Should zooming move in the direction of the mouse?") : catalog.i18nc("@info:tooltip", "Zooming towards the mouse is not supported in the orthographic perspective.")
CheckBox
{
@ -389,7 +389,7 @@ UM.PreferencesPage
{
return;
}
zoomToMouseCheckbox.enabled = UM.Preferences.getValue("general/camera_perspective_mode") !== "orthogonal";
zoomToMouseCheckbox.enabled = UM.Preferences.getValue("general/camera_perspective_mode") !== "orthographic";
zoomToMouseCheckbox.checked = boolCheck(UM.Preferences.getValue("view/zoom_to_mouse")) && zoomToMouseCheckbox.enabled;
}
}
@ -481,7 +481,7 @@ UM.PreferencesPage
Component.onCompleted: {
append({ text: catalog.i18n("Perspective"), code: "perspective" })
append({ text: catalog.i18n("Orthogonal"), code: "orthogonal" })
append({ text: catalog.i18n("Orthographic"), code: "orthographic" })
}
}

View file

@ -82,6 +82,7 @@ Item
}
editingEnabled: currentItem != null && !currentItem.is_read_only
onResetSelectedMaterial: base.resetExpandedActiveMaterial()
properties: materialProperties
containerId: currentItem != null ? currentItem.id : ""

View file

@ -102,6 +102,7 @@ Item
}
}
}
base.currentItem = null
return false
}

View file

@ -13,7 +13,6 @@ Item
{
id: base
property QtObject materialManager: CuraApplication.getMaterialManager()
// Keep PreferencesDialog happy
property var resetEnabled: false
property var currentItem: null
@ -41,14 +40,29 @@ Item
name: "cura"
}
function resetExpandedActiveMaterial()
{
materialListView.expandActiveMaterial(active_root_material_id)
}
function setExpandedActiveMaterial(root_material_id)
{
materialListView.expandActiveMaterial(root_material_id)
}
// When loaded, try to select the active material in the tree
Component.onCompleted: materialListView.expandActiveMaterial(active_root_material_id)
Component.onCompleted: resetExpandedActiveMaterial()
// Every time the selected item has changed, notify to the details panel
onCurrentItemChanged:
{
forceActiveFocus()
materialDetailsPanel.currentItem = currentItem
// CURA-6679 If the current item is gone after the model update, reset the current item to the active material.
if (currentItem == null)
{
resetExpandedActiveMaterial()
}
}
// Main layout
@ -105,7 +119,7 @@ Item
onClicked:
{
forceActiveFocus();
base.newRootMaterialIdToSwitchTo = base.materialManager.createMaterial();
base.newRootMaterialIdToSwitchTo = CuraApplication.getMaterialManager().createMaterial();
base.toActivateNewMaterial = true;
}
}
@ -120,7 +134,7 @@ Item
onClicked:
{
forceActiveFocus();
base.newRootMaterialIdToSwitchTo = base.materialManager.duplicateMaterial(base.currentItem.container_node);
base.newRootMaterialIdToSwitchTo = CuraApplication.getMaterialManager().duplicateMaterial(base.currentItem.container_node);
base.toActivateNewMaterial = true;
}
}
@ -131,7 +145,7 @@ Item
id: removeMenuButton
text: catalog.i18nc("@action:button", "Remove")
iconName: "list-remove"
enabled: base.hasCurrentItem && !base.currentItem.is_read_only && !base.isCurrentItemActivated && base.materialManager.canMaterialBeRemoved(base.currentItem.container_node)
enabled: base.hasCurrentItem && !base.currentItem.is_read_only && !base.isCurrentItemActivated && CuraApplication.getMaterialManager().canMaterialBeRemoved(base.currentItem.container_node)
onClicked:
{
forceActiveFocus();
@ -280,7 +294,7 @@ Item
{
// Set the active material as the fallback. It will be selected when the current material is deleted
base.newRootMaterialIdToSwitchTo = base.active_root_material_id
base.materialManager.removeMaterial(base.currentItem.container_node);
CuraApplication.getMaterialManager().removeMaterial(base.currentItem.container_node);
}
}

View file

@ -51,7 +51,7 @@ Rectangle
anchors.left: swatch.right
anchors.verticalCenter: materialSlot.verticalCenter
anchors.leftMargin: UM.Theme.getSize("narrow_margin").width
font.italic: Cura.MachineManager.currentRootMaterialId[Cura.ExtruderManager.activeExtruderIndex] == material.root_material_id
font.italic: material != null && Cura.MachineManager.currentRootMaterialId[Cura.ExtruderManager.activeExtruderIndex] == material.root_material_id
}
MouseArea
{
@ -60,7 +60,7 @@ Rectangle
{
materialList.currentBrand = material.brand
materialList.currentType = material.brand + "_" + material.material
base.currentItem = material
base.setExpandedActiveMaterial(material.root_material_id)
}
hoverEnabled: true
onEntered: { materialSlot.hovered = true }
@ -82,10 +82,10 @@ Rectangle
{
if (materialSlot.is_favorite)
{
base.materialManager.removeFavorite(material.root_material_id)
CuraApplication.getMaterialManager().removeFavorite(material.root_material_id)
return
}
base.materialManager.addFavorite(material.root_material_id)
CuraApplication.getMaterialManager().addFavorite(material.root_material_id)
return
}
style: ButtonStyle

View file

@ -14,8 +14,6 @@ TabView
{
id: base
property QtObject materialManager: CuraApplication.getMaterialManager()
property QtObject properties
property var currentMaterialNode: null
@ -29,6 +27,8 @@ TabView
property double spoolLength: calculateSpoolLength()
property real costPerMeter: calculateCostPerMeter()
signal resetSelectedMaterial()
property bool reevaluateLinkedMaterials: false
property string linkedMaterialNames:
{
@ -105,29 +105,21 @@ TabView
property var new_diameter_value: null;
property var old_diameter_value: null;
property var old_approximate_diameter_value: null;
property bool keyPressed: false
onYes:
{
base.setMetaDataEntry("approximate_diameter", old_approximate_diameter_value, getApproximateDiameter(new_diameter_value).toString());
base.setMetaDataEntry("properties/diameter", properties.diameter, new_diameter_value);
base.resetSelectedMaterial()
}
onNo:
{
properties.diameter = old_diameter_value;
diameterSpinBox.value = properties.diameter;
base.properties.diameter = old_diameter_value;
diameterSpinBox.value = Qt.binding(function() { return base.properties.diameter })
}
onVisibilityChanged:
{
if (!visible && !keyPressed)
{
// If the user closes this dialog without clicking on any button, it's the same as clicking "No".
no();
}
keyPressed = false;
}
onRejected: no()
}
Label { width: scrollView.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Display Name") }
@ -573,7 +565,7 @@ TabView
}
// update the values
base.materialManager.setMaterialName(base.currentMaterialNode, new_name)
CuraApplication.getMaterialManager().setMaterialName(base.currentMaterialNode, new_name)
properties.name = new_name
}

View file

@ -34,8 +34,8 @@ Item
anchors.fill: parent
onEditingFinished: base.editingFinished()
Keys.onEnterPressed: base.editingFinished()
Keys.onReturnPressed: base.editingFinished()
Keys.onEnterPressed: spinBox.focus = false
Keys.onReturnPressed: spinBox.focus = false
}
Label

View file

@ -1,3 +1,6 @@
//Copyright (c) 2019 Ultimaker B.V.
//Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2
import QtQuick.Controls 1.1
import QtQuick.Controls.Styles 1.1
@ -35,7 +38,7 @@ Item
Label //Extruder name.
{
text: Cura.ExtruderManager.getExtruderName(position) != "" ? Cura.ExtruderManager.getExtruderName(position) : catalog.i18nc("@label", "Extruder")
text: Cura.MachineManager.activeMachine.extruders[position].name !== "" ? Cura.MachineManager.activeMachine.extruders[position].name : catalog.i18nc("@label", "Extruder")
color: UM.Theme.getColor("text")
font: UM.Theme.getFont("default")
anchors.left: parent.left

View file

@ -22,9 +22,12 @@ Item
? machineList.model.getItem(machineList.currentIndex)
: null
// The currently active (expanded) section/category, where section/category is the grouping of local machine items.
property string currentSection: preferredCategory
property string currentSection: "Ultimaker B.V."
// By default (when this list shows up) we always expand the "Ultimaker" section.
property string preferredCategory: "Ultimaker"
property var preferredCategories: {
"Ultimaker B.V.": -2,
"Custom": -1
}
property int maxItemCountAtOnce: 10 // show at max 10 items at once, otherwise you need to scroll.
@ -89,8 +92,8 @@ Item
{
id: machineDefinitionsModel
filter: { "visible": true }
sectionProperty: "category"
preferredSectionValue: preferredCategory
sectionProperty: "manufacturer"
preferredSections: preferredCategories
}
section.property: "section"