mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-06 05:23:58 -06:00
Load preference pages dynamically and reset the current page to 0 on close
This commit is contained in:
parent
e2b2088246
commit
d208885755
1 changed files with 8 additions and 11 deletions
|
@ -512,25 +512,22 @@ UM.MainWindow
|
|||
{
|
||||
//; Remove & re-add the general page as we want to use our own instead of uranium standard.
|
||||
removePage(0);
|
||||
insertPage(0, catalog.i18nc("@title:tab","General"), generalPage);
|
||||
insertPage(0, catalog.i18nc("@title:tab","General"), Qt.resolvedUrl("GeneralPage.qml"));
|
||||
|
||||
//: View preferences page title
|
||||
insertPage(1, catalog.i18nc("@title:tab","View"), viewPage);
|
||||
insertPage(1, catalog.i18nc("@title:tab","View"), Qt.resolvedUrl("ViewPage.qml"));
|
||||
|
||||
//Force refresh
|
||||
setPage(0)
|
||||
}
|
||||
|
||||
Item {
|
||||
visible: false
|
||||
GeneralPage
|
||||
onVisibleChanged:
|
||||
{
|
||||
if(!visible)
|
||||
{
|
||||
id: generalPage
|
||||
}
|
||||
|
||||
ViewPage
|
||||
{
|
||||
id: viewPage
|
||||
// When the dialog closes, switch to the General page.
|
||||
// This prevents us from having a heavy page like Setting Visiblity active in the background.
|
||||
setPage(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue