diff --git a/resources/qml/Actions.qml b/resources/qml/Actions.qml index c363dd4a55..34cf0ad7a7 100644 --- a/resources/qml/Actions.qml +++ b/resources/qml/Actions.qml @@ -21,7 +21,7 @@ Item property alias unGroupObjects:unGroupObjectsAction; property alias mergeObjects: mergeObjectsAction; //property alias unMergeObjects: unMergeObjectsAction; - + property alias multiplyObject: multiplyObjectAction; property alias deleteAll: deleteAllAction; @@ -32,6 +32,8 @@ Item property alias addMachine: addMachineAction; property alias configureMachines: settingsAction; property alias addProfile: addProfileAction; + property alias updateProfile: updateProfileAction; + property alias resetProfile: resetProfileAction; property alias manageProfiles: manageProfilesAction; property alias preferences: preferencesAction; @@ -96,11 +98,25 @@ Item iconName: "configure"; } + Action + { + id: updateProfileAction; + enabled: UM.ActiveProfile.valid && !UM.ActiveProfile.readOnly && UM.ActiveProfile.hasCustomisedValues + text: catalog.i18nc("@action:inmenu menubar:profile","&Update Current Profile"); + } + + Action + { + id: resetProfileAction; + enabled: UM.ActiveProfile.valid && !UM.ActiveProfile.readOnly && UM.ActiveProfile.hasCustomisedValues + text: catalog.i18nc("@action:inmenu menubar:profile","&Reset Current Profile"); + } + Action { id: addProfileAction; enabled: UM.ActiveProfile.valid - text: catalog.i18nc("@action:inmenu menubar:profile","&Add Profile..."); + text: catalog.i18nc("@action:inmenu menubar:profile","&Create New Profile..."); } Action diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index 776e83cb60..7a8d131239 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -229,7 +229,7 @@ UM.MainWindow //Insert a separator between readonly and custom profiles if(separatorIndex < 0 && index > 0) { if(model.getItem(index-1).readOnly != model.getItem(index).readOnly) { - profileMenu.addSeparator(); + profileMenu.insertSeparator(index); separatorIndex = index; } } @@ -277,7 +277,10 @@ UM.MainWindow MenuSeparator { id: profileMenuSeparator } + MenuItem { action: actions.updateProfile; } + MenuItem { action: actions.resetProfile; } MenuItem { action: actions.addProfile; } + MenuSeparator { } MenuItem { action: actions.manageProfiles; } } @@ -287,7 +290,7 @@ UM.MainWindow //: Extensions menu title: catalog.i18nc("@title:menu menubar:toplevel","E&xtensions"); - Instantiator + Instantiator { model: UM.Models.extensionModel @@ -513,6 +516,8 @@ UM.MainWindow addMachineAction: actions.addMachine; configureMachinesAction: actions.configureMachines; addProfileAction: actions.addProfile; + updateProfileAction: actions.updateProfile; + resetProfileAction: actions.resetProfile; manageProfilesAction: actions.manageProfiles; configureSettingsAction: Action @@ -623,6 +628,8 @@ UM.MainWindow addMachine.onTriggered: addMachineWizard.visible = true; addProfile.onTriggered: { UM.MachineManager.createProfile(); preferences.visible = true; preferences.setPage(4); } + updateProfile.onTriggered: { UM.ActiveProfile.updateProfile() } + resetProfile.onTriggered: { UM.ActiveProfile.discardChanges() } preferences.onTriggered: { preferences.visible = true; } configureMachines.onTriggered: { preferences.visible = true; preferences.setPage(3); } diff --git a/resources/qml/ProfileSetup.qml b/resources/qml/ProfileSetup.qml index 1e6c3f9996..d6ff042a44 100644 --- a/resources/qml/ProfileSetup.qml +++ b/resources/qml/ProfileSetup.qml @@ -14,6 +14,8 @@ Item{ property int totalHeightProfileSetup: childrenRect.height property Action manageProfilesAction property Action addProfileAction + property Action updateProfileAction + property Action resetProfileAction signal showTooltip(Item item, point location, string text) signal hideTooltip() @@ -67,7 +69,7 @@ Item{ //Insert a separator between readonly and custom profiles if(separatorIndex < 0 && index > 0) { if(model.getItem(index-1).readOnly != model.getItem(index).readOnly) { - profileSelectionMenu.addSeparator(); + profileSelectionMenu.insertSeparator(index); separatorIndex = index; } } @@ -113,9 +115,16 @@ Item{ } MenuSeparator { } + MenuItem { + action: base.updateProfileAction; + } + MenuItem { + action: base.resetProfileAction; + } MenuItem { action: base.addProfileAction; } + MenuSeparator { } MenuItem { action: base.manageProfilesAction; } diff --git a/resources/qml/Sidebar.qml b/resources/qml/Sidebar.qml index f7292cf190..5426125194 100644 --- a/resources/qml/Sidebar.qml +++ b/resources/qml/Sidebar.qml @@ -15,6 +15,8 @@ Rectangle property Action addMachineAction; property Action configureMachinesAction; property Action addProfileAction; + property Action updateProfileAction; + property Action resetProfileAction; property Action manageProfilesAction; property Action configureSettingsAction; property int currentModeIndex; @@ -60,12 +62,14 @@ Rectangle height: UM.Theme.getSize("sidebar_lining").height color: UM.Theme.getColor("sidebar_lining") anchors.top: header.bottom - anchors.topMargin: UM.Theme.getSize("default_margin").height + anchors.topMargin: UM.Theme.getSize("default_margin").height } ProfileSetup { id: profileItem addProfileAction: base.addProfileAction + updateProfileAction: base.updateProfileAction + resetProfileAction: base.resetProfileAction manageProfilesAction: base.manageProfilesAction anchors.top: settingsModeSelection.bottom anchors.topMargin: UM.Theme.getSize("default_margin").height