author | mickeyl <mickeyl> | 2003-11-20 14:11:45 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-11-20 14:11:45 (UTC) |
commit | f43e28fe8f226039d96ebda4e6c4d26e4f3320ba (patch) (unidiff) | |
tree | 3a312c1333e53b0c674c3b1a682226dd80917f5c | |
parent | ae9e1ed9cc9e65c1ffb28f3b75ff499e18c6b31a (diff) | |
download | opie-f43e28fe8f226039d96ebda4e6c4d26e4f3320ba.zip opie-f43e28fe8f226039d96ebda4e6c4d26e4f3320ba.tar.gz opie-f43e28fe8f226039d96ebda4e6c4d26e4f3320ba.tar.bz2 |
fix battery message box text wrapping
patch courtesy of Matthias Hentges - thanks.
-rw-r--r-- | core/launcher/serverapp.cpp | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/core/launcher/serverapp.cpp b/core/launcher/serverapp.cpp index 23a7f95..e8d49fd 100644 --- a/core/launcher/serverapp.cpp +++ b/core/launcher/serverapp.cpp | |||
@@ -371,4 +371,5 @@ void ServerApplication::apmTimeout() { | |||
371 | 371 | ||
372 | if ( m_ps->acStatus() == PowerStatus::Online ) | 372 | if ( m_ps->acStatus() == PowerStatus::Online ) { |
373 | return; | 373 | return; |
374 | } | ||
374 | 375 | ||
@@ -377,10 +378,27 @@ void ServerApplication::apmTimeout() { | |||
377 | if ( bat < m_ps_last-> batteryPercentRemaining() ) { | 378 | if ( bat < m_ps_last-> batteryPercentRemaining() ) { |
378 | if ( bat <= m_powerCritical ) | 379 | if ( bat <= m_powerCritical ) { |
379 | pa->alert( tr( "Battery level is critical!\nKeep power off until power restored!" ), 1 ); | 380 | QMessageBox battlow( |
380 | else if ( bat <= m_powerVeryLow ) | 381 | tr("WARNING"), |
381 | pa->alert( tr( "Battery is running very low. "), 2 ); | 382 | tr("<p>The battery level is critical!" |
383 | "<p>Keep power off until AC is restored"), | ||
384 | QMessageBox::Warning, | ||
385 | QMessageBox::Cancel, QMessageBox::NoButton, QMessageBox::NoButton, | ||
386 | 0, QString::null, TRUE, WStyle_StaysOnTop); | ||
387 | battlow.setButtonText(QMessageBox::Cancel, tr("Ok")); | ||
388 | battlow.exec(); | ||
389 | } else if ( bat <= m_powerVeryLow ) | ||
390 | pa->alert( tr( "The battery is running very low. "), 2 ); | ||
391 | } | ||
392 | |||
393 | if ( m_ps-> backupBatteryStatus() == PowerStatus::VeryLow ) { | ||
394 | QMessageBox battlow( | ||
395 | tr("WARNING"), | ||
396 | tr("<p>The Back-up battery is very low" | ||
397 | "<p>Please charge the back-up battery"), | ||
398 | QMessageBox::Warning, | ||
399 | QMessageBox::Cancel, QMessageBox::NoButton, QMessageBox::NoButton, | ||
400 | 0, QString::null, TRUE, WStyle_StaysOnTop); | ||
401 | battlow.setButtonText(QMessageBox::Cancel, tr("Ok")); | ||
402 | battlow.exec(); | ||
382 | } | 403 | } |
383 | if ( m_ps-> backupBatteryStatus() == PowerStatus::VeryLow ) | ||
384 | pa->alert( tr("The Back-up battery is very low.\nPlease charge the back-up battery." ), 2); | ||
385 | |||
386 | } | 404 | } |