Allow launching custom pages from main menu entries

This commit is contained in:
Michael Zanetti 2022-06-03 01:18:23 +02:00
parent 0fbfaefcbe
commit 82dfceb953
3 changed files with 10 additions and 0 deletions

View File

@ -15,6 +15,7 @@ Drawer {
signal openMagicSettings();
signal openAppSettings();
signal openSystemSettings();
signal openCustomPage(string page);
signal configureMainView();
signal startWirelessSetup();
@ -215,6 +216,10 @@ Drawer {
iconName: entry.iconName
progressive: false
onClicked: {
if (entry.page !== undefined) {
root.openCustomPage(entry.page)
}
if (entry.func !== undefined) {
entry.func(app, root.currentEngine)
}

View File

@ -121,6 +121,7 @@ ApplicationWindow {
onOpenMagicSettings: rootItem.openMagicSettings();
onOpenAppSettings: rootItem.openAppSettings();
onOpenSystemSettings: rootItem.openSystemSettings();
onOpenCustomPage: rootItem.openCustomPage(page);
onConfigureMainView: rootItem.configureMainView();
onStartManualConnection: rootItem.startManualConnection();
onStartWirelessSetup: rootItem.startWirelessSetup();

View File

@ -70,6 +70,10 @@ Item {
function openSystemSettings() {
d.pushSettingsPage("SettingsPage.qml")
}
function openCustomPage(page) {
d.pushSettingsPage(page)
}
function configureMainView() {
swipeView.currentItem.pageStack.pop(null)
swipeView.currentItem.pageStack.currentItem.configureViews()