mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 21:15:56 +08:00
Prevent wizard pages from closing when they are "accepted" by pressing return.
Also removes some code replication in wizard pages. CURA-1354
This commit is contained in:
parent
134867f833
commit
cde23edfed
@ -34,25 +34,10 @@ Item
|
|||||||
target: base.wizard
|
target: base.wizard
|
||||||
onNextClicked: //You can add functions here that get triggered when the final button is clicked in the wizard-element
|
onNextClicked: //You can add functions here that get triggered when the final button is clicked in the wizard-element
|
||||||
{
|
{
|
||||||
var name = machineName.text
|
base.wizard.resetPages()
|
||||||
|
|
||||||
var old_page_count = base.wizard.getPageCount()
|
|
||||||
// Delete old pages (if any)
|
|
||||||
for (var i = old_page_count - 1; i > 0; i--)
|
|
||||||
{
|
|
||||||
base.wizard.removePage(i)
|
|
||||||
}
|
|
||||||
saveMachine()
|
saveMachine()
|
||||||
}
|
}
|
||||||
onBackClicked:
|
onBackClicked: base.wizard.resetPages()
|
||||||
{
|
|
||||||
var old_page_count = base.wizard.getPageCount()
|
|
||||||
// Delete old pages (if any)
|
|
||||||
for (var i = old_page_count - 1; i > 0; i--)
|
|
||||||
{
|
|
||||||
base.wizard.removePage(i)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Label
|
Label
|
||||||
@ -249,9 +234,6 @@ Item
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(base.wizard.lastPage == true){
|
|
||||||
base.wizard.visible = false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,17 +28,6 @@ Item
|
|||||||
UM.I18nCatalog { id: catalog; name:"cura"}
|
UM.I18nCatalog { id: catalog; name:"cura"}
|
||||||
property variant wizard: null;
|
property variant wizard: null;
|
||||||
|
|
||||||
Connections
|
|
||||||
{
|
|
||||||
target: wizardPage.wizard
|
|
||||||
onNextClicked: //You can add functions here that get triggered when the final button is clicked in the wizard-element
|
|
||||||
{
|
|
||||||
if(wizardPage.wizard.lastPage == true){
|
|
||||||
wizardPage.wizard.visible = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
id: pageTitle
|
id: pageTitle
|
||||||
@ -120,18 +109,7 @@ Item
|
|||||||
anchors.left: parent.width < wizardPage.width ? bedlevelingButton.right : parent.left
|
anchors.left: parent.width < wizardPage.width ? bedlevelingButton.right : parent.left
|
||||||
anchors.leftMargin: parent.width < wizardPage.width ? UM.Theme.getSize("default_margin").width : 0
|
anchors.leftMargin: parent.width < wizardPage.width ? UM.Theme.getSize("default_margin").width : 0
|
||||||
text: catalog.i18nc("@action:button","Skip Bedleveling");
|
text: catalog.i18nc("@action:button","Skip Bedleveling");
|
||||||
onClicked: {
|
onClicked: base.nextPage()
|
||||||
if(wizardPage.wizard.lastPage == true){
|
|
||||||
var old_page_count = wizardPage.wizard.getPageCount()
|
|
||||||
// Delete old pages (if any)
|
|
||||||
for (var i = old_page_count - 1; i > 0; i--)
|
|
||||||
{
|
|
||||||
wizardPage.wizard.removePage(i)
|
|
||||||
}
|
|
||||||
wizardPage.wizard.currentPage = 0
|
|
||||||
wizardPage.wizard.visible = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,9 +114,7 @@ Item
|
|||||||
anchors.leftMargin: parent.width < wizardPage.width ? UM.Theme.getSize("default_margin").width : 0
|
anchors.leftMargin: parent.width < wizardPage.width ? UM.Theme.getSize("default_margin").width : 0
|
||||||
//enabled: !alreadyTested
|
//enabled: !alreadyTested
|
||||||
text: catalog.i18nc("@action:button","Skip Printer Check");
|
text: catalog.i18nc("@action:button","Skip Printer Check");
|
||||||
onClicked: {
|
onClicked: base.nextPage()
|
||||||
base.currentPage += 1
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,9 +71,7 @@ Item
|
|||||||
anchors.left: parent.width < wizardPage.width ? upgradeButton.right : parent.left
|
anchors.left: parent.width < wizardPage.width ? upgradeButton.right : parent.left
|
||||||
anchors.leftMargin: parent.width < wizardPage.width ? UM.Theme.getSize("default_margin").width : 0
|
anchors.leftMargin: parent.width < wizardPage.width ? UM.Theme.getSize("default_margin").width : 0
|
||||||
text: catalog.i18nc("@action:button","Skip Upgrade");
|
text: catalog.i18nc("@action:button","Skip Upgrade");
|
||||||
onClicked: {
|
onClicked: base.nextPage()
|
||||||
base.currentPage += 1
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ExclusiveGroup { id: printerGroup; }
|
ExclusiveGroup { id: printerGroup; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user