Merge remote-tracking branch 'Ultimaker/master'

This commit is contained in:
PCDotFan 2017-07-08 09:47:49 +08:00
commit bca7c75cd2
333 changed files with 1935 additions and 1157 deletions

View file

@ -86,6 +86,8 @@ UM.PreferencesPage
centerOnSelectCheckbox.checked = boolCheck(UM.Preferences.getValue("view/center_on_select"))
UM.Preferences.resetPreference("view/invert_zoom");
invertZoomCheckbox.checked = boolCheck(UM.Preferences.getValue("view/invert_zoom"))
UM.Preferences.resetPreference("view/zoom_to_mouse");
zoomToMouseCheckbox.checked = boolCheck(UM.Preferences.getValue("view/zoom_to_mouse"))
UM.Preferences.resetPreference("view/top_layer_count");
topLayerCountCheckbox.checked = boolCheck(UM.Preferences.getValue("view/top_layer_count"))
@ -355,6 +357,20 @@ UM.PreferencesPage
}
}
UM.TooltipArea {
width: childrenRect.width;
height: childrenRect.height;
text: catalog.i18nc("@info:tooltip", "Should zooming move in the direction of the mouse?")
CheckBox
{
id: zoomToMouseCheckbox
text: catalog.i18nc("@action:button", "Zoom toward mouse direction");
checked: boolCheck(UM.Preferences.getValue("view/zoom_to_mouse"))
onClicked: UM.Preferences.setValue("view/zoom_to_mouse", checked)
}
}
UM.TooltipArea {
width: childrenRect.width
height: childrenRect.height

View file

@ -169,9 +169,11 @@ TabView
// This does not use a SettingPropertyProvider, because we need to make the change to all containers
// which derive from the same base_file
var old_diameter = Cura.ContainerManager.getContainerProperty(base.containerId, "material_diameter", "value").toString();
base.setMetaDataEntry("approximate_diameter", properties.approximate_diameter, Math.round(value).toString());
var old_approximate_diameter = Cura.ContainerManager.getContainerMetaDataEntry(base.containerId, "approximate_diameter");
base.setMetaDataEntry("approximate_diameter", old_approximate_diameter, Math.round(value).toString());
base.setMetaDataEntry("properties/diameter", properties.diameter, value);
if (Cura.MachineManager.filterMaterialsByMachine && properties.approximate_diameter != Cura.MachineManager.activeMachine.approximateMaterialDiameter)
var new_approximate_diameter = Cura.ContainerManager.getContainerMetaDataEntry(base.containerId, "approximate_diameter");
if (Cura.MachineManager.filterMaterialsByMachine && new_approximate_diameter != Cura.MachineManager.activeMachine.approximateMaterialDiameter)
{
Cura.MaterialManager.showMaterialWarningMessage(base.containerId, old_diameter);
}

View file

@ -1,5 +1,5 @@
// Copyright (c) 2016 Ultimaker B.V.
// Cura is released under the terms of the AGPLv3 or higher.
//Copyright (c) 2017 Ultimaker B.V.
//Cura is released under the terms of the AGPLv3 or higher.
import QtQuick 2.1
import QtQuick.Controls 1.1
@ -139,6 +139,7 @@ UM.ManagementPage
enabled: base.currentItem != null && base.currentItem.id != Cura.MachineManager.activeMaterialId && Cura.MachineManager.hasMaterials
onClicked:
{
forceActiveFocus();
Cura.MachineManager.setActiveMaterial(base.currentItem.id)
currentItem = base.model.getItem(base.objectList.currentIndex) // Refresh the current item.
}
@ -149,6 +150,7 @@ UM.ManagementPage
iconName: "list-add"
onClicked:
{
forceActiveFocus();
var material_id = Cura.ContainerManager.createMaterial()
if(material_id == "")
{
@ -168,6 +170,7 @@ UM.ManagementPage
enabled: base.currentItem != null
onClicked:
{
forceActiveFocus();
var base_file = Cura.ContainerManager.getContainerMetaDataEntry(base.currentItem.id, "base_file")
// We need to copy the base container instead of the specific variant.
var material_id = base_file == "" ? Cura.ContainerManager.duplicateMaterial(base.currentItem.id): Cura.ContainerManager.duplicateMaterial(base_file)
@ -187,20 +190,32 @@ UM.ManagementPage
text: catalog.i18nc("@action:button", "Remove");
iconName: "list-remove";
enabled: base.currentItem != null && !base.currentItem.readOnly && !Cura.ContainerManager.isContainerUsed(base.currentItem.id)
onClicked: confirmDialog.open()
onClicked:
{
forceActiveFocus();
confirmDialog.open();
}
},
Button
{
text: catalog.i18nc("@action:button", "Import");
iconName: "document-import";
onClicked: importDialog.open();
onClicked:
{
forceActiveFocus();
importDialog.open();
}
visible: true;
},
Button
{
text: catalog.i18nc("@action:button", "Export")
iconName: "document-export"
onClicked: exportDialog.open()
onClicked:
{
forceActiveFocus();
exportDialog.open();
}
enabled: currentItem != null
}
]