mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-16 04:15:53 +08:00
Load preference pages dynamically and reset the current page to 0 on close
This commit is contained in:
parent
e2b2088246
commit
d208885755
@ -512,25 +512,22 @@ UM.MainWindow
|
|||||||
{
|
{
|
||||||
//; Remove & re-add the general page as we want to use our own instead of uranium standard.
|
//; Remove & re-add the general page as we want to use our own instead of uranium standard.
|
||||||
removePage(0);
|
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
|
//: 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
|
//Force refresh
|
||||||
setPage(0)
|
setPage(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
onVisibleChanged:
|
||||||
visible: false
|
|
||||||
GeneralPage
|
|
||||||
{
|
{
|
||||||
id: generalPage
|
if(!visible)
|
||||||
}
|
|
||||||
|
|
||||||
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…
x
Reference in New Issue
Block a user