Merge PR #727: Hide settings while disconnected

This commit is contained in:
Jenkins nymea 2021-12-14 16:11:32 +01:00
commit d5d881f472
12 changed files with 54 additions and 7 deletions

View File

@ -1776,12 +1776,16 @@
</message>
<message>
<source>Root meter</source>
<translation>Wuzelmesser</translation>
<translation>Wurzelmesser</translation>
</message>
<message>
<source>Consumers</source>
<translation>Verbraucher</translation>
</message>
<message>
<source>Uncheck individual consumers to hide them from the energy charts.</source>
<translation>Entferne das Häkchen bei einzelnen Verbrauchern um diese in den Energieansichten auszublenden.</translation>
</message>
</context>
<context>
<name>EnergyView</name>
@ -5147,7 +5151,7 @@ Möchtest Du fortfahren?</translation>
<name>PowerBalanceStats</name>
<message>
<source>Totals</source>
<translation>Gesamt</translation>
<translation>Gesamtsummen</translation>
</message>
<message>
<source>Hours</source>

View File

@ -1776,6 +1776,10 @@
<source>Consumers</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Uncheck individual consumers to hide them from the energy charts.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EnergyView</name>

View File

@ -1776,6 +1776,10 @@
<source>Consumers</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Uncheck individual consumers to hide them from the energy charts.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EnergyView</name>

View File

@ -1776,6 +1776,10 @@
<source>Consumers</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Uncheck individual consumers to hide them from the energy charts.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EnergyView</name>

View File

@ -1780,6 +1780,10 @@
<source>Consumers</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Uncheck individual consumers to hide them from the energy charts.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EnergyView</name>

View File

@ -1776,6 +1776,10 @@
<source>Consumers</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Uncheck individual consumers to hide them from the energy charts.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EnergyView</name>

View File

@ -1780,6 +1780,10 @@
<source>Consumers</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Uncheck individual consumers to hide them from the energy charts.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EnergyView</name>

View File

@ -1774,6 +1774,10 @@
<source>Consumers</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Uncheck individual consumers to hide them from the energy charts.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EnergyView</name>

View File

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

View File

@ -51,7 +51,7 @@ MainViewBase {
trigger: function() {
pageStack.push("energy/EnergySettingsPage.qml", {energyManager: energyManager});
},
visible: true
visible: energyMeters.count > 1 || consumers.count > 0
}
]

View File

@ -239,6 +239,11 @@ StatsBase {
var previous = powerLogs.find(entry.thingId, new Date(categoryAxis.timestamps[categoryAxis.timestamps.length - 1]))
var previousValue = previous ? previous.totalConsumption : 0
var barSet = barSeries.thingBarSetMap[entry.thingId]
if (!barSet) {
return
}
barSet.replace(barSet.count - 1, entry.totalConsumption - previousValue)
}
}

View File

@ -59,6 +59,16 @@ SettingsPageBase {
SettingsPageSectionHeader {
text: qsTr("Consumers")
visible: root.allConsumers.count > 0
}
Label {
Layout.fillWidth: true
Layout.leftMargin: Style.margins
Layout.rightMargin: Style.margins
wrapMode: Text.WordWrap
text: qsTr("Uncheck individual consumers to hide them from the energy charts.")
visible: root.allConsumers.count > 0
}
Repeater {