Merge remote-tracking branch 'origin/master' into feature_model_list

This commit is contained in:
Lipu Fei 2019-05-16 15:17:46 +02:00
commit 28172c9ad2
182 changed files with 31808 additions and 18294 deletions

View file

@ -28,7 +28,7 @@ Column
Label
{
text: catalog.i18nc("@label", "Time specification").toUpperCase()
text: catalog.i18nc("@label", "Time estimation").toUpperCase()
color: UM.Theme.getColor("primary")
font: UM.Theme.getFont("default_bold")
renderType: Text.NativeRendering
@ -111,7 +111,7 @@ Column
Label
{
text: catalog.i18nc("@label", "Material specification").toUpperCase()
text: catalog.i18nc("@label", "Material estimation").toUpperCase()
color: UM.Theme.getColor("primary")
font: UM.Theme.getFont("default_bold")
renderType: Text.NativeRendering

View file

@ -53,6 +53,25 @@ UM.TooltipArea
anchors.left: parent.left
anchors.right: parent.right
background: Rectangle
{
color: UM.Theme.getColor("main_background")
anchors.fill: parent
border.color:
{
if (!gcodeTextArea.enabled)
{
return UM.Theme.getColor("setting_control_disabled_border")
}
if (gcodeTextArea.hovered || gcodeTextArea.activeFocus)
{
return UM.Theme.getColor("setting_control_border_highlight")
}
return UM.Theme.getColor("setting_control_border")
}
}
TextArea
{
id: gcodeTextArea
@ -66,25 +85,6 @@ UM.TooltipArea
color: UM.Theme.getColor("text")
wrapMode: TextEdit.NoWrap
background: Rectangle
{
color: UM.Theme.getColor("main_background")
anchors.fill: parent
border.color:
{
if (!gcodeTextArea.enabled)
{
return UM.Theme.getColor("setting_control_disabled_border")
}
if (gcodeTextArea.hovered || gcodeTextArea.activeFocus)
{
return UM.Theme.getColor("setting_control_border_highlight")
}
return UM.Theme.getColor("setting_control_border")
}
}
onActiveFocusChanged:
{
if (!activeFocus)

View file

@ -70,7 +70,7 @@ Item
OldControls.ToolButton
{
id: printerTypeSelector
text: Cura.MachineManager.activeMachine.definition.name
text: Cura.MachineManager.activeMachine !== null ? Cura.MachineManager.activeMachine.definition.name: ""
tooltip: text
height: UM.Theme.getSize("print_setup_big_item").height
width: Math.round(parent.width * 0.7) + UM.Theme.getSize("default_margin").width
@ -201,7 +201,7 @@ Item
return paddedWidth - textWidth - UM.Theme.getSize("print_setup_big_item").height * 0.5 - UM.Theme.getSize("default_margin").width
}
}
property string instructionLink: Cura.ContainerManager.getContainerMetaDataEntry(Cura.MachineManager.activeStack.material.id, "instruction_link", "")
property string instructionLink: Cura.MachineManager.activeStack != null ? Cura.ContainerManager.getContainerMetaDataEntry(Cura.MachineManager.activeStack.material.id, "instruction_link", ""): ""
Row
{

View file

@ -15,7 +15,7 @@ Instantiator
{
text: model.name
checkable: true
checked: Cura.MachineManager.activeMachineId == model.id
checked: Cura.MachineManager.activeMachine !== null ? Cura.MachineManager.activeMachine.id == model.id: false
exclusiveGroup: group
visible: !model.hasRemoteConnection
onTriggered: Cura.MachineManager.setActiveMachine(model.id)

View file

@ -18,7 +18,7 @@ UM.ManagementPage
sectionRole: "discoverySource"
activeId: Cura.MachineManager.activeMachineId
activeId: Cura.MachineManager.activeMachine !== null ? Cura.MachineManager.activeMachine.id: ""
activeIndex: activeMachineIndex()
function activeMachineIndex()

View file

@ -1,4 +1,4 @@
// Copyright (c) 2018 Ultimaker B.V.
// Copyright (c) 2019 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.7
@ -13,7 +13,7 @@ import Cura 1.0 as Cura
Item
{
id: brand_section
property var sectionName: ""
property var elementsModel // This can be a MaterialTypesModel or GenericMaterialsModel or FavoriteMaterialsModel
property var hasMaterialTypes: true // It indicates wheather it has material types or not

View file

@ -1,4 +1,4 @@
// Copyright (c) 2018 Ultimaker B.V.
// Copyright (c) 2019 Ultimaker B.V.
// Uranium is released under the terms of the LGPLv3 or higher.
import QtQuick 2.7

View file

@ -81,6 +81,7 @@ Item
// Activate button
Button
{
id: activateMenuButton
text: catalog.i18nc("@action:button", "Activate")
iconName: "list-activate"
enabled: !isCurrentItemActivated && Cura.MachineManager.hasMaterials
@ -98,6 +99,7 @@ Item
// Create button
Button
{
id: createMenuButton
text: catalog.i18nc("@action:button", "Create")
iconName: "list-add"
onClicked:
@ -111,6 +113,7 @@ Item
// Duplicate button
Button
{
id: duplicateMenuButton
text: catalog.i18nc("@action:button", "Duplicate");
iconName: "list-add"
enabled: base.hasCurrentItem
@ -125,6 +128,7 @@ Item
// Remove button
Button
{
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)
@ -138,6 +142,7 @@ Item
// Import button
Button
{
id: importMenuButton
text: catalog.i18nc("@action:button", "Import")
iconName: "document-import"
onClicked:
@ -151,6 +156,7 @@ Item
// Export button
Button
{
id: exportMenuButton
text: catalog.i18nc("@action:button", "Export")
iconName: "document-export"
onClicked:
@ -265,7 +271,9 @@ Item
id: confirmRemoveMaterialDialog
icon: StandardIcon.Question;
title: catalog.i18nc("@title:window", "Confirm Remove")
text: catalog.i18nc("@label (%1 is object name)", "Are you sure you wish to remove %1? This cannot be undone!").arg(base.currentItem.name)
property string materialName: base.currentItem !== null ? base.currentItem.name : ""
text: catalog.i18nc("@label (%1 is object name)", "Are you sure you wish to remove %1? This cannot be undone!").arg(materialName)
standardButtons: StandardButton.Yes | StandardButton.No
modality: Qt.ApplicationModal
onYes:

View file

@ -19,8 +19,18 @@ Rectangle
height: UM.Theme.getSize("favorites_row").height
width: parent.width
color: material != null ? (base.currentItem.root_material_id == material.root_material_id ? UM.Theme.getColor("favorites_row_selected") : "transparent") : "transparent"
//color: material != null ? (base.currentItem.root_material_id == material.root_material_id ? UM.Theme.getColor("favorites_row_selected") : "transparent") : "transparent"
color:
{
if(material !== null && base.currentItem !== null)
{
if(base.currentItem.root_material_id === material.root_material_id)
{
return UM.Theme.getColor("favorites_row_selected")
}
}
return "transparent"
}
Rectangle
{
id: swatch

View file

@ -14,8 +14,11 @@ Item
{
id: material_type_section
property var materialType
property var expanded: materialList.expandedTypes.indexOf(materialType.brand + "_" + materialType.name) > -1
property var colorsModel: materialType.colors
property string materialBrand: materialType != null ? materialType.brand : ""
property string materialName: materialType != null ? materialType.name : ""
property var expanded: materialList.expandedTypes.indexOf(materialBrand + "_" + materialName) > -1
property var colorsModel: materialType != null ? materialType.colors: null
height: childrenRect.height
width: parent.width
Rectangle
@ -23,7 +26,7 @@ Item
id: material_type_header_background
color:
{
if(!expanded && materialType.brand + "_" + materialType.name == materialList.currentType)
if(!expanded && materialBrand + "_" + materialName == materialList.currentType)
{
return UM.Theme.getColor("favorites_row_selected")
}
@ -55,7 +58,7 @@ Item
}
Label
{
text: materialType.name
text: materialName
height: UM.Theme.getSize("favorites_row").height
width: parent.width - parent.leftPadding - UM.Theme.getSize("favorites_button").width
id: material_type_name
@ -92,7 +95,7 @@ Item
anchors.fill: material_type_header
onPressed:
{
const identifier = materialType.brand + "_" + materialType.name;
const identifier = materialBrand + "_" + materialName;
const i = materialList.expandedTypes.indexOf(identifier)
if (i > -1)
{
@ -135,7 +138,7 @@ Item
return;
}
expanded = materialList.expandedTypes.indexOf(materialType.brand + "_" + materialType.name) > -1
expanded = materialList.expandedTypes.indexOf(materialBrand + "_" + materialName) > -1
}
}
}

View file

@ -69,6 +69,7 @@ Item
// Activate button
Button
{
id: activateMenuButton
text: catalog.i18nc("@action:button", "Activate")
iconName: "list-activate"
enabled: !isCurrentItemActivated
@ -84,6 +85,7 @@ Item
// Create button
Button
{
id: createMenuButton
text: catalog.i18nc("@label", "Create")
iconName: "list-add"
enabled: base.canCreateProfile && !Cura.MachineManager.stacksHaveErrors
@ -99,6 +101,7 @@ Item
// Duplicate button
Button
{
id: duplicateMenuButton
text: catalog.i18nc("@label", "Duplicate")
iconName: "list-add"
enabled: !base.canCreateProfile
@ -114,6 +117,7 @@ Item
// Remove button
Button
{
id: removeMenuButton
text: catalog.i18nc("@action:button", "Remove")
iconName: "list-remove"
enabled: base.hasCurrentItem && !base.currentItem.is_read_only && !base.isCurrentItemActivated
@ -126,6 +130,7 @@ Item
// Rename button
Button
{
id: renameMenuButton
text: catalog.i18nc("@action:button", "Rename")
iconName: "edit-rename"
enabled: base.hasCurrentItem && !base.currentItem.is_read_only
@ -139,6 +144,7 @@ Item
// Import button
Button
{
id: importMenuButton
text: catalog.i18nc("@action:button", "Import")
iconName: "document-import"
onClicked: {
@ -149,6 +155,7 @@ Item
// Export button
Button
{
id: exportMenuButton
text: catalog.i18nc("@action:button", "Export")
iconName: "document-export"
enabled: base.hasCurrentItem && !base.currentItem.is_read_only
@ -420,6 +427,9 @@ Item
width: profileScrollView.width
height: childrenRect.height
// Added this property to identify custom profiles in automated system tests (Squish)
property bool isReadOnly: model.is_read_only
property bool isCurrentItem: ListView.isCurrentItem
color: isCurrentItem ? palette.highlight : (model.index % 2) ? palette.base : palette.alternateBase

View file

@ -1,4 +1,4 @@
// Copyright (c) 2018 Ultimaker B.V.
// Copyright (c) 2019 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.7
@ -49,11 +49,6 @@ Item
property var activePrinter: connectedDevice != null ? connectedDevice.activePrinter : null
property var activePrintJob: activePrinter != null ? activePrinter.activePrintJob: null
PrintSetupTooltip
{
id: tooltip
}
Column
{
id: printMonitor
@ -183,4 +178,9 @@ Item
width: base.width
}
}
PrintSetupTooltip
{
id: tooltip
}
}

View file

@ -64,19 +64,19 @@ Item
onClicked:
{
var adhesionType = "skirt"
var adhesionType = "skirt";
if (!parent.checked)
{
// Remove the "user" setting to see if the rest of the stack prescribes a brim or a raft
platformAdhesionType.removeFromContainer(0)
adhesionType = platformAdhesionType.properties.value
if(adhesionType == "skirt" || adhesionType == "none")
platformAdhesionType.removeFromContainer(0);
adhesionType = platformAdhesionType.properties.resolve;
if(adhesionType === "skirt" || adhesionType === "none")
{
// If the rest of the stack doesn't prescribe an adhesion-type, default to a brim
adhesionType = "brim"
adhesionType = "brim";
}
}
platformAdhesionType.setPropertyValue("value", adhesionType)
platformAdhesionType.setPropertyValue("value", adhesionType);
}
onEntered:
@ -95,7 +95,7 @@ Item
containerStack: Cura.MachineManager.activeMachine
removeUnusedValue: false //Doesn't work with settings that are resolved.
key: "adhesion_type"
watchedProperties: [ "value", "enabled" ]
watchedProperties: [ "value", "resolve", "enabled" ]
storeIndex: 0
}
}

View file

@ -1,4 +1,4 @@
// Copyright (c) 2017 Ultimaker B.V.
// Copyright (c) 2019 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.10
@ -357,13 +357,16 @@ Item
onHoveredChanged:
{
if (containsMouse) {
if (containsMouse)
{
base.showTooltip(
base,
{ x: 0, y: customCommandControlMouseArea.mapToItem(base, 0, 0).y },
{ x: -tooltip.width, y: customCommandControlMouseArea.mapToItem(base, 0, 0).y },
catalog.i18nc("@tooltip of G-code command input", "Send a custom G-code command to the connected printer. Press 'enter' to send the command.")
)
} else {
}
else
{
base.hideTooltip()
}
}

View file

@ -32,9 +32,9 @@ Cura.ExpandablePopup
{
return Cura.MachineManager.activeMachineNetworkGroupName
}
if(Cura.MachineManager.activeStack != null)
if(Cura.MachineManager.activeMachine != null)
{
return Cura.MachineManager.activeStack.name
return Cura.MachineManager.activeMachine.name
}
return ""
}

View file

@ -1,4 +1,4 @@
// Copyright (c) 2018 Ultimaker B.V.
// Copyright (c) 2019 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.7
@ -271,6 +271,8 @@ Item
property var globalPropertyProvider: inheritStackProvider
property var externalResetHandler: false
property string activeMachineId: Cura.MachineManager.activeMachine !== null ? Cura.MachineManager.activeMachine.id : ""
//Qt5.4.2 and earlier has a bug where this causes a crash: https://bugreports.qt.io/browse/QTBUG-35989
//In addition, while it works for 5.5 and higher, the ordering of the actual combo box drop down changes,
//causing nasty issues when selecting different options. So disable asynchronous loading of enum type completely.
@ -314,16 +316,15 @@ Item
when: model.settable_per_extruder || (inheritStackProvider.properties.limit_to_extruder != null && inheritStackProvider.properties.limit_to_extruder >= 0);
value:
{
// associate this binding with Cura.MachineManager.activeMachineId in the beginning so this
// Associate this binding with Cura.MachineManager.activeMachine.id in the beginning so this
// binding will be triggered when activeMachineId is changed too.
// Otherwise, if this value only depends on the extruderIds, it won't get updated when the
// machine gets changed.
var activeMachineId = Cura.MachineManager.activeMachineId;
if (!model.settable_per_extruder)
{
//Not settable per extruder or there only is global, so we must pick global.
return activeMachineId;
return delegate.activeMachineId
}
if (inheritStackProvider.properties.limit_to_extruder != null && inheritStackProvider.properties.limit_to_extruder >= 0)
{
@ -336,7 +337,7 @@ Item
return Cura.ExtruderManager.activeExtruderStackId;
}
//No extruder tab is selected. Pick the global stack. Shouldn't happen any more since we removed the global tab.
return activeMachineId;
return delegate.activeMachineId
}
}
@ -345,7 +346,7 @@ Item
UM.SettingPropertyProvider
{
id: inheritStackProvider
containerStackId: Cura.MachineManager.activeMachineId
containerStackId: Cura.MachineManager.activeMachine !== null ? Cura.MachineManager.activeMachine.id: ""
key: model.key
watchedProperties: [ "limit_to_extruder" ]
}
@ -354,7 +355,7 @@ Item
{
id: provider
containerStackId: Cura.MachineManager.activeMachineId
containerStackId: delegate.activeMachineId
key: model.key ? model.key : ""
watchedProperties: [ "value", "enabled", "state", "validationState", "settable_per_extruder", "resolve" ]
storeIndex: 0
@ -371,7 +372,7 @@ Item
contextMenu.provider = provider
contextMenu.popup();
}
onShowTooltip: base.showTooltip(delegate, Qt.point(- settingsView.x - UM.Theme.getSize("default_margin").width, 0), text)
onShowTooltip: base.showTooltip(delegate, Qt.point(-settingsView.x - UM.Theme.getSize("default_margin").width, 0), text)
onHideTooltip: base.hideTooltip()
onShowAllHiddenInheritedSettings:
{
@ -564,7 +565,7 @@ Item
{
id: machineExtruderCount
containerStackId: Cura.MachineManager.activeMachineId
containerStackId: delegate.activeMachineId
key: "machine_extruder_count"
watchedProperties: [ "value" ]
storeIndex: 0

View file

@ -182,6 +182,8 @@ Item
MouseArea //Catch all mouse events (so scene doesnt handle them)
{
anchors.fill: parent
acceptedButtons: Qt.NoButton
onWheel: wheel.accepted = true
}
Loader

View file

@ -14,8 +14,6 @@ import Cura 1.0 as Cura
//
Item
{
UM.I18nCatalog { id: catalog; name: "cura" }
id: base
height: childrenRect.height
@ -85,7 +83,7 @@ Item
{
id: machineList
cacheBuffer: 0 // Workaround for https://bugreports.qt.io/browse/QTBUG-49224
cacheBuffer: 1000000 // Set a large cache to effectively just cache every list item.
model: UM.DefinitionContainersModel
{

View file

@ -72,7 +72,7 @@ Item
section.criteria: ViewSection.FullString
section.delegate: sectionHeading
cacheBuffer: 0 // Workaround for https://bugreports.qt.io/browse/QTBUG-49224
cacheBuffer: 1000000 // Set a large cache to effectively just cache every list item.
Component.onCompleted:
{