Changeset View
Changeset View
Standalone View
Standalone View
applets/batterymonitor/package/contents/ui/batterymonitor.qml
Show First 20 Lines • Show All 99 Lines • ▼ Show 20 Line(s) | 30 | Item { | |||
---|---|---|---|---|---|
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"] | 105 | readonly property var kcm_energyinfo: ["kcm_energyinfo.desktop"] | ||
106 | readonly property bool kcmEnergyInformationAuthorized: KCMShell.authorize(kcm_energyinfo).length > 0 | 106 | readonly property bool kcmEnergyInformationAuthorized: KCMShell.authorize(kcm_energyinfo).length > 0 | ||
107 | 107 | | |||
108 | property QtObject updateScreenBrightnessJob | ||||
108 | onScreenBrightnessChanged: { | 109 | onScreenBrightnessChanged: { | ||
broulik: Should we not forward the notion of "moved" here, too? | |||||
109 | if (disableBrightnessUpdate) { | 110 | if (disableBrightnessUpdate) { | ||
110 | return; | 111 | return; | ||
111 | } | 112 | } | ||
112 | var service = pmSource.serviceForSource("PowerDevil"); | 113 | var service = pmSource.serviceForSource("PowerDevil"); | ||
113 | var operation = service.operationDescription("setBrightness"); | 114 | var operation = service.operationDescription("setBrightness"); | ||
114 | operation.brightness = screenBrightness; | 115 | operation.brightness = screenBrightness; | ||
115 | // show OSD only when the plasmoid isn't expanded since the moving slider is feedback enough | 116 | // show OSD only when the plasmoid isn't expanded since the moving slider is feedback enough | ||
116 | operation.silent = plasmoid.expanded | 117 | operation.silent = plasmoid.expanded | ||
117 | service.startOperationCall(operation); | 118 | updateScreenBrightnessJob = service.startOperationCall(operation); | ||
119 | updateScreenBrightnessJob.finished.connect(function(job) { | ||||
120 | Logic.updateBrightness(batterymonitor, pmSource); | ||||
121 | }); | ||||
118 | } | 122 | } | ||
123 | | ||||
124 | property QtObject updateKeyboardBrightnessJob | ||||
119 | onKeyboardBrightnessChanged: { | 125 | onKeyboardBrightnessChanged: { | ||
120 | if (disableBrightnessUpdate) { | 126 | if (disableBrightnessUpdate) { | ||
121 | return; | 127 | return; | ||
122 | } | 128 | } | ||
123 | var service = pmSource.serviceForSource("PowerDevil"); | 129 | var service = pmSource.serviceForSource("PowerDevil"); | ||
124 | var operation = service.operationDescription("setKeyboardBrightness"); | 130 | var operation = service.operationDescription("setKeyboardBrightness"); | ||
125 | operation.brightness = keyboardBrightness; | 131 | operation.brightness = keyboardBrightness; | ||
126 | operation.silent = plasmoid.expanded | 132 | operation.silent = plasmoid.expanded | ||
127 | service.startOperationCall(operation); | 133 | updateKeyboardBrightnessJob = service.startOperationCall(operation); | ||
134 | updateKeyboardBrightnessJob.finished.connect(function(job) { | ||||
135 | Logic.updateBrightness(batterymonitor, pmSource); | ||||
136 | }); | ||||
128 | } | 137 | } | ||
129 | 138 | | |||
130 | function action_powerdevilkcm() { | 139 | function action_powerdevilkcm() { | ||
131 | KCMShell.open(batterymonitor.kcms); | 140 | KCMShell.open(batterymonitor.kcms); | ||
132 | } | 141 | } | ||
133 | 142 | | |||
134 | function action_energyinformationkcm() { | 143 | function action_energyinformationkcm() { | ||
135 | KCMShell.open(batterymonitor.kcm_energyinfo); | 144 | KCMShell.open(batterymonitor.kcm_energyinfo); | ||
▲ Show 20 Lines • Show All 119 Lines • Show Last 20 Lines |
Should we not forward the notion of "moved" here, too?