Merge branch 'network_rewrite' into feature_preheat_extruder

This commit is contained in:
fieldOfView 2018-01-11 15:28:28 +01:00
commit 76fd49b185
137 changed files with 4422 additions and 177 deletions

View file

@ -47,6 +47,7 @@ Menu
{
model: Cura.BuildPlateModel
MenuItem {
enabled: UM.Selection.hasSelection
text: Cura.BuildPlateModel.getItem(index).name;
onTriggered: CuraActions.setBuildPlateForSelection(Cura.BuildPlateModel.getItem(index).buildPlateNumber);
checkable: true
@ -58,6 +59,7 @@ Menu
}
MenuItem {
enabled: UM.Selection.hasSelection
text: "New build plate";
onTriggered: {
CuraActions.setBuildPlateForSelection(Cura.BuildPlateModel.maxBuildPlate + 1);

View file

@ -105,7 +105,6 @@ Rectangle
topMargin: UM.Theme.getSize("default_margin").height;
left: parent.left;
leftMargin: UM.Theme.getSize("default_margin").height;
//bottom: objectsList.top;
bottomMargin: UM.Theme.getSize("default_margin").height;
}
@ -139,7 +138,7 @@ Rectangle
anchors.left: parent.left
anchors.leftMargin: UM.Theme.getSize("default_margin").width
width: parent.width - 2 * UM.Theme.getSize("default_margin").width - 30
text: Cura.ObjectsModel.getItem(index) ? Cura.ObjectsModel.getItem(index).name : "";
text: (index >= 0) && Cura.ObjectsModel.getItem(index) ? Cura.ObjectsModel.getItem(index).name : "";
color: Cura.ObjectsModel.getItem(index).isSelected ? palette.highlightedText : (Cura.ObjectsModel.getItem(index).isOutsideBuildArea ? palette.mid : palette.text)
elide: Text.ElideRight
}

View file

@ -453,34 +453,6 @@ UM.PreferencesPage
text: catalog.i18nc("@label","Opening and saving files")
}
UM.TooltipArea {
width: childrenRect.width
height: childrenRect.height
text: catalog.i18nc("@info:tooltip","Use multi build plate functionality (EXPERIMENTAL)")
CheckBox
{
id: useMultiBuildPlateCheckbox
text: catalog.i18nc("@option:check","Use multi build plate functionality (EXPERIMENTAL, restart)")
checked: boolCheck(UM.Preferences.getValue("cura/use_multi_build_plate"))
onCheckedChanged: UM.Preferences.setValue("cura/use_multi_build_plate", checked)
}
}
UM.TooltipArea {
width: childrenRect.width
height: childrenRect.height
text: catalog.i18nc("@info:tooltip","Should newly loaded models be arranged on the build plate? Used in conjunction with multi build plate (EXPERIMENTAL)")
CheckBox
{
id: arrangeOnLoadCheckbox
text: catalog.i18nc("@option:check","Arrange objects on load (EXPERIMENTAL)")
checked: boolCheck(UM.Preferences.getValue("cura/arrange_objects_on_load"))
onCheckedChanged: UM.Preferences.setValue("cura/arrange_objects_on_load", checked)
}
}
UM.TooltipArea {
width: childrenRect.width
height: childrenRect.height
@ -688,6 +660,49 @@ UM.PreferencesPage
onCheckedChanged: UM.Preferences.setValue("info/send_slice_info", checked)
}
}
Item
{
//: Spacer
height: UM.Theme.getSize("default_margin").height
width: UM.Theme.getSize("default_margin").height
}
Label
{
font.bold: true
text: catalog.i18nc("@label","Experimental")
}
UM.TooltipArea {
width: childrenRect.width
height: childrenRect.height
text: catalog.i18nc("@info:tooltip","Use multi build plate functionality")
CheckBox
{
id: useMultiBuildPlateCheckbox
text: catalog.i18nc("@option:check","Use multi build plate functionality (restart required)")
checked: boolCheck(UM.Preferences.getValue("cura/use_multi_build_plate"))
onCheckedChanged: UM.Preferences.setValue("cura/use_multi_build_plate", checked)
}
}
UM.TooltipArea {
width: childrenRect.width
height: childrenRect.height
text: catalog.i18nc("@info:tooltip","Should newly loaded models be arranged on the build plate? Used in conjunction with multi build plate (EXPERIMENTAL)")
CheckBox
{
id: arrangeOnLoadCheckbox
text: catalog.i18nc("@option:check","Do not arrange objects on load")
checked: boolCheck(UM.Preferences.getValue("cura/not_arrange_objects_on_load"))
onCheckedChanged: UM.Preferences.setValue("cura/not_arrange_objects_on_load", checked)
}
}
}
}
}

View file

