Changeset View
Changeset View
Standalone View
Standalone View
daemon/actions/bundled/handlebuttonevents.cpp
Show First 20 Lines • Show All 132 Lines • ▼ Show 20 Line(s) | 126 | case BackendInterface::LidClose: | |||
---|---|---|---|---|---|
133 | break; | 133 | break; | ||
134 | case BackendInterface::LidOpen: | 134 | case BackendInterface::LidOpen: | ||
135 | // In this case, let's send a wakeup event | 135 | // In this case, let's send a wakeup event | ||
136 | KIdleTime::instance()->simulateUserActivity(); | 136 | KIdleTime::instance()->simulateUserActivity(); | ||
137 | break; | 137 | break; | ||
138 | case BackendInterface::PowerButton: | 138 | case BackendInterface::PowerButton: | ||
139 | processAction(m_powerButtonAction); | 139 | processAction(m_powerButtonAction); | ||
140 | break; | 140 | break; | ||
141 | case BackendInterface::PowerDownButton: | ||||
142 | processAction(m_powerDownButtonAction); | ||||
143 | break; | ||||
141 | case BackendInterface::SleepButton: | 144 | case BackendInterface::SleepButton: | ||
142 | processAction(m_sleepButtonAction); | 145 | processAction(m_sleepButtonAction); | ||
143 | break; | 146 | break; | ||
144 | case BackendInterface::HibernateButton: | 147 | case BackendInterface::HibernateButton: | ||
145 | processAction(m_hibernateButtonAction); | 148 | processAction(m_hibernateButtonAction); | ||
146 | break; | 149 | break; | ||
147 | default: | 150 | default: | ||
148 | break; | 151 | break; | ||
Show All 40 Lines | |||||
189 | } | 192 | } | ||
190 | 193 | | |||
191 | bool HandleButtonEvents::loadAction(const KConfigGroup& config) | 194 | bool HandleButtonEvents::loadAction(const KConfigGroup& config) | ||
192 | { | 195 | { | ||
193 | // Read configs | 196 | // Read configs | ||
194 | m_lidAction = config.readEntry<uint>("lidAction", 0); | 197 | m_lidAction = config.readEntry<uint>("lidAction", 0); | ||
195 | m_triggerLidActionWhenExternalMonitorPresent = config.readEntry<bool>("triggerLidActionWhenExternalMonitorPresent", false); | 198 | m_triggerLidActionWhenExternalMonitorPresent = config.readEntry<bool>("triggerLidActionWhenExternalMonitorPresent", false); | ||
196 | m_powerButtonAction = config.readEntry<uint>("powerButtonAction", 0); | 199 | m_powerButtonAction = config.readEntry<uint>("powerButtonAction", 0); | ||
200 | m_powerDownButtonAction = config.readEntry<uint>("powerDownAction", 0); | ||||
197 | 201 | | |||
198 | checkOutputs(); | 202 | checkOutputs(); | ||
199 | 203 | | |||
200 | return true; | 204 | return true; | ||
201 | } | 205 | } | ||
202 | 206 | | |||
203 | int HandleButtonEvents::lidAction() const | 207 | int HandleButtonEvents::lidAction() const | ||
204 | { | 208 | { | ||
▲ Show 20 Lines • Show All 62 Lines • Show Last 20 Lines |