mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-21 20:19:32 +08:00
Merge pull request #11596 from Ultimaker/CURA-8982_Profile_tab_fixes
Profile tab fixes (preferences)
This commit is contained in:
commit
6cf7fae607
@ -16,25 +16,14 @@ UM.ManagementPage
|
||||
|
||||
property var extrudersModel: CuraApplication.getExtrudersModel()
|
||||
property var qualityManagementModel: CuraApplication.getQualityManagementModel()
|
||||
property bool hasCurrentItem: base.currentItem != null
|
||||
|
||||
scrollviewCaption: catalog.i18nc("@label", "Profiles compatible with active printer:") + "<b>" + Cura.MachineManager.activeMachine.name + "</b>"
|
||||
property var currentItem: objectList.currentIndex == -1 ? null : base.qualityManagementModel.getItem(objectList.currentIndex)
|
||||
|
||||
onHamburgeButtonClicked: menu.popup(content_item, content_item.width - menu.width, hamburger_button.height)
|
||||
property string currentItemName: hasCurrentItem ? base.currentItem.name : ""
|
||||
property string currentItemDisplayName: hasCurrentItem ? base.qualityManagementModel.getQualityItemDisplayName(base.currentItem) : ""
|
||||
|
||||
|
||||
property var hasCurrentItem: base.currentItem != null
|
||||
sectionRole: "section_name"
|
||||
|
||||
property var currentItem:
|
||||
{
|
||||
var current_index = objectList.currentIndex;
|
||||
return (current_index == -1) ? null : base.qualityManagementModel.getItem(current_index);
|
||||
}
|
||||
|
||||
property var currentItemName: hasCurrentItem ? base.currentItem.name : ""
|
||||
property var currentItemDisplayName: hasCurrentItem ? base.qualityManagementModel.getQualityItemDisplayName(base.currentItem) : ""
|
||||
|
||||
property var isCurrentItemActivated:
|
||||
property bool isCurrentItemActivated:
|
||||
{
|
||||
if (!base.currentItem)
|
||||
{
|
||||
@ -50,11 +39,29 @@ UM.ManagementPage
|
||||
}
|
||||
}
|
||||
|
||||
property var canCreateProfile:
|
||||
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:
|
||||
{
|
||||
return isCurrentItemActivated && Cura.MachineManager.hasUserSettings;
|
||||
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
|
||||
buttons: [
|
||||
Cura.SecondaryButton
|
||||
@ -79,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
|
||||
{
|
||||
id: content_item
|
||||
@ -179,6 +174,16 @@ UM.ManagementPage
|
||||
}
|
||||
}
|
||||
Cura.MenuItem
|
||||
{
|
||||
text: catalog.i18nc("@action:button", "Duplicate")
|
||||
enabled: base.hasCurrentItem
|
||||
onTriggered:
|
||||
{
|
||||
forceActiveFocus()
|
||||
duplicateQualityDialog.open()
|
||||
}
|
||||
}
|
||||
Cura.MenuItem
|
||||
{
|
||||
text: catalog.i18nc("@action:button", "Remove")
|
||||
enabled: base.hasCurrentItem && !base.currentItem.is_read_only && !base.isCurrentItemActivated
|
||||
@ -238,10 +243,7 @@ UM.ManagementPage
|
||||
id: duplicateQualityDialog
|
||||
title: catalog.i18nc("@title:window", "Duplicate Profile")
|
||||
object: "<new name>"
|
||||
onAccepted:
|
||||
{
|
||||
base.qualityManagementModel.duplicateQualityChanges(newName, base.currentItem);
|
||||
}
|
||||
onAccepted: base.qualityManagementModel.duplicateQualityChanges(newName, base.currentItem)
|
||||
}
|
||||
|
||||
// Confirmation dialog for removing a profile
|
||||
@ -330,9 +332,9 @@ UM.ManagementPage
|
||||
|
||||
Cura.SecondaryButton
|
||||
{
|
||||
text: catalog.i18nc("@action:button", "Discard current changes");
|
||||
text: catalog.i18nc("@action:button", "Discard current changes")
|
||||
enabled: Cura.MachineManager.hasUserSettings
|
||||
onClicked: Cura.ContainerManager.clearUserContainers();
|
||||
onClicked: Cura.ContainerManager.clearUserContainers()
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user