Changeset View
Changeset View
Standalone View
Standalone View
applets/batterymonitor/package/contents/ui/logic.js
Show All 31 Lines | 31 | } else { | |||
---|---|---|---|---|---|
32 | return i18nc("Battery is currently not present in the bay","Not present"); | 32 | return i18nc("Battery is currently not present in the bay","Not present"); | ||
33 | } | 33 | } | ||
34 | } | 34 | } | ||
35 | 35 | | |||
36 | function batteryDetails(batteryData, remainingTime) { | 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: i18n("Battery Health:") }) | 45 | data.push({label: i18n("Battery health:") }) | ||
46 | data.push({value: i18nc("Placeholder is battery health percentage", "%1%", 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 (rootItem.updateScreenBrightnessJob || rootItem.updateKeyboardBrightnessJob) | 53 | if (rootItem.updateScreenBrightnessJob || rootItem.updateKeyboardBrightnessJob) | ||
Show All 33 Lines |