author | sandman <sandman> | 2002-12-29 18:41:55 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-12-29 18:41:55 (UTC) |
commit | 7c3dceb16d9007e2c36b2b83e2a499cda3411138 (patch) (unidiff) | |
tree | 78a0945be9233099ca7e5e4e01d8b78364f009cb /core/launcher/desktop.cpp | |
parent | f8673391881545af514054babe47fdc162770a72 (diff) | |
download | opie-7c3dceb16d9007e2c36b2b83e2a499cda3411138.zip opie-7c3dceb16d9007e2c36b2b83e2a499cda3411138.tar.gz opie-7c3dceb16d9007e2c36b2b83e2a499cda3411138.tar.bz2 |
Power warning changes:
- interval can now be in the range (0 [Never] ... 300 [5min] )
- some code cleanup in the launcher
-rw-r--r-- | core/launcher/desktop.cpp | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp index fa9736f..03a23dc 100644 --- a/core/launcher/desktop.cpp +++ b/core/launcher/desktop.cpp | |||
@@ -177,9 +177,2 @@ DesktopApplication::DesktopApplication( int& argc, char **argv, Type appType ) | |||
177 | { | 177 | { |
178 | |||
179 | Config cfg( "apm" ); | ||
180 | cfg.setGroup( "Warnings" ); | ||
181 | //cfg.readNumEntry( "checkinterval", 10000 ) | ||
182 | m_powerVeryLow = cfg.readNumEntry( "powerverylow", 10 ); | ||
183 | m_powerCritical = cfg.readNumEntry( "powercritical", 5 ); | ||
184 | |||
185 | m_ps = new PowerStatus; | 178 | m_ps = new PowerStatus; |
@@ -188,5 +181,5 @@ DesktopApplication::DesktopApplication( int& argc, char **argv, Type appType ) | |||
188 | 181 | ||
189 | m_timer = new QTimer( this ); | 182 | m_apm_timer = new QTimer ( this ); |
190 | connect( m_timer, SIGNAL( timeout() ), this, SLOT( apmTimeout() ) ); | 183 | connect ( m_apm_timer, SIGNAL( timeout ( )), this, SLOT( apmTimeout ( ))); |
191 | m_timer->start( 5000 ); | 184 | reloadPowerWarnSettings ( ); |
192 | 185 | ||
@@ -228,3 +221,3 @@ void DesktopApplication::apmTimeout() | |||
228 | { | 221 | { |
229 | qpedesktop->checkMemory(); // in case no events are being generated | 222 | qpedesktop-> checkMemory ( ); // in case no events are being generated |
230 | 223 | ||
@@ -298,10 +291,15 @@ void DesktopApplication::systemMessage( const QCString & msg, const QByteArray & | |||
298 | 291 | ||
299 | void DesktopApplication::reloadPowerWarnSettings() | 292 | void DesktopApplication::reloadPowerWarnSettings ( ) |
300 | { | 293 | { |
301 | Config cfg( "apm" ); | 294 | Config cfg ( "apm" ); |
302 | cfg.setGroup( "Warnings" ); | 295 | cfg. setGroup ( "Warnings" ); |
303 | 296 | ||
304 | // m_timer->changeInterval( cfg.readNumEntry( "checkinterval", 10000 ) ); | 297 | int iv = cfg. readNumEntry ( "checkinterval", 10000 ); |
305 | m_powerVeryLow = cfg.readNumEntry( "powerverylow", 10 ); | 298 | |
306 | m_powerCritical = cfg.readNumEntry( "powervcritical", 5 ); | 299 | m_apm_timer-> stop ( ); |
300 | if ( iv ) | ||
301 | m_apm_timer-> start ( iv ); | ||
302 | |||
303 | m_powerVeryLow = cfg. readNumEntry ( "powerverylow", 10 ); | ||
304 | m_powerCritical = cfg. readNumEntry ( "powervcritical", 5 ); | ||
307 | } | 305 | } |
@@ -344,3 +342,3 @@ void DesktopApplication::sendHeldAction ( ) | |||
344 | 342 | ||
345 | void DesktopApplication::checkButtonAction ( const ODeviceButton *db, int keycode, bool press, bool autoRepeat ) | 343 | void DesktopApplication::checkButtonAction ( const ODeviceButton *db, int /*keycode*/, bool press, bool autoRepeat ) |
346 | { | 344 | { |