Skip to content

Commit

Permalink
Show 'None' for solar history alarms/errors where applicable #277
Browse files Browse the repository at this point in the history
It's a bit odd if the alarms/errors link cannot be clicked (if
there are none to view), so show 'None' to indicate there is no
information viewable there.
  • Loading branch information
blammit committed May 5, 2023
1 parent f4c45b6 commit 1e1e666
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions pages/solar/SolarChargerPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,15 @@ Page {
ListNavigationItem {
//% "Alarms and Errors"
text: qsTrId("charger_alarms_alarms_and_errors")
secondaryText: root.solarCharger.errorModel.count > 0
//: Shows number of items found. %1 = number of items
//% "%1 found"
? qsTrId("charger_history_found_with_count").arg(root.solarCharger.errorModel.count)
: ""
secondaryText: enabled
? (root.solarCharger.errorModel.count > 0
//: Shows number of items found. %1 = number of items
//% "%1 found"
? qsTrId("charger_history_found_with_count").arg(root.solarCharger.errorModel.count)
: "")
//: Indicates there are no alarms/errors present
//% "None"
: qsTrId("charger_alarms_none")
secondaryLabel.color: root.solarCharger.errorModel.count ? Theme.color.critical : Theme.color.font.secondary

// Only enable if there is content on the alarms/errors page.
Expand Down

0 comments on commit 1e1e666

Please sign in to comment.