author | sandman <sandman> | 2002-12-29 18:41:55 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-12-29 18:41:55 (UTC) |
commit | 7c3dceb16d9007e2c36b2b83e2a499cda3411138 (patch) (side-by-side diff) | |
tree | 78a0945be9233099ca7e5e4e01d8b78364f009cb | |
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 | ||||
-rw-r--r-- | core/launcher/desktop.h | 2 | ||||
-rw-r--r-- | core/settings/light-and-power/lightsettingsbase.ui | 20 |
3 files changed, 35 insertions, 21 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 ) { - - Config cfg( "apm" ); - cfg.setGroup( "Warnings" ); - //cfg.readNumEntry( "checkinterval", 10000 ) - m_powerVeryLow = cfg.readNumEntry( "powerverylow", 10 ); - m_powerCritical = cfg.readNumEntry( "powercritical", 5 ); - m_ps = new PowerStatus; @@ -188,5 +181,5 @@ DesktopApplication::DesktopApplication( int& argc, char **argv, Type appType ) - m_timer = new QTimer( this ); - connect( m_timer, SIGNAL( timeout() ), this, SLOT( apmTimeout() ) ); - m_timer->start( 5000 ); + m_apm_timer = new QTimer ( this ); + connect ( m_apm_timer, SIGNAL( timeout ( )), this, SLOT( apmTimeout ( ))); + reloadPowerWarnSettings ( ); @@ -228,3 +221,3 @@ void DesktopApplication::apmTimeout() { - qpedesktop->checkMemory(); // in case no events are being generated + qpedesktop-> checkMemory ( ); // in case no events are being generated @@ -298,10 +291,15 @@ void DesktopApplication::systemMessage( const QCString & msg, const QByteArray & -void DesktopApplication::reloadPowerWarnSettings() +void DesktopApplication::reloadPowerWarnSettings ( ) { - Config cfg( "apm" ); - cfg.setGroup( "Warnings" ); + Config cfg ( "apm" ); + cfg. setGroup ( "Warnings" ); - // m_timer->changeInterval( cfg.readNumEntry( "checkinterval", 10000 ) ); - m_powerVeryLow = cfg.readNumEntry( "powerverylow", 10 ); - m_powerCritical = cfg.readNumEntry( "powervcritical", 5 ); + int iv = cfg. readNumEntry ( "checkinterval", 10000 ); + + m_apm_timer-> stop ( ); + if ( iv ) + m_apm_timer-> start ( iv ); + + m_powerVeryLow = cfg. readNumEntry ( "powerverylow", 10 ); + m_powerCritical = cfg. readNumEntry ( "powervcritical", 5 ); } @@ -344,3 +342,3 @@ void DesktopApplication::sendHeldAction ( ) -void DesktopApplication::checkButtonAction ( const ODeviceButton *db, int keycode, bool press, bool autoRepeat ) +void DesktopApplication::checkButtonAction ( const ODeviceButton *db, int /*keycode*/, bool press, bool autoRepeat ) { diff --git a/core/launcher/desktop.h b/core/launcher/desktop.h index 6cb7ab2..db0173e 100644 --- a/core/launcher/desktop.h +++ b/core/launcher/desktop.h @@ -97,3 +97,3 @@ private: OpieScreenSaver *m_screensaver; - QTimer * m_timer; + QTimer * m_apm_timer; int m_powerVeryLow; diff --git a/core/settings/light-and-power/lightsettingsbase.ui b/core/settings/light-and-power/lightsettingsbase.ui index 309b95d..b583b5c 100644 --- a/core/settings/light-and-power/lightsettingsbase.ui +++ b/core/settings/light-and-power/lightsettingsbase.ui @@ -13,3 +13,3 @@ <y>0</y> - <width>371</width> + <width>367</width> <height>532</height> @@ -1064,2 +1064,10 @@ <property stdset="1"> + <name>specialValueText</name> + <string>never</string> + </property> + <property stdset="1"> + <name>wrapping</name> + <bool>true</bool> + </property> + <property stdset="1"> <name>buttonSymbols</name> @@ -1069,3 +1077,3 @@ <name>maxValue</name> - <number>60</number> + <number>300</number> </property> @@ -1073,2 +1081,10 @@ <name>minValue</name> + <number>0</number> + </property> + <property stdset="1"> + <name>lineStep</name> + <number>5</number> + </property> + <property stdset="1"> + <name>value</name> <number>5</number> |