author | sandman <sandman> | 2002-09-06 19:28:46 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-09-06 19:28:46 (UTC) |
commit | 088a233d52f2b06b6f478e73776eb2b430b2a1a5 (patch) (side-by-side diff) | |
tree | 5316a2ea38418a0dd00977895f73ef06434eb9e5 /core/settings/light-and-power/light.cpp | |
parent | 61b8be0405b46896160afaf7f4a2082527f01f58 (diff) | |
download | opie-088a233d52f2b06b6f478e73776eb2b430b2a1a5.zip opie-088a233d52f2b06b6f478e73776eb2b430b2a1a5.tar.gz opie-088a233d52f2b06b6f478e73776eb2b430b2a1a5.tar.bz2 |
Changes to use the new ODevice interface for LCD brightness control
Diffstat (limited to 'core/settings/light-and-power/light.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/settings/light-and-power/light.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/core/settings/light-and-power/light.cpp b/core/settings/light-and-power/light.cpp index e959603..fbea905 100644 --- a/core/settings/light-and-power/light.cpp +++ b/core/settings/light-and-power/light.cpp @@ -24,73 +24,74 @@ #include <qpe/config.h> #include <qpe/applnk.h> #include <qpe/qpeapplication.h> #if defined(Q_WS_QWS) && !defined(QT_NO_COP) #include <qpe/qcopenvelope_qws.h> #endif #include <qlabel.h> #include <qcheckbox.h> #include <qradiobutton.h> #include <qtabwidget.h> #include <qslider.h> #include <qfile.h> #include <qtextstream.h> #include <qdatastream.h> #include <qmessagebox.h> #include <qcombobox.h> #include <qspinbox.h> #include <qlistbox.h> #include <qdir.h> #if QT_VERSION >= 300 #include <qstylefactory.h> #endif -extern int qpe_sysBrightnessSteps(); +#include <opie/odevice.h> + LightSettings::LightSettings( QWidget* parent, const char* name, WFlags fl ) : LightSettingsBase( parent, name, TRUE, fl ) { // Not supported auto_brightness->hide(); Config config( "qpe" ); config.setGroup( "Screensaver" ); int interval; interval = config.readNumEntry( "Interval_Dim", 20 ); interval_dim->setValue( interval ); interval = config.readNumEntry( "Interval_LightOff", 30 ); interval_lightoff->setValue( interval ); interval = config.readNumEntry( "Interval", 60 ); if ( interval > 3600 ) interval /= 1000; // compatibility (was millisecs) interval_suspend->setValue( interval ); screensaver_dim->setChecked( config.readNumEntry("Dim",1) != 0 ); screensaver_lightoff->setChecked( config.readNumEntry("LightOff",1) != 0 ); LcdOffOnly->setChecked( config.readNumEntry("LcdOffOnly",0) != 0 ); - int maxbright = qpe_sysBrightnessSteps(); + int maxbright = ODevice::inst ( )-> displayBrightnessResolution ( ); initbright = config.readNumEntry("Brightness",255); brightness->setMaxValue( maxbright ); brightness->setTickInterval( QMAX(1,maxbright/16) ); brightness->setLineStep( QMAX(1,maxbright/16) ); brightness->setPageStep( QMAX(1,maxbright/16) ); brightness->setValue( (maxbright*255 - initbright*maxbright)/255 ); connect(brightness, SIGNAL(valueChanged(int)), this, SLOT(applyBrightness())); } LightSettings::~LightSettings() { } static void set_fl(int bright) { QCopEnvelope e("QPE/System", "setBacklight(int)" ); e << bright; } void LightSettings::reject() { set_fl(initbright); |