author | sandman <sandman> | 2002-11-01 18:13:18 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-11-01 18:13:18 (UTC) |
commit | 2259e3ab9f2e06a4ee4dbd633c17221a47fdb7ba (patch) (unidiff) | |
tree | f3e6bb8ee6c0d8f2671a63c240d1145e710da82d /core/settings/light-and-power/sensor.cpp | |
parent | 7b7b760ca3886d5b6562a88b5c2ef8e610b73eb8 (diff) | |
download | opie-2259e3ab9f2e06a4ee4dbd633c17221a47fdb7ba.zip opie-2259e3ab9f2e06a4ee4dbd633c17221a47fdb7ba.tar.gz opie-2259e3ab9f2e06a4ee4dbd633c17221a47fdb7ba.tar.bz2 |
- Completly reworked the backlight "preview":
every slider/control that relates to backlight levels, is now switching the
lcd to this level for 2 seconds - after that the backlight switches back to
the standard level (or light sensor control)
- Many bugfixes and usability improvements in light sensor calibration
Diffstat (limited to 'core/settings/light-and-power/sensor.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/settings/light-and-power/sensor.cpp | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/core/settings/light-and-power/sensor.cpp b/core/settings/light-and-power/sensor.cpp index c1df04d..5ca54d4 100644 --- a/core/settings/light-and-power/sensor.cpp +++ b/core/settings/light-and-power/sensor.cpp | |||
@@ -32,2 +32,6 @@ | |||
32 | 32 | ||
33 | #include <opie/odevice.h> | ||
34 | |||
35 | using namespace Opie; | ||
36 | |||
33 | #include "calibration.h" | 37 | #include "calibration.h" |
@@ -54,2 +58,5 @@ Sensor::Sensor ( QStringList ¶ms, QWidget *parent, const char *name ) | |||
54 | } | 58 | } |
59 | |||
60 | int xscale = ODevice::inst ( )-> lightSensorResolution ( ); | ||
61 | int yscale = ODevice::inst ( )-> displayBrightnessResolution ( ); | ||
55 | 62 | ||
@@ -58,9 +65,9 @@ Sensor::Sensor ( QStringList ¶ms, QWidget *parent, const char *name ) | |||
58 | m_calib = new Calibration ( frame ); | 65 | m_calib = new Calibration ( frame ); |
59 | lay-> add ( m_calib ); | 66 | lay-> add ( m_calib ); |
60 | 67 | ||
61 | m_calib-> setScale ( QSize ( 256, 256 )); | 68 | m_calib-> setScale ( QSize ( xscale, yscale )); |
62 | m_calib-> setLineSteps ( steps ); | 69 | m_calib-> setLineSteps ( steps ); |
63 | m_calib-> setInterval ( inter ); | 70 | m_calib-> setInterval ( inter ); |
64 | m_calib-> setStartPoint ( QPoint ( smin, lmax )); | 71 | m_calib-> setStartPoint ( QPoint ( smin * xscale / 256, lmax * yscale / 256 )); |
65 | m_calib-> setEndPoint ( QPoint ( smax, lmin )); | 72 | m_calib-> setEndPoint ( QPoint ( smax * xscale / 256, lmin * yscale / 256 )); |
66 | 73 | ||
@@ -71,2 +78,5 @@ Sensor::Sensor ( QStringList ¶ms, QWidget *parent, const char *name ) | |||
71 | connect ( linesteps, SIGNAL( valueChanged ( int )), m_calib, SLOT( setLineSteps ( int ))); | 78 | connect ( linesteps, SIGNAL( valueChanged ( int )), m_calib, SLOT( setLineSteps ( int ))); |
79 | |||
80 | connect ( m_calib, SIGNAL( startPointChanged ( const QPoint & )), this, SLOT( pointDrag ( const QPoint & ))); | ||
81 | connect ( m_calib, SIGNAL( endPointChanged ( const QPoint & )), this, SLOT( pointDrag ( const QPoint & ))); | ||
72 | } | 82 | } |
@@ -75,2 +85,5 @@ void Sensor::accept ( ) | |||
75 | { | 85 | { |
86 | int xscale = ODevice::inst ( )-> lightSensorResolution ( ); | ||
87 | int yscale = ODevice::inst ( )-> displayBrightnessResolution ( ); | ||
88 | |||
76 | m_params. clear ( ); | 89 | m_params. clear ( ); |
@@ -78,6 +91,6 @@ void Sensor::accept ( ) | |||
78 | << QString::number ( m_calib-> lineSteps ( )) | 91 | << QString::number ( m_calib-> lineSteps ( )) |
79 | << QString::number ( m_calib-> startPoint ( ). x ( )) | 92 | << QString::number ( m_calib-> startPoint ( ). x ( ) * 256 / xscale ) |
80 | << QString::number ( m_calib-> endPoint ( ). x ( )) | 93 | << QString::number ( m_calib-> endPoint ( ). x ( ) * 256 / xscale ) |
81 | << QString::number ( m_calib-> endPoint ( ). y ( )) | 94 | << QString::number ( m_calib-> endPoint ( ). y ( ) * 256 / yscale ) |
82 | << QString::number ( m_calib-> startPoint ( ). y ( )); | 95 | << QString::number ( m_calib-> startPoint ( ). y ( ) * 256 / yscale ); |
83 | 96 | ||
@@ -85 +98,6 @@ void Sensor::accept ( ) | |||
85 | } | 98 | } |
99 | |||
100 | void Sensor::pointDrag ( const QPoint &p ) | ||
101 | { | ||
102 | emit viewBacklight ( p. y ( )); | ||
103 | } | ||