author | sandman <sandman> | 2002-09-06 19:28:46 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-09-06 19:28:46 (UTC) |
commit | 088a233d52f2b06b6f478e73776eb2b430b2a1a5 (patch) (unidiff) | |
tree | 5316a2ea38418a0dd00977895f73ef06434eb9e5 /core | |
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
-rw-r--r-- | core/settings/light-and-power/light-and-power.pro | 2 | ||||
-rw-r--r-- | core/settings/light-and-power/light.cpp | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/core/settings/light-and-power/light-and-power.pro b/core/settings/light-and-power/light-and-power.pro index 9d2452c..43395bf 100644 --- a/core/settings/light-and-power/light-and-power.pro +++ b/core/settings/light-and-power/light-and-power.pro | |||
@@ -1,17 +1,17 @@ | |||
1 | TEMPLATE= app | 1 | TEMPLATE= app |
2 | CONFIG += qt warn_on release | 2 | CONFIG += qt warn_on release |
3 | DESTDIR = $(OPIEDIR)/bin | 3 | DESTDIR = $(OPIEDIR)/bin |
4 | HEADERS = settings.h | 4 | HEADERS = settings.h |
5 | SOURCES = light.cpp main.cpp | 5 | SOURCES = light.cpp main.cpp |
6 | INTERFACES= lightsettingsbase.ui | 6 | INTERFACES= lightsettingsbase.ui |
7 | INCLUDEPATH += $(OPIEDIR)/include | 7 | INCLUDEPATH += $(OPIEDIR)/include |
8 | DEPENDPATH+= ../$(OPIEDIR)/include | 8 | DEPENDPATH+= ../$(OPIEDIR)/include |
9 | LIBS += -lqpe | 9 | LIBS += -lqpe -lopie |
10 | TARGET = light-and-power | 10 | TARGET = light-and-power |
11 | 11 | ||
12 | TRANSLATIONS = ../../../i18n/de/light-and-power.ts \ | 12 | TRANSLATIONS = ../../../i18n/de/light-and-power.ts \ |
13 | ../../../i18n/en/light-and-power.ts \ | 13 | ../../../i18n/en/light-and-power.ts \ |
14 | ../../../i18n/es/light-and-power.ts \ | 14 | ../../../i18n/es/light-and-power.ts \ |
15 | ../../../i18n/fr/light-and-power.ts \ | 15 | ../../../i18n/fr/light-and-power.ts \ |
16 | ../../../i18n/hu/light-and-power.ts \ | 16 | ../../../i18n/hu/light-and-power.ts \ |
17 | ../../../i18n/ja/light-and-power.ts \ | 17 | ../../../i18n/ja/light-and-power.ts \ |
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 | |||
@@ -40,17 +40,18 @@ | |||
40 | #include <qcombobox.h> | 40 | #include <qcombobox.h> |
41 | #include <qspinbox.h> | 41 | #include <qspinbox.h> |
42 | #include <qlistbox.h> | 42 | #include <qlistbox.h> |
43 | #include <qdir.h> | 43 | #include <qdir.h> |
44 | #if QT_VERSION >= 300 | 44 | #if QT_VERSION >= 300 |
45 | #include <qstylefactory.h> | 45 | #include <qstylefactory.h> |
46 | #endif | 46 | #endif |
47 | 47 | ||
48 | extern int qpe_sysBrightnessSteps(); | 48 | #include <opie/odevice.h> |
49 | |||
49 | 50 | ||
50 | LightSettings::LightSettings( QWidget* parent, const char* name, WFlags fl ) | 51 | LightSettings::LightSettings( QWidget* parent, const char* name, WFlags fl ) |
51 | : LightSettingsBase( parent, name, TRUE, fl ) | 52 | : LightSettingsBase( parent, name, TRUE, fl ) |
52 | { | 53 | { |
53 | // Not supported | 54 | // Not supported |
54 | auto_brightness->hide(); | 55 | auto_brightness->hide(); |
55 | 56 | ||
56 | Config config( "qpe" ); | 57 | Config config( "qpe" ); |
@@ -64,17 +65,17 @@ LightSettings::LightSettings( QWidget* parent, const char* name, WFlags fl ) | |||
64 | interval_lightoff->setValue( interval ); | 65 | interval_lightoff->setValue( interval ); |
65 | interval = config.readNumEntry( "Interval", 60 ); | 66 | interval = config.readNumEntry( "Interval", 60 ); |
66 | if ( interval > 3600 ) interval /= 1000; // compatibility (was millisecs) | 67 | if ( interval > 3600 ) interval /= 1000; // compatibility (was millisecs) |
67 | interval_suspend->setValue( interval ); | 68 | interval_suspend->setValue( interval ); |
68 | 69 | ||
69 | screensaver_dim->setChecked( config.readNumEntry("Dim",1) != 0 ); | 70 | screensaver_dim->setChecked( config.readNumEntry("Dim",1) != 0 ); |
70 | screensaver_lightoff->setChecked( config.readNumEntry("LightOff",1) != 0 ); | 71 | screensaver_lightoff->setChecked( config.readNumEntry("LightOff",1) != 0 ); |
71 | LcdOffOnly->setChecked( config.readNumEntry("LcdOffOnly",0) != 0 ); | 72 | LcdOffOnly->setChecked( config.readNumEntry("LcdOffOnly",0) != 0 ); |
72 | int maxbright = qpe_sysBrightnessSteps(); | 73 | int maxbright = ODevice::inst ( )-> displayBrightnessResolution ( ); |
73 | initbright = config.readNumEntry("Brightness",255); | 74 | initbright = config.readNumEntry("Brightness",255); |
74 | brightness->setMaxValue( maxbright ); | 75 | brightness->setMaxValue( maxbright ); |
75 | brightness->setTickInterval( QMAX(1,maxbright/16) ); | 76 | brightness->setTickInterval( QMAX(1,maxbright/16) ); |
76 | brightness->setLineStep( QMAX(1,maxbright/16) ); | 77 | brightness->setLineStep( QMAX(1,maxbright/16) ); |
77 | brightness->setPageStep( QMAX(1,maxbright/16) ); | 78 | brightness->setPageStep( QMAX(1,maxbright/16) ); |
78 | brightness->setValue( (maxbright*255 - initbright*maxbright)/255 ); | 79 | brightness->setValue( (maxbright*255 - initbright*maxbright)/255 ); |
79 | 80 | ||
80 | connect(brightness, SIGNAL(valueChanged(int)), this, SLOT(applyBrightness())); | 81 | connect(brightness, SIGNAL(valueChanged(int)), this, SLOT(applyBrightness())); |