summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/desktop.cpp20
-rw-r--r--core/launcher/screensaver.cpp14
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
@@ -223,16 +223,16 @@ void DesktopApplication::apmTimeout()
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
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
@@ -116,9 +116,9 @@ void OpieScreenSaver::setIntervals ( int i1, int i2, int i3 )
116 int v[ 4 ]; 116 int v[ 4 ];
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
124 if ( m_on_ac ) { 124 if ( m_on_ac ) {
@@ -126,5 +126,5 @@ void OpieScreenSaver::setIntervals ( int i1, int i2, int i3 )
126 m_enable_lightoff_ac = ( i2 > 0 ); 126 m_enable_lightoff_ac = ( i2 > 0 );
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 }
130 else { 130 else {
@@ -132,5 +132,5 @@ void OpieScreenSaver::setIntervals ( int i1, int i2, int i3 )
132 m_enable_lightoff = ( i2 > 0 ); 132 m_enable_lightoff = ( i2 > 0 );
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 }
136 136
@@ -168,9 +168,9 @@ void OpieScreenSaver::setBacklight ( int bright )
168 Config config ( "apm" ); 168 Config config ( "apm" );
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
172 m_use_light_sensor = config. readBoolEntry ( "LightSensor", false ); 172 m_use_light_sensor = config. readBoolEntry ( "LightSensor", false );
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
176 killTimers ( ); 176 killTimers ( );