summaryrefslogtreecommitdiff
authorharlekin <harlekin>2002-10-23 22:48:00 (UTC)
committer harlekin <harlekin>2002-10-23 22:48:00 (UTC)
commit2e08979f61e2008fed1a9deca6f3995795ef46e4 (patch) (unidiff)
tree1cba694f8855819f338e75be1f374ca00156cb70
parent12c59f8b81dc83ec3a5b71f31dcdfeb9ba7d3002 (diff)
downloadopie-2e08979f61e2008fed1a9deca6f3995795ef46e4.zip
opie-2e08979f61e2008fed1a9deca6f3995795ef46e4.tar.gz
opie-2e08979f61e2008fed1a9deca6f3995795ef46e4.tar.bz2
load ac settings on startup
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/desktop.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp
index 986ae5d..2ea6d27 100644
--- a/core/launcher/desktop.cpp
+++ b/core/launcher/desktop.cpp
@@ -294,48 +294,49 @@ public:
294 i1 = ssi( i1, config, "DimAC", "Interval_DimAC", 30 ); 294 i1 = ssi( i1, config, "DimAC", "Interval_DimAC", 30 );
295 i2 = ssi( i2, config, "LightOffAC", "Interval_LightOffAC", 20 ); 295 i2 = ssi( i2, config, "LightOffAC", "Interval_LightOffAC", 20 );
296 i3 = ssi( i3, config, "", "IntervalAC", 60 ); 296 i3 = ssi( i3, config, "", "IntervalAC", 60 );
297 297
298 //qDebug("screen saver intervals: %d %d %d", i1, i2, i3); 298 //qDebug("screen saver intervals: %d %d %d", i1, i2, i3);
299 299
300 v [ 0 ] = QMAX( 1000 * i1, 100 ); 300 v [ 0 ] = QMAX( 1000 * i1, 100 );
301 v [ 1 ] = QMAX( 1000 * i2, 100 ); 301 v [ 1 ] = QMAX( 1000 * i2, 100 );
302 v [ 2 ] = QMAX( 1000 * i3, 100 ); 302 v [ 2 ] = QMAX( 1000 * i3, 100 );
303 v [ 3 ] = 0; 303 v [ 3 ] = 0;
304 m_enable_dim_ac = ( ( i1 != 0 ) ? config.readNumEntry ( "DimAC", 1 ) : false ); 304 m_enable_dim_ac = ( ( i1 != 0 ) ? config.readNumEntry ( "DimAC", 1 ) : false );
305 m_enable_lightoff_ac = ( ( i2 != 0 ) ? config.readNumEntry ( "LightOffAC", 1 ) : false ); 305 m_enable_lightoff_ac = ( ( i2 != 0 ) ? config.readNumEntry ( "LightOffAC", 1 ) : false );
306 m_enable_onlylcdoff_ac = config.readNumEntry ( "LcdOffOnlyAC", 0 ); 306 m_enable_onlylcdoff_ac = config.readNumEntry ( "LcdOffOnlyAC", 0 );
307 m_disable_apm_ac = config.readNumEntry ( "NoApmAC", 0 ); 307 m_disable_apm_ac = config.readNumEntry ( "NoApmAC", 0 );
308 308
309 if ( !i1 && !i2 && !i3 ) 309 if ( !i1 && !i2 && !i3 )
310 QWSServer::setScreenSaverInterval( 0 ); 310 QWSServer::setScreenSaverInterval( 0 );
311 else 311 else
312 QWSServer::setScreenSaverIntervals( v ); 312 QWSServer::setScreenSaverIntervals( v );
313 } 313 }
314 314
315 void setInterval ( int interval ) 315 void setInterval ( int interval )
316 { 316 {
317 setIntervals ( -1, -1, interval ); 317 setIntervals ( -1, -1, interval );
318 setIntervalsAC ( -1, -1, interval );
318 } 319 }
319 320
320 void setMode ( int mode ) 321 void setMode ( int mode )
321 { 322 {
322 if ( mode > m_disable_suspend ) 323 if ( mode > m_disable_suspend )
323 setInterval( -1 ); 324 setInterval( -1 );
324 m_disable_suspend = mode; 325 m_disable_suspend = mode;
325 } 326 }
326 327
327 void setBacklight ( int bright ) 328 void setBacklight ( int bright )
328 { 329 {
329 // Read from config 330 // Read from config
330 Config config ( "qpe" ); 331 Config config ( "qpe" );
331 config. setGroup ( "Screensaver" ); 332 config. setGroup ( "Screensaver" );
332 m_backlight_normal = config. readNumEntry ( "Brightness", 255 ); 333 m_backlight_normal = config. readNumEntry ( "Brightness", 255 );
333 334
334 setBacklightInternal ( bright ); 335 setBacklightInternal ( bright );
335 } 336 }
336 337
337private: 338private:
338 void setBacklightInternal ( int bright ) 339 void setBacklightInternal ( int bright )
339 { 340 {
340 if ( bright == -3 ) { 341 if ( bright == -3 ) {
341 // Forced on 342 // Forced on