mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-18 20:28:01 -06:00
Merge branch 'feature_quality_changes'
This commit is contained in:
commit
bb90c593b9
52 changed files with 747 additions and 346 deletions
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue