Move main view configuration into menu
This commit is contained in:
parent
e1249b7760
commit
5b7028def1
@ -13,6 +13,7 @@ Drawer {
|
||||
signal openMagicSettings();
|
||||
signal openAppSettings();
|
||||
signal openSystemSettings();
|
||||
signal configureMainView();
|
||||
|
||||
signal startWirelessSetup();
|
||||
signal startManualConnection();
|
||||
@ -161,6 +162,17 @@ Drawer {
|
||||
root.close();
|
||||
}
|
||||
}
|
||||
NymeaItemDelegate {
|
||||
Layout.fillWidth: true
|
||||
text: qsTr("Configure main view")
|
||||
iconName: "../images/configure.svg"
|
||||
progressive: false
|
||||
visible: root.currentEngine && root.currentEngine.jsonRpcClient.currentHost
|
||||
onClicked: {
|
||||
root.configureMainView();
|
||||
root.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
NymeaItemDelegate {
|
||||
|
||||
@ -43,13 +43,17 @@ import "mainviews"
|
||||
Page {
|
||||
id: root
|
||||
|
||||
function configureViews() {
|
||||
d.configOverlay = configComponent.createObject(contentContainer)
|
||||
}
|
||||
|
||||
header: ToolBar {
|
||||
id: mainHeader
|
||||
RowLayout {
|
||||
anchors.fill: parent
|
||||
|
||||
HeaderButton {
|
||||
imageSource: "qrc:/styles/%1/logo.svg".arg(styleController.currentStyle)
|
||||
imageSource: "../images/navigation-menu.svg"
|
||||
onClicked: {
|
||||
if (d.configOverlay != null) {
|
||||
d.configOverlay.destroy();
|
||||
@ -64,12 +68,6 @@ Page {
|
||||
qsTr("Configure main view")
|
||||
: swipeView.currentItem.item.title.length > 0 ? swipeView.currentItem.item.title : filteredContentModel.data(swipeView.currentIndex, "displayName")
|
||||
}
|
||||
|
||||
HeaderButton {
|
||||
imageSource: "../images/settings.svg"
|
||||
visible: d.configOverlay == null
|
||||
onClicked: d.configOverlay = configComponent.createObject(contentContainer)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -109,6 +109,7 @@ ApplicationWindow {
|
||||
onOpenMagicSettings: rootItem.openMagicSettings();
|
||||
onOpenAppSettings: rootItem.openAppSettings();
|
||||
onOpenSystemSettings: rootItem.openSystemSettings();
|
||||
onConfigureMainView: rootItem.configureMainView();
|
||||
onStartManualConnection: rootItem.startManualConnection();
|
||||
onStartWirelessSetup: rootItem.startWirelessSetup();
|
||||
onStartDemoMode: rootItem.startDemoMode();
|
||||
|
||||
@ -72,6 +72,11 @@ Item {
|
||||
function openSystemSettings() {
|
||||
d.pushSettingsPage("SettingsPage.qml")
|
||||
}
|
||||
function configureMainView() {
|
||||
swipeView.currentItem.pageStack.pop(null)
|
||||
swipeView.currentItem.pageStack.currentItem.configureViews()
|
||||
}
|
||||
|
||||
function startManualConnection() {
|
||||
d.pushSettingsPage("connection/ManualConnectPage.qml")
|
||||
}
|
||||
|
||||
@ -91,7 +91,7 @@ Page {
|
||||
if (root.showDetailsButton) {
|
||||
thingMenu.addItem(menuEntryComponent.createObject(thingMenu, {text: qsTr("Details"), iconSource: "../images/info.svg", functionName: "openGenericDevicePage"}))
|
||||
}
|
||||
thingMenu.addItem(menuEntryComponent.createObject(thingMenu, {text: qsTr("Settings"), iconSource: "../images/configure.svg", functionName: "openThingSettingsPage"}))
|
||||
// thingMenu.addItem(menuEntryComponent.createObject(thingMenu, {text: qsTr("Settings"), iconSource: "../images/configure.svg", functionName: "openThingSettingsPage"}))
|
||||
if (root.showLogsButton) {
|
||||
thingMenu.addItem(menuEntryComponent.createObject(thingMenu, {text: qsTr("Logs"), iconSource: "../images/logs.svg", functionName: "openDeviceLogPage"}))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user