Changeset View
Changeset View
Standalone View
Standalone View
applets/batterymonitor/package/contents/ui/logic.js
Show All 36 Lines | 36 | function batteryDetails(batteryData, remainingTime) { | |||
---|---|---|---|---|---|
37 | var data = [] | 37 | var data = [] | ||
38 | 38 | | |||
39 | if (remainingTime > 0 && batteryData["Is Power Supply"] && (batteryData["State"] == "Discharging" || batteryData["State"] == "Charging")) { | 39 | if (remainingTime > 0 && batteryData["Is Power Supply"] && (batteryData["State"] == "Discharging" || batteryData["State"] == "Charging")) { | ||
40 | data.push({label: (batteryData["State"] == "Charging" ? i18n("Time To Full:") : i18n("Time To Empty:")) }) | 40 | data.push({label: (batteryData["State"] == "Charging" ? i18n("Time To Full:") : i18n("Time To Empty:")) }) | ||
41 | data.push({value: KCoreAddons.Format.formatDuration(remainingTime, KCoreAddons.FormatTypes.HideSeconds) }) | 41 | data.push({value: KCoreAddons.Format.formatDuration(remainingTime, KCoreAddons.FormatTypes.HideSeconds) }) | ||
42 | } | 42 | } | ||
43 | 43 | | |||
44 | if (batteryData["Is Power Supply"] && batteryData["Capacity"] != "" && typeof batteryData["Capacity"] == "number") { | 44 | if (batteryData["Is Power Supply"] && batteryData["Capacity"] != "" && typeof batteryData["Capacity"] == "number") { | ||
45 | data.push({label: i18nc("The degradation in the battery's energy capacity", "Capacity degradation:") }) | 45 | data.push({label: i18n("Battery Health:") }) | ||
46 | data.push({value: i18nc("Placeholder is battery's capacity degradation", "%1%", 100 - batteryData["Capacity"]) }) | 46 | data.push({value: i18nc("Placeholder is battery health percentage", "%1%", batteryData["Capacity"]) }) | ||
47 | } | 47 | } | ||
48 | 48 | | |||
49 | return data | 49 | return data | ||
50 | } | 50 | } | ||
51 | 51 | | |||
52 | function updateBrightness(rootItem, source) { | 52 | function updateBrightness(rootItem, source) { | ||
53 | if (!source.data["PowerDevil"]) { | 53 | if (!source.data["PowerDevil"]) { | ||
54 | return; | 54 | return; | ||
Show All 29 Lines |