mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-02 20:52:20 -07:00
WIP: Add gotoPage
This commit is contained in:
parent
53ea944da1
commit
cc35eb0195
5 changed files with 42 additions and 2 deletions
|
|
@ -33,6 +33,7 @@ Item
|
|||
signal showNextPage()
|
||||
signal showPreviousPage()
|
||||
signal passLastPage() // Emitted when there is no more page to show
|
||||
signal gotoPage(string page_id) // Go to a specific page by the given page_id.
|
||||
|
||||
onShowNextPage:
|
||||
{
|
||||
|
|
@ -53,6 +54,29 @@ Item
|
|||
}
|
||||
}
|
||||
|
||||
onGotoPage:
|
||||
{
|
||||
// find the page index
|
||||
var page_index = -1
|
||||
for (var i = 0; i < base.model.count; i++)
|
||||
{
|
||||
const item = base.model.getItem(i)
|
||||
if (item.id == page_id)
|
||||
{
|
||||
page_index = i
|
||||
break
|
||||
}
|
||||
}
|
||||
if (page_index > 0)
|
||||
{
|
||||
currentStep = page_index
|
||||
}
|
||||
else
|
||||
{
|
||||
console.log("Error: cannot find page with page_id = [", page_id, "]")
|
||||
}
|
||||
}
|
||||
|
||||
onVisibleChanged:
|
||||
{
|
||||
if (visible)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue