Allow launching custom pages from main menu entries
This commit is contained in:
parent
0fbfaefcbe
commit
82dfceb953
@ -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)
|
||||
}
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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()
|
||||
|
||||
Reference in New Issue
Block a user