mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-18 04:07:57 -06:00
15.10 adds a ManageProfilesAction
Moves it from the button to the bottom of the menu Contributes to: issue CURA-60
This commit is contained in:
parent
a839371832
commit
d6fde94e92
4 changed files with 49 additions and 30 deletions
|
@ -33,6 +33,7 @@ Item
|
||||||
|
|
||||||
property alias addMachine: addMachineAction;
|
property alias addMachine: addMachineAction;
|
||||||
property alias configureMachines: settingsAction;
|
property alias configureMachines: settingsAction;
|
||||||
|
property alias manageProfiles: manageProfilesAction;
|
||||||
|
|
||||||
property alias preferences: preferencesAction;
|
property alias preferences: preferencesAction;
|
||||||
|
|
||||||
|
@ -101,6 +102,13 @@ Item
|
||||||
iconName: "configure";
|
iconName: "configure";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Action
|
||||||
|
{
|
||||||
|
id: manageProfilesAction;
|
||||||
|
//: manage profiles action
|
||||||
|
text: catalog.i18nc("@action","Manage Profiles");
|
||||||
|
}
|
||||||
|
|
||||||
Action
|
Action
|
||||||
{
|
{
|
||||||
id: documentationAction;
|
id: documentationAction;
|
||||||
|
|
|
@ -301,9 +301,9 @@ UM.MainWindow
|
||||||
anchors
|
anchors
|
||||||
{
|
{
|
||||||
top: parent.top;
|
top: parent.top;
|
||||||
topMargin: UM.Theme.sizes.loadfile_margin.height
|
//topMargin: UM.Theme.sizes.loadfile_margin.height
|
||||||
left: parent.left;
|
left: parent.left;
|
||||||
leftMargin: UM.Theme.sizes.loadfile_margin.width
|
//leftMargin: UM.Theme.sizes.loadfile_margin.width
|
||||||
}
|
}
|
||||||
action: actions.open;
|
action: actions.open;
|
||||||
}
|
}
|
||||||
|
@ -393,6 +393,7 @@ UM.MainWindow
|
||||||
|
|
||||||
addMachineAction: actions.addMachine;
|
addMachineAction: actions.addMachine;
|
||||||
configureMachinesAction: actions.configureMachines;
|
configureMachinesAction: actions.configureMachines;
|
||||||
|
manageProfilesAction: actions.manageProfiles;
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle
|
Rectangle
|
||||||
|
@ -503,6 +504,7 @@ UM.MainWindow
|
||||||
|
|
||||||
preferences.onTriggered: preferences.visible = true;
|
preferences.onTriggered: preferences.visible = true;
|
||||||
configureMachines.onTriggered: { preferences.visible = true; preferences.setPage(2); }
|
configureMachines.onTriggered: { preferences.visible = true; preferences.setPage(2); }
|
||||||
|
manageProfiles.onTriggered: { preferences.visible = true; preferences.setPage(4); }
|
||||||
|
|
||||||
documentation.onTriggered: CuraActions.openDocumentation();
|
documentation.onTriggered: CuraActions.openDocumentation();
|
||||||
reportBug.onTriggered: CuraActions.openBugReportPage();
|
reportBug.onTriggered: CuraActions.openBugReportPage();
|
||||||
|
|
|
@ -12,6 +12,7 @@ Column{
|
||||||
id: base;
|
id: base;
|
||||||
UM.I18nCatalog { id: catalog; name:"cura"}
|
UM.I18nCatalog { id: catalog; name:"cura"}
|
||||||
property int totalHeightProfileSetup: childrenRect.height
|
property int totalHeightProfileSetup: childrenRect.height
|
||||||
|
property Action manageProfilesAction
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
Rectangle{
|
Rectangle{
|
||||||
|
@ -87,17 +88,17 @@ Column{
|
||||||
ToolButton {
|
ToolButton {
|
||||||
id: globalProfileSelection
|
id: globalProfileSelection
|
||||||
text: UM.MachineManager.activeProfile
|
text: UM.MachineManager.activeProfile
|
||||||
width: parent.width/100*45
|
width: parent.width/100*55
|
||||||
height: UM.Theme.sizes.setting_control.height
|
height: UM.Theme.sizes.setting_control.height
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.rightMargin: (UM.Theme.sizes.default_margin.width * 2) + saveProfileButton.width
|
anchors.rightMargin: UM.Theme.sizes.default_margin.width
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
tooltip: UM.MachineManager.activeProfile
|
tooltip: UM.MachineManager.activeProfile
|
||||||
style: UM.Theme.styles.sidebar_header_button
|
style: UM.Theme.styles.sidebar_header_button
|
||||||
|
|
||||||
menu: Menu
|
menu: Menu
|
||||||
{
|
{
|
||||||
id: machineSelectionMenu
|
id: profileSelectionMenu
|
||||||
Instantiator
|
Instantiator
|
||||||
{
|
{
|
||||||
model: UM.ProfilesModel { }
|
model: UM.ProfilesModel { }
|
||||||
|
@ -109,36 +110,42 @@ Column{
|
||||||
exclusiveGroup: profileSelectionMenuGroup;
|
exclusiveGroup: profileSelectionMenuGroup;
|
||||||
onTriggered: UM.MachineManager.setActiveProfile(model.name)
|
onTriggered: UM.MachineManager.setActiveProfile(model.name)
|
||||||
}
|
}
|
||||||
onObjectAdded: machineSelectionMenu.insertItem(index, object)
|
onObjectAdded: profileSelectionMenu.insertItem(index, object)
|
||||||
onObjectRemoved: machineSelectionMenu.removeItem(object)
|
onObjectRemoved: profileSelectionMenu.removeItem(object)
|
||||||
}
|
}
|
||||||
ExclusiveGroup { id: profileSelectionMenuGroup; }
|
ExclusiveGroup { id: profileSelectionMenuGroup; }
|
||||||
}
|
|
||||||
Button {
|
|
||||||
id: saveProfileButton
|
|
||||||
visible: true
|
|
||||||
anchors.top: parent.top
|
|
||||||
x: globalProfileSelection.width + 2
|
|
||||||
width: parent.width/100*25
|
|
||||||
text: catalog.i18nc("@action:button", "Save");
|
|
||||||
height: parent.height
|
|
||||||
|
|
||||||
style: ButtonStyle {
|
MenuSeparator { }
|
||||||
background: Rectangle {
|
MenuItem {
|
||||||
color: control.hovered ? UM.Theme.colors.load_save_button_hover : UM.Theme.colors.load_save_button
|
action: base.manageProfilesAction;
|
||||||
Behavior on color { ColorAnimation { duration: 50; } }
|
|
||||||
width: actualLabel.width + UM.Theme.sizes.default_margin.width
|
|
||||||
Label {
|
|
||||||
id: actualLabel
|
|
||||||
anchors.centerIn: parent
|
|
||||||
color: UM.Theme.colors.load_save_button_text
|
|
||||||
font: UM.Theme.fonts.default
|
|
||||||
text: control.text;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
label: Item { }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Button {
|
||||||
|
// id: saveProfileButton
|
||||||
|
// visible: true
|
||||||
|
// anchors.top: parent.top
|
||||||
|
// x: globalProfileSelection.width + 2
|
||||||
|
// width: parent.width/100*25
|
||||||
|
// text: catalog.i18nc("@action:button", "Save");
|
||||||
|
// height: parent.height
|
||||||
|
//
|
||||||
|
// style: ButtonStyle {
|
||||||
|
// background: Rectangle {
|
||||||
|
// color: control.hovered ? UM.Theme.colors.load_save_button_hover : UM.Theme.colors.load_save_button
|
||||||
|
// Behavior on color { ColorAnimation { duration: 50; } }
|
||||||
|
// width: actualLabel.width + UM.Theme.sizes.default_margin.width
|
||||||
|
// Label {
|
||||||
|
// id: actualLabel
|
||||||
|
// anchors.centerIn: parent
|
||||||
|
// color: UM.Theme.colors.load_save_button_text
|
||||||
|
// font: UM.Theme.fonts.default
|
||||||
|
// text: control.text;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// label: Item { }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Rectangle{
|
Rectangle{
|
||||||
|
|
|
@ -14,6 +14,7 @@ Rectangle
|
||||||
|
|
||||||
property Action addMachineAction;
|
property Action addMachineAction;
|
||||||
property Action configureMachinesAction;
|
property Action configureMachinesAction;
|
||||||
|
property Action manageProfilesAction;
|
||||||
|
|
||||||
color: UM.Theme.colors.sidebar;
|
color: UM.Theme.colors.sidebar;
|
||||||
UM.I18nCatalog { id: catalog; name:"cura"}
|
UM.I18nCatalog { id: catalog; name:"cura"}
|
||||||
|
@ -64,6 +65,7 @@ Rectangle
|
||||||
|
|
||||||
ProfileSetup {
|
ProfileSetup {
|
||||||
id: profileItem
|
id: profileItem
|
||||||
|
manageProfilesAction: base.manageProfilesAction
|
||||||
anchors.top: header.bottom
|
anchors.top: header.bottom
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: totalHeightProfileSetup
|
height: totalHeightProfileSetup
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue