mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-24 23:23:57 -06:00
Merge branch 'feature_quality_changes'
This commit is contained in:
commit
bb90c593b9
52 changed files with 747 additions and 346 deletions
|
@ -122,7 +122,7 @@ Item
|
|||
id: updateProfileAction;
|
||||
enabled: Cura.MachineManager.isActiveStackValid && Cura.MachineManager.hasUserSettings && !Cura.MachineManager.isReadOnly(Cura.MachineManager.activeQualityId)
|
||||
text: catalog.i18nc("@action:inmenu menubar:profile","&Update profile with current settings");
|
||||
onTriggered: Cura.MachineManager.updateQualityContainerFromUserContainer()
|
||||
onTriggered: Cura.ContainerManager.updateQualityChanges();
|
||||
}
|
||||
|
||||
Action
|
||||
|
@ -130,7 +130,7 @@ Item
|
|||
id: resetProfileAction;
|
||||
enabled: Cura.MachineManager.hasUserSettings
|
||||
text: catalog.i18nc("@action:inmenu menubar:profile","&Discard current settings");
|
||||
onTriggered: Cura.MachineManager.clearUserSettings();
|
||||
onTriggered: Cura.ContainerManager.clearUserContainers();
|
||||
}
|
||||
|
||||
Action
|
||||
|
|
|
@ -150,7 +150,7 @@ UM.MainWindow
|
|||
|
||||
MenuSeparator { }
|
||||
|
||||
MenuItem { text: "Set as Active Extruder" }
|
||||
MenuItem { text: catalog.i18nc("@action:inmenu", "Set as Active Extruder"); onTriggered: Cura.ExtruderManager.setActiveExtruderIndex(model.index) }
|
||||
}
|
||||
onObjectAdded: settingsMenu.insertItem(index, object)
|
||||
onObjectRemoved: settingsMenu.removeItem(object)
|
||||
|
@ -459,7 +459,7 @@ UM.MainWindow
|
|||
target: Cura.Actions.addProfile
|
||||
onTriggered:
|
||||
{
|
||||
Cura.MachineManager.newQualityContainerFromQualityAndUser();
|
||||
Cura.ContainerManager.createQualityChanges();
|
||||
preferences.setPage(4);
|
||||
preferences.show();
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ import QtQuick.Controls 1.1
|
|||
import UM 1.2 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
Menu
|
||||
Menu
|
||||
{
|
||||
id: menu
|
||||
|
||||
|
@ -15,14 +15,14 @@ import Cura 1.0 as Cura
|
|||
{
|
||||
model: UM.InstanceContainersModel
|
||||
{
|
||||
filter: menu.getFilter({ "read_only": true });
|
||||
filter: menu.getFilter({ "type": "quality" });
|
||||
}
|
||||
|
||||
MenuItem
|
||||
{
|
||||
text: model.name
|
||||
checkable: true
|
||||
checked: Cura.MachineManager.activeQualityId == model.id
|
||||
checked: Cura.MachineManager.activeQualityChangesId == "empty_quality_changes" && Cura.MachineManager.activeQualityType == model.metadata.quality_type
|
||||
exclusiveGroup: group
|
||||
onTriggered: Cura.MachineManager.setActiveQuality(model.id)
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ import Cura 1.0 as Cura
|
|||
id: customProfileInstantiator
|
||||
model: UM.InstanceContainersModel
|
||||
{
|
||||
filter: menu.getFilter({ "read_only": false });
|
||||
filter: { "type": "quality_changes", "extruder": null, "definition": Cura.MachineManager.filterQualityByMachine ? Cura.MachineManager.activeDefinitionId : "fdmprinter" };
|
||||
onModelReset: customSeparator.visible = rowCount() > 0
|
||||
}
|
||||
|
||||
|
@ -76,7 +76,6 @@ import Cura 1.0 as Cura
|
|||
function getFilter(initial_conditions)
|
||||
{
|
||||
var result = initial_conditions;
|
||||
result.type = "quality"
|
||||
|
||||
if(Cura.MachineManager.filterQualityByMachine)
|
||||
{
|
||||
|
|
38
resources/qml/Preferences/ProfileTab.qml
Normal file
38
resources/qml/Preferences/ProfileTab.qml
Normal file
|
@ -0,0 +1,38 @@
|
|||
// Copyright (c) 2016 Ultimaker B.V.
|
||||
// Cura is released under the terms of the AGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.1
|
||||
import QtQuick.Controls 1.1
|
||||
|
||||
import UM 1.2 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
Tab
|
||||
{
|
||||
id: base
|
||||
|
||||
property string extruderId: "";
|
||||
property string quality: "";
|
||||
property string material: "";
|
||||
|
||||
TableView
|
||||
{
|
||||
anchors.fill: parent
|
||||
anchors.margins: UM.Theme.getSize("default_margin").width
|
||||
|
||||
TableViewColumn { role: "label"; title: catalog.i18nc("@title:column", "Setting") }
|
||||
TableViewColumn { role: "profile_value"; title: catalog.i18nc("@title:column", "Profile Value"); }
|
||||
TableViewColumn { role: "user_value"; title: catalog.i18nc("@title:column", "User Value"); visible: quality == Cura.MachineManager.activeQualityId }
|
||||
TableViewColumn { role: "unit"; title: catalog.i18nc("@title:column", "Unit") }
|
||||
|
||||
section.property: "category"
|
||||
section.delegate: Label { text: section }
|
||||
|
||||
model: Cura.QualitySettingsModel
|
||||
{
|
||||
extruderId: base.extruderId != "" ? base.extruderId : null;
|
||||
quality: base.quality != null ? base.quality : "";
|
||||
material: base.material
|
||||
}
|
||||
}
|
||||
}
|
|
@ -18,13 +18,13 @@ UM.ManagementPage
|
|||
{
|
||||
filter:
|
||||
{
|
||||
var result = { "type": "quality" };
|
||||
var result = { "type": "quality*", "extruder": null };
|
||||
if(Cura.MachineManager.filterQualityByMachine)
|
||||
{
|
||||
result.definition = Cura.MachineManager.activeDefinitionId;
|
||||
if(Cura.MachineManager.hasMaterials)
|
||||
{
|
||||
result.material = Cura.MachineManager.activeMaterialId;
|
||||
result.material = Cura.MachineManager.allActiveMaterialIds[Cura.MachineManager.activeMachineId];
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -76,9 +76,9 @@ UM.ManagementPage
|
|||
{
|
||||
var selectedContainer;
|
||||
if (base.currentItem.id == Cura.MachineManager.activeQualityId) {
|
||||
selectedContainer = Cura.MachineManager.newQualityContainerFromQualityAndUser();
|
||||
selectedContainer = Cura.ContainerManager.createQualityChanges();
|
||||
} else {
|
||||
selectedContainer = Cura.MachineManager.duplicateContainer(base.currentItem.id);
|
||||
selectedContainer = Cura.ContainerManager.duplicateQualityOrQualityChanges(base.currentItem.name);
|
||||
}
|
||||
base.selectContainer(selectedContainer);
|
||||
|
||||
|
@ -106,13 +106,15 @@ UM.ManagementPage
|
|||
text: catalog.i18nc("@action:button", "Import");
|
||||
iconName: "document-import";
|
||||
onClicked: importDialog.open();
|
||||
enabled: false
|
||||
},
|
||||
Button
|
||||
{
|
||||
text: catalog.i18nc("@action:button", "Export")
|
||||
iconName: "document-export"
|
||||
onClicked: exportDialog.open()
|
||||
enabled: currentItem != null
|
||||
// enabled: currentItem != null
|
||||
enabled: false
|
||||
}
|
||||
]
|
||||
|
||||
|
@ -152,14 +154,14 @@ UM.ManagementPage
|
|||
return catalog.i18nc("@action:button", "Update profile with current settings");
|
||||
}
|
||||
enabled: Cura.MachineManager.hasUserSettings && !Cura.MachineManager.isReadOnly(Cura.MachineManager.activeQualityId)
|
||||
onClicked: Cura.MachineManager.updateQualityContainerFromUserContainer()
|
||||
onClicked: Cura.ContainerManager.updateQualityChanges()
|
||||
}
|
||||
|
||||
Button
|
||||
{
|
||||
text: catalog.i18nc("@action:button", "Discard current settings");
|
||||
enabled: Cura.MachineManager.hasUserSettings
|
||||
onClicked: Cura.MachineManager.clearUserSettings();
|
||||
onClicked: Cura.ContainerManager.clearUserContainers();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -173,7 +175,7 @@ UM.ManagementPage
|
|||
|
||||
Label {
|
||||
id: defaultsMessage
|
||||
visible: currentItem && !currentItem.metadata.has_settings
|
||||
visible: false
|
||||
text: catalog.i18nc("@action:label", "This profile has no settings and uses the defaults specified by the printer.")
|
||||
wrapMode: Text.WordWrap
|
||||
width: parent.width
|
||||
|
@ -187,71 +189,31 @@ UM.ManagementPage
|
|||
}
|
||||
}
|
||||
|
||||
ScrollView {
|
||||
id: scrollView
|
||||
|
||||
TabView
|
||||
{
|
||||
anchors.left: parent.left
|
||||
anchors.top: profileNotices.visible ? profileNotices.bottom : profileNotices.anchors.top
|
||||
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
|
||||
ListView {
|
||||
model: Cura.ContainerSettingsModel
|
||||
ProfileTab
|
||||
{
|
||||
title: catalog.i18nc("@title:tab", "Global Settings");
|
||||
quality: base.currentItem != null ? base.currentItem.id : "";
|
||||
material: Cura.MachineManager.allActiveMaterialIds.global
|
||||
}
|
||||
|
||||
Repeater
|
||||
{
|
||||
model: Cura.ExtrudersModel { }
|
||||
|
||||
ProfileTab
|
||||
{
|
||||
containers:
|
||||
{
|
||||
if (!currentItem) {
|
||||
return []
|
||||
} else if (currentItem.id == Cura.MachineManager.activeQualityId) {
|
||||
return [base.currentItem.id, Cura.MachineManager.activeUserProfileId]
|
||||
} else {
|
||||
return [base.currentItem.id]
|
||||
}
|
||||
}
|
||||
}
|
||||
delegate: Row {
|
||||
property variant setting: model
|
||||
spacing: UM.Theme.getSize("default_margin").width/2
|
||||
Label {
|
||||
text: model.label
|
||||
elide: Text.ElideMiddle
|
||||
width: scrollView.width / 100 * 40
|
||||
}
|
||||
Repeater {
|
||||
model: setting.values.length
|
||||
Label {
|
||||
text: setting.values[index].toString()
|
||||
width: scrollView.width / 100 * 15
|
||||
elide: Text.ElideRight
|
||||
font.strikeout: index < setting.values.length - 1 && setting.values[index + 1] != ""
|
||||
opacity: font.strikeout ? 0.5 : 1
|
||||
}
|
||||
}
|
||||
Label {
|
||||
text: model.unit
|
||||
}
|
||||
}
|
||||
header: Row {
|
||||
visible: currentItem && currentItem.id == Cura.MachineManager.activeQualityId
|
||||
spacing: UM.Theme.getSize("default_margin").width
|
||||
Label {
|
||||
text: catalog.i18nc("@action:label", "Profile:")
|
||||
width: scrollView.width / 100 * 55
|
||||
horizontalAlignment: Text.AlignRight
|
||||
font.bold: true
|
||||
}
|
||||
Label {
|
||||
text: catalog.i18nc("@action:label", "Current:")
|
||||
visible: currentItem && currentItem.id == Cura.MachineManager.activeQualityId
|
||||
font.bold: true
|
||||
}
|
||||
}
|
||||
section.property: "category"
|
||||
section.criteria: ViewSection.FullString
|
||||
section.delegate: Label {
|
||||
text: section
|
||||
font.bold: true
|
||||
title: model.name;
|
||||
extruderId: model.id;
|
||||
quality: base.currentItem != null ? base.currentItem.id : null;
|
||||
material: Cura.MachineManager.allActiveMaterialIds[model.id]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -265,17 +227,25 @@ UM.ManagementPage
|
|||
{
|
||||
id: confirmDialog
|
||||
object: base.currentItem != null ? base.currentItem.name : ""
|
||||
onYes: Cura.MachineManager.removeQualityContainer(base.currentItem.id)
|
||||
onYes:
|
||||
{
|
||||
var name = base.currentItem.name;
|
||||
Cura.ContainerManager.removeQualityChanges(name)
|
||||
if(Cura.MachineManager.activeQualityName == name)
|
||||
{
|
||||
Cura.MachineManager.setActiveQuality(base.model.getItem(0).name)
|
||||
}
|
||||
}
|
||||
}
|
||||
UM.RenameDialog
|
||||
{
|
||||
id: renameDialog;
|
||||
object: base.currentItem != null ? base.currentItem.name : ""
|
||||
property bool removeWhenRejected: false
|
||||
onAccepted: Cura.MachineManager.renameQualityContainer(base.currentItem.id, newName)
|
||||
onAccepted: Cura.ContainerManager.renameQualityChanges(base.currentItem.name, newName)
|
||||
onRejected: {
|
||||
if(removeWhenRejected) {
|
||||
Cura.MachineManager.removeQualityContainer(base.currentItem.id)
|
||||
Cura.ContainerManager.removeQualityChanges(base.currentItem.name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,6 @@ Item {
|
|||
|
||||
// Create properties to put property provider stuff in (bindings break in qt 5.5.1 otherwise)
|
||||
property var state: propertyProvider.properties.state
|
||||
property var settablePerExtruder: propertyProvider.properties.settable_per_extruder
|
||||
property var stackLevels: propertyProvider.stackLevels
|
||||
property var stackLevel: stackLevels[0]
|
||||
|
||||
|
@ -138,7 +137,7 @@ Item {
|
|||
{
|
||||
id: linkedSettingIcon;
|
||||
|
||||
visible: Cura.MachineManager.activeStackId != Cura.MachineManager.activeMachineId && base.settablePerExtruder != "True" && base.showLinkedSettingIcon
|
||||
visible: Cura.MachineManager.activeStackId != Cura.MachineManager.activeMachineId && !definition.settable_per_extruder && base.showLinkedSettingIcon
|
||||
|
||||
height: parent.height;
|
||||
width: height;
|
||||
|
|
|
@ -94,31 +94,37 @@ ScrollView
|
|||
{
|
||||
target: provider
|
||||
property: "containerStackId"
|
||||
when: model.settable_per_extruder || model.settable_per_mesh || (inheritStackProvider.properties.global_inherits_stack != null && inheritStackProvider.properties.global_inherits_stack >= 0);
|
||||
value:
|
||||
{
|
||||
if(inheritStackProvider.properties.global_inherits_stack == -1 || inheritStackProvider.properties.global_inherits_stack == null)
|
||||
if(!model.settable_per_extruder && !model.settable_per_mesh)
|
||||
{
|
||||
if( ExtruderManager.activeExtruderStackId)
|
||||
{
|
||||
return ExtruderManager.activeExtruderStackId
|
||||
}
|
||||
else
|
||||
{
|
||||
return Cura.MachineManager.activeMachineId
|
||||
}
|
||||
//Not settable per extruder, so we must pick global.
|
||||
return Cura.MachineManager.activeMachineId;
|
||||
}
|
||||
return ExtruderManager.extruderIds[String(inheritStackProvider.properties.global_inherits_stack)]
|
||||
if(inheritStackProvider.properties.global_inherits_stack != null && inheritStackProvider.properties.global_inherits_stack >= 0)
|
||||
{
|
||||
//We have global_inherits_stack, so pick that stack.
|
||||
return ExtruderManager.extruderIds[String(inheritStackProvider.properties.global_inherits_stack)];
|
||||
}
|
||||
if(ExtruderManager.activeExtruderStackId)
|
||||
{
|
||||
//We're on an extruder tab. Pick the current extruder.
|
||||
return ExtruderManager.activeExtruderStackId;
|
||||
}
|
||||
//No extruder tab is selected. Pick the global stack. Shouldn't happen any more since we removed the global tab.
|
||||
return Cura.MachineManager.activeMachineId;
|
||||
}
|
||||
}
|
||||
|
||||
// Specialty provider that only watches global_inherits (we cant filter on what property changed we get events
|
||||
// so we bypass that to make a dedicated provider.
|
||||
// so we bypass that to make a dedicated provider).
|
||||
UM.SettingPropertyProvider
|
||||
{
|
||||
id: inheritStackProvider
|
||||
containerStackId: Cura.MachineManager.activeMachineId
|
||||
key: model.key
|
||||
watchedProperties: [ "global_inherits_stack"]
|
||||
watchedProperties: [ "global_inherits_stack" ]
|
||||
}
|
||||
|
||||
UM.SettingPropertyProvider
|
||||
|
@ -127,7 +133,7 @@ ScrollView
|
|||
|
||||
containerStackId: Cura.MachineManager.activeMachineId
|
||||
key: model.key ? model.key : ""
|
||||
watchedProperties: [ "value", "enabled", "state", "validationState", "settable_per_extruder" ]
|
||||
watchedProperties: [ "value", "enabled", "state", "validationState" ]
|
||||
storeIndex: 0
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue