Load preference pages dynamically and reset the current page to 0 on close

This commit is contained in:
Arjen Hiemstra 2016-02-15 08:42:40 +01:00 committed by Ghostkeeper
parent e2b2088246
commit d208885755

View File

@ -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 if(!visible)
{ {
id: generalPage // 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);
ViewPage
{
id: viewPage
} }
} }
} }