From 975a60bec32600b0c9cef5f75039405db1c573e9 Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Wed, 10 Aug 2016 11:03:00 +0200 Subject: [PATCH] Display all the extruder settings and global settings in profile manager Contributes to CURA-2006 --- resources/qml/Preferences/ProfileTab.qml | 33 +++++++++++ resources/qml/Preferences/ProfilesPage.qml | 67 +++------------------- 2 files changed, 42 insertions(+), 58 deletions(-) create mode 100644 resources/qml/Preferences/ProfileTab.qml diff --git a/resources/qml/Preferences/ProfileTab.qml b/resources/qml/Preferences/ProfileTab.qml new file mode 100644 index 0000000000..1be1d82cb8 --- /dev/null +++ b/resources/qml/Preferences/ProfileTab.qml @@ -0,0 +1,33 @@ +// Copyright (c) 2015 Ultimaker B.V. +// Uranium 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; material: base.material } + } +} diff --git a/resources/qml/Preferences/ProfilesPage.qml b/resources/qml/Preferences/ProfilesPage.qml index 3c613d71c4..b32590382b 100644 --- a/resources/qml/Preferences/ProfilesPage.qml +++ b/resources/qml/Preferences/ProfilesPage.qml @@ -187,70 +187,21 @@ 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{ 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 - } + 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 { title: model.name; extruderId: model.id; quality: base.currentItem.id; material: Cura.MachineManager.allActiveMaterialIds[model.id] } } } }