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:
Tamara Hogenhout 2015-09-03 15:50:48 +02:00
parent a839371832
commit d6fde94e92
4 changed files with 49 additions and 30 deletions

View file

@ -33,6 +33,7 @@ Item
property alias addMachine: addMachineAction;
property alias configureMachines: settingsAction;
property alias manageProfiles: manageProfilesAction;
property alias preferences: preferencesAction;
@ -101,6 +102,13 @@ Item
iconName: "configure";
}
Action
{
id: manageProfilesAction;
//: manage profiles action
text: catalog.i18nc("@action","Manage Profiles");
}
Action
{
id: documentationAction;

View file

@ -301,9 +301,9 @@ UM.MainWindow
anchors
{
top: parent.top;
topMargin: UM.Theme.sizes.loadfile_margin.height
//topMargin: UM.Theme.sizes.loadfile_margin.height
left: parent.left;
leftMargin: UM.Theme.sizes.loadfile_margin.width
//leftMargin: UM.Theme.sizes.loadfile_margin.width
}
action: actions.open;
}
@ -393,6 +393,7 @@ UM.MainWindow
addMachineAction: actions.addMachine;
configureMachinesAction: actions.configureMachines;
manageProfilesAction: actions.manageProfiles;
}
Rectangle
@ -503,6 +504,7 @@ UM.MainWindow
preferences.onTriggered: preferences.visible = true;
configureMachines.onTriggered: { preferences.visible = true; preferences.setPage(2); }
manageProfiles.onTriggered: { preferences.visible = true; preferences.setPage(4); }
documentation.onTriggered: CuraActions.openDocumentation();
reportBug.onTriggered: CuraActions.openBugReportPage();

View file

@ -12,6 +12,7 @@ Column{
id: base;
UM.I18nCatalog { id: catalog; name:"cura"}
property int totalHeightProfileSetup: childrenRect.height
property Action manageProfilesAction
spacing: 0
Rectangle{
@ -87,17 +88,17 @@ Column{
ToolButton {
id: globalProfileSelection
text: UM.MachineManager.activeProfile
width: parent.width/100*45
width: parent.width/100*55
height: UM.Theme.sizes.setting_control.height
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
tooltip: UM.MachineManager.activeProfile
style: UM.Theme.styles.sidebar_header_button
menu: Menu
{
id: machineSelectionMenu
id: profileSelectionMenu
Instantiator
{
model: UM.ProfilesModel { }
@ -109,36 +110,42 @@ Column{
exclusiveGroup: profileSelectionMenuGroup;
onTriggered: UM.MachineManager.setActiveProfile(model.name)
}
onObjectAdded: machineSelectionMenu.insertItem(index, object)
onObjectRemoved: machineSelectionMenu.removeItem(object)
onObjectAdded: profileSelectionMenu.insertItem(index, object)
onObjectRemoved: profileSelectionMenu.removeItem(object)
}
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 {
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 { }
MenuSeparator { }
MenuItem {
action: base.manageProfilesAction;
}
}
// 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{

View file

@ -14,6 +14,7 @@ Rectangle
property Action addMachineAction;
property Action configureMachinesAction;
property Action manageProfilesAction;
color: UM.Theme.colors.sidebar;
UM.I18nCatalog { id: catalog; name:"cura"}
@ -64,6 +65,7 @@ Rectangle
ProfileSetup {
id: profileItem
manageProfilesAction: base.manageProfilesAction
anchors.top: header.bottom
width: parent.width
height: totalHeightProfileSetup