Add "Close" button to (single) machine actions dialog

CURA-2019
This commit is contained in:
fieldOfView 2016-07-29 11:27:03 +02:00
parent a19123eb66
commit f584b49af2
4 changed files with 19 additions and 50 deletions

View file

@ -47,39 +47,23 @@ Cura.MachineAction
text: catalog.i18nc("@label", "For every position; insert a piece of paper under the nozzle and adjust the print bed height. The print bed height is right when the paper is slightly gripped by the tip of the nozzle.") text: catalog.i18nc("@label", "For every position; insert a piece of paper under the nozzle and adjust the print bed height. The print bed height is right when the paper is slightly gripped by the tip of the nozzle.")
} }
Item Row
{ {
id: bedlevelingWrapper id: bedlevelingWrapper
anchors.top: bedlevelingText.bottom anchors.top: bedlevelingText.bottom
anchors.topMargin: UM.Theme.getSize("default_margin").height anchors.topMargin: UM.Theme.getSize("default_margin").height
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
height: skipBedlevelingButton.height width: childrenRect.width
width: bedlevelingButton.width + skipBedlevelingButton.width + UM.Theme.getSize("default_margin").height < bedLevelMachineAction.width ? bedlevelingButton.width + skipBedlevelingButton.width + UM.Theme.getSize("default_margin").height : bedLevelMachineAction.width spacing: UM.Theme.getSize("default_margin").width
Button Button
{ {
id: bedlevelingButton id: bedlevelingButton
anchors.top: parent.top
anchors.left: parent.left
text: catalog.i18nc("@action:button","Move to Next Position"); text: catalog.i18nc("@action:button","Move to Next Position");
onClicked: onClicked:
{ {
manager.moveToNextLevelPosition() manager.moveToNextLevelPosition()
} }
} }
Button
{
id: skipBedlevelingButton
anchors.top: parent.width < bedLevelMachineAction.width ? parent.top : bedlevelingButton.bottom
anchors.topMargin: parent.width < bedLevelMachineAction.width ? 0 : UM.Theme.getSize("default_margin").height/2
anchors.left: parent.width < bedLevelMachineAction.width ? bedlevelingButton.right : parent.left
anchors.leftMargin: parent.width < bedLevelMachineAction.width ? UM.Theme.getSize("default_margin").width : 0
text: catalog.i18nc("@action:button","Skip bed leveling");
onClicked:
{
manager.setFinished()
}
}
} }
} }
} }

View file

@ -39,19 +39,17 @@ Cura.MachineAction
text: catalog.i18nc("@label", "It's a good idea to do a few sanity checks on your Ultimaker. You can skip this step if you know your machine is functional"); text: catalog.i18nc("@label", "It's a good idea to do a few sanity checks on your Ultimaker. You can skip this step if you know your machine is functional");
} }
Item Row
{ {
id: startStopButtons id: startStopButtons
anchors.top: pageDescription.bottom anchors.top: pageDescription.bottom
anchors.topMargin: UM.Theme.getSize("default_margin").height anchors.topMargin: UM.Theme.getSize("default_margin").height
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
height: childrenRect.height width: childrenRect.width
width: startCheckButton.width + skipCheckButton.width + UM.Theme.getSize("default_margin").height < checkupMachineAction.width ? startCheckButton.width + skipCheckButton.width + UM.Theme.getSize("default_margin").height : checkupMachineAction.width spacing: UM.Theme.getSize("default_margin").width
Button Button
{ {
id: startCheckButton id: startCheckButton
anchors.top: parent.top
anchors.left: parent.left
text: catalog.i18nc("@action:button","Start Printer Check"); text: catalog.i18nc("@action:button","Start Printer Check");
onClicked: onClicked:
{ {
@ -60,17 +58,6 @@ Cura.MachineAction
manager.startCheck() manager.startCheck()
} }
} }
Button
{
id: skipCheckButton
anchors.top: parent.width < checkupMachineAction.width ? parent.top : startCheckButton.bottom
anchors.topMargin: parent.width < checkupMachineAction.width ? 0 : UM.Theme.getSize("default_margin").height/2
anchors.left: parent.width < checkupMachineAction.width ? startCheckButton.right : parent.left
anchors.leftMargin: parent.width < checkupMachineAction.width ? UM.Theme.getSize("default_margin").width : 0
text: catalog.i18nc("@action:button", "Skip Printer Check");
onClicked: manager.setFinished()
}
} }
Item Item

View file

@ -56,29 +56,21 @@ Cura.MachineAction
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
text: catalog.i18nc("@label", "Cura requires these new features and thus your firmware will most likely need to be upgraded. You can do so now."); text: catalog.i18nc("@label", "Cura requires these new features and thus your firmware will most likely need to be upgraded. You can do so now.");
} }
Item Row
{ {
anchors.top: upgradeText2.bottom anchors.top: upgradeText2.bottom
anchors.topMargin: UM.Theme.getSize("default_margin").height anchors.topMargin: UM.Theme.getSize("default_margin").height
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
width: upgradeButton.width + skipUpgradeButton.width + UM.Theme.getSize("default_margin").height < upgradeFirmwareMachineAction.width ? upgradeButton.width + skipUpgradeButton.width + UM.Theme.getSize("default_margin").height : upgradeFirmwareMachineAction.width width: childrenRect.width
spacing: UM.Theme.getSize("default_margin").width
Button Button
{ {
id: upgradeButton id: upgradeButton
anchors.top: parent.top
anchors.left: parent.left
text: catalog.i18nc("@action:button","Upgrade to Marlin Firmware"); text: catalog.i18nc("@action:button","Upgrade to Marlin Firmware");
onClicked: Cura.USBPrinterManager.updateAllFirmware() onClicked:
}
Button
{ {
id: skipUpgradeButton Cura.USBPrinterManager.updateAllFirmware()
anchors.top: parent.width < upgradeFirmwareMachineAction.width ? parent.top : upgradeButton.bottom }
anchors.topMargin: parent.width < upgradeFirmwareMachineAction.width ? 0 : UM.Theme.getSize("default_margin").height / 2
anchors.left: parent.width < upgradeFirmwareMachineAction.width ? upgradeButton.right : parent.left
anchors.leftMargin: parent.width < upgradeFirmwareMachineAction.width ? UM.Theme.getSize("default_margin").width : 0
text: catalog.i18nc("@action:button", "Skip Upgrade");
onClicked: manager.setFinished()
} }
} }
} }

View file

@ -107,6 +107,12 @@ UM.ManagementPage
contents = content; contents = content;
content.onCompleted.connect(hide) content.onCompleted.connect(hide)
} }
rightButtons: Button
{
text: catalog.i18nc("@action:button", "Close")
iconName: "dialog-close"
onClicked: actionDialog.accept()
}
} }
Row Row