-rw-r--r-- | core/launcher/desktop.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp index bc43475..f2e00d8 100644 --- a/core/launcher/desktop.cpp +++ b/core/launcher/desktop.cpp | |||
@@ -213,36 +213,36 @@ DesktopApplication::~DesktopApplication() | |||
213 | } | 213 | } |
214 | 214 | ||
215 | void DesktopApplication::apmTimeout() | 215 | void DesktopApplication::apmTimeout() |
216 | { | 216 | { |
217 | qpedesktop->checkMemory(); // in case no events are being generated | 217 | qpedesktop->checkMemory(); // in case no events are being generated |
218 | 218 | ||
219 | *m_ps_last = *m_ps; | 219 | *m_ps_last = *m_ps; |
220 | *m_ps = PowerStatusManager::readStatus(); | 220 | *m_ps = PowerStatusManager::readStatus(); |
221 | 221 | ||
222 | if ( m_ps-> acStatus ( ) != m_ps_last-> acStatus ( )) | 222 | if ( m_ps-> acStatus ( ) != m_ps_last-> acStatus ( )) |
223 | m_screensaver-> powerStatusChanged ( *m_ps ); | 223 | m_screensaver-> powerStatusChanged ( *m_ps ); |
224 | 224 | ||
225 | int bat = m_ps-> batteryPercentRemaining ( ); | 225 | if ( m_ps-> acStatus ( ) != PowerStatus::Online ) { |
226 | 226 | int bat = m_ps-> batteryPercentRemaining ( ); | |
227 | if ( m_ps_last-> batteryPercentRemaining ( ) != bat ) { | 227 | |
228 | if ( bat <= m_powerCritical ) | 228 | if ( bat < m_ps_last-> batteryPercentRemaining ( )) { |
229 | pa->alert( tr( "Battery level is critical!\nKeep power off until power restored!" ), 1 ); | 229 | if ( bat <= m_powerCritical ) |
230 | else if ( bat <= m_powerVeryLow ) | 230 | pa->alert( tr( "Battery level is critical!\nKeep power off until power restored!" ), 1 ); |
231 | pa->alert( tr( "Battery is running very low." ), 2 ); | 231 | else if ( bat <= m_powerVeryLow ) |
232 | 232 | pa->alert( tr( "Battery is running very low." ), 2 ); | |
233 | 233 | } | |
234 | if ( m_ps-> backupBatteryStatus ( ) == PowerStatus::VeryLow ) | 234 | if ( m_ps-> backupBatteryStatus ( ) == PowerStatus::VeryLow ) |
235 | pa->alert( tr( "The Back-up battery is very low.\nPlease charge the back-up battery." ), 2 ); | 235 | pa->alert( tr( "The Back-up battery is very low.\nPlease charge the back-up battery." ), 2 ); |
236 | } | 236 | } |
237 | } | 237 | } |
238 | 238 | ||
239 | void DesktopApplication::desktopMessage( const QCString &msg, const QByteArray &data ) | 239 | void DesktopApplication::desktopMessage( const QCString &msg, const QByteArray &data ) |
240 | { | 240 | { |
241 | QDataStream stream( data, IO_ReadOnly ); | 241 | QDataStream stream( data, IO_ReadOnly ); |
242 | if ( msg == "keyRegister(int key, QString channel, QString message)" ) { | 242 | if ( msg == "keyRegister(int key, QString channel, QString message)" ) { |
243 | int k; | 243 | int k; |
244 | QString c, m; | 244 | QString c, m; |
245 | stream >> k; | 245 | stream >> k; |
246 | stream >> c; | 246 | stream >> c; |
247 | stream >> m; | 247 | stream >> m; |
248 | 248 | ||