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

View File

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

View File

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