Changeset View
Changeset View
Standalone View
Standalone View
applets/batterymonitor/package/contents/ui/logic.js
Show All 40 Lines | 39 | if (remainingTime > 0 && batteryData["Is Power Supply"] && (batteryData["State"] == "Discharging" || batteryData["State"] == "Charging")) { | |||
---|---|---|---|---|---|
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("Capacity:") }) | 45 | data.push({label: i18n("Capacity:") }) | ||
46 | data.push({value: i18nc("Placeholder is battery capacity", "%1%", batteryData["Capacity"]) }) | 46 | data.push({value: i18nc("Placeholder is battery capacity", "%1%", batteryData["Capacity"]) }) | ||
47 | } | 47 | } | ||
48 | 48 | | |||
49 | // Non-powersupply batteries have a name consisting of the vendor and model already | | |||
50 | if (batteryData["Is Power Supply"]) { | | |||
51 | if (batteryData["Vendor"] != "" && typeof batteryData["Vendor"] == "string") { | | |||
52 | data.push({label: i18n("Vendor:") }) | | |||
53 | data.push({value: batteryData["Vendor"] }) | | |||
54 | } | | |||
55 | | ||||
56 | if (batteryData["Product"] != "" && typeof batteryData["Product"] == "string") { | | |||
57 | data.push({label: i18n("Model:") }) | | |||
58 | data.push({value: batteryData["Product"] }) | | |||
59 | } | | |||
60 | } | | |||
61 | | ||||
62 | return data | 49 | return data | ||
63 | } | 50 | } | ||
64 | 51 | | |||
65 | function updateBrightness(rootItem, source) { | 52 | function updateBrightness(rootItem, source) { | ||
66 | if (!source.data["PowerDevil"]) { | 53 | if (!source.data["PowerDevil"]) { | ||
67 | return; | 54 | return; | ||
68 | } | 55 | } | ||
69 | 56 | | |||
Show All 27 Lines |