-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 @@ -175,20 +175,13 @@ void DesktopApplication::switchLCD ( bool on ) DesktopApplication::DesktopApplication( int& argc, char **argv, Type appType ) : QPEApplication( argc, argv, 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; m_ps_last = new PowerStatus; pa = new DesktopPowerAlerter( 0 ); - 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 ( ); m_last_button = 0; m_button_timer = new QTimer ( ); @@ -226,7 +219,7 @@ DesktopApplication::~DesktopApplication() void DesktopApplication::apmTimeout() { - qpedesktop->checkMemory(); // in case no events are being generated + qpedesktop-> checkMemory ( ); // in case no events are being generated *m_ps_last = *m_ps; *m_ps = PowerStatusManager::readStatus(); @@ -296,14 +289,19 @@ 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 ); } @@ -342,7 +340,7 @@ 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 ) { if ( db ) { if ( !press && !autoRepeat && m_button_timer-> isActive ( )) { 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 @@ -95,7 +95,7 @@ private: QTimer *cardSendTimer; QCopChannel *channel; OpieScreenSaver *m_screensaver; - QTimer * m_timer; + QTimer * m_apm_timer; int m_powerVeryLow; int m_powerCritical; int m_currentPowerLevel; 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 @@ -11,7 +11,7 @@ <rect> <x>0</x> <y>0</y> - <width>371</width> + <width>367</width> <height>532</height> </rect> </property> @@ -1062,15 +1062,31 @@ <string> sec</string> </property> <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> <enum>PlusMinus</enum> </property> <property stdset="1"> <name>maxValue</name> - <number>60</number> + <number>300</number> </property> <property stdset="1"> <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> </property> <property> |