author | harlekin <harlekin> | 2002-10-23 22:30:45 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-10-23 22:30:45 (UTC) |
commit | fc14573b3327d3087416fe158efaf09568260e55 (patch) (side-by-side diff) | |
tree | 0bfa334fe27f9967c8432f5bc4c8481cea526e49 | |
parent | f5ee7b6584fe8c6e03494a241e30854cd658bb71 (diff) | |
download | opie-fc14573b3327d3087416fe158efaf09568260e55.zip opie-fc14573b3327d3087416fe158efaf09568260e55.tar.gz opie-fc14573b3327d3087416fe158efaf09568260e55.tar.bz2 |
thanks go to the programming god to point some bool alg stuff to me .-)
-rw-r--r-- | core/launcher/desktop.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp index c4c6050..986ae5d 100644 --- a/core/launcher/desktop.cpp +++ b/core/launcher/desktop.cpp @@ -194,53 +194,53 @@ public: bool onAC = ( PowerStatusManager::readStatus().acStatus() == PowerStatus::Online ); switch ( level ) { case 0: if ( m_disable_suspend_ac > 0 && m_enable_dim_ac && onAC ) { if ( m_backlight_current > 1 ) setBacklight( 1 ); // lowest non-off - } else if ( m_disable_suspend > 0 && m_enable_dim ) { + } else if ( !onAC && m_disable_suspend > 0 && m_enable_dim ) { if ( m_backlight_current > 1 ) setBacklightInternal( 1 ); // lowest non-off } return true; break; case 1: if ( m_disable_suspend_ac > 1 && m_enable_lightoff_ac && onAC ) { setBacklightInternal( 0 ); // off - } else if ( m_disable_suspend > 1 && m_enable_lightoff ) { + } else if ( !onAC && m_disable_suspend > 1 && m_enable_lightoff ) { setBacklightInternal( 0 ); // off } return true; break; case 2: if ( m_disable_apm_ac && onAC ) { return true; } if ( m_enable_onlylcdoff_ac && onAC ) { ODevice::inst ( ) -> setDisplayStatus ( false ); m_lcd_status = false; return true; } - else if ( m_enable_onlylcdoff ) { + else if ( !onAC && m_enable_onlylcdoff ) { ODevice::inst ( ) -> setDisplayStatus ( false ); m_lcd_status = false; return true; } else // We're going to suspend the whole machine { if ( ( m_disable_suspend_ac > 2 && onAC ) && ( !Network::networkOnline ( ) ) ) { QWSServer::sendKeyEvent( 0xffff, Qt::Key_F34, FALSE, TRUE, FALSE ); return true; } - if ( ( m_disable_suspend > 2 ) && ( !Network::networkOnline ( ) ) ) { + if ( !onAC && ( m_disable_suspend > 2 ) && ( !Network::networkOnline ( ) ) ) { QWSServer::sendKeyEvent( 0xffff, Qt::Key_F34, FALSE, TRUE, FALSE ); return true; } } break; } return false; } @@ -640,27 +640,27 @@ bool DesktopApplication::qwsEventFilter( QWSEvent *e ) void DesktopApplication::psTimeout( int batRemaining ) { *ps = PowerStatusManager::readStatus(); // maybe now since its triggered by apm change there might be to few warnings // if ( ( ps->batteryStatus() == PowerStatus::VeryLow ) ) { if ( ( batRemaining == m_powerVeryLow ) ) { - pa->alert( tr( "Battery is running very low." ), 6 ); + pa->alert( tr( "Battery is running very low." ), 2 ); } // if ( ps->batteryStatus() == PowerStatus::Critical ) { if ( batRemaining == m_powerCritical ) { pa->alert( tr( "Battery level is critical!\n" "Keep power off until power restored!" ), 1 ); } if ( ps->backupBatteryStatus() == PowerStatus::VeryLow ) { - pa->alert( tr( "The Back-up battery is very low.\nPlease charge the back-up battery." ), 3 ); + pa->alert( tr( "The Back-up battery is very low.\nPlease charge the back-up battery." ), 2 ); } } void DesktopApplication::apmTimeout() { qpedesktop->checkMemory(); // in case no events are being generated *ps = PowerStatusManager::readStatus(); |