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 extrudersModel: CuraApplication.getExtrudersModel()
|
||||||
property var qualityManagementModel: CuraApplication.getQualityManagementModel()
|
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 bool isCurrentItemActivated:
|
||||||
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:
|
|
||||||
{
|
{
|
||||||
if (!base.currentItem)
|
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
|
model: qualityManagementModel
|
||||||
buttons: [
|
buttons: [
|
||||||
Cura.SecondaryButton
|
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
|
Item
|
||||||
{
|
{
|
||||||
id: content_item
|
id: content_item
|
||||||
@ -179,6 +174,16 @@ UM.ManagementPage
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Cura.MenuItem
|
Cura.MenuItem
|
||||||
|
{
|
||||||
|
text: catalog.i18nc("@action:button", "Duplicate")
|
||||||
|
enabled: base.hasCurrentItem
|
||||||
|
onTriggered:
|
||||||
|
{
|
||||||
|
forceActiveFocus()
|
||||||
|
duplicateQualityDialog.open()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Cura.MenuItem
|
||||||
{
|
{
|
||||||
text: catalog.i18nc("@action:button", "Remove")
|
text: catalog.i18nc("@action:button", "Remove")
|
||||||
enabled: base.hasCurrentItem && !base.currentItem.is_read_only && !base.isCurrentItemActivated
|
enabled: base.hasCurrentItem && !base.currentItem.is_read_only && !base.isCurrentItemActivated
|
||||||
@ -238,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
|
||||||
@ -330,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()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -354,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