@ -104,14 +104,13 @@ TabView
Label { width: scrollView.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Color") }
Row
{
width: scrollView.columnWidth;
height: parent.rowHeight;
Row {
width: scrollView.columnWidth
height: parent.rowHeight
spacing: Math.floor(UM.Theme.getSize("default_margin").width/2)
Rectangle
{
// color indicator square
Rectangle {
id: colorSelector
color: properties.color_code
@ -121,17 +120,36 @@ TabView
anchors.verticalCenter: parent.verticalCenter
MouseArea { anchors.fill: parent; onClicked: colorDialog.open(); enabled: base.editingEnabled }
// open the color selection dialog on click
MouseArea {
anchors.fill: parent
onClicked: colorDialog.open()
enabled: base.editingEnabled
}
}
ReadOnlyTextField
{
// make sure the color stays connected after changing the color
Binding {
target: colorSelector
property: "color"
value: properties.color_code
}
// pretty color name text field
ReadOnlyTextField {
id: colorLabel;
text: properties.color_name;
readOnly: !base.editingEnabled
onEditingFinished: base.setMetaDataEntry("color_name", properties.color_name, text)
}
ColorDialog { id: colorDialog; color: properties.color_code; onAccepted: base.setMetaDataEntry("color_code", properties.color_code, color) }
// popup dialog to select a new color
// if successful it sets the properties.color_code value to the new color
ColorDialog {
id: colorDialog
color: properties.color_code
onAccepted: base.setMetaDataEntry("color_code", properties.color_code, color)
}
}
Item { width: parent.width; height: UM.Theme.getSize("default_margin").height }
@ -401,11 +419,11 @@ TabView
}
// Tiny convenience function to check if a value really changed before trying to set it.
function setMetaDataEntry(entry_name, old_value, new_value)
{
if(old_value != new_value)
{
Cura.ContainerManager.setContainerMetaDataEntry(base.containerId, entry_name, new_value);
function setMetaDataEntry(entry_name, old_value, new_value) {
if (old_value != new_value) {
Cura.ContainerManager.setContainerMetaDataEntry(base.containerId, entry_name, new_value)
// make sure the UI properties are updated as well since we don't re-fetch the entire model here
properties[entry_name] = new_value
}
}

View file

@ -132,93 +132,82 @@ UM.ManagementPage
}
buttons: [
Button
{
text: catalog.i18nc("@action:button", "Activate");
// Activate button
Button {
text: catalog.i18nc("@action:button", "Activate")
iconName: "list-activate";
enabled: base.currentItem != null && base.currentItem.id != Cura.MachineManager.activeMaterialId && Cura.MachineManager.hasMaterials
onClicked:
{
forceActiveFocus();
onClicked: {
forceActiveFocus()
Cura.MachineManager.setActiveMaterial(base.currentItem.id)
currentItem = base.model.getItem(base.objectList.currentIndex) // Refresh the current item.
}
},
Button
{
// Create button
Button {
text: catalog.i18nc("@action:button", "Create")
iconName: "list-add"
onClicked:
onClicked: {
forceActiveFocus()
Cura.ContainerManager.createMaterial()
}
Connections
{
forceActiveFocus();
var material_id = Cura.ContainerManager.createMaterial()
if(material_id == "")
target: base.objectList.model
onItemsChanged:
{
return
base.objectList.currentIndex = base.getIndexById(Cura.MachineManager.activeMaterialId);
}
if(Cura.MachineManager.hasMaterials)
{
Cura.MachineManager.setActiveMaterial(material_id)
}
base.objectList.currentIndex = base.getIndexById(material_id);
}
},
Button
{
// Duplicate button
Button {
text: catalog.i18nc("@action:button", "Duplicate");
iconName: "list-add";
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)
if(material_id == "")
{
return
}
if(Cura.MachineManager.hasMaterials)
{
Cura.MachineManager.setActiveMaterial(material_id)
}
// TODO: this doesn't work because the source is a bit delayed
base.objectList.currentIndex = base.getIndexById(material_id);
onClicked: {
forceActiveFocus()
Cura.ContainerManager.duplicateOriginalMaterial(base.currentItem.id)
}
},
Button
{
text: catalog.i18nc("@action:button", "Remove");
iconName: "list-remove";
// Remove button
Button {
text: catalog.i18nc("@action:button", "Remove")
iconName: "list-remove"
enabled: base.currentItem != null && !base.currentItem.readOnly && !Cura.ContainerManager.isContainerUsed(base.currentItem.id)
onClicked:
{
forceActiveFocus();
confirmDialog.open();
onClicked: {
forceActiveFocus()
confirmDialog.open()
}
},
Button
{
text: catalog.i18nc("@action:button", "Import");
iconName: "document-import";
onClicked:
{
forceActiveFocus();
importDialog.open();
// Import button
Button {
text: catalog.i18nc("@action:button", "Import")
iconName: "document-import"
onClicked: {
forceActiveFocus()
importDialog.open()
}
visible: true;
visible: true
},
Button
{
// Export button
Button {
text: catalog.i18nc("@action:button", "Export")
iconName: "document-export"
onClicked:
{
forceActiveFocus();
exportDialog.open();
onClicked: {
forceActiveFocus()
exportDialog.open()
}
enabled: currentItem != null
}
]
Item {

View file

@ -195,11 +195,22 @@ Item
text:
{
var result = ""
if (Cura.MachineManager.activeMachine != null) {
if(Cura.MachineManager.activeMachine != null)
{
result = Cura.ProfilesModel.getItem(index).layer_height_without_unit
if (result == undefined)
result = ""
if(result == undefined)
{
result = "";
}
else
{
result = Number(Math.round(result + "e+2") + "e-2"); //Round to 2 decimals. Javascript makes this difficult...
if (result == undefined || result != result) //Parse failure.
{
result = "";
}
}
}
return result
}