author | sandman <sandman> | 2002-10-29 15:44:30 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-10-29 15:44:30 (UTC) |
commit | 6224d462ef211b3b4cffa42d4a7f261caa92834b (patch) (unidiff) | |
tree | 7cb1ccbd7a3cf7c0340cc2283cd7b5040636fd4d | |
parent | f47abe11e3e0281fab06e2b4b9d23a2e35960a2c (diff) | |
download | opie-6224d462ef211b3b4cffa42d4a7f261caa92834b.zip opie-6224d462ef211b3b4cffa42d4a7f261caa92834b.tar.gz opie-6224d462ef211b3b4cffa42d4a7f261caa92834b.tar.bz2 |
- use sane default values for screensaver timeouts
- fixed the "Battery low warning" when plugging the device into AC
-rw-r--r-- | core/launcher/desktop.cpp | 20 | ||||
-rw-r--r-- | core/launcher/screensaver.cpp | 14 |
2 files changed, 17 insertions, 17 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 | |||
@@ -224,14 +224,14 @@ void DesktopApplication::apmTimeout() | |||
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 | } |
diff --git a/core/launcher/screensaver.cpp b/core/launcher/screensaver.cpp index 741591e..45da9ed 100644 --- a/core/launcher/screensaver.cpp +++ b/core/launcher/screensaver.cpp | |||
@@ -117,7 +117,7 @@ void OpieScreenSaver::setIntervals ( int i1, int i2, int i3 ) | |||
117 | if ( i1 < 0 ) | 117 | if ( i1 < 0 ) |
118 | i1 = config. readNumEntry ( "Dim", 30 ); | 118 | i1 = config. readNumEntry ( "Dim", m_on_ac ? 60 : 30 ); |
119 | if ( i2 < 0 ) | 119 | if ( i2 < 0 ) |
120 | i2 = config. readNumEntry ( "LightOff", 20 ); | 120 | i2 = config. readNumEntry ( "LightOff", m_on_ac ? 120 : 20 ); |
121 | if ( i3 < 0 ) | 121 | if ( i3 < 0 ) |
122 | i3 = config. readNumEntry ( "Suspend", 60 ); | 122 | i3 = config. readNumEntry ( "Suspend", m_on_ac ? 0 : 60 ); |
123 | 123 | ||
@@ -127,3 +127,3 @@ void OpieScreenSaver::setIntervals ( int i1, int i2, int i3 ) | |||
127 | m_enable_suspend_ac = ( i3 > 0 ); | 127 | m_enable_suspend_ac = ( i3 > 0 ); |
128 | m_onlylcdoff_ac = config.readNumEntry ( "LcdOffOnly", 0 ); | 128 | m_onlylcdoff_ac = config.readBoolEntry ( "LcdOffOnly", false ); |
129 | } | 129 | } |
@@ -133,3 +133,3 @@ void OpieScreenSaver::setIntervals ( int i1, int i2, int i3 ) | |||
133 | m_enable_suspend = ( i3 > 0 ); | 133 | m_enable_suspend = ( i3 > 0 ); |
134 | m_onlylcdoff = config.readNumEntry ( "LcdOffOnly", 0 ); | 134 | m_onlylcdoff = config.readBoolEntry ( "LcdOffOnly", false ); |
135 | } | 135 | } |
@@ -169,3 +169,3 @@ void OpieScreenSaver::setBacklight ( int bright ) | |||
169 | config. setGroup ( m_on_ac ? "AC" : "Battery" ); | 169 | config. setGroup ( m_on_ac ? "AC" : "Battery" ); |
170 | m_backlight_normal = config. readNumEntry ( "Brightness", 255 ); | 170 | m_backlight_normal = config. readNumEntry ( "Brightness", m_on_ac ? 255 : 127 ); |
171 | 171 | ||
@@ -173,3 +173,3 @@ void OpieScreenSaver::setBacklight ( int bright ) | |||
173 | 173 | ||
174 | qDebug ( "setBacklight: %d (ls: %d)", m_backlight_normal, m_use_light_sensor ? 1 : 0 ); | 174 | //qDebug ( "setBacklight: %d (ls: %d)", m_backlight_normal, m_use_light_sensor ? 1 : 0 ); |
175 | 175 | ||