Hide system/thing settings in main menu while disconnected

This commit is contained in:
Michael Zanetti 2021-12-14 16:03:11 +01:00
parent 60357716c7
commit cf9c63e192

View File

@ -139,7 +139,7 @@ Drawer {
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("Configure things") text: qsTr("Configure things")
iconName: "../images/things.svg" iconName: "../images/things.svg"
visible: root.currentEngine && root.currentEngine.jsonRpcClient.currentHost visible: root.currentEngine && root.currentEngine.jsonRpcClient.currentHost && root.currentEngine.jsonRpcClient.connected
progressive: false progressive: false
onClicked: { onClicked: {
root.openThingSettings() root.openThingSettings()
@ -151,7 +151,7 @@ Drawer {
text: qsTr("Magic") text: qsTr("Magic")
iconName: "../images/magic.svg" iconName: "../images/magic.svg"
progressive: false progressive: false
visible: root.currentEngine && root.currentEngine.jsonRpcClient.currentHost visible: root.currentEngine && root.currentEngine.jsonRpcClient.currentHost && root.currentEngine.jsonRpcClient.connected
onClicked: { onClicked: {
root.openMagicSettings(); root.openMagicSettings();
root.close(); root.close();
@ -162,7 +162,7 @@ Drawer {
text: qsTr("Configure main view") text: qsTr("Configure main view")
iconName: "../images/configure.svg" iconName: "../images/configure.svg"
progressive: false progressive: false
visible: root.currentEngine && root.currentEngine.jsonRpcClient.currentHost && visible: root.currentEngine && root.currentEngine.jsonRpcClient.currentHost && root.currentEngine.jsonRpcClient.connected &&
!Configuration.hasOwnProperty("mainViewsFilter") !Configuration.hasOwnProperty("mainViewsFilter")
onClicked: { onClicked: {
root.configureMainView(); root.configureMainView();
@ -184,7 +184,7 @@ Drawer {
text: qsTr("System settings") text: qsTr("System settings")
iconName: "../images/settings.svg" iconName: "../images/settings.svg"
progressive: false progressive: false
visible: root.currentEngine && root.currentEngine.jsonRpcClient.currentHost visible: root.currentEngine && root.currentEngine.jsonRpcClient.currentHost && root.currentEngine.jsonRpcClient.connected
onClicked: { onClicked: {
root.openSystemSettings(); root.openSystemSettings();
root.close(); root.close();