mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 18:49:02 +08:00
Clean up ordering of properties in profiles page
Boyscouting; It was a bit of a mess CURA-8982
This commit is contained in:
parent
e569346750
commit
efea7c9bed
@ -13,29 +13,17 @@ import Cura 1.6 as Cura
|
|||||||
UM.ManagementPage
|
UM.ManagementPage
|
||||||
{
|
{
|
||||||
id: base
|
id: base
|
||||||
title: catalog.i18nc("@title:tab", "Profiles")
|
|
||||||
property var extrudersModel: CuraApplication.getExtrudersModel()
|
property var extrudersModel: CuraApplication.getExtrudersModel()
|
||||||
property var qualityManagementModel: CuraApplication.getQualityManagementModel()
|
property var qualityManagementModel: CuraApplication.getQualityManagementModel()
|
||||||
|
|
||||||
scrollviewCaption: catalog.i18nc("@label", "Profiles compatible with active printer:") + "<br><b>" + Cura.MachineManager.activeMachine.name + "</b>"
|
|
||||||
|
|
||||||
onHamburgeButtonClicked: menu.popup(content_item, content_item.width - menu.width, hamburger_button.height)
|
|
||||||
|
|
||||||
property bool hasCurrentItem: base.currentItem != null
|
property bool hasCurrentItem: base.currentItem != null
|
||||||
hamburgerButtonVisible: hasCurrentItem
|
|
||||||
|
|
||||||
sectionRole: "section_name"
|
property var currentItem: objectList.currentIndex == -1 ? null : base.qualityManagementModel.getItem(objectList.currentIndex)
|
||||||
|
|
||||||
property var currentItem:
|
property string currentItemName: hasCurrentItem ? base.currentItem.name : ""
|
||||||
{
|
property string currentItemDisplayName: hasCurrentItem ? base.qualityManagementModel.getQualityItemDisplayName(base.currentItem) : ""
|
||||||
var current_index = objectList.currentIndex;
|
|
||||||
return (current_index == -1) ? null : base.qualityManagementModel.getItem(current_index);
|
|
||||||
}
|
|
||||||
|
|
||||||
property var currentItemName: hasCurrentItem ? base.currentItem.name : ""
|
property bool isCurrentItemActivated:
|
||||||
property var currentItemDisplayName: hasCurrentItem ? base.qualityManagementModel.getQualityItemDisplayName(base.currentItem) : ""
|
|
||||||
|
|
||||||
property var isCurrentItemActivated:
|
|
||||||
{
|
{
|
||||||
if (!base.currentItem)
|
if (!base.currentItem)
|
||||||
{
|
{
|
||||||
@ -51,7 +39,28 @@ UM.ManagementPage
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
property var canCreateProfile: Cura.MachineManager.hasUserSettings
|
property bool canCreateProfile: Cura.MachineManager.hasUserSettings
|
||||||
|
|
||||||
|
signal createProfile() // Click create profile from ... in Profile context menu
|
||||||
|
|
||||||
|
property string newQualityNameToSelect: ""
|
||||||
|
property bool toActivateNewQuality: false
|
||||||
|
|
||||||
|
onHamburgeButtonClicked: menu.popup(content_item, content_item.width - menu.width, hamburger_button.height)
|
||||||
|
|
||||||
|
onCreateProfile:
|
||||||
|
{
|
||||||
|
createQualityDialog.object = Cura.ContainerManager.makeUniqueName(Cura.MachineManager.activeQualityOrQualityChangesName);
|
||||||
|
createQualityDialog.open();
|
||||||
|
createQualityDialog.selectText();
|
||||||
|
}
|
||||||
|
|
||||||
|
title: catalog.i18nc("@title:tab", "Profiles")
|
||||||
|
scrollviewCaption: catalog.i18nc("@label", "Profiles compatible with active printer:") + "<br><b>" + Cura.MachineManager.activeMachine.name + "</b>"
|
||||||
|
|
||||||
|
hamburgerButtonVisible: hasCurrentItem
|
||||||
|
|
||||||
|
sectionRole: "section_name"
|
||||||
|
|
||||||
model: qualityManagementModel
|
model: qualityManagementModel
|
||||||
buttons: [
|
buttons: [
|
||||||
@ -77,18 +86,6 @@ UM.ManagementPage
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
// Click create profile from ... in Profile context menu
|
|
||||||
signal createProfile()
|
|
||||||
onCreateProfile:
|
|
||||||
{
|
|
||||||
createQualityDialog.object = Cura.ContainerManager.makeUniqueName(Cura.MachineManager.activeQualityOrQualityChangesName);
|
|
||||||
createQualityDialog.open();
|
|
||||||
createQualityDialog.selectText();
|
|
||||||
}
|
|
||||||
|
|
||||||
property string newQualityNameToSelect: ""
|
|
||||||
property bool toActivateNewQuality: false
|
|
||||||
|
|
||||||
Item
|
Item
|
||||||
{
|
{
|
||||||
id: content_item
|
id: content_item
|
||||||
@ -246,10 +243,7 @@ UM.ManagementPage
|
|||||||
id: duplicateQualityDialog
|
id: duplicateQualityDialog
|
||||||
title: catalog.i18nc("@title:window", "Duplicate Profile")
|
title: catalog.i18nc("@title:window", "Duplicate Profile")
|
||||||
object: "<new name>"
|
object: "<new name>"
|
||||||
onAccepted:
|
onAccepted: base.qualityManagementModel.duplicateQualityChanges(newName, base.currentItem)
|
||||||
{
|
|
||||||
base.qualityManagementModel.duplicateQualityChanges(newName, base.currentItem);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Confirmation dialog for removing a profile
|
// Confirmation dialog for removing a profile
|
||||||
@ -338,9 +332,9 @@ UM.ManagementPage
|
|||||||
|
|
||||||
Cura.SecondaryButton
|
Cura.SecondaryButton
|
||||||
{
|
{
|
||||||
text: catalog.i18nc("@action:button", "Discard current changes");
|
text: catalog.i18nc("@action:button", "Discard current changes")
|
||||||
enabled: Cura.MachineManager.hasUserSettings
|
enabled: Cura.MachineManager.hasUserSettings
|
||||||
onClicked: Cura.ContainerManager.clearUserContainers();
|
onClicked: Cura.ContainerManager.clearUserContainers()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -362,7 +356,7 @@ UM.ManagementPage
|
|||||||
UM.TabRow
|
UM.TabRow
|
||||||
{
|
{
|
||||||
id: profileExtruderTabs
|
id: profileExtruderTabs
|
||||||
UM.TabRowButton //One extra tab for the global settings.
|
UM.TabRowButton // One extra tab for the global settings.
|
||||||
{
|
{
|
||||||
text: catalog.i18nc("@title:tab", "Global Settings")
|
text: catalog.i18nc("@title:tab", "Global Settings")
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user