Changeset View
Changeset View
Standalone View
Standalone View
applets/batterymonitor/package/contents/ui/batterymonitor.qml
Show First 20 Lines • Show All 96 Lines • ▼ Show 20 Line(s) | 30 | Item { | |||
---|---|---|---|---|---|
97 | 97 | | |||
98 | property var inhibitions: [] | 98 | property var inhibitions: [] | ||
99 | 99 | | |||
100 | readonly property var kcms: ["powerdevilprofilesconfig.desktop", | 100 | readonly property var kcms: ["powerdevilprofilesconfig.desktop", | ||
101 | "powerdevilactivitiesconfig.desktop", | 101 | "powerdevilactivitiesconfig.desktop", | ||
102 | "powerdevilglobalconfig.desktop"] | 102 | "powerdevilglobalconfig.desktop"] | ||
103 | readonly property bool kcmsAuthorized: KCMShell.authorize(batterymonitor.kcms).length > 0 | 103 | readonly property bool kcmsAuthorized: KCMShell.authorize(batterymonitor.kcms).length > 0 | ||
104 | 104 | | |||
105 | readonly property var kcm_energyinfo: ["kcm_energyinfo.desktop"] | ||||
106 | readonly property bool kcmEnergyInformationAuthorized: KCMShell.authorize(kcm_energyinfo).length > 0 | ||||
apol: Typo? kcm_energyinfo vs kcms_energyinfo | |||||
meven: Thanks | |||||
107 | | ||||
105 | onScreenBrightnessChanged: { | 108 | onScreenBrightnessChanged: { | ||
106 | if (disableBrightnessUpdate) { | 109 | if (disableBrightnessUpdate) { | ||
107 | return; | 110 | return; | ||
108 | } | 111 | } | ||
109 | var service = pmSource.serviceForSource("PowerDevil"); | 112 | var service = pmSource.serviceForSource("PowerDevil"); | ||
110 | var operation = service.operationDescription("setBrightness"); | 113 | var operation = service.operationDescription("setBrightness"); | ||
111 | operation.brightness = screenBrightness; | 114 | operation.brightness = screenBrightness; | ||
112 | // show OSD only when the plasmoid isn't expanded since the moving slider is feedback enough | 115 | // show OSD only when the plasmoid isn't expanded since the moving slider is feedback enough | ||
Show All 10 Lines | 119 | onKeyboardBrightnessChanged: { | |||
123 | operation.silent = plasmoid.expanded | 126 | operation.silent = plasmoid.expanded | ||
124 | service.startOperationCall(operation); | 127 | service.startOperationCall(operation); | ||
125 | } | 128 | } | ||
126 | 129 | | |||
127 | function action_powerdevilkcm() { | 130 | function action_powerdevilkcm() { | ||
128 | KCMShell.open(batterymonitor.kcms); | 131 | KCMShell.open(batterymonitor.kcms); | ||
129 | } | 132 | } | ||
130 | 133 | | |||
134 | function action_energyinformationkcm() { | ||||
135 | KCMShell.open(batterymonitor.kcm_energyinfo); | ||||
136 | } | ||||
137 | | ||||
131 | Component.onCompleted: { | 138 | Component.onCompleted: { | ||
132 | Logic.updateBrightness(batterymonitor, pmSource); | 139 | Logic.updateBrightness(batterymonitor, pmSource); | ||
133 | Logic.updateInhibitions(batterymonitor, pmSource) | 140 | Logic.updateInhibitions(batterymonitor, pmSource) | ||
134 | 141 | | |||
142 | if (batterymonitor.kcmEnergyInformationAuthorized) { | ||||
143 | plasmoid.setAction("energyinformationkcm", i18n("&Show Energy Information..."), "battery"); | ||||
Generally we start menu items with action verbs. And in this case we don't need ellipsis because no further input from the user is required as a part of the action. See https://hig.kde.org/style/writing/labels.html#using-ellipses-in-labels So for this string, I would recommend "Show Energy Information" ngraham: Generally we start menu items with action verbs. And in this case we don't need ellipsis… | |||||
meven: Thanks for pointing it out. | |||||
ngraham: Not fixed yet. The text needs to be "Show Energy Information..." | |||||
144 | } | ||||
135 | if (batterymonitor.kcmsAuthorized) { | 145 | if (batterymonitor.kcmsAuthorized) { | ||
136 | plasmoid.setAction("powerdevilkcm", i18n("&Configure Power Saving..."), "preferences-system-power-management"); | 146 | plasmoid.setAction("powerdevilkcm", i18n("&Configure Power Saving..."), "preferences-system-power-management"); | ||
broulik: This should be in a check for `kcmEnergyInformationAuthorized` | |||||
137 | } | 147 | } | ||
138 | } | 148 | } | ||
139 | 149 | | |||
140 | Plasmoid.compactRepresentation: CompactRepresentation { | 150 | Plasmoid.compactRepresentation: CompactRepresentation { | ||
141 | property int wheelDelta: 0 | 151 | property int wheelDelta: 0 | ||
142 | 152 | | |||
143 | onEntered: wheelDelta = 0 | 153 | onEntered: wheelDelta = 0 | ||
144 | onExited: wheelDelta = 0 | 154 | onExited: wheelDelta = 0 | ||
▲ Show 20 Lines • Show All 100 Lines • Show Last 20 Lines |
Typo? kcm_energyinfo vs kcms_energyinfo