Changeset View
Changeset View
Standalone View
Standalone View
Modules/energy/package/contents/ui/main.qml
Show First 20 Lines • Show All 62 Lines • ▼ Show 20 Line(s) | 62 | { | |||
---|---|---|---|---|---|
63 | title: i18n("Battery"), | 63 | title: i18n("Battery"), | ||
64 | data: [ | 64 | data: [ | ||
65 | {label: i18n("Rechargeable"), value: "rechargeable"}, | 65 | {label: i18n("Rechargeable"), value: "rechargeable"}, | ||
66 | {label: i18n("Charge state"), value: "chargeState", modifier: "chargeState"}, | 66 | {label: i18n("Charge state"), value: "chargeState", modifier: "chargeState"}, | ||
67 | {label: i18n("Current charge"), value: "chargePercent", unit: i18n("%"), precision: 0}, | 67 | {label: i18n("Current charge"), value: "chargePercent", unit: i18n("%"), precision: 0}, | ||
68 | {label: i18n("Health"), value: "capacity", unit: i18n("%"), precision: 0}, | 68 | {label: i18n("Health"), value: "capacity", unit: i18n("%"), precision: 0}, | ||
69 | {label: i18n("Vendor"), value: "vendor", source:"Vendor"}, | 69 | {label: i18n("Vendor"), value: "vendor", source:"Vendor"}, | ||
70 | {label: i18n("Model"), value: "model", source:"Product"}, | 70 | {label: i18n("Model"), value: "model", source:"Product"}, | ||
71 | {label: i18n("Serial Number"), value: "serial"} | 71 | {label: i18n("Serial Number"), value: "serial"}, | ||
72 | {label: i18n("Technology"), value: "technology", modifier: "technology"} | ||||
72 | ] | 73 | ] | ||
73 | }, | 74 | }, | ||
74 | { | 75 | { | ||
75 | title: i18n("Energy"), | 76 | title: i18n("Energy"), | ||
76 | data: [ | 77 | data: [ | ||
77 | {label: i18nc("current power draw from the battery in W", "Consumption"), value: "energyRate", unit: i18nc("Watt", "W"), precision: 2}, | 78 | {label: i18nc("current power draw from the battery in W", "Consumption"), value: "energyRate", unit: i18nc("Watt", "W"), precision: 2}, | ||
78 | {label: i18n("Voltage"), value: "voltage", unit: i18nc("Volt", "V"), precision: 2}, | 79 | {label: i18n("Voltage"), value: "voltage", unit: i18nc("Volt", "V"), precision: 2}, | ||
79 | {label: i18n("Remaining energy"), value: "energy", unit: i18nc("Watt-hours", "Wh"), precision: 2}, | 80 | {label: i18n("Remaining energy"), value: "energy", unit: i18nc("Watt-hours", "Wh"), precision: 2}, | ||
Show All 13 Lines | 93 | function modifier_chargeState(value) { | |||
93 | switch(value) { | 94 | switch(value) { | ||
94 | case 0: return i18n("Not charging") | 95 | case 0: return i18n("Not charging") | ||
95 | case 1: return i18n("Charging") | 96 | case 1: return i18n("Charging") | ||
96 | case 2: return i18n("Discharging") | 97 | case 2: return i18n("Discharging") | ||
97 | case 3: return i18n("Fully charged") | 98 | case 3: return i18n("Fully charged") | ||
98 | } | 99 | } | ||
99 | } | 100 | } | ||
100 | 101 | | |||
102 | function modifier_technology(value) { | ||||
103 | switch(value) { | ||||
104 | case 0: return i18n("Unknown Technology") | ||||
105 | case 1: return i18n("Lithium Ion") | ||||
106 | case 2: return i18n("Lithium Polymer") | ||||
107 | case 3: return i18n("Lithium Iron Phosphate") | ||||
108 | case 4: return i18n("LeadAcid") | ||||
109 | case 5: return i18n("Lead Acid") | ||||
110 | case 6: return i18n("Nickel Metal Hydride") | ||||
111 | } | ||||
112 | } | ||||
113 | | ||||
101 | implicitWidth: units.gridUnit * 30 | 114 | implicitWidth: units.gridUnit * 30 | ||
102 | implicitHeight: !!currentBattery ? units.gridUnit * 30 : units.gridUnit * 12 | 115 | implicitHeight: !!currentBattery ? units.gridUnit * 30 : units.gridUnit * 12 | ||
103 | 116 | | |||
104 | readonly property var timespanComboChoices: [i18n("Last hour"),i18n("Last 2 hours"),i18n("Last 12 hours"),i18n("Last 24 hours"),i18n("Last 48 hours"), i18n("Last 7 days")] | 117 | readonly property var timespanComboChoices: [i18n("Last hour"),i18n("Last 2 hours"),i18n("Last 12 hours"),i18n("Last 24 hours"),i18n("Last 48 hours"), i18n("Last 7 days")] | ||
105 | readonly property var timespanComboDurations: [3600, 7200, 43200, 86400, 172800, 604800] | 118 | readonly property var timespanComboDurations: [3600, 7200, 43200, 86400, 172800, 604800] | ||
106 | 119 | | |||
107 | ColumnLayout { | 120 | ColumnLayout { | ||
108 | id: column | 121 | id: column | ||
▲ Show 20 Lines • Show All 399 Lines • Show Last 20 Lines |