summaryrefslogtreecommitdiff
Side-by-side diff
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
@@ -224,14 +224,14 @@ void DesktopApplication::apmTimeout()
- int bat = m_ps-> batteryPercentRemaining ( );
-
- if ( m_ps_last-> batteryPercentRemaining ( ) != bat ) {
- if ( bat <= m_powerCritical )
- pa->alert( tr( "Battery level is critical!\nKeep power off until power restored!" ), 1 );
- else if ( bat <= m_powerVeryLow )
- pa->alert( tr( "Battery is running very low." ), 2 );
-
-
+ if ( m_ps-> acStatus ( ) != PowerStatus::Online ) {
+ int bat = m_ps-> batteryPercentRemaining ( );
+
+ if ( bat < m_ps_last-> batteryPercentRemaining ( )) {
+ if ( bat <= m_powerCritical )
+ pa->alert( tr( "Battery level is critical!\nKeep power off until power restored!" ), 1 );
+ else if ( bat <= m_powerVeryLow )
+ pa->alert( tr( "Battery is running very low." ), 2 );
+ }
if ( m_ps-> backupBatteryStatus ( ) == PowerStatus::VeryLow )
pa->alert( tr( "The Back-up battery is very low.\nPlease charge the back-up battery." ), 2 );
- }
+ }
}
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 )
if ( i1 < 0 )
- i1 = config. readNumEntry ( "Dim", 30 );
+ i1 = config. readNumEntry ( "Dim", m_on_ac ? 60 : 30 );
if ( i2 < 0 )
- i2 = config. readNumEntry ( "LightOff", 20 );
+ i2 = config. readNumEntry ( "LightOff", m_on_ac ? 120 : 20 );
if ( i3 < 0 )
- i3 = config. readNumEntry ( "Suspend", 60 );
+ i3 = config. readNumEntry ( "Suspend", m_on_ac ? 0 : 60 );
@@ -127,3 +127,3 @@ void OpieScreenSaver::setIntervals ( int i1, int i2, int i3 )
m_enable_suspend_ac = ( i3 > 0 );
- m_onlylcdoff_ac = config.readNumEntry ( "LcdOffOnly", 0 );
+ m_onlylcdoff_ac = config.readBoolEntry ( "LcdOffOnly", false );
}
@@ -133,3 +133,3 @@ void OpieScreenSaver::setIntervals ( int i1, int i2, int i3 )
m_enable_suspend = ( i3 > 0 );
- m_onlylcdoff = config.readNumEntry ( "LcdOffOnly", 0 );
+ m_onlylcdoff = config.readBoolEntry ( "LcdOffOnly", false );
}
@@ -169,3 +169,3 @@ void OpieScreenSaver::setBacklight ( int bright )
config. setGroup ( m_on_ac ? "AC" : "Battery" );
- m_backlight_normal = config. readNumEntry ( "Brightness", 255 );
+ m_backlight_normal = config. readNumEntry ( "Brightness", m_on_ac ? 255 : 127 );
@@ -173,3 +173,3 @@ void OpieScreenSaver::setBacklight ( int bright )
- qDebug ( "setBacklight: %d (ls: %d)", m_backlight_normal, m_use_light_sensor ? 1 : 0 );
+// qDebug ( "setBacklight: %d (ls: %d)", m_backlight_normal, m_use_light_sensor ? 1 : 0 );