summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/settings/light-and-power/calibration.cpp278
-rw-r--r--core/settings/light-and-power/calibration.h71
-rw-r--r--core/settings/light-and-power/light-and-power.pro6
-rw-r--r--core/settings/light-and-power/light.cpp338
-rw-r--r--core/settings/light-and-power/lightsettingsbase.ui951
-rw-r--r--core/settings/light-and-power/sensor.cpp85
-rw-r--r--core/settings/light-and-power/sensor.h47
-rw-r--r--core/settings/light-and-power/sensorbase.ui870
-rw-r--r--core/settings/light-and-power/settings.h59
9 files changed, 2029 insertions, 676 deletions
diff --git a/core/settings/light-and-power/calibration.cpp b/core/settings/light-and-power/calibration.cpp
new file mode 100644
index 0000000..307de1f
--- a/dev/null
+++ b/core/settings/light-and-power/calibration.cpp
@@ -0,0 +1,278 @@
1/*
2 This file is part of the OPIE Project
3               =. Copyright (c) 2002 Maximilian Reiss <harlekin@handhelds.org>
4             .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org>
5           .>+-=
6 _;:,     .>    :=|. This file is free software; you can
7.> <`_,   >  .   <= redistribute it and/or modify it under
8:`=1 )Y*s>-.--   : the terms of the GNU General Public
9.="- .-=="i,     .._ License as published by the Free Software
10 - .   .-<_>     .<> Foundation; either version 2 of the License,
11     ._= =}       : or (at your option) any later version.
12    .%`+i>       _;_.
13    .i_,=:_.      -<s. This file is distributed in the hope that
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15    : ..    .:,     . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
18..}^=.=       =       ; Public License for more details.
19++=   -.     .`     .:
20 :     =  ...= . :.=- You should have received a copy of the GNU
21 -.   .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
28#include "calibration.h"
29
30#include <qpainter.h>
31#include <qpalette.h>
32
33#define BRD 2
34
35Calibration::Calibration ( QWidget *parent, const char *name, WFlags fl )
36 : QWidget ( parent, name, fl )
37{
38 m_scale = QSize ( 256, 256 );
39 m_steps = 5;
40 m_dragged = -1;
41 m_interval = 5;
42
43 m_p [0] = QPoint ( 0, 0 );
44 m_p [1] = QPoint ( 255, 255 );
45}
46
47Calibration::~Calibration ( )
48{
49}
50
51void Calibration::setScale ( const QSize &s )
52{
53 if ( s. width ( ) < 1 || s. height ( ) < 1 )
54 return;
55
56 m_scale = s;
57 checkPoints ( );
58
59 update ( );
60}
61
62QSize Calibration::scale ( ) const
63{
64 return m_scale;
65}
66
67void Calibration::setLineSteps ( int steps )
68{
69 if ( m_steps < 2 )
70 return;
71
72 m_steps = steps;
73 update ( );
74}
75
76int Calibration::lineSteps ( ) const
77{
78 return m_steps;
79}
80
81void Calibration::setInterval ( int iv )
82{
83 if ( iv < 1 )
84 return;
85
86 m_interval = iv;
87 //update ( );
88}
89
90int Calibration::interval ( ) const
91{
92 return m_interval;
93}
94
95void Calibration::setStartPoint ( const QPoint &p )
96{
97 m_p [0] = p;
98 checkPoints ( );
99 update ( );
100}
101
102QPoint Calibration::startPoint ( ) const
103{
104 return m_p [0];
105}
106
107void Calibration::setEndPoint ( const QPoint &p )
108{
109 m_p [1] = p;
110 checkPoints ( );
111 update ( );
112}
113
114QPoint Calibration::endPoint ( ) const
115{
116 return m_p [1];
117}
118
119void Calibration::checkPoints ( )
120{
121 int dx = m_scale. width ( );
122 int dy = m_scale. height ( );
123
124 if ( m_p [1]. x ( ) >= dx )
125 m_p [1]. setX ( dx - 1 );
126 if ( m_p [0]. x ( ) > m_p [1]. x ( ))
127 m_p [0]. setX ( m_p [1]. x ( ));
128
129 if ( m_p [1]. y ( ) >= dy )
130 m_p [1]. setY ( dy - 1 );
131 if ( m_p [0]. y ( ) > m_p [1]. y ( ))
132 m_p [0]. setY ( m_p [1]. y ( ));
133}
134
135
136#define SCALEX(x) (BRD+x*(width()- 2*BRD)/m_scale.width())
137#define SCALEY(y) (BRD+y*(height()-2*BRD)/m_scale.height())
138
139
140static QRect around ( int x, int y )
141{
142 return QRect ( x - BRD, y - BRD, 2 * BRD + 1, 2 * BRD + 1 );
143}
144
145void Calibration::mousePressEvent ( QMouseEvent *e )
146{
147 if ( e-> button ( ) != LeftButton )
148 return QWidget::mousePressEvent ( e );
149
150 int olddragged = m_dragged;
151 int x [2], y [2];
152
153 m_dragged = -1;
154 for ( int i = 0; i < 2; i++ ) {
155 x [i] = SCALEX( m_p [i]. x ( ));
156 y [i] = SCALEY( m_p [i]. y ( ));
157
158 if (( QABS( e-> x ( ) - x [i] ) <= BRD ) &&
159 ( QABS( e-> y ( ) - y [i] ) <= BRD )) {
160 m_dragged = i;
161 break;
162 }
163 }
164
165 if ( m_dragged != olddragged ) {
166 QRect r;
167
168 if ( olddragged >= 0 )
169 r |= around ( x [olddragged], y [olddragged] );
170 if ( m_dragged >= 0 )
171 r |= around ( x [m_dragged], y [m_dragged] );
172 repaint ( r );
173 }
174}
175
176void Calibration::mouseMoveEvent ( QMouseEvent *e )
177{
178 if ( m_dragged < 0 )
179 return;
180
181 QPoint n [2];
182
183 n [m_dragged]. setX (( e-> x ( ) - BRD ) * m_scale. width ( ) / ( width ( ) - 2 * BRD ));
184 n [m_dragged]. setY (( e-> y ( ) - BRD ) * m_scale. height ( ) / ( height ( ) - 2 * BRD ));
185 n [1 - m_dragged] = m_p [1 - m_dragged];
186
187 if (( n [0]. x ( ) > n [1]. x ( )) || ( n [m_dragged]. x ( ) < 0 ) || ( n [m_dragged]. x ( ) >= m_scale. width ( )))
188 n [m_dragged]. setX ( m_p [m_dragged]. x ( ));
189 if (( n [0]. y ( ) > n [1]. y ( )) || ( n [m_dragged]. y ( ) < 0 ) || ( n [m_dragged]. y ( ) >= m_scale. height ( )))
190 n [m_dragged]. setY ( m_p [m_dragged]. y ( ));
191
192 QRect r;
193 int ox [2], oy [2], nx [2], ny [2];
194
195 for ( int i = 0; i < 2; i++ ) {
196 nx [i] = SCALEX( n [i]. x ( ));
197 ny [i] = SCALEY( n [i]. y ( ));
198 ox [i] = SCALEX( m_p [i]. x ( ));
199 oy [i] = SCALEY( m_p [i]. y ( ));
200
201 if ( n [i] != m_p [i] ){
202 r |= around ( nx [i], ny [i] );
203 r |= around ( ox [i], oy [i] );
204 m_p [i] = n [i];
205
206 if ( i == 0 ) {
207 r |= QRect ( 0, 0, nx [0] - 0 + 1, ny [0] - 0 + 1 );
208 r |= QRect ( 0, 0, ox [0] - 0 + 1, oy [0] - 0 + 1 );
209 }
210 else if ( i == 1 ) {
211 r |= QRect ( nx [1], ny [1], width ( ) - nx [1], height ( ) - ny [1] );
212 r |= QRect ( ox [1], oy [1], width ( ) - ox [1], height ( ) - oy [1] );
213 }
214 }
215 }
216 if ( r. isValid ( )) {
217 r |= QRect ( nx [0], ny [0], nx [1] - nx [0] + 1, ny [1] - ny [0] + 1 );
218 r |= QRect ( ox [0], oy [0], ox [1] - ox [0] + 1, oy [1] - oy [0] + 1 );
219
220 repaint ( r );
221 }
222}
223
224void Calibration::mouseReleaseEvent ( QMouseEvent *e )
225{
226 if ( e-> button ( ) != LeftButton )
227 return QWidget::mouseReleaseEvent ( e );
228
229 if ( m_dragged < 0 )
230 return;
231
232 int x = SCALEX( m_p [m_dragged]. x ( ));
233 int y = SCALEY( m_p [m_dragged]. y ( ));
234 m_dragged = -1;
235
236 repaint ( around ( x, y ));
237}
238
239void Calibration::paintEvent ( QPaintEvent * )
240{
241 QPainter p ( this );
242 QColorGroup g = colorGroup ( );
243
244 int x0 = SCALEX( m_p [0]. x ( ));
245 int y0 = SCALEY( m_p [0]. y ( ));
246 int x1 = SCALEX( m_p [1]. x ( ));
247 int y1 = SCALEY( m_p [1]. y ( ));
248
249 int dx = x1 - x0;
250 int dy = y1 - y0;
251
252 int ex = x0, ey = y0;
253
254 p. setPen ( g. highlight ( ));
255
256 p. drawLine ( BRD, BRD, ex, BRD );
257 p. drawLine ( ex, BRD, ex, ey );
258
259 for ( int i = 1; i < m_steps; i++ ) {
260 int fx = x0 + dx * i / m_steps;
261 int fy = y0 + dy * i / ( m_steps - 1 );
262
263 p. drawLine ( ex, ey, fx, ey );
264 p. drawLine ( fx, ey, fx, fy );
265
266 ex = fx;
267 ey = fy;
268 }
269
270 p. drawLine ( ex, ey, width ( ) - 1 - BRD, ey );
271
272 p. fillRect ( around ( x0, y0 ), m_dragged == 0 ? g. highlightedText ( ) : g. text ( ));
273 p. fillRect ( around ( x1, y1 ), m_dragged == 1 ? g. highlightedText ( ) : g. text ( ));
274
275 p. setPen ( g. text ( ));
276 p. drawText ( QRect ( BRD, BRD, width ( ) - 2*BRD, height() - 2*BRD ), AlignTop | AlignRight, tr( "%1 Steps" ). arg ( m_steps ));
277}
278
diff --git a/core/settings/light-and-power/calibration.h b/core/settings/light-and-power/calibration.h
new file mode 100644
index 0000000..2bff69a
--- a/dev/null
+++ b/core/settings/light-and-power/calibration.h
@@ -0,0 +1,71 @@
1/*
2 This file is part of the OPIE Project
3               =. Copyright (c) 2002 Maximilian Reiss <harlekin@handhelds.org>
4             .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org>
5           .>+-=
6 _;:,     .>    :=|. This file is free software; you can
7.> <`_,   >  .   <= redistribute it and/or modify it under
8:`=1 )Y*s>-.--   : the terms of the GNU General Public
9.="- .-=="i,     .._ License as published by the Free Software
10 - .   .-<_>     .<> Foundation; either version 2 of the License,
11     ._= =}       : or (at your option) any later version.
12    .%`+i>       _;_.
13    .i_,=:_.      -<s. This file is distributed in the hope that
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15    : ..    .:,     . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
18..}^=.=       =       ; Public License for more details.
19++=   -.     .`     .:
20 :     =  ...= . :.=- You should have received a copy of the GNU
21 -.   .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
28#ifndef __CALIBRATION_H__
29#define __CALIBRATION_H__
30
31#include <qwidget.h>
32
33class Calibration : public QWidget {
34 Q_OBJECT
35
36public:
37 Calibration ( QWidget *parent = 0, const char *name = 0, WFlags fl = 0 );
38 virtual ~Calibration ( );
39
40 QSize scale ( ) const;
41 int lineSteps ( ) const;
42 int interval ( ) const;
43 QPoint startPoint ( ) const;
44 QPoint endPoint ( ) const;
45
46public slots:
47 void setScale ( const QSize &s );
48 void setLineSteps ( int step );
49 void setInterval ( int iv );
50 void setStartPoint ( const QPoint &p );
51 void setEndPoint ( const QPoint &p );
52
53protected:
54 virtual void paintEvent ( QPaintEvent * );
55 virtual void mousePressEvent ( QMouseEvent * );
56 virtual void mouseMoveEvent ( QMouseEvent * );
57 virtual void mouseReleaseEvent ( QMouseEvent * );
58
59 void checkPoints ( );
60
61private:
62 QSize m_scale;
63 QPoint m_p [2];
64 int m_dragged;
65 int m_steps;
66 int m_interval;
67};
68
69#endif
70
71
diff --git a/core/settings/light-and-power/light-and-power.pro b/core/settings/light-and-power/light-and-power.pro
index 43395bf..c89a26d 100644
--- a/core/settings/light-and-power/light-and-power.pro
+++ b/core/settings/light-and-power/light-and-power.pro
@@ -1,26 +1,26 @@
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 sensor.h calibration.h
5 SOURCES = light.cpp main.cpp 5 SOURCES = light.cpp main.cpp sensor.cpp calibration.cpp
6 INTERFACES= lightsettingsbase.ui 6 INTERFACES= lightsettingsbase.ui sensorbase.ui
7INCLUDEPATH += $(OPIEDIR)/include 7INCLUDEPATH += $(OPIEDIR)/include
8 DEPENDPATH+= ../$(OPIEDIR)/include 8 DEPENDPATH+= ../$(OPIEDIR)/include
9LIBS += -lqpe -lopie 9LIBS += -lqpe -lopie
10 TARGET = light-and-power 10 TARGET = light-and-power
11 11
12TRANSLATIONS = ../../../i18n/de/light-and-power.ts \ 12TRANSLATIONS = ../../../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 \
18 ../../../i18n/ko/light-and-power.ts \ 18 ../../../i18n/ko/light-and-power.ts \
19 ../../../i18n/no/light-and-power.ts \ 19 ../../../i18n/no/light-and-power.ts \
20 ../../../i18n/pl/light-and-power.ts \ 20 ../../../i18n/pl/light-and-power.ts \
21 ../../../i18n/pt/light-and-power.ts \ 21 ../../../i18n/pt/light-and-power.ts \
22 ../../../i18n/pt_BR/light-and-power.ts \ 22 ../../../i18n/pt_BR/light-and-power.ts \
23 ../../../i18n/sl/light-and-power.ts \ 23 ../../../i18n/sl/light-and-power.ts \
24 ../../../i18n/zh_CN/light-and-power.ts \ 24 ../../../i18n/zh_CN/light-and-power.ts \
25 ../../../i18n/zh_TW/light-and-power.ts \ 25 ../../../i18n/zh_TW/light-and-power.ts \
26 ../../../i18n/it/light-and-power.ts 26 ../../../i18n/it/light-and-power.ts
diff --git a/core/settings/light-and-power/light.cpp b/core/settings/light-and-power/light.cpp
index 572f8ea..2ea0356 100644
--- a/core/settings/light-and-power/light.cpp
+++ b/core/settings/light-and-power/light.cpp
@@ -1,245 +1,227 @@
1/********************************************************************** 1/*
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2 This file is part of the OPIE Project
3** 3               =. Copyright (c) 2002 Maximilian Reiss <harlekin@handhelds.org>
4** This file is part of Qtopia Environment. 4             .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org>
5** 5           .>+-=
6** This file may be distributed and/or modified under the terms of the 6 _;:,     .>    :=|. This file is free software; you can
7** GNU General Public License version 2 as published by the Free Software 7.> <`_,   >  .   <= redistribute it and/or modify it under
8** Foundation and appearing in the file LICENSE.GPL included in the 8:`=1 )Y*s>-.--   : the terms of the GNU General Public
9** packaging of this file. 9.="- .-=="i,     .._ License as published by the Free Software
10** 10 - .   .-<_>     .<> Foundation; either version 2 of the License,
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11     ._= =}       : or (at your option) any later version.
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12    .%`+i>       _;_.
13** 13    .i_,=:_.      -<s. This file is distributed in the hope that
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15** 15    : ..    .:,     . . . without even the implied warranty of
16** Contact info@trolltech.com if any conditions of this licensing are 16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17** not clear to you. 17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
18** 18..}^=.=       =       ; Public License for more details.
19**********************************************************************/ 19++=   -.     .`     .:
20 20 :     =  ...= . :.=- You should have received a copy of the GNU
21// redone by Maximilian Reiss <harlekin@handhelds.org> 21 -.   .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
22 28
23#include "settings.h" 29#include "settings.h"
24 30
25#include <qpe/global.h> 31#include <qpe/global.h>
26#include <qpe/fontmanager.h> 32#include <qpe/fontmanager.h>
27#include <qpe/config.h> 33#include <qpe/config.h>
28#include <qpe/applnk.h> 34#include <qpe/applnk.h>
29#include <qpe/qpeapplication.h> 35#include <qpe/qpeapplication.h>
30#include <qpe/power.h> 36#include <qpe/power.h>
31#if defined(Q_WS_QWS) && !defined(QT_NO_COP) 37#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
32#include <qpe/qcopenvelope_qws.h> 38#include <qpe/qcopenvelope_qws.h>
33#endif 39#endif
34 40
35#include <qlabel.h> 41#include <qlabel.h>
36#include <qcheckbox.h> 42#include <qcheckbox.h>
37#include <qradiobutton.h> 43#include <qradiobutton.h>
38#include <qtabwidget.h> 44#include <qtabwidget.h>
39#include <qslider.h> 45#include <qslider.h>
40#include <qfile.h> 46#include <qfile.h>
41#include <qtextstream.h> 47#include <qtextstream.h>
42#include <qdatastream.h> 48#include <qdatastream.h>
43#include <qmessagebox.h> 49#include <qmessagebox.h>
44#include <qcombobox.h> 50#include <qcombobox.h>
45#include <qgroupbox.h> 51#include <qgroupbox.h>
46#include <qspinbox.h> 52#include <qspinbox.h>
47#include <qpushbutton.h> 53#include <qpushbutton.h>
48#include <qlistbox.h> 54#include <qlistbox.h>
49#include <qdir.h> 55#include <qdir.h>
50#if QT_VERSION >= 300 56#if QT_VERSION >= 300
51#include <qstylefactory.h> 57#include <qstylefactory.h>
52#endif 58#endif
53 59
54#include <opie/odevice.h> 60#include <opie/odevice.h>
55 61
62#include "sensor.h"
63
56using namespace Opie; 64using namespace Opie;
57 65
58LightSettings::LightSettings( QWidget* parent, const char* name, WFlags ) 66LightSettings::LightSettings( QWidget* parent, const char* name, WFlags )
59 : LightSettingsBase( parent, name, TRUE, WStyle_ContextHelp ) 67 : LightSettingsBase( parent, name, true, WStyle_ContextHelp )
60{ 68{
61 int res = ODevice::inst ( )-> displayBrightnessResolution ( ); 69 m_res = ODevice::inst ( )-> displayBrightnessResolution ( );
62 70
63 if ( ODevice::inst()->hasLightSensor() ) { 71 if ( !ODevice::inst ( )-> hasLightSensor ( )) {
64 // Not supported yet - hide until implemented 72 auto_brightness-> hide ( );
65 CalibrateLightSensor->setEnabled( false ); 73 CalibrateLightSensor-> hide ( );
66 CalibrateLightSensorAC->setEnabled( false ); 74 auto_brightness_ac_3-> hide ( );
67 } else { 75 CalibrateLightSensorAC-> hide ( );
68 // if ipaq no need to show the sensor box 76 }
69 auto_brightness->hide(); 77
70 CalibrateLightSensor->hide(); 78 Config config ( "apm" );
71 auto_brightness_ac_3->hide(); 79 config. setGroup ( "Battery" );
72 CalibrateLightSensorAC->hide(); 80
73 } 81 // battery spinboxes
74 82 interval_dim-> setValue ( config. readNumEntry ( "Dim", 20 ));
75 Config config( "apm" ); 83 interval_lightoff-> setValue ( config. readNumEntry ( "LightOff", 30 ));
76 config.setGroup( "Battery" ); 84 interval_suspend-> setValue ( config. readNumEntry ( "Suspend", 60 ));
77 85
78 // battery spinboxes 86 // battery check and slider
79 interval_dim->setValue( config.readNumEntry( "Dim", 20 )); 87 LcdOffOnly-> setChecked ( config. readBoolEntry ( "LcdOffOnly", false ));
80 interval_lightoff->setValue( config.readNumEntry( "LightOff", 30 )); 88
81 interval_suspend->setValue( config.readNumEntry( "Suspend", 60 )); 89 int bright = config. readNumEntry ( "Brightness", 255 );
82 90 brightness-> setMaxValue ( m_res - 1 );
83 // battery check and slider 91 brightness-> setTickInterval ( QMAX( 1, m_res / 16 ));
84 LcdOffOnly->setChecked( config.readBoolEntry("LcdOffOnly",false)); 92 brightness-> setLineStep ( QMAX( 1, m_res / 16 ));
85 93 brightness-> setPageStep ( QMAX( 1, m_res / 16 ));
86 initbright = config. readNumEntry ( "Brightness", 255 ); 94 brightness-> setValue (( bright * ( m_res - 1 ) + 127 ) / 255 );
87 brightness-> setMaxValue ( res - 1 ); 95
88 brightness-> setTickInterval ( QMAX( 1, res / 16 )); 96 // light sensor
89 brightness-> setLineStep ( QMAX( 1, res / 16 )); 97 auto_brightness-> setChecked ( config. readBoolEntry ( "LightSensor", false ));
90 brightness-> setPageStep ( QMAX( 1, res / 16 )); 98 m_sensordata = config. readListEntry ( "LightSensorData", ';' );
91 brightness-> setValue (( initbright * ( res - 1 ) + 127 ) / 255 ); 99
92 100 config. setGroup ( "AC" );
93 // light sensor 101
94 auto_brightness->setChecked( config.readNumEntry("LightSensor",0) != 0 ); 102 // ac spinboxes
95 103 interval_dim_ac_3-> setValue ( config. readNumEntry ( "Dim", 20 ));
96 config.setGroup( "AC" ); 104 interval_lightoff_ac_3-> setValue ( config. readNumEntry ( "LightOff", 30 ));
97 // ac spinboxes 105 interval_suspend_ac_3-> setValue ( config. readNumEntry ( "Suspend", 60 ));
98 interval_dim_ac_3->setValue( config.readNumEntry( "Dim", 20 )); 106
99 interval_lightoff_ac_3->setValue( config.readNumEntry( "LightOff", 30 )); 107 // ac check and slider
100 interval_suspend_ac_3->setValue( config.readNumEntry( "Suspend", 60 )); 108 LcdOffOnly_2_3-> setChecked ( config. readBoolEntry ( "LcdOffOnly", false ));
101 109
102 // ac check and slider 110 bright = config. readNumEntry ( "Brightness", 255 );
103 LcdOffOnly_2_3->setChecked( config.readBoolEntry("LcdOffOnly",false)); 111 brightness_ac_3-> setMaxValue ( m_res - 1 );
104 112 brightness_ac_3-> setTickInterval ( QMAX( 1, m_res / 16 ));
105 initbright_ac = config. readNumEntry ( "Brightness", 255 ); 113 brightness_ac_3-> setLineStep ( QMAX( 1, m_res / 16 ));
106 brightness_ac_3-> setMaxValue ( res - 1 ); 114 brightness_ac_3-> setPageStep ( QMAX( 1, m_res / 16 ));
107 brightness_ac_3-> setTickInterval ( QMAX( 1, res / 16 )); 115 brightness_ac_3-> setValue (( bright * ( m_res - 1 ) + 127 ) / 255 );
108 brightness_ac_3-> setLineStep ( QMAX( 1, res / 16 )); 116
109 brightness_ac_3-> setPageStep ( QMAX( 1, res / 16 )); 117 // light sensor
110 brightness_ac_3-> setValue (( initbright_ac * ( res - 1 ) + 127 ) / 255 ); 118 auto_brightness_ac_3-> setChecked ( config. readBoolEntry ( "LightSensor", false ));
111 119 m_sensordata_ac = config. readListEntry ( "LightSensorData", ';' );
112 // light sensor 120
113 auto_brightness_ac_3->setChecked( config.readNumEntry("LightSensor",0) != 0 ); 121 // advanced settings
114 122 config. setGroup ( "Warnings" );
115 123 warnintervalBox-> setValue ( config. readNumEntry ( "checkinterval", 10000 ) / 1000 );
116 //LightStepSpin->setValue( config.readNumEntry("Steps", 10 ) ); 124 lowSpinBox-> setValue ( config. readNumEntry ( "powerverylow", 10 ) );
117 //LightMinValueSlider->setValue( config.readNumEntry("MinValue", 70 ) ); 125 criticalSpinBox-> setValue ( config. readNumEntry ( "powercritical", 5 ) );
118 //connect( LightStepSpin, SIGNAL( valueChanged( int ) ), this, SLOT( slotSliderTicks( int ) ) ) ; 126
119 //LightShiftSpin->setValue( config.readNumEntry("Shift", 0 ) ); 127 if ( PowerStatusManager::readStatus ( ). acStatus ( ) != PowerStatus::Online )
120 128 connect ( brightness, SIGNAL( valueChanged ( int )), this, SLOT( setBacklight ( int )));
121 // advanced settings 129 else
122 config.setGroup( "Warnings" ); 130 connect ( brightness_ac_3, SIGNAL( valueChanged ( int )), this, SLOT( setBacklight ( int )));
123 warnintervalBox->setValue( config.readNumEntry("checkinterval", 10000)/1000 );
124 lowSpinBox->setValue( config.readNumEntry("powerverylow", 10 ) );
125 criticalSpinBox->setValue( config.readNumEntry("powercritical", 5 ) );
126
127 connect( brightness, SIGNAL( valueChanged(int) ), this, SLOT( applyBrightness() ) );
128 connect( brightness_ac_3, SIGNAL( valueChanged(int) ), this, SLOT( applyBrightnessAC() ) );
129} 131}
130 132
131LightSettings::~LightSettings() { 133LightSettings::~LightSettings ( )
134{
132} 135}
133 136
134void LightSettings::slotSliderTicks( int steps ) { 137
135// LightMinValueSlider->setTickInterval( steps ); 138void LightSettings::calibrateSensor ( )
139{
140 Sensor *s = new Sensor ( m_sensordata, this );
141 s-> showMaximized ( );
142 s-> exec ( );
143 delete s;
136} 144}
137 145
138static void set_fl(int bright) 146void LightSettings::calibrateSensorAC ( )
139{ 147{
140 QCopEnvelope e("QPE/System", "setBacklight(int)" ); 148 Sensor *s = new Sensor ( m_sensordata_ac, this );
141 e << bright; 149 s-> showMaximized ( );
150 s-> exec ( );
151 delete s;
142} 152}
143 153
144void LightSettings::reject() 154void LightSettings::setBacklight ( int bright )
145{ 155{
146 set_fl(initbright); 156 bright = bright * 255 / ( m_res - 1 );
147 QDialog::reject(); 157 QCopEnvelope e ( "QPE/System", "setBacklight(int)" );
158 e << bright;
159}
160
161void LightSettings::reject ( )
162{
163 {
164 QCopEnvelope e ( "QPE/System", "setBacklight(int)" );
165 e << -1;
166 }
167 QDialog::reject ( );
148} 168}
149 169
150void LightSettings::accept() 170void LightSettings::accept ( )
151{ 171{
152 if ( qApp->focusWidget() ) { 172 Config config ( "apm" );
153 qApp->focusWidget()->clearFocus(); 173
154 } 174 // bat
155 175 config. setGroup ( "Battery" );
156 applyBrightness(); 176 config. writeEntry ( "LcdOffOnly", LcdOffOnly-> isChecked ( ));
157 177 config. writeEntry ( "Dim", interval_dim-> value ( ));
158 // bat 178 config. writeEntry ( "LightOff", interval_lightoff-> value ( ));
159 int i_dim = interval_dim->value(); 179 config. writeEntry ( "Suspend", interval_suspend-> value ( ));
160 int i_lightoff = interval_lightoff->value(); 180 config. writeEntry ( "Brightness", brightness-> value ( ) * 255 / ( m_res - 1 ) );
161 int i_suspend = interval_suspend->value(); 181
162 182 // ac
163 // ac 183 config. setGroup ( "AC" );
164 int i_dim_ac = interval_dim_ac_3->value(); 184 config. writeEntry ( "LcdOffOnly", LcdOffOnly_2_3-> isChecked ( ));
165 int i_lightoff_ac = interval_lightoff_ac_3->value(); 185 config. writeEntry ( "Dim", interval_dim_ac_3-> value ( ));
166 int i_suspend_ac = interval_suspend_ac_3->value(); 186 config. writeEntry ( "LightOff", interval_lightoff_ac_3-> value ( ));
167 187 config. writeEntry ( "Suspend", interval_suspend_ac_3-> value ( ));
168 Config config( "apm" ); 188 config. writeEntry ( "Brightness", brightness_ac_3-> value ( ) * 255 / ( m_res - 1 ));
169 189
170 config.setGroup( "Battery" ); 190 // only make light sensor stuff appear if the unit has a sensor
171 191 if ( ODevice::inst ( )-> hasLightSensor ( )) {
172 // bat 192 config. setGroup ( "Battery" );
173 config.writeEntry( "LcdOffOnly", LcdOffOnly->isChecked() ); 193 config. writeEntry ( "LightSensor", auto_brightness->isChecked() );
174 config.writeEntry( "Dim", i_dim ); 194 config. writeEntry ( "LightSensorData", m_sensordata, ';' );
175 config.writeEntry( "LightOff", i_lightoff ); 195 config. setGroup ( "AC" );
176 config.writeEntry( "Suspend", i_suspend ); 196 config. writeEntry ( "LightSensor", auto_brightness_ac_3->isChecked() );
177 config.writeEntry( "Brightness", 197 config. writeEntry ( "LightSensorData", m_sensordata_ac, ';' );
178 ( brightness->value() ) * 255 / brightness->maxValue() ); 198 }
179 199
180 // ac 200 // advanced
181 config.setGroup( "AC" ); 201 config. setGroup ( "Warnings" );
182 config.writeEntry( "LcdOffOnly", LcdOffOnly_2_3->isChecked() ); 202 config. writeEntry ( "check_interval", warnintervalBox-> value ( ) * 1000 );
183 config.writeEntry( "Dim", i_dim_ac ); 203 config. writeEntry ( "power_verylow", lowSpinBox-> value ( ));
184 config.writeEntry( "LightOff", i_lightoff_ac ); 204 config. writeEntry ( "power_critical", criticalSpinBox-> value ( ));
185 config.writeEntry( "Suspend", i_suspend_ac ); 205 config. write ( );
186 config.writeEntry( "Brightness",
187 ( brightness_ac_3->value()) * 255 / brightness_ac_3->maxValue() );
188
189
190 // only make light sensor stuff appear if the unit has a sensor
191 if ( ODevice::inst()->hasLightSensor() ) {
192 config.setGroup( "Battery" );
193 config.writeEntry( "LightSensor", auto_brightness->isChecked() );
194 config.setGroup( "AC" );
195 config.writeEntry( "LightSensor", auto_brightness_ac_3->isChecked() );
196 //config.writeEntry( "Steps", LightStepSpin->value() );
197 //onfig.writeEntry( "MinValue", LightMinValueSlider->value() );
198 //config.writeEntry( "Shift", LightShiftSpin->value() );
199 }
200
201
202 // advanced
203 config.setGroup( "Warnings" );
204 config.writeEntry( "check_interval", warnintervalBox->value()*1000 );
205 config.writeEntry( "power_verylow", lowSpinBox->value() );
206 config.writeEntry( "power_critical", criticalSpinBox->value() );
207 config.write();
208 206
207 // notify the launcher
209 { 208 {
210 QCopEnvelope e ( "QPE/System", "reloadPowerWarnSettings()" ); 209 QCopEnvelope e ( "QPE/System", "reloadPowerWarnSettings()" );
211 } 210 }
212 { 211 {
213 QCopEnvelope e ( "QPE/System", "setScreenSaverInterval(int)" ); 212 QCopEnvelope e ( "QPE/System", "setScreenSaverInterval(int)" );
214 e << -1; 213 e << -1;
215 } 214 }
216 { 215 {
217 QCopEnvelope e ( "QPE/System", "setBacklight(int)" ); 216 QCopEnvelope e ( "QPE/System", "setBacklight(int)" );
218 e << -1; 217 e << -1;
219 } 218 }
220 219
221 QDialog::accept(); 220 QDialog::accept ( );
222}
223
224void LightSettings::applyBrightness()
225{
226 if ( PowerStatusManager::readStatus().acStatus() != PowerStatus::Online ) {
227 int bright = ( brightness->value() ) * 255 / brightness->maxValue();
228 set_fl(bright);
229 }
230}
231
232void LightSettings::applyBrightnessAC()
233{
234 // if ac is attached, set directly that sliders setting, else the "on battery" sliders setting
235 if ( PowerStatusManager::readStatus().acStatus() == PowerStatus::Online ) {
236 int bright = ( brightness_ac_3->value() ) * 255 / brightness_ac_3->maxValue();
237 set_fl(bright);
238 }
239} 221}
240 222
241void LightSettings::done(int r) 223void LightSettings::done ( int r )
242{ 224{
243 QDialog::done(r); 225 QDialog::done ( r );
244 close(); 226 close ( );
245} 227}
diff --git a/core/settings/light-and-power/lightsettingsbase.ui b/core/settings/light-and-power/lightsettingsbase.ui
index f41e5a6..4df6024 100644
--- a/core/settings/light-and-power/lightsettingsbase.ui
+++ b/core/settings/light-and-power/lightsettingsbase.ui
@@ -1,38 +1,38 @@
1<!DOCTYPE UI><UI> 1<!DOCTYPE UI><UI>
2<class>LightSettingsBase</class> 2<class>LightSettingsBase</class>
3<widget> 3<widget>
4 <class>QDialog</class> 4 <class>QDialog</class>
5 <property stdset="1"> 5 <property stdset="1">
6 <name>name</name> 6 <name>name</name>
7 <cstring>LightSettingsBase</cstring> 7 <cstring>LightSettingsBase</cstring>
8 </property> 8 </property>
9 <property stdset="1"> 9 <property stdset="1">
10 <name>geometry</name> 10 <name>geometry</name>
11 <rect> 11 <rect>
12 <x>0</x> 12 <x>0</x>
13 <y>0</y> 13 <y>0</y>
14 <width>399</width> 14 <width>387</width>
15 <height>532</height> 15 <height>532</height>
16 </rect> 16 </rect>
17 </property> 17 </property>
18 <property stdset="1"> 18 <property stdset="1">
19 <name>sizePolicy</name> 19 <name>sizePolicy</name>
20 <sizepolicy> 20 <sizepolicy>
21 <hsizetype>7</hsizetype> 21 <hsizetype>7</hsizetype>
22 <vsizetype>5</vsizetype> 22 <vsizetype>5</vsizetype>
23 </sizepolicy> 23 </sizepolicy>
24 </property> 24 </property>
25 <property stdset="1"> 25 <property stdset="1">
26 <name>caption</name> 26 <name>caption</name>
27 <string>Light and Power Settings</string> 27 <string>Light and Power Settings</string>
28 </property> 28 </property>
29 <property stdset="1"> 29 <property stdset="1">
30 <name>sizeGripEnabled</name> 30 <name>sizeGripEnabled</name>
31 <bool>false</bool> 31 <bool>false</bool>
32 </property> 32 </property>
33 <property> 33 <property>
34 <name>layoutMargin</name> 34 <name>layoutMargin</name>
35 </property> 35 </property>
36 <property> 36 <property>
37 <name>layoutSpacing</name> 37 <name>layoutSpacing</name>
38 </property> 38 </property>
@@ -49,272 +49,270 @@
49 <class>QTabWidget</class> 49 <class>QTabWidget</class>
50 <property stdset="1"> 50 <property stdset="1">
51 <name>name</name> 51 <name>name</name>
52 <cstring>TabWidget3</cstring> 52 <cstring>TabWidget3</cstring>
53 </property> 53 </property>
54 <property> 54 <property>
55 <name>layoutMargin</name> 55 <name>layoutMargin</name>
56 </property> 56 </property>
57 <property> 57 <property>
58 <name>layoutSpacing</name> 58 <name>layoutSpacing</name>
59 </property> 59 </property>
60 <widget> 60 <widget>
61 <class>QWidget</class> 61 <class>QWidget</class>
62 <property stdset="1"> 62 <property stdset="1">
63 <name>name</name> 63 <name>name</name>
64 <cstring>tab</cstring> 64 <cstring>tab</cstring>
65 </property> 65 </property>
66 <attribute> 66 <attribute>
67 <name>title</name> 67 <name>title</name>
68 <string>on Battery</string> 68 <string>on Battery</string>
69 </attribute> 69 </attribute>
70 <vbox> 70 <vbox>
71 <property stdset="1"> 71 <property stdset="1">
72 <name>margin</name> 72 <name>margin</name>
73 <number>3</number> 73 <number>5</number>
74 </property> 74 </property>
75 <property stdset="1"> 75 <property stdset="1">
76 <name>spacing</name> 76 <name>spacing</name>
77 <number>3</number> 77 <number>3</number>
78 </property> 78 </property>
79 <widget> 79 <widget>
80 <class>QGroupBox</class> 80 <class>QGroupBox</class>
81 <property stdset="1"> 81 <property stdset="1">
82 <name>name</name> 82 <name>name</name>
83 <cstring>GroupBox3</cstring> 83 <cstring>GroupBox3</cstring>
84 </property> 84 </property>
85 <property stdset="1"> 85 <property stdset="1">
86 <name>enabled</name> 86 <name>enabled</name>
87 <bool>true</bool> 87 <bool>true</bool>
88 </property> 88 </property>
89 <property stdset="1"> 89 <property stdset="1">
90 <name>title</name> 90 <name>title</name>
91 <string>General Settings</string> 91 <string>General Settings</string>
92 </property> 92 </property>
93 <property> 93 <property>
94 <name>layoutMargin</name> 94 <name>layoutMargin</name>
95 </property> 95 </property>
96 <property> 96 <property>
97 <name>layoutSpacing</name> 97 <name>layoutSpacing</name>
98 </property> 98 </property>
99 <vbox> 99 <grid>
100 <property stdset="1"> 100 <property stdset="1">
101 <name>margin</name> 101 <name>margin</name>
102 <number>3</number> 102 <number>5</number>
103 </property> 103 </property>
104 <property stdset="1"> 104 <property stdset="1">
105 <name>spacing</name> 105 <name>spacing</name>
106 <number>3</number> 106 <number>3</number>
107 </property> 107 </property>
108 <widget> 108 <widget row="1" column="1" >
109 <class>QLayoutWidget</class> 109 <class>QSpinBox</class>
110 <property stdset="1"> 110 <property stdset="1">
111 <name>name</name> 111 <name>name</name>
112 <cstring>Layout11</cstring> 112 <cstring>interval_lightoff</cstring>
113 </property> 113 </property>
114 <property> 114 <property stdset="1">
115 <name>layoutMargin</name> 115 <name>suffix</name>
116 <string> sec</string>
116 </property> 117 </property>
117 <property> 118 <property stdset="1">
118 <name>layoutSpacing</name> 119 <name>specialValueText</name>
120 <string>never</string>
121 </property>
122 <property stdset="1">
123 <name>buttonSymbols</name>
124 <enum>PlusMinus</enum>
125 </property>
126 <property stdset="1">
127 <name>maxValue</name>
128 <number>3600</number>
129 </property>
130 <property stdset="1">
131 <name>minValue</name>
132 <number>0</number>
133 </property>
134 <property stdset="1">
135 <name>lineStep</name>
136 <number>10</number>
119 </property> 137 </property>
120 <grid>
121 <property stdset="1">
122 <name>margin</name>
123 <number>3</number>
124 </property>
125 <property stdset="1">
126 <name>spacing</name>
127 <number>3</number>
128 </property>
129 <widget row="1" column="1" >
130 <class>QSpinBox</class>
131 <property stdset="1">
132 <name>name</name>
133 <cstring>interval_lightoff</cstring>
134 </property>
135 <property stdset="1">
136 <name>suffix</name>
137 <string> sec</string>
138 </property>
139 <property stdset="1">
140 <name>specialValueText</name>
141 <string>never</string>
142 </property>
143 <property stdset="1">
144 <name>buttonSymbols</name>
145 <enum>PlusMinus</enum>
146 </property>
147 <property stdset="1">
148 <name>maxValue</name>
149 <number>3600</number>
150 </property>
151 <property stdset="1">
152 <name>minValue</name>
153 <number>0</number>
154 </property>
155 <property stdset="1">
156 <name>lineStep</name>
157 <number>10</number>
158 </property>
159 </widget>
160 <widget row="1" column="0" >
161 <class>QLabel</class>
162 <property stdset="1">
163 <name>name</name>
164 <cstring>TextLabel2_2</cstring>
165 </property>
166 <property stdset="1">
167 <name>text</name>
168 <string>Light off after</string>
169 </property>
170 </widget>
171 <widget row="0" column="0" >
172 <class>QLabel</class>
173 <property stdset="1">
174 <name>name</name>
175 <cstring>TextLabel1_3</cstring>
176 </property>
177 <property stdset="1">
178 <name>sizePolicy</name>
179 <sizepolicy>
180 <hsizetype>7</hsizetype>
181 <vsizetype>1</vsizetype>
182 </sizepolicy>
183 </property>
184 <property stdset="1">
185 <name>text</name>
186 <string>Dim light after</string>
187 </property>
188 </widget>
189 <widget row="0" column="1" >
190 <class>QSpinBox</class>
191 <property stdset="1">
192 <name>name</name>
193 <cstring>interval_dim</cstring>
194 </property>
195 <property stdset="1">
196 <name>suffix</name>
197 <string> sec</string>
198 </property>
199 <property stdset="1">
200 <name>specialValueText</name>
201 <string>never</string>
202 </property>
203 <property stdset="1">
204 <name>buttonSymbols</name>
205 <enum>PlusMinus</enum>
206 </property>
207 <property stdset="1">
208 <name>maxValue</name>
209 <number>3600</number>
210 </property>
211 <property stdset="1">
212 <name>minValue</name>
213 <number>0</number>
214 </property>
215 <property stdset="1">
216 <name>lineStep</name>
217 <number>10</number>
218 </property>
219 </widget>
220 <widget row="2" column="1" >
221 <class>QSpinBox</class>
222 <property stdset="1">
223 <name>name</name>
224 <cstring>interval_suspend</cstring>
225 </property>
226 <property stdset="1">
227 <name>suffix</name>
228 <string> sec</string>
229 </property>
230 <property stdset="1">
231 <name>specialValueText</name>
232 <string>never</string>
233 </property>
234 <property stdset="1">
235 <name>buttonSymbols</name>
236 <enum>PlusMinus</enum>
237 </property>
238 <property stdset="1">
239 <name>maxValue</name>
240 <number>3600</number>
241 </property>
242 <property stdset="1">
243 <name>minValue</name>
244 <number>0</number>
245 </property>
246 <property stdset="1">
247 <name>lineStep</name>
248 <number>10</number>
249 </property>
250 </widget>
251 <widget row="2" column="0" >
252 <class>QLabel</class>
253 <property stdset="1">
254 <name>name</name>
255 <cstring>TextLabel1_2</cstring>
256 </property>
257 <property stdset="1">
258 <name>text</name>
259 <string>Suspend after</string>
260 </property>
261 </widget>
262 </grid>
263 </widget> 138 </widget>
264 <widget> 139 <widget row="1" column="0" >
140 <class>QLabel</class>
141 <property stdset="1">
142 <name>name</name>
143 <cstring>TextLabel2_2</cstring>
144 </property>
145 <property stdset="1">
146 <name>sizePolicy</name>
147 <sizepolicy>
148 <hsizetype>3</hsizetype>
149 <vsizetype>1</vsizetype>
150 </sizepolicy>
151 </property>
152 <property stdset="1">
153 <name>text</name>
154 <string>Light off after</string>
155 </property>
156 </widget>
157 <widget row="0" column="0" >
158 <class>QLabel</class>
159 <property stdset="1">
160 <name>name</name>
161 <cstring>TextLabel1_3</cstring>
162 </property>
163 <property stdset="1">
164 <name>sizePolicy</name>
165 <sizepolicy>
166 <hsizetype>3</hsizetype>
167 <vsizetype>1</vsizetype>
168 </sizepolicy>
169 </property>
170 <property stdset="1">
171 <name>text</name>
172 <string>Dim light after</string>
173 </property>
174 </widget>
175 <widget row="0" column="1" >
176 <class>QSpinBox</class>
177 <property stdset="1">
178 <name>name</name>
179 <cstring>interval_dim</cstring>
180 </property>
181 <property stdset="1">
182 <name>suffix</name>
183 <string> sec</string>
184 </property>
185 <property stdset="1">
186 <name>specialValueText</name>
187 <string>never</string>
188 </property>
189 <property stdset="1">
190 <name>buttonSymbols</name>
191 <enum>PlusMinus</enum>
192 </property>
193 <property stdset="1">
194 <name>maxValue</name>
195 <number>3600</number>
196 </property>
197 <property stdset="1">
198 <name>minValue</name>
199 <number>0</number>
200 </property>
201 <property stdset="1">
202 <name>lineStep</name>
203 <number>10</number>
204 </property>
205 </widget>
206 <widget row="2" column="1" >
207 <class>QSpinBox</class>
208 <property stdset="1">
209 <name>name</name>
210 <cstring>interval_suspend</cstring>
211 </property>
212 <property stdset="1">
213 <name>suffix</name>
214 <string> sec</string>
215 </property>
216 <property stdset="1">
217 <name>specialValueText</name>
218 <string>never</string>
219 </property>
220 <property stdset="1">
221 <name>buttonSymbols</name>
222 <enum>PlusMinus</enum>
223 </property>
224 <property stdset="1">
225 <name>maxValue</name>
226 <number>3600</number>
227 </property>
228 <property stdset="1">
229 <name>minValue</name>
230 <number>0</number>
231 </property>
232 <property stdset="1">
233 <name>lineStep</name>
234 <number>10</number>
235 </property>
236 </widget>
237 <widget row="2" column="0" >
238 <class>QLabel</class>
239 <property stdset="1">
240 <name>name</name>
241 <cstring>TextLabel1_2</cstring>
242 </property>
243 <property stdset="1">
244 <name>sizePolicy</name>
245 <sizepolicy>
246 <hsizetype>3</hsizetype>
247 <vsizetype>1</vsizetype>
248 </sizepolicy>
249 </property>
250 <property stdset="1">
251 <name>text</name>
252 <string>Suspend after</string>
253 </property>
254 </widget>
255 <widget row="3" column="0" rowspan="1" colspan="2" >
265 <class>QCheckBox</class> 256 <class>QCheckBox</class>
266 <property stdset="1"> 257 <property stdset="1">
267 <name>name</name> 258 <name>name</name>
268 <cstring>LcdOffOnly</cstring> 259 <cstring>LcdOffOnly</cstring>
269 </property> 260 </property>
270 <property stdset="1"> 261 <property stdset="1">
262 <name>sizePolicy</name>
263 <sizepolicy>
264 <hsizetype>7</hsizetype>
265 <vsizetype>0</vsizetype>
266 </sizepolicy>
267 </property>
268 <property stdset="1">
271 <name>text</name> 269 <name>text</name>
272 <string>Deactivate LCD only (does not suspend)</string> 270 <string>Deactivate LCD only (does not suspend)</string>
273 </property> 271 </property>
274 </widget> 272 </widget>
275 </vbox> 273 </grid>
276 </widget> 274 </widget>
277 <widget> 275 <widget>
278 <class>QGroupBox</class> 276 <class>QGroupBox</class>
279 <property stdset="1"> 277 <property stdset="1">
280 <name>name</name> 278 <name>name</name>
281 <cstring>GroupBox9</cstring> 279 <cstring>GroupBox9</cstring>
282 </property> 280 </property>
283 <property stdset="1"> 281 <property stdset="1">
284 <name>title</name> 282 <name>title</name>
285 <string>Backlight</string> 283 <string>Backlight</string>
286 </property> 284 </property>
287 <property> 285 <property>
288 <name>layoutMargin</name> 286 <name>layoutMargin</name>
289 </property> 287 </property>
290 <property> 288 <property>
291 <name>layoutSpacing</name> 289 <name>layoutSpacing</name>
292 </property> 290 </property>
293 <vbox> 291 <vbox>
294 <property stdset="1"> 292 <property stdset="1">
295 <name>margin</name> 293 <name>margin</name>
296 <number>3</number> 294 <number>5</number>
297 </property> 295 </property>
298 <property stdset="1"> 296 <property stdset="1">
299 <name>spacing</name> 297 <name>spacing</name>
300 <number>3</number> 298 <number>3</number>
301 </property> 299 </property>
302 <widget> 300 <widget>
303 <class>QSlider</class> 301 <class>QSlider</class>
304 <property stdset="1"> 302 <property stdset="1">
305 <name>name</name> 303 <name>name</name>
306 <cstring>brightness</cstring> 304 <cstring>brightness</cstring>
307 </property> 305 </property>
308 <property stdset="1"> 306 <property stdset="1">
309 <name>maxValue</name> 307 <name>maxValue</name>
310 <number>255</number> 308 <number>255</number>
311 </property> 309 </property>
312 <property stdset="1"> 310 <property stdset="1">
313 <name>lineStep</name> 311 <name>lineStep</name>
314 <number>1</number> 312 <number>1</number>
315 </property> 313 </property>
316 <property stdset="1"> 314 <property stdset="1">
317 <name>pageStep</name> 315 <name>pageStep</name>
318 <number>16</number> 316 <number>16</number>
319 </property> 317 </property>
320 <property stdset="1"> 318 <property stdset="1">
@@ -323,56 +321,59 @@
323 </property> 321 </property>
324 <property stdset="1"> 322 <property stdset="1">
325 <name>orientation</name> 323 <name>orientation</name>
326 <enum>Horizontal</enum> 324 <enum>Horizontal</enum>
327 </property> 325 </property>
328 <property stdset="1"> 326 <property stdset="1">
329 <name>tickmarks</name> 327 <name>tickmarks</name>
330 <enum>Right</enum> 328 <enum>Right</enum>
331 </property> 329 </property>
332 <property stdset="1"> 330 <property stdset="1">
333 <name>tickInterval</name> 331 <name>tickInterval</name>
334 <number>32</number> 332 <number>32</number>
335 </property> 333 </property>
336 <property> 334 <property>
337 <name>whatsThis</name> 335 <name>whatsThis</name>
338 <string>set a fix value for backlight</string> 336 <string>set a fix value for backlight</string>
339 </property> 337 </property>
340 </widget> 338 </widget>
341 <widget> 339 <widget>
342 <class>QLayoutWidget</class> 340 <class>QLayoutWidget</class>
343 <property stdset="1"> 341 <property stdset="1">
344 <name>name</name> 342 <name>name</name>
345 <cstring>Layout10</cstring> 343 <cstring>Layout10</cstring>
346 </property> 344 </property>
345 <property>
346 <name>layoutSpacing</name>
347 </property>
347 <hbox> 348 <hbox>
348 <property stdset="1"> 349 <property stdset="1">
349 <name>margin</name> 350 <name>margin</name>
350 <number>0</number> 351 <number>0</number>
351 </property> 352 </property>
352 <property stdset="1"> 353 <property stdset="1">
353 <name>spacing</name> 354 <name>spacing</name>
354 <number>6</number> 355 <number>3</number>
355 </property> 356 </property>
356 <widget> 357 <widget>
357 <class>QLabel</class> 358 <class>QLabel</class>
358 <property stdset="1"> 359 <property stdset="1">
359 <name>name</name> 360 <name>name</name>
360 <cstring>PixmapLabel2</cstring> 361 <cstring>PixmapLabel2</cstring>
361 </property> 362 </property>
362 <property stdset="1"> 363 <property stdset="1">
363 <name>pixmap</name> 364 <name>pixmap</name>
364 <pixmap>image0</pixmap> 365 <pixmap>image0</pixmap>
365 </property> 366 </property>
366 <property stdset="1"> 367 <property stdset="1">
367 <name>scaledContents</name> 368 <name>scaledContents</name>
368 <bool>false</bool> 369 <bool>false</bool>
369 </property> 370 </property>
370 </widget> 371 </widget>
371 <widget> 372 <widget>
372 <class>QLabel</class> 373 <class>QLabel</class>
373 <property stdset="1"> 374 <property stdset="1">
374 <name>name</name> 375 <name>name</name>
375 <cstring>TextLabel4</cstring> 376 <cstring>TextLabel4</cstring>
376 </property> 377 </property>
377 <property stdset="1"> 378 <property stdset="1">
378 <name>text</name> 379 <name>text</name>
@@ -413,56 +414,59 @@
413 </widget> 414 </widget>
414 <widget> 415 <widget>
415 <class>QLabel</class> 416 <class>QLabel</class>
416 <property stdset="1"> 417 <property stdset="1">
417 <name>name</name> 418 <name>name</name>
418 <cstring>PixmapLabel1</cstring> 419 <cstring>PixmapLabel1</cstring>
419 </property> 420 </property>
420 <property stdset="1"> 421 <property stdset="1">
421 <name>pixmap</name> 422 <name>pixmap</name>
422 <pixmap>image1</pixmap> 423 <pixmap>image1</pixmap>
423 </property> 424 </property>
424 <property stdset="1"> 425 <property stdset="1">
425 <name>scaledContents</name> 426 <name>scaledContents</name>
426 <bool>false</bool> 427 <bool>false</bool>
427 </property> 428 </property>
428 </widget> 429 </widget>
429 </hbox> 430 </hbox>
430 </widget> 431 </widget>
431 <widget> 432 <widget>
432 <class>QLayoutWidget</class> 433 <class>QLayoutWidget</class>
433 <property stdset="1"> 434 <property stdset="1">
434 <name>name</name> 435 <name>name</name>
435 <cstring>Layout9</cstring> 436 <cstring>Layout9</cstring>
436 </property> 437 </property>
438 <property>
439 <name>layoutSpacing</name>
440 </property>
437 <hbox> 441 <hbox>
438 <property stdset="1"> 442 <property stdset="1">
439 <name>margin</name> 443 <name>margin</name>
440 <number>0</number> 444 <number>0</number>
441 </property> 445 </property>
442 <property stdset="1"> 446 <property stdset="1">
443 <name>spacing</name> 447 <name>spacing</name>
444 <number>6</number> 448 <number>3</number>
445 </property> 449 </property>
446 <widget> 450 <widget>
447 <class>QCheckBox</class> 451 <class>QCheckBox</class>
448 <property stdset="1"> 452 <property stdset="1">
449 <name>name</name> 453 <name>name</name>
450 <cstring>auto_brightness</cstring> 454 <cstring>auto_brightness</cstring>
451 </property> 455 </property>
452 <property stdset="1"> 456 <property stdset="1">
453 <name>text</name> 457 <name>text</name>
454 <string>Use Light Sensor</string> 458 <string>Use Light Sensor</string>
455 </property> 459 </property>
456 <property> 460 <property>
457 <name>whatsThis</name> 461 <name>whatsThis</name>
458 <string>By sensing the ambient light where you are using your device, the screen light can be adjusted automatically. The brightness setting still affects the average brightness.</string> 462 <string>By sensing the ambient light where you are using your device, the screen light can be adjusted automatically. The brightness setting still affects the average brightness.</string>
459 </property> 463 </property>
460 </widget> 464 </widget>
461 <widget> 465 <widget>
462 <class>QPushButton</class> 466 <class>QPushButton</class>
463 <property stdset="1"> 467 <property stdset="1">
464 <name>name</name> 468 <name>name</name>
465 <cstring>CalibrateLightSensor</cstring> 469 <cstring>CalibrateLightSensor</cstring>
466 </property> 470 </property>
467 <property stdset="1"> 471 <property stdset="1">
468 <name>text</name> 472 <name>text</name>
@@ -492,272 +496,270 @@
492 </property> 496 </property>
493 <property> 497 <property>
494 <name>sizeHint</name> 498 <name>sizeHint</name>
495 <size> 499 <size>
496 <width>20</width> 500 <width>20</width>
497 <height>20</height> 501 <height>20</height>
498 </size> 502 </size>
499 </property> 503 </property>
500 </spacer> 504 </spacer>
501 </vbox> 505 </vbox>
502 </widget> 506 </widget>
503 <widget> 507 <widget>
504 <class>QWidget</class> 508 <class>QWidget</class>
505 <property stdset="1"> 509 <property stdset="1">
506 <name>name</name> 510 <name>name</name>
507 <cstring>tab</cstring> 511 <cstring>tab</cstring>
508 </property> 512 </property>
509 <attribute> 513 <attribute>
510 <name>title</name> 514 <name>title</name>
511 <string>on AC</string> 515 <string>on AC</string>
512 </attribute> 516 </attribute>
513 <vbox> 517 <vbox>
514 <property stdset="1"> 518 <property stdset="1">
515 <name>margin</name> 519 <name>margin</name>
516 <number>3</number> 520 <number>5</number>
517 </property> 521 </property>
518 <property stdset="1"> 522 <property stdset="1">
519 <name>spacing</name> 523 <name>spacing</name>
520 <number>3</number> 524 <number>3</number>
521 </property> 525 </property>
522 <widget> 526 <widget>
523 <class>QGroupBox</class> 527 <class>QGroupBox</class>
524 <property stdset="1"> 528 <property stdset="1">
525 <name>name</name> 529 <name>name</name>
526 <cstring>GroupBox4</cstring> 530 <cstring>GroupBox4</cstring>
527 </property> 531 </property>
528 <property stdset="1"> 532 <property stdset="1">
529 <name>enabled</name> 533 <name>enabled</name>
530 <bool>true</bool> 534 <bool>true</bool>
531 </property> 535 </property>
532 <property stdset="1"> 536 <property stdset="1">
533 <name>title</name> 537 <name>title</name>
534 <string>General Settings</string> 538 <string>General Settings</string>
535 </property> 539 </property>
536 <property> 540 <property>
537 <name>layoutMargin</name> 541 <name>layoutMargin</name>
538 </property> 542 </property>
539 <property> 543 <property>
540 <name>layoutSpacing</name> 544 <name>layoutSpacing</name>
541 </property> 545 </property>
542 <vbox> 546 <grid>
543 <property stdset="1"> 547 <property stdset="1">
544 <name>margin</name> 548 <name>margin</name>
545 <number>3</number> 549 <number>5</number>
546 </property> 550 </property>
547 <property stdset="1"> 551 <property stdset="1">
548 <name>spacing</name> 552 <name>spacing</name>
549 <number>3</number> 553 <number>3</number>
550 </property> 554 </property>
551 <widget> 555 <widget row="1" column="1" >
552 <class>QLayoutWidget</class> 556 <class>QSpinBox</class>
553 <property stdset="1"> 557 <property stdset="1">
554 <name>name</name> 558 <name>name</name>
555 <cstring>Layout14</cstring> 559 <cstring>interval_lightoff_ac_3</cstring>
556 </property> 560 </property>
557 <property> 561 <property stdset="1">
558 <name>layoutMargin</name> 562 <name>suffix</name>
563 <string> sec</string>
559 </property> 564 </property>
560 <property> 565 <property stdset="1">
561 <name>layoutSpacing</name> 566 <name>specialValueText</name>
567 <string>never</string>
568 </property>
569 <property stdset="1">
570 <name>buttonSymbols</name>
571 <enum>PlusMinus</enum>
572 </property>
573 <property stdset="1">
574 <name>maxValue</name>
575 <number>3600</number>
576 </property>
577 <property stdset="1">
578 <name>minValue</name>
579 <number>0</number>
580 </property>
581 <property stdset="1">
582 <name>lineStep</name>
583 <number>10</number>
562 </property> 584 </property>
563 <grid>
564 <property stdset="1">
565 <name>margin</name>
566 <number>3</number>
567 </property>
568 <property stdset="1">
569 <name>spacing</name>
570 <number>3</number>
571 </property>
572 <widget row="1" column="1" >
573 <class>QSpinBox</class>
574 <property stdset="1">
575 <name>name</name>
576 <cstring>interval_lightoff_ac_3</cstring>
577 </property>
578 <property stdset="1">
579 <name>suffix</name>
580 <string> sec</string>
581 </property>
582 <property stdset="1">
583 <name>specialValueText</name>
584 <string>never</string>
585 </property>
586 <property stdset="1">
587 <name>buttonSymbols</name>
588 <enum>PlusMinus</enum>
589 </property>
590 <property stdset="1">
591 <name>maxValue</name>
592 <number>3600</number>
593 </property>
594 <property stdset="1">
595 <name>minValue</name>
596 <number>0</number>
597 </property>
598 <property stdset="1">
599 <name>lineStep</name>
600 <number>10</number>
601 </property>
602 </widget>
603 <widget row="0" column="0" >
604 <class>QLabel</class>
605 <property stdset="1">
606 <name>name</name>
607 <cstring>TextLabel1_3_2</cstring>
608 </property>
609 <property stdset="1">
610 <name>sizePolicy</name>
611 <sizepolicy>
612 <hsizetype>7</hsizetype>
613 <vsizetype>1</vsizetype>
614 </sizepolicy>
615 </property>
616 <property stdset="1">
617 <name>text</name>
618 <string>Dim light after</string>
619 </property>
620 </widget>
621 <widget row="2" column="1" >
622 <class>QSpinBox</class>
623 <property stdset="1">
624 <name>name</name>
625 <cstring>interval_suspend_ac_3</cstring>
626 </property>
627 <property stdset="1">
628 <name>suffix</name>
629 <string> sec</string>
630 </property>
631 <property stdset="1">
632 <name>specialValueText</name>
633 <string>never</string>
634 </property>
635 <property stdset="1">
636 <name>buttonSymbols</name>
637 <enum>PlusMinus</enum>
638 </property>
639 <property stdset="1">
640 <name>maxValue</name>
641 <number>3600</number>
642 </property>
643 <property stdset="1">
644 <name>minValue</name>
645 <number>0</number>
646 </property>
647 <property stdset="1">
648 <name>lineStep</name>
649 <number>10</number>
650 </property>
651 </widget>
652 <widget row="2" column="0" >
653 <class>QLabel</class>
654 <property stdset="1">
655 <name>name</name>
656 <cstring>TextLabel1_2_2_3</cstring>
657 </property>
658 <property stdset="1">
659 <name>text</name>
660 <string>Suspend after</string>
661 </property>
662 </widget>
663 <widget row="0" column="1" >
664 <class>QSpinBox</class>
665 <property stdset="1">
666 <name>name</name>
667 <cstring>interval_dim_ac_3</cstring>
668 </property>
669 <property stdset="1">
670 <name>suffix</name>
671 <string> sec</string>
672 </property>
673 <property stdset="1">
674 <name>specialValueText</name>
675 <string>never</string>
676 </property>
677 <property stdset="1">
678 <name>buttonSymbols</name>
679 <enum>PlusMinus</enum>
680 </property>
681 <property stdset="1">
682 <name>maxValue</name>
683 <number>3600</number>
684 </property>
685 <property stdset="1">
686 <name>minValue</name>
687 <number>0</number>
688 </property>
689 <property stdset="1">
690 <name>lineStep</name>
691 <number>10</number>
692 </property>
693 </widget>
694 <widget row="1" column="0" >
695 <class>QLabel</class>
696 <property stdset="1">
697 <name>name</name>
698 <cstring>TextLabel2_2_2</cstring>
699 </property>
700 <property stdset="1">
701 <name>text</name>
702 <string>Light off after</string>
703 </property>
704 </widget>
705 </grid>
706 </widget> 585 </widget>
707 <widget> 586 <widget row="0" column="0" >
587 <class>QLabel</class>
588 <property stdset="1">
589 <name>name</name>
590 <cstring>TextLabel1_3_2</cstring>
591 </property>
592 <property stdset="1">
593 <name>sizePolicy</name>
594 <sizepolicy>
595 <hsizetype>3</hsizetype>
596 <vsizetype>1</vsizetype>
597 </sizepolicy>
598 </property>
599 <property stdset="1">
600 <name>text</name>
601 <string>Dim light after</string>
602 </property>
603 </widget>
604 <widget row="2" column="1" >
605 <class>QSpinBox</class>
606 <property stdset="1">
607 <name>name</name>
608 <cstring>interval_suspend_ac_3</cstring>
609 </property>
610 <property stdset="1">
611 <name>suffix</name>
612 <string> sec</string>
613 </property>
614 <property stdset="1">
615 <name>specialValueText</name>
616 <string>never</string>
617 </property>
618 <property stdset="1">
619 <name>buttonSymbols</name>
620 <enum>PlusMinus</enum>
621 </property>
622 <property stdset="1">
623 <name>maxValue</name>
624 <number>3600</number>
625 </property>
626 <property stdset="1">
627 <name>minValue</name>
628 <number>0</number>
629 </property>
630 <property stdset="1">
631 <name>lineStep</name>
632 <number>10</number>
633 </property>
634 </widget>
635 <widget row="2" column="0" >
636 <class>QLabel</class>
637 <property stdset="1">
638 <name>name</name>
639 <cstring>TextLabel1_2_2_3</cstring>
640 </property>
641 <property stdset="1">
642 <name>sizePolicy</name>
643 <sizepolicy>
644 <hsizetype>3</hsizetype>
645 <vsizetype>1</vsizetype>
646 </sizepolicy>
647 </property>
648 <property stdset="1">
649 <name>text</name>
650 <string>Suspend after</string>
651 </property>
652 </widget>
653 <widget row="0" column="1" >
654 <class>QSpinBox</class>
655 <property stdset="1">
656 <name>name</name>
657 <cstring>interval_dim_ac_3</cstring>
658 </property>
659 <property stdset="1">
660 <name>suffix</name>
661 <string> sec</string>
662 </property>
663 <property stdset="1">
664 <name>specialValueText</name>
665 <string>never</string>
666 </property>
667 <property stdset="1">
668 <name>buttonSymbols</name>
669 <enum>PlusMinus</enum>
670 </property>
671 <property stdset="1">
672 <name>maxValue</name>
673 <number>3600</number>
674 </property>
675 <property stdset="1">
676 <name>minValue</name>
677 <number>0</number>
678 </property>
679 <property stdset="1">
680 <name>lineStep</name>
681 <number>10</number>
682 </property>
683 </widget>
684 <widget row="1" column="0" >
685 <class>QLabel</class>
686 <property stdset="1">
687 <name>name</name>
688 <cstring>TextLabel2_2_2</cstring>
689 </property>
690 <property stdset="1">
691 <name>sizePolicy</name>
692 <sizepolicy>
693 <hsizetype>3</hsizetype>
694 <vsizetype>1</vsizetype>
695 </sizepolicy>
696 </property>
697 <property stdset="1">
698 <name>text</name>
699 <string>Light off after</string>
700 </property>
701 </widget>
702 <widget row="3" column="0" rowspan="1" colspan="2" >
708 <class>QCheckBox</class> 703 <class>QCheckBox</class>
709 <property stdset="1"> 704 <property stdset="1">
710 <name>name</name> 705 <name>name</name>
711 <cstring>LcdOffOnly_2_3</cstring> 706 <cstring>LcdOffOnly_2_3</cstring>
712 </property> 707 </property>
713 <property stdset="1"> 708 <property stdset="1">
709 <name>sizePolicy</name>
710 <sizepolicy>
711 <hsizetype>7</hsizetype>
712 <vsizetype>0</vsizetype>
713 </sizepolicy>
714 </property>
715 <property stdset="1">
714 <name>text</name> 716 <name>text</name>
715 <string>Deactivate LCD only (does not suspend)</string> 717 <string>Deactivate LCD only (does not suspend)</string>
716 </property> 718 </property>
717 </widget> 719 </widget>
718 </vbox> 720 </grid>
719 </widget> 721 </widget>
720 <widget> 722 <widget>
721 <class>QGroupBox</class> 723 <class>QGroupBox</class>
722 <property stdset="1"> 724 <property stdset="1">
723 <name>name</name> 725 <name>name</name>
724 <cstring>GroupBox8</cstring> 726 <cstring>GroupBox8</cstring>
725 </property> 727 </property>
726 <property stdset="1"> 728 <property stdset="1">
727 <name>title</name> 729 <name>title</name>
728 <string>Backlight</string> 730 <string>Backlight</string>
729 </property> 731 </property>
730 <property> 732 <property>
731 <name>layoutMargin</name> 733 <name>layoutMargin</name>
732 </property> 734 </property>
733 <property> 735 <property>
734 <name>layoutSpacing</name> 736 <name>layoutSpacing</name>
735 </property> 737 </property>
736 <vbox> 738 <vbox>
737 <property stdset="1"> 739 <property stdset="1">
738 <name>margin</name> 740 <name>margin</name>
739 <number>3</number> 741 <number>5</number>
740 </property> 742 </property>
741 <property stdset="1"> 743 <property stdset="1">
742 <name>spacing</name> 744 <name>spacing</name>
743 <number>3</number> 745 <number>3</number>
744 </property> 746 </property>
745 <widget> 747 <widget>
746 <class>QSlider</class> 748 <class>QSlider</class>
747 <property stdset="1"> 749 <property stdset="1">
748 <name>name</name> 750 <name>name</name>
749 <cstring>brightness_ac_3</cstring> 751 <cstring>brightness_ac_3</cstring>
750 </property> 752 </property>
751 <property stdset="1"> 753 <property stdset="1">
752 <name>minValue</name> 754 <name>minValue</name>
753 <number>0</number> 755 <number>0</number>
754 </property> 756 </property>
755 <property stdset="1"> 757 <property stdset="1">
756 <name>maxValue</name> 758 <name>maxValue</name>
757 <number>255</number> 759 <number>255</number>
758 </property> 760 </property>
759 <property stdset="1"> 761 <property stdset="1">
760 <name>lineStep</name> 762 <name>lineStep</name>
761 <number>16</number> 763 <number>16</number>
762 </property> 764 </property>
763 <property stdset="1"> 765 <property stdset="1">
@@ -770,56 +772,59 @@
770 </property> 772 </property>
771 <property stdset="1"> 773 <property stdset="1">
772 <name>tracking</name> 774 <name>tracking</name>
773 <bool>true</bool> 775 <bool>true</bool>
774 </property> 776 </property>
775 <property stdset="1"> 777 <property stdset="1">
776 <name>orientation</name> 778 <name>orientation</name>
777 <enum>Horizontal</enum> 779 <enum>Horizontal</enum>
778 </property> 780 </property>
779 <property stdset="1"> 781 <property stdset="1">
780 <name>tickmarks</name> 782 <name>tickmarks</name>
781 <enum>Right</enum> 783 <enum>Right</enum>
782 </property> 784 </property>
783 <property> 785 <property>
784 <name>whatsThis</name> 786 <name>whatsThis</name>
785 <string>set a fix value for backlight</string> 787 <string>set a fix value for backlight</string>
786 </property> 788 </property>
787 </widget> 789 </widget>
788 <widget> 790 <widget>
789 <class>QLayoutWidget</class> 791 <class>QLayoutWidget</class>
790 <property stdset="1"> 792 <property stdset="1">
791 <name>name</name> 793 <name>name</name>
792 <cstring>Layout20</cstring> 794 <cstring>Layout20</cstring>
793 </property> 795 </property>
796 <property>
797 <name>layoutSpacing</name>
798 </property>
794 <hbox> 799 <hbox>
795 <property stdset="1"> 800 <property stdset="1">
796 <name>margin</name> 801 <name>margin</name>
797 <number>0</number> 802 <number>0</number>
798 </property> 803 </property>
799 <property stdset="1"> 804 <property stdset="1">
800 <name>spacing</name> 805 <name>spacing</name>
801 <number>6</number> 806 <number>3</number>
802 </property> 807 </property>
803 <widget> 808 <widget>
804 <class>QLabel</class> 809 <class>QLabel</class>
805 <property stdset="1"> 810 <property stdset="1">
806 <name>name</name> 811 <name>name</name>
807 <cstring>PixmapLabel2_2_3</cstring> 812 <cstring>PixmapLabel2_2_3</cstring>
808 </property> 813 </property>
809 <property stdset="1"> 814 <property stdset="1">
810 <name>pixmap</name> 815 <name>pixmap</name>
811 <pixmap>image2</pixmap> 816 <pixmap>image2</pixmap>
812 </property> 817 </property>
813 <property stdset="1"> 818 <property stdset="1">
814 <name>scaledContents</name> 819 <name>scaledContents</name>
815 <bool>false</bool> 820 <bool>false</bool>
816 </property> 821 </property>
817 </widget> 822 </widget>
818 <widget> 823 <widget>
819 <class>QLabel</class> 824 <class>QLabel</class>
820 <property stdset="1"> 825 <property stdset="1">
821 <name>name</name> 826 <name>name</name>
822 <cstring>TextLabel6</cstring> 827 <cstring>TextLabel6</cstring>
823 </property> 828 </property>
824 <property stdset="1"> 829 <property stdset="1">
825 <name>text</name> 830 <name>text</name>
@@ -860,56 +865,59 @@
860 </widget> 865 </widget>
861 <widget> 866 <widget>
862 <class>QLabel</class> 867 <class>QLabel</class>
863 <property stdset="1"> 868 <property stdset="1">
864 <name>name</name> 869 <name>name</name>
865 <cstring>PixmapLabel1_2_3</cstring> 870 <cstring>PixmapLabel1_2_3</cstring>
866 </property> 871 </property>
867 <property stdset="1"> 872 <property stdset="1">
868 <name>pixmap</name> 873 <name>pixmap</name>
869 <pixmap>image1</pixmap> 874 <pixmap>image1</pixmap>
870 </property> 875 </property>
871 <property stdset="1"> 876 <property stdset="1">
872 <name>scaledContents</name> 877 <name>scaledContents</name>
873 <bool>false</bool> 878 <bool>false</bool>
874 </property> 879 </property>
875 </widget> 880 </widget>
876 </hbox> 881 </hbox>
877 </widget> 882 </widget>
878 <widget> 883 <widget>
879 <class>QLayoutWidget</class> 884 <class>QLayoutWidget</class>
880 <property stdset="1"> 885 <property stdset="1">
881 <name>name</name> 886 <name>name</name>
882 <cstring>Layout10</cstring> 887 <cstring>Layout10</cstring>
883 </property> 888 </property>
889 <property>
890 <name>layoutSpacing</name>
891 </property>
884 <hbox> 892 <hbox>
885 <property stdset="1"> 893 <property stdset="1">
886 <name>margin</name> 894 <name>margin</name>
887 <number>0</number> 895 <number>0</number>
888 </property> 896 </property>
889 <property stdset="1"> 897 <property stdset="1">
890 <name>spacing</name> 898 <name>spacing</name>
891 <number>6</number> 899 <number>3</number>
892 </property> 900 </property>
893 <widget> 901 <widget>
894 <class>QCheckBox</class> 902 <class>QCheckBox</class>
895 <property stdset="1"> 903 <property stdset="1">
896 <name>name</name> 904 <name>name</name>
897 <cstring>auto_brightness_ac_3</cstring> 905 <cstring>auto_brightness_ac_3</cstring>
898 </property> 906 </property>
899 <property stdset="1"> 907 <property stdset="1">
900 <name>text</name> 908 <name>text</name>
901 <string>Use Light Sensor</string> 909 <string>Use Light Sensor</string>
902 </property> 910 </property>
903 <property> 911 <property>
904 <name>whatsThis</name> 912 <name>whatsThis</name>
905 <string>By sensing the ambient light where you are using your device, the screen light can be adjusted automatically. The brightness setting still affects the average brightness.</string> 913 <string>By sensing the ambient light where you are using your device, the screen light can be adjusted automatically. The brightness setting still affects the average brightness.</string>
906 </property> 914 </property>
907 </widget> 915 </widget>
908 <widget> 916 <widget>
909 <class>QPushButton</class> 917 <class>QPushButton</class>
910 <property stdset="1"> 918 <property stdset="1">
911 <name>name</name> 919 <name>name</name>
912 <cstring>CalibrateLightSensorAC</cstring> 920 <cstring>CalibrateLightSensorAC</cstring>
913 </property> 921 </property>
914 <property stdset="1"> 922 <property stdset="1">
915 <name>text</name> 923 <name>text</name>
@@ -939,237 +947,226 @@
939 </property> 947 </property>
940 <property> 948 <property>
941 <name>sizeHint</name> 949 <name>sizeHint</name>
942 <size> 950 <size>
943 <width>20</width> 951 <width>20</width>
944 <height>20</height> 952 <height>20</height>
945 </size> 953 </size>
946 </property> 954 </property>
947 </spacer> 955 </spacer>
948 </vbox> 956 </vbox>
949 </widget> 957 </widget>
950 <widget> 958 <widget>
951 <class>QWidget</class> 959 <class>QWidget</class>
952 <property stdset="1"> 960 <property stdset="1">
953 <name>name</name> 961 <name>name</name>
954 <cstring>tab</cstring> 962 <cstring>tab</cstring>
955 </property> 963 </property>
956 <attribute> 964 <attribute>
957 <name>title</name> 965 <name>title</name>
958 <string>Advanced Settings</string> 966 <string>Advanced Settings</string>
959 </attribute> 967 </attribute>
960 <vbox> 968 <vbox>
961 <property stdset="1"> 969 <property stdset="1">
962 <name>margin</name> 970 <name>margin</name>
963 <number>3</number> 971 <number>5</number>
964 </property> 972 </property>
965 <property stdset="1"> 973 <property stdset="1">
966 <name>spacing</name> 974 <name>spacing</name>
967 <number>3</number> 975 <number>3</number>
968 </property> 976 </property>
969 <widget> 977 <widget>
970 <class>QGroupBox</class> 978 <class>QGroupBox</class>
971 <property stdset="1"> 979 <property stdset="1">
972 <name>name</name> 980 <name>name</name>
973 <cstring>GroupBox5</cstring> 981 <cstring>GroupBox5</cstring>
974 </property> 982 </property>
975 <property stdset="1"> 983 <property stdset="1">
976 <name>title</name> 984 <name>title</name>
977 <string>Warnings</string> 985 <string>Warnings</string>
978 </property> 986 </property>
979 <property> 987 <property>
980 <name>layoutMargin</name> 988 <name>layoutMargin</name>
981 </property> 989 </property>
982 <property> 990 <property>
983 <name>layoutSpacing</name> 991 <name>layoutSpacing</name>
984 </property> 992 </property>
985 <vbox> 993 <grid>
986 <property stdset="1"> 994 <property stdset="1">
987 <name>margin</name> 995 <name>margin</name>
988 <number>3</number> 996 <number>5</number>
989 </property> 997 </property>
990 <property stdset="1"> 998 <property stdset="1">
991 <name>spacing</name> 999 <name>spacing</name>
992 <number>3</number> 1000 <number>3</number>
993 </property> 1001 </property>
994 <widget> 1002 <widget row="0" column="0" >
995 <class>QLayoutWidget</class> 1003 <class>QLabel</class>
996 <property stdset="1"> 1004 <property stdset="1">
997 <name>name</name> 1005 <name>name</name>
998 <cstring>Layout18</cstring> 1006 <cstring>TextLabel1</cstring>
1007 </property>
1008 <property stdset="1">
1009 <name>sizePolicy</name>
1010 <sizepolicy>
1011 <hsizetype>3</hsizetype>
1012 <vsizetype>5</vsizetype>
1013 </sizepolicy>
1014 </property>
1015 <property stdset="1">
1016 <name>text</name>
1017 <string>Low power warning interval</string>
1018 </property>
1019 <property stdset="1">
1020 <name>alignment</name>
1021 <set>WordBreak|AlignVCenter|AlignLeft</set>
999 </property> 1022 </property>
1000 <property> 1023 <property>
1001 <name>layoutMargin</name> 1024 <name>wordwrap</name>
1025 </property>
1026 </widget>
1027 <widget row="1" column="1" >
1028 <class>QSpinBox</class>
1029 <property stdset="1">
1030 <name>name</name>
1031 <cstring>lowSpinBox</cstring>
1032 </property>
1033 <property stdset="1">
1034 <name>suffix</name>
1035 <string> %</string>
1036 </property>
1037 <property stdset="1">
1038 <name>buttonSymbols</name>
1039 <enum>PlusMinus</enum>
1040 </property>
1041 <property stdset="1">
1042 <name>maxValue</name>
1043 <number>80</number>
1044 </property>
1045 <property stdset="1">
1046 <name>minValue</name>
1047 <number>2</number>
1002 </property> 1048 </property>
1003 <property> 1049 <property>
1004 <name>layoutSpacing</name> 1050 <name>whatsThis</name>
1051 <string>At what battery level should the low power warning pop up</string>
1005 </property> 1052 </property>
1006 <grid>
1007 <property stdset="1">
1008 <name>margin</name>
1009 <number>3</number>
1010 </property>
1011 <property stdset="1">
1012 <name>spacing</name>
1013 <number>3</number>
1014 </property>
1015 <widget row="0" column="0" >
1016 <class>QLabel</class>
1017 <property stdset="1">
1018 <name>name</name>
1019 <cstring>TextLabel1</cstring>
1020 </property>
1021 <property stdset="1">
1022 <name>sizePolicy</name>
1023 <sizepolicy>
1024 <hsizetype>7</hsizetype>
1025 <vsizetype>5</vsizetype>
1026 </sizepolicy>
1027 </property>
1028 <property stdset="1">
1029 <name>text</name>
1030 <string>Low power warning interval</string>
1031 </property>
1032 <property stdset="1">
1033 <name>alignment</name>
1034 <set>WordBreak|AlignVCenter|AlignLeft</set>
1035 </property>
1036 <property>
1037 <name>wordwrap</name>
1038 </property>
1039 </widget>
1040 <widget row="1" column="1" >
1041 <class>QSpinBox</class>
1042 <property stdset="1">
1043 <name>name</name>
1044 <cstring>lowSpinBox</cstring>
1045 </property>
1046 <property stdset="1">
1047 <name>suffix</name>
1048 <string> %</string>
1049 </property>
1050 <property stdset="1">
1051 <name>maxValue</name>
1052 <number>80</number>
1053 </property>
1054 <property stdset="1">
1055 <name>minValue</name>
1056 <number>2</number>
1057 </property>
1058 <property>
1059 <name>whatsThis</name>
1060 <string>At what battery level should the low power warning pop up</string>
1061 </property>
1062 </widget>
1063 <widget row="0" column="1" >
1064 <class>QSpinBox</class>
1065 <property stdset="1">
1066 <name>name</name>
1067 <cstring>warnintervalBox</cstring>
1068 </property>
1069 <property stdset="1">
1070 <name>suffix</name>
1071 <string> sec</string>
1072 </property>
1073 <property stdset="1">
1074 <name>maxValue</name>
1075 <number>60</number>
1076 </property>
1077 <property stdset="1">
1078 <name>minValue</name>
1079 <number>5</number>
1080 </property>
1081 <property>
1082 <name>whatsThis</name>
1083 <string>how often should be checked for low power. This determines the rate popups occure in low power situations</string>
1084 </property>
1085 </widget>
1086 <widget row="2" column="1" >
1087 <class>QSpinBox</class>
1088 <property stdset="1">
1089 <name>name</name>
1090 <cstring>criticalSpinBox</cstring>
1091 </property>
1092 <property stdset="1">
1093 <name>prefix</name>
1094 <string></string>
1095 </property>
1096 <property stdset="1">
1097 <name>suffix</name>
1098 <string> %</string>
1099 </property>
1100 <property stdset="1">
1101 <name>maxValue</name>
1102 <number>80</number>
1103 </property>
1104 <property stdset="1">
1105 <name>minValue</name>
1106 <number>2</number>
1107 </property>
1108 <property>
1109 <name>whatsThis</name>
1110 <string>At what battery level should the critical power warning pop up</string>
1111 </property>
1112 </widget>
1113 <widget row="1" column="0" >
1114 <class>QLabel</class>
1115 <property stdset="1">
1116 <name>name</name>
1117 <cstring>TextLabel2</cstring>
1118 </property>
1119 <property stdset="1">
1120 <name>sizePolicy</name>
1121 <sizepolicy>
1122 <hsizetype>1</hsizetype>
1123 <vsizetype>5</vsizetype>
1124 </sizepolicy>
1125 </property>
1126 <property stdset="1">
1127 <name>text</name>
1128 <string>very low battery warning at</string>
1129 </property>
1130 </widget>
1131 <widget row="2" column="0" >
1132 <class>QLabel</class>
1133 <property stdset="1">
1134 <name>name</name>
1135 <cstring>TextLabel3</cstring>
1136 </property>
1137 <property stdset="1">
1138 <name>sizePolicy</name>
1139 <sizepolicy>
1140 <hsizetype>1</hsizetype>
1141 <vsizetype>5</vsizetype>
1142 </sizepolicy>
1143 </property>
1144 <property stdset="1">
1145 <name>text</name>
1146 <string>critical power warning at</string>
1147 </property>
1148 </widget>
1149 </grid>
1150 </widget> 1053 </widget>
1151 </vbox> 1054 <widget row="0" column="1" >
1055 <class>QSpinBox</class>
1056 <property stdset="1">
1057 <name>name</name>
1058 <cstring>warnintervalBox</cstring>
1059 </property>
1060 <property stdset="1">
1061 <name>suffix</name>
1062 <string> sec</string>
1063 </property>
1064 <property stdset="1">
1065 <name>buttonSymbols</name>
1066 <enum>PlusMinus</enum>
1067 </property>
1068 <property stdset="1">
1069 <name>maxValue</name>
1070 <number>60</number>
1071 </property>
1072 <property stdset="1">
1073 <name>minValue</name>
1074 <number>5</number>
1075 </property>
1076 <property>
1077 <name>whatsThis</name>
1078 <string>how often should be checked for low power. This determines the rate popups occure in low power situations</string>
1079 </property>
1080 </widget>
1081 <widget row="2" column="1" >
1082 <class>QSpinBox</class>
1083 <property stdset="1">
1084 <name>name</name>
1085 <cstring>criticalSpinBox</cstring>
1086 </property>
1087 <property stdset="1">
1088 <name>prefix</name>
1089 <string></string>
1090 </property>
1091 <property stdset="1">
1092 <name>suffix</name>
1093 <string> %</string>
1094 </property>
1095 <property stdset="1">
1096 <name>buttonSymbols</name>
1097 <enum>PlusMinus</enum>
1098 </property>
1099 <property stdset="1">
1100 <name>maxValue</name>
1101 <number>80</number>
1102 </property>
1103 <property stdset="1">
1104 <name>minValue</name>
1105 <number>2</number>
1106 </property>
1107 <property>
1108 <name>whatsThis</name>
1109 <string>At what battery level should the critical power warning pop up</string>
1110 </property>
1111 </widget>
1112 <widget row="1" column="0" >
1113 <class>QLabel</class>
1114 <property stdset="1">
1115 <name>name</name>
1116 <cstring>TextLabel2</cstring>
1117 </property>
1118 <property stdset="1">
1119 <name>sizePolicy</name>
1120 <sizepolicy>
1121 <hsizetype>1</hsizetype>
1122 <vsizetype>5</vsizetype>
1123 </sizepolicy>
1124 </property>
1125 <property stdset="1">
1126 <name>text</name>
1127 <string>very low battery warning at</string>
1128 </property>
1129 </widget>
1130 <widget row="2" column="0" >
1131 <class>QLabel</class>
1132 <property stdset="1">
1133 <name>name</name>
1134 <cstring>TextLabel3</cstring>
1135 </property>
1136 <property stdset="1">
1137 <name>sizePolicy</name>
1138 <sizepolicy>
1139 <hsizetype>1</hsizetype>
1140 <vsizetype>5</vsizetype>
1141 </sizepolicy>
1142 </property>
1143 <property stdset="1">
1144 <name>text</name>
1145 <string>critical power warning at</string>
1146 </property>
1147 </widget>
1148 </grid>
1152 </widget> 1149 </widget>
1153 <spacer> 1150 <spacer>
1154 <property> 1151 <property>
1155 <name>name</name> 1152 <name>name</name>
1156 <cstring>Spacer1</cstring> 1153 <cstring>Spacer1</cstring>
1157 </property> 1154 </property>
1158 <property stdset="1"> 1155 <property stdset="1">
1159 <name>orientation</name> 1156 <name>orientation</name>
1160 <enum>Vertical</enum> 1157 <enum>Vertical</enum>
1161 </property> 1158 </property>
1162 <property stdset="1"> 1159 <property stdset="1">
1163 <name>sizeType</name> 1160 <name>sizeType</name>
1164 <enum>Expanding</enum> 1161 <enum>Expanding</enum>
1165 </property> 1162 </property>
1166 <property> 1163 <property>
1167 <name>sizeHint</name> 1164 <name>sizeHint</name>
1168 <size> 1165 <size>
1169 <width>20</width> 1166 <width>20</width>
1170 <height>20</height> 1167 <height>20</height>
1171 </size> 1168 </size>
1172 </property> 1169 </property>
1173 </spacer> 1170 </spacer>
1174 </vbox> 1171 </vbox>
1175 </widget> 1172 </widget>
@@ -1254,46 +1251,60 @@
1254 <connection> 1251 <connection>
1255 <sender>auto_brightness_ac_3</sender> 1252 <sender>auto_brightness_ac_3</sender>
1256 <signal>toggled(bool)</signal> 1253 <signal>toggled(bool)</signal>
1257 <receiver>PixmapLabel2_2_3</receiver> 1254 <receiver>PixmapLabel2_2_3</receiver>
1258 <slot>setDisabled(bool)</slot> 1255 <slot>setDisabled(bool)</slot>
1259 </connection> 1256 </connection>
1260 <connection> 1257 <connection>
1261 <sender>auto_brightness_ac_3</sender> 1258 <sender>auto_brightness_ac_3</sender>
1262 <signal>toggled(bool)</signal> 1259 <signal>toggled(bool)</signal>
1263 <receiver>TextLabel6</receiver> 1260 <receiver>TextLabel6</receiver>
1264 <slot>setDisabled(bool)</slot> 1261 <slot>setDisabled(bool)</slot>
1265 </connection> 1262 </connection>
1266 <connection> 1263 <connection>
1267 <sender>auto_brightness_ac_3</sender> 1264 <sender>auto_brightness_ac_3</sender>
1268 <signal>toggled(bool)</signal> 1265 <signal>toggled(bool)</signal>
1269 <receiver>TextLabel7</receiver> 1266 <receiver>TextLabel7</receiver>
1270 <slot>setDisabled(bool)</slot> 1267 <slot>setDisabled(bool)</slot>
1271 </connection> 1268 </connection>
1272 <connection> 1269 <connection>
1273 <sender>auto_brightness_ac_3</sender> 1270 <sender>auto_brightness_ac_3</sender>
1274 <signal>toggled(bool)</signal> 1271 <signal>toggled(bool)</signal>
1275 <receiver>PixmapLabel1_2_3</receiver> 1272 <receiver>PixmapLabel1_2_3</receiver>
1276 <slot>setDisabled(bool)</slot> 1273 <slot>setDisabled(bool)</slot>
1277 </connection> 1274 </connection>
1275 <connection>
1276 <sender>CalibrateLightSensor</sender>
1277 <signal>clicked()</signal>
1278 <receiver>LightSettingsBase</receiver>
1279 <slot>calibrateSensor()</slot>
1280 </connection>
1281 <connection>
1282 <sender>CalibrateLightSensorAC</sender>
1283 <signal>clicked()</signal>
1284 <receiver>LightSettingsBase</receiver>
1285 <slot>calibrateSensorAC()</slot>
1286 </connection>
1287 <slot access="public">calibrateSensor()</slot>
1288 <slot access="public">calibrateSensorAC()</slot>
1278</connections> 1289</connections>
1279<tabstops> 1290<tabstops>
1280 <tabstop>interval_dim</tabstop> 1291 <tabstop>interval_dim</tabstop>
1281 <tabstop>interval_lightoff</tabstop> 1292 <tabstop>interval_lightoff</tabstop>
1282 <tabstop>interval_suspend</tabstop> 1293 <tabstop>interval_suspend</tabstop>
1283 <tabstop>LcdOffOnly</tabstop> 1294 <tabstop>LcdOffOnly</tabstop>
1284 <tabstop>brightness</tabstop> 1295 <tabstop>brightness</tabstop>
1285 <tabstop>auto_brightness</tabstop> 1296 <tabstop>auto_brightness</tabstop>
1286 <tabstop>CalibrateLightSensor</tabstop> 1297 <tabstop>CalibrateLightSensor</tabstop>
1287 <tabstop>TabWidget3</tabstop> 1298 <tabstop>TabWidget3</tabstop>
1288 <tabstop>interval_lightoff_ac_3</tabstop> 1299 <tabstop>interval_lightoff_ac_3</tabstop>
1289 <tabstop>interval_suspend_ac_3</tabstop> 1300 <tabstop>interval_suspend_ac_3</tabstop>
1290 <tabstop>interval_dim_ac_3</tabstop> 1301 <tabstop>interval_dim_ac_3</tabstop>
1291 <tabstop>LcdOffOnly_2_3</tabstop> 1302 <tabstop>LcdOffOnly_2_3</tabstop>
1292 <tabstop>brightness_ac_3</tabstop> 1303 <tabstop>brightness_ac_3</tabstop>
1293 <tabstop>auto_brightness_ac_3</tabstop> 1304 <tabstop>auto_brightness_ac_3</tabstop>
1294 <tabstop>CalibrateLightSensorAC</tabstop> 1305 <tabstop>CalibrateLightSensorAC</tabstop>
1295 <tabstop>lowSpinBox</tabstop> 1306 <tabstop>lowSpinBox</tabstop>
1296 <tabstop>warnintervalBox</tabstop> 1307 <tabstop>warnintervalBox</tabstop>
1297 <tabstop>criticalSpinBox</tabstop> 1308 <tabstop>criticalSpinBox</tabstop>
1298</tabstops> 1309</tabstops>
1299</UI> 1310</UI>
diff --git a/core/settings/light-and-power/sensor.cpp b/core/settings/light-and-power/sensor.cpp
new file mode 100644
index 0000000..ddd71d6
--- a/dev/null
+++ b/core/settings/light-and-power/sensor.cpp
@@ -0,0 +1,85 @@
1/*
2 This file is part of the OPIE Project
3               =. Copyright (c) 2002 Maximilian Reiss <harlekin@handhelds.org>
4             .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org>
5           .>+-=
6 _;:,     .>    :=|. This file is free software; you can
7.> <`_,   >  .   <= redistribute it and/or modify it under
8:`=1 )Y*s>-.--   : the terms of the GNU General Public
9.="- .-=="i,     .._ License as published by the Free Software
10 - .   .-<_>     .<> Foundation; either version 2 of the License,
11     ._= =}       : or (at your option) any later version.
12    .%`+i>       _;_.
13    .i_,=:_.      -<s. This file is distributed in the hope that
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15    : ..    .:,     . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
18..}^=.=       =       ; Public License for more details.
19++=   -.     .`     .:
20 :     =  ...= . :.=- You should have received a copy of the GNU
21 -.   .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
28#include <qframe.h>
29#include <qlayout.h>
30#include <qslider.h>
31#include <qspinbox.h>
32
33#include "calibration.h"
34#include "sensor.h"
35
36Sensor::Sensor ( QStringList &params, QWidget *parent, const char *name )
37 : SensorBase ( parent, name, true, WStyle_ContextHelp ), m_params ( params )
38{
39 int steps = 5;
40 int inter = 5;
41
42 int smin = 0;
43 int smax = 255;
44 int lmin = 0;
45 int lmax = 255;
46
47 switch ( params. count ( )) {
48 case 6: lmax = params [5]. toInt ( );
49 case 5: lmin = params [4]. toInt ( );
50 case 4: smax = params [3]. toInt ( );
51 case 3: smin = params [2]. toInt ( );
52 case 2: steps = params [1]. toInt ( );
53 case 1: inter = params [0]. toInt ( );
54 }
55
56 QVBoxLayout *lay = new QVBoxLayout ( frame );
57 lay-> setMargin ( 2 );
58 m_calib = new Calibration ( frame );
59 lay-> add ( m_calib );
60
61 m_calib-> setScale ( QSize ( 256, 256 ));
62 m_calib-> setLineSteps ( steps );
63 m_calib-> setInterval ( inter );
64 m_calib-> setStartPoint ( QPoint ( smin, lmin ));
65 m_calib-> setEndPoint ( QPoint ( smax, lmax ));
66
67 interval-> setValue ( inter );
68 linesteps-> setValue ( steps );
69
70 connect ( interval, SIGNAL( valueChanged ( int )), m_calib, SLOT( setInterval ( int )));
71 connect ( linesteps, SIGNAL( valueChanged ( int )), m_calib, SLOT( setLineSteps ( int )));
72}
73
74void Sensor::accept ( )
75{
76 m_params. clear ( );
77 m_params << QString::number ( m_calib-> interval ( ))
78 << QString::number ( m_calib-> lineSteps ( ))
79 << QString::number ( m_calib-> startPoint ( ). x ( ))
80 << QString::number ( m_calib-> endPoint ( ). x ( ))
81 << QString::number ( m_calib-> startPoint ( ). y ( ))
82 << QString::number ( m_calib-> endPoint ( ). y ( ));
83
84 QDialog::accept ( );
85}
diff --git a/core/settings/light-and-power/sensor.h b/core/settings/light-and-power/sensor.h
new file mode 100644
index 0000000..7a26d81
--- a/dev/null
+++ b/core/settings/light-and-power/sensor.h
@@ -0,0 +1,47 @@
1/*
2 This file is part of the OPIE Project
3               =. Copyright (c) 2002 Maximilian Reiss <harlekin@handhelds.org>
4             .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org>
5           .>+-=
6 _;:,     .>    :=|. This file is free software; you can
7.> <`_,   >  .   <= redistribute it and/or modify it under
8:`=1 )Y*s>-.--   : the terms of the GNU General Public
9.="- .-=="i,     .._ License as published by the Free Software
10 - .   .-<_>     .<> Foundation; either version 2 of the License,
11     ._= =}       : or (at your option) any later version.
12    .%`+i>       _;_.
13    .i_,=:_.      -<s. This file is distributed in the hope that
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15    : ..    .:,     . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
18..}^=.=       =       ; Public License for more details.
19++=   -.     .`     .:
20 :     =  ...= . :.=- You should have received a copy of the GNU
21 -.   .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
28#ifndef __SENSOR_H__
29#define __SENSOR_H__
30
31#include "sensorbase.h"
32
33class Calibration;
34class QStringList;
35
36class Sensor : public SensorBase {
37public:
38 Sensor ( QStringList &params, QWidget *parent = 0, const char *name = 0 );
39
40 virtual void accept ( );
41
42private:
43 QStringList &m_params;
44 Calibration *m_calib;
45};
46
47#endif \ No newline at end of file
diff --git a/core/settings/light-and-power/sensorbase.ui b/core/settings/light-and-power/sensorbase.ui
new file mode 100644
index 0000000..98fce88
--- a/dev/null
+++ b/core/settings/light-and-power/sensorbase.ui
@@ -0,0 +1,870 @@
1<!DOCTYPE UI><UI>
2<class>SensorBase</class>
3<widget>
4 <class>QDialog</class>
5 <property stdset="1">
6 <name>name</name>
7 <cstring>SensorBase</cstring>
8 </property>
9 <property stdset="1">
10 <name>geometry</name>
11 <rect>
12 <x>0</x>
13 <y>0</y>
14 <width>293</width>
15 <height>443</height>
16 </rect>
17 </property>
18 <property stdset="1">
19 <name>caption</name>
20 <string>Sensor Calibration</string>
21 </property>
22 <property>
23 <name>layoutMargin</name>
24 </property>
25 <property>
26 <name>layoutSpacing</name>
27 </property>
28 <vbox>
29 <property stdset="1">
30 <name>margin</name>
31 <number>3</number>
32 </property>
33 <property stdset="1">
34 <name>spacing</name>
35 <number>3</number>
36 </property>
37 <widget>
38 <class>QLayoutWidget</class>
39 <property stdset="1">
40 <name>name</name>
41 <cstring>Layout21</cstring>
42 </property>
43 <property>
44 <name>layoutSpacing</name>
45 </property>
46 <grid>
47 <property stdset="1">
48 <name>margin</name>
49 <number>0</number>
50 </property>
51 <property stdset="1">
52 <name>spacing</name>
53 <number>2</number>
54 </property>
55 <widget row="0" column="0" >
56 <class>QLayoutWidget</class>
57 <property stdset="1">
58 <name>name</name>
59 <cstring>Layout20</cstring>
60 </property>
61 <property>
62 <name>layoutSpacing</name>
63 </property>
64 <vbox>
65 <property stdset="1">
66 <name>margin</name>
67 <number>0</number>
68 </property>
69 <property stdset="1">
70 <name>spacing</name>
71 <number>3</number>
72 </property>
73 <widget>
74 <class>QLabel</class>
75 <property stdset="1">
76 <name>name</name>
77 <cstring>PixmapLabel1</cstring>
78 </property>
79 <property stdset="1">
80 <name>pixmap</name>
81 <pixmap>image0</pixmap>
82 </property>
83 <property stdset="1">
84 <name>scaledContents</name>
85 <bool>false</bool>
86 </property>
87 </widget>
88 <widget>
89 <class>QLabel</class>
90 <property stdset="1">
91 <name>name</name>
92 <cstring>TextLabel5</cstring>
93 </property>
94 <property stdset="1">
95 <name>text</name>
96 <string>Full</string>
97 </property>
98 </widget>
99 <spacer>
100 <property>
101 <name>name</name>
102 <cstring>Spacer2</cstring>
103 </property>
104 <property stdset="1">
105 <name>orientation</name>
106 <enum>Vertical</enum>
107 </property>
108 <property stdset="1">
109 <name>sizeType</name>
110 <enum>Expanding</enum>
111 </property>
112 <property>
113 <name>sizeHint</name>
114 <size>
115 <width>20</width>
116 <height>20</height>
117 </size>
118 </property>
119 </spacer>
120 <widget>
121 <class>QLabel</class>
122 <property stdset="1">
123 <name>name</name>
124 <cstring>TextLabel4_3</cstring>
125 </property>
126 <property stdset="1">
127 <name>text</name>
128 <string>Off</string>
129 </property>
130 </widget>
131 <widget>
132 <class>QLabel</class>
133 <property stdset="1">
134 <name>name</name>
135 <cstring>PixmapLabel2</cstring>
136 </property>
137 <property stdset="1">
138 <name>pixmap</name>
139 <pixmap>image1</pixmap>
140 </property>
141 <property stdset="1">
142 <name>scaledContents</name>
143 <bool>false</bool>
144 </property>
145 </widget>
146 </vbox>
147 </widget>
148 <widget row="0" column="1" >
149 <class>QFrame</class>
150 <property stdset="1">
151 <name>name</name>
152 <cstring>frame</cstring>
153 </property>
154 <property stdset="1">
155 <name>frameShape</name>
156 <enum>StyledPanel</enum>
157 </property>
158 <property stdset="1">
159 <name>frameShadow</name>
160 <enum>Sunken</enum>
161 </property>
162 </widget>
163 <widget row="1" column="1" >
164 <class>QLayoutWidget</class>
165 <property stdset="1">
166 <name>name</name>
167 <cstring>Layout16</cstring>
168 </property>
169 <property>
170 <name>layoutSpacing</name>
171 </property>
172 <hbox>
173 <property stdset="1">
174 <name>margin</name>
175 <number>0</number>
176 </property>
177 <property stdset="1">
178 <name>spacing</name>
179 <number>3</number>
180 </property>
181 <widget>
182 <class>QLabel</class>
183 <property stdset="1">
184 <name>name</name>
185 <cstring>TextLabel3_2_2</cstring>
186 </property>
187 <property stdset="1">
188 <name>sizePolicy</name>
189 <sizepolicy>
190 <hsizetype>0</hsizetype>
191 <vsizetype>0</vsizetype>
192 </sizepolicy>
193 </property>
194 <property stdset="1">
195 <name>minimumSize</name>
196 <size>
197 <width>14</width>
198 <height>14</height>
199 </size>
200 </property>
201 <property stdset="1">
202 <name>maximumSize</name>
203 <size>
204 <width>14</width>
205 <height>14</height>
206 </size>
207 </property>
208 <property stdset="1">
209 <name>palette</name>
210 <palette>
211 <active>
212 <color>
213 <red>0</red>
214 <green>0</green>
215 <blue>0</blue>
216 </color>
217 <color>
218 <red>218</red>
219 <green>226</green>
220 <blue>255</blue>
221 </color>
222 <color>
223 <red>255</red>
224 <green>255</green>
225 <blue>255</blue>
226 </color>
227 <color>
228 <red>236</red>
229 <green>240</green>
230 <blue>255</blue>
231 </color>
232 <color>
233 <red>109</red>
234 <green>113</green>
235 <blue>127</blue>
236 </color>
237 <color>
238 <red>145</red>
239 <green>151</green>
240 <blue>170</blue>
241 </color>
242 <color>
243 <red>0</red>
244 <green>0</green>
245 <blue>0</blue>
246 </color>
247 <color>
248 <red>255</red>
249 <green>255</green>
250 <blue>255</blue>
251 </color>
252 <color>
253 <red>0</red>
254 <green>0</green>
255 <blue>0</blue>
256 </color>
257 <color>
258 <red>255</red>
259 <green>255</green>
260 <blue>255</blue>
261 </color>
262 <color>
263 <red>0</red>
264 <green>0</green>
265 <blue>0</blue>
266 </color>
267 <color>
268 <red>0</red>
269 <green>0</green>
270 <blue>0</blue>
271 </color>
272 <color>
273 <red>10</red>
274 <green>95</green>
275 <blue>137</blue>
276 </color>
277 <color>
278 <red>255</red>
279 <green>255</green>
280 <blue>255</blue>
281 </color>
282 </active>
283 <disabled>
284 <color>
285 <red>128</red>
286 <green>128</green>
287 <blue>128</blue>
288 </color>
289 <color>
290 <red>218</red>
291 <green>226</green>
292 <blue>255</blue>
293 </color>
294 <color>
295 <red>255</red>
296 <green>255</green>
297 <blue>255</blue>
298 </color>
299 <color>
300 <red>255</red>
301 <green>255</green>
302 <blue>255</blue>
303 </color>
304 <color>
305 <red>109</red>
306 <green>113</green>
307 <blue>127</blue>
308 </color>
309 <color>
310 <red>145</red>
311 <green>151</green>
312 <blue>170</blue>
313 </color>
314 <color>
315 <red>0</red>
316 <green>0</green>
317 <blue>0</blue>
318 </color>
319 <color>
320 <red>255</red>
321 <green>255</green>
322 <blue>255</blue>
323 </color>
324 <color>
325 <red>128</red>
326 <green>128</green>
327 <blue>128</blue>
328 </color>
329 <color>
330 <red>255</red>
331 <green>255</green>
332 <blue>255</blue>
333 </color>
334 <color>
335 <red>0</red>
336 <green>0</green>
337 <blue>0</blue>
338 </color>
339 <color>
340 <red>0</red>
341 <green>0</green>
342 <blue>0</blue>
343 </color>
344 <color>
345 <red>10</red>
346 <green>95</green>
347 <blue>137</blue>
348 </color>
349 <color>
350 <red>255</red>
351 <green>255</green>
352 <blue>255</blue>
353 </color>
354 </disabled>
355 <inactive>
356 <color>
357 <red>0</red>
358 <green>0</green>
359 <blue>0</blue>
360 </color>
361 <color>
362 <red>218</red>
363 <green>226</green>
364 <blue>255</blue>
365 </color>
366 <color>
367 <red>255</red>
368 <green>255</green>
369 <blue>255</blue>
370 </color>
371 <color>
372 <red>255</red>
373 <green>255</green>
374 <blue>255</blue>
375 </color>
376 <color>
377 <red>109</red>
378 <green>113</green>
379 <blue>127</blue>
380 </color>
381 <color>
382 <red>145</red>
383 <green>151</green>
384 <blue>170</blue>
385 </color>
386 <color>
387 <red>0</red>
388 <green>0</green>
389 <blue>0</blue>
390 </color>
391 <color>
392 <red>255</red>
393 <green>255</green>
394 <blue>255</blue>
395 </color>
396 <color>
397 <red>0</red>
398 <green>0</green>
399 <blue>0</blue>
400 </color>
401 <color>
402 <red>255</red>
403 <green>255</green>
404 <blue>255</blue>
405 </color>
406 <color>
407 <red>0</red>
408 <green>0</green>
409 <blue>0</blue>
410 </color>
411 <color>
412 <red>0</red>
413 <green>0</green>
414 <blue>0</blue>
415 </color>
416 <color>
417 <red>10</red>
418 <green>95</green>
419 <blue>137</blue>
420 </color>
421 <color>
422 <red>255</red>
423 <green>255</green>
424 <blue>255</blue>
425 </color>
426 </inactive>
427 </palette>
428 </property>
429 <property stdset="1">
430 <name>frameShape</name>
431 <enum>Box</enum>
432 </property>
433 <property stdset="1">
434 <name>frameShadow</name>
435 <enum>Plain</enum>
436 </property>
437 </widget>
438 <widget>
439 <class>QLabel</class>
440 <property stdset="1">
441 <name>name</name>
442 <cstring>TextLabel4_2</cstring>
443 </property>
444 <property stdset="1">
445 <name>text</name>
446 <string>Dark</string>
447 </property>
448 </widget>
449 <spacer>
450 <property>
451 <name>name</name>
452 <cstring>Spacer2_2</cstring>
453 </property>
454 <property stdset="1">
455 <name>orientation</name>
456 <enum>Horizontal</enum>
457 </property>
458 <property stdset="1">
459 <name>sizeType</name>
460 <enum>Expanding</enum>
461 </property>
462 <property>
463 <name>sizeHint</name>
464 <size>
465 <width>20</width>
466 <height>20</height>
467 </size>
468 </property>
469 </spacer>
470 <widget>
471 <class>QLabel</class>
472 <property stdset="1">
473 <name>name</name>
474 <cstring>TextLabel5_2</cstring>
475 </property>
476 <property stdset="1">
477 <name>text</name>
478 <string>Light</string>
479 </property>
480 </widget>
481 <widget>
482 <class>QLabel</class>
483 <property stdset="1">
484 <name>name</name>
485 <cstring>TextLabel3_2</cstring>
486 </property>
487 <property stdset="1">
488 <name>sizePolicy</name>
489 <sizepolicy>
490 <hsizetype>0</hsizetype>
491 <vsizetype>0</vsizetype>
492 </sizepolicy>
493 </property>
494 <property stdset="1">
495 <name>minimumSize</name>
496 <size>
497 <width>14</width>
498 <height>14</height>
499 </size>
500 </property>
501 <property stdset="1">
502 <name>maximumSize</name>
503 <size>
504 <width>14</width>
505 <height>14</height>
506 </size>
507 </property>
508 <property stdset="1">
509 <name>palette</name>
510 <palette>
511 <active>
512 <color>
513 <red>0</red>
514 <green>0</green>
515 <blue>0</blue>
516 </color>
517 <color>
518 <red>218</red>
519 <green>226</green>
520 <blue>255</blue>
521 </color>
522 <color>
523 <red>255</red>
524 <green>255</green>
525 <blue>255</blue>
526 </color>
527 <color>
528 <red>236</red>
529 <green>240</green>
530 <blue>255</blue>
531 </color>
532 <color>
533 <red>109</red>
534 <green>113</green>
535 <blue>127</blue>
536 </color>
537 <color>
538 <red>145</red>
539 <green>151</green>
540 <blue>170</blue>
541 </color>
542 <color>
543 <red>0</red>
544 <green>0</green>
545 <blue>0</blue>
546 </color>
547 <color>
548 <red>255</red>
549 <green>255</green>
550 <blue>255</blue>
551 </color>
552 <color>
553 <red>0</red>
554 <green>0</green>
555 <blue>0</blue>
556 </color>
557 <color>
558 <red>255</red>
559 <green>255</green>
560 <blue>255</blue>
561 </color>
562 <color>
563 <red>255</red>
564 <green>255</green>
565 <blue>255</blue>
566 </color>
567 <color>
568 <red>0</red>
569 <green>0</green>
570 <blue>0</blue>
571 </color>
572 <color>
573 <red>10</red>
574 <green>95</green>
575 <blue>137</blue>
576 </color>
577 <color>
578 <red>255</red>
579 <green>255</green>
580 <blue>255</blue>
581 </color>
582 </active>
583 <disabled>
584 <color>
585 <red>128</red>
586 <green>128</green>
587 <blue>128</blue>
588 </color>
589 <color>
590 <red>218</red>
591 <green>226</green>
592 <blue>255</blue>
593 </color>
594 <color>
595 <red>255</red>
596 <green>255</green>
597 <blue>255</blue>
598 </color>
599 <color>
600 <red>255</red>
601 <green>255</green>
602 <blue>255</blue>
603 </color>
604 <color>
605 <red>109</red>
606 <green>113</green>
607 <blue>127</blue>
608 </color>
609 <color>
610 <red>145</red>
611 <green>151</green>
612 <blue>170</blue>
613 </color>
614 <color>
615 <red>0</red>
616 <green>0</green>
617 <blue>0</blue>
618 </color>
619 <color>
620 <red>255</red>
621 <green>255</green>
622 <blue>255</blue>
623 </color>
624 <color>
625 <red>128</red>
626 <green>128</green>
627 <blue>128</blue>
628 </color>
629 <color>
630 <red>255</red>
631 <green>255</green>
632 <blue>255</blue>
633 </color>
634 <color>
635 <red>255</red>
636 <green>255</green>
637 <blue>255</blue>
638 </color>
639 <color>
640 <red>0</red>
641 <green>0</green>
642 <blue>0</blue>
643 </color>
644 <color>
645 <red>10</red>
646 <green>95</green>
647 <blue>137</blue>
648 </color>
649 <color>
650 <red>255</red>
651 <green>255</green>
652 <blue>255</blue>
653 </color>
654 </disabled>
655 <inactive>
656 <color>
657 <red>0</red>
658 <green>0</green>
659 <blue>0</blue>
660 </color>
661 <color>
662 <red>218</red>
663 <green>226</green>
664 <blue>255</blue>
665 </color>
666 <color>
667 <red>255</red>
668 <green>255</green>
669 <blue>255</blue>
670 </color>
671 <color>
672 <red>255</red>
673 <green>255</green>
674 <blue>255</blue>
675 </color>
676 <color>
677 <red>109</red>
678 <green>113</green>
679 <blue>127</blue>
680 </color>
681 <color>
682 <red>145</red>
683 <green>151</green>
684 <blue>170</blue>
685 </color>
686 <color>
687 <red>0</red>
688 <green>0</green>
689 <blue>0</blue>
690 </color>
691 <color>
692 <red>255</red>
693 <green>255</green>
694 <blue>255</blue>
695 </color>
696 <color>
697 <red>0</red>
698 <green>0</green>
699 <blue>0</blue>
700 </color>
701 <color>
702 <red>255</red>
703 <green>255</green>
704 <blue>255</blue>
705 </color>
706 <color>
707 <red>255</red>
708 <green>255</green>
709 <blue>255</blue>
710 </color>
711 <color>
712 <red>0</red>
713 <green>0</green>
714 <blue>0</blue>
715 </color>
716 <color>
717 <red>10</red>
718 <green>95</green>
719 <blue>137</blue>
720 </color>
721 <color>
722 <red>255</red>
723 <green>255</green>
724 <blue>255</blue>
725 </color>
726 </inactive>
727 </palette>
728 </property>
729 <property stdset="1">
730 <name>frameShape</name>
731 <enum>Box</enum>
732 </property>
733 <property stdset="1">
734 <name>frameShadow</name>
735 <enum>Plain</enum>
736 </property>
737 </widget>
738 </hbox>
739 </widget>
740 </grid>
741 </widget>
742 <widget>
743 <class>QLayoutWidget</class>
744 <property stdset="1">
745 <name>name</name>
746 <cstring>Layout22</cstring>
747 </property>
748 <property>
749 <name>layoutSpacing</name>
750 </property>
751 <hbox>
752 <property stdset="1">
753 <name>margin</name>
754 <number>0</number>
755 </property>
756 <property stdset="1">
757 <name>spacing</name>
758 <number>3</number>
759 </property>
760 <widget>
761 <class>QLabel</class>
762 <property stdset="1">
763 <name>name</name>
764 <cstring>TextLabel4</cstring>
765 </property>
766 <property stdset="1">
767 <name>text</name>
768 <string>Steps</string>
769 </property>
770 </widget>
771 <widget>
772 <class>QSlider</class>
773 <property stdset="1">
774 <name>name</name>
775 <cstring>linesteps</cstring>
776 </property>
777 <property stdset="1">
778 <name>minValue</name>
779 <number>2</number>
780 </property>
781 <property stdset="1">
782 <name>maxValue</name>
783 <number>127</number>
784 </property>
785 <property stdset="1">
786 <name>lineStep</name>
787 <number>10</number>
788 </property>
789 <property stdset="1">
790 <name>orientation</name>
791 <enum>Horizontal</enum>
792 </property>
793 <property stdset="1">
794 <name>tickmarks</name>
795 <enum>Right</enum>
796 </property>
797 </widget>
798 </hbox>
799 </widget>
800 <widget>
801 <class>QLayoutWidget</class>
802 <property stdset="1">
803 <name>name</name>
804 <cstring>Layout28</cstring>
805 </property>
806 <property>
807 <name>layoutSpacing</name>
808 </property>
809 <hbox>
810 <property stdset="1">
811 <name>margin</name>
812 <number>0</number>
813 </property>
814 <property stdset="1">
815 <name>spacing</name>
816 <number>3</number>
817 </property>
818 <widget>
819 <class>QLabel</class>
820 <property stdset="1">
821 <name>name</name>
822 <cstring>TextLabel6</cstring>
823 </property>
824 <property stdset="1">
825 <name>text</name>
826 <string>Check interval</string>
827 </property>
828 </widget>
829 <widget>
830 <class>QSpinBox</class>
831 <property stdset="1">
832 <name>name</name>
833 <cstring>interval</cstring>
834 </property>
835 <property stdset="1">
836 <name>suffix</name>
837 <string> sec</string>
838 </property>
839 <property stdset="1">
840 <name>buttonSymbols</name>
841 <enum>PlusMinus</enum>
842 </property>
843 <property stdset="1">
844 <name>maxValue</name>
845 <number>10</number>
846 </property>
847 <property stdset="1">
848 <name>minValue</name>
849 <number>1</number>
850 </property>
851 <property stdset="1">
852 <name>lineStep</name>
853 <number>1</number>
854 </property>
855 </widget>
856 </hbox>
857 </widget>
858 </vbox>
859</widget>
860<images>
861 <image>
862 <name>image0</name>
863 <data format="XPM.GZ" length="439">789c6d8ec10ac2300c86ef7b8ad0ff36a4730777111f41f1288887b4b3e8610a3a0f22bebb6dd3d54d0ca5cdffe54f9aaaa4dd764d6555dc7beecf96ec896f54b68fae7bee0fab57a1ea86fc5950ad6685d2646973bd1c43ce3ec73c46903648e79a5624443a27d20cd2b9382704747e124382f11a7c5e30b364b957b331866331b3800c38f70282121c7c628367c098c1e0eb03121ccd4b46fcb0f80b26bb4833987f76b6d6f274de5fe6a1a031d30969f55e161fe4715f7b</data>
864 </image>
865 <image>
866 <name>image1</name>
867 <data format="XPM.GZ" length="424">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523234530022130543251d2e253d856405bffcbc54105b19c856360003103711c4354b324b364b06719340dcb434b36488ac1e1a2020a6acac8c2ea60cc54862606ea232b218541b5810452c3111432c510f550c22886a1e482c115d0c2c88e6168818babaa4a42462c48082cae8e68102011a06b5d65c004336518f</data>
868 </image>
869</images>
870</UI>
diff --git a/core/settings/light-and-power/settings.h b/core/settings/light-and-power/settings.h
index adfd735..77290a3 100644
--- a/core/settings/light-and-power/settings.h
+++ b/core/settings/light-and-power/settings.h
@@ -1,55 +1,64 @@
1/********************************************************************** 1/*
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2 This file is part of the OPIE Project
3** 3               =. Copyright (c) 2002 Maximilian Reiss <harlekin@handhelds.org>
4** This file is part of Qtopia Environment. 4             .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org>
5** 5           .>+-=
6** This file may be distributed and/or modified under the terms of the 6 _;:,     .>    :=|. This file is free software; you can
7** GNU General Public License version 2 as published by the Free Software 7.> <`_,   >  .   <= redistribute it and/or modify it under
8** Foundation and appearing in the file LICENSE.GPL included in the 8:`=1 )Y*s>-.--   : the terms of the GNU General Public
9** packaging of this file. 9.="- .-=="i,     .._ License as published by the Free Software
10** 10 - .   .-<_>     .<> Foundation; either version 2 of the License,
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11     ._= =}       : or (at your option) any later version.
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12    .%`+i>       _;_.
13** 13    .i_,=:_.      -<s. This file is distributed in the hope that
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15** 15    : ..    .:,     . . . without even the implied warranty of
16** Contact info@trolltech.com if any conditions of this licensing are 16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17** not clear to you. 17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
18** 18..}^=.=       =       ; Public License for more details.
19**********************************************************************/ 19++=   -.     .`     .:
20 :     =  ...= . :.=- You should have received a copy of the GNU
21 -.   .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
20#ifndef SETTINGS_H 28#ifndef SETTINGS_H
21#define SETTINGS_H 29#define SETTINGS_H
22 30
23 31
24#include <qstrlist.h> 32#include <qstrlist.h>
25#include <qasciidict.h> 33#include <qasciidict.h>
26#include "lightsettingsbase.h" 34#include "lightsettingsbase.h"
27 35
28 36
29class LightSettings : public LightSettingsBase 37class LightSettings : public LightSettingsBase
30{ 38{
31 Q_OBJECT 39 Q_OBJECT
32 40
33public: 41public:
34 LightSettings( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); 42 LightSettings( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
35 ~LightSettings(); 43 ~LightSettings();
36 44
37protected: 45protected:
38 void accept(); 46 void accept();
39 void reject(); 47 void reject();
40 48
41 void done ( int r ); 49 void done ( int r );
42 50
43private slots: 51protected slots:
44 void applyBrightness(); 52 void setBacklight ( int );
45 void applyBrightnessAC(); 53 virtual void calibrateSensor ( );
46 void slotSliderTicks( int steps ); 54 virtual void calibrateSensorAC ( );
47 55
48private: 56private:
49 int initbright; 57 int m_res;
50 int initbright_ac; 58 QStringList m_sensordata;
59 QStringList m_sensordata_ac;
51}; 60};
52 61
53 62
54#endif // SETTINGS_H 63#endif // SETTINGS_H
55 64