summaryrefslogtreecommitdiff
path: root/core/settings/light-and-power
authorkergoth <kergoth>2002-01-25 22:14:26 (UTC)
committer kergoth <kergoth>2002-01-25 22:14:26 (UTC)
commit15318cad33835e4e2dc620d033e43cd930676cdd (patch) (unidiff)
treec2fa0399a2c47fda8e2cd0092c73a809d17f68eb /core/settings/light-and-power
downloadopie-15318cad33835e4e2dc620d033e43cd930676cdd.zip
opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.gz
opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.bz2
Initial revision
Diffstat (limited to 'core/settings/light-and-power') (more/less context) (ignore whitespace changes)
-rw-r--r--core/settings/light-and-power/.cvsignore4
-rw-r--r--core/settings/light-and-power/Makefile.in135
-rw-r--r--core/settings/light-and-power/light-and-power.pro12
-rw-r--r--core/settings/light-and-power/light-off.xpm23
-rw-r--r--core/settings/light-and-power/light-on.xpm24
-rw-r--r--core/settings/light-and-power/light.cpp133
-rw-r--r--core/settings/light-and-power/lightsettingsbase.ui471
-rw-r--r--core/settings/light-and-power/main.cpp38
-rw-r--r--core/settings/light-and-power/qpe-light-and-power.control9
-rw-r--r--core/settings/light-and-power/settings.h50
10 files changed, 899 insertions, 0 deletions
diff --git a/core/settings/light-and-power/.cvsignore b/core/settings/light-and-power/.cvsignore
new file mode 100644
index 0000000..e6ba7a1
--- a/dev/null
+++ b/core/settings/light-and-power/.cvsignore
@@ -0,0 +1,4 @@
1moc_*
2Makefile
3lightsettingsbase.h
4lightsettingsbase.cpp
diff --git a/core/settings/light-and-power/Makefile.in b/core/settings/light-and-power/Makefile.in
new file mode 100644
index 0000000..8236ed0
--- a/dev/null
+++ b/core/settings/light-and-power/Makefile.in
@@ -0,0 +1,135 @@
1#############################################################################
2
3####### Compiler, tools and options
4
5 CXX =$(SYSCONF_CXX) $(QT_CXX_MT)
6 CXXFLAGS=$(SYSCONF_CXXFLAGS_QT) $(SYSCONF_CXXFLAGS)
7 CC =$(SYSCONF_CC) $(QT_C_MT)
8 CFLAGS =$(SYSCONF_CFLAGS)
9 INCPATH =-I$(QPEDIR)/include
10 LFLAGS =$(SYSCONF_LFLAGS_QT) $(SYSCONF_RPATH_QT) $(SYSCONF_LFLAGS) $(QT_LFLAGS_MT)
11 LIBS =$(SUBLIBS) -lqpe $(SYSCONF_LIBS_QT) $(SYSCONF_LIBS) $(SYSCONF_LIBS_QTAPP)
12 MOC =$(SYSCONF_MOC)
13 UIC =$(SYSCONF_UIC)
14
15####### Target
16
17DESTDIR = ../../bin/
18VER_MAJ = 1
19VER_MIN = 0
20VER_PATCH = 0
21 TARGET= light-and-power
22TARGET1 = lib$(TARGET).so.$(VER_MAJ)
23
24####### Files
25
26 HEADERS =settings.h
27 SOURCES =light.cpp \
28 main.cpp
29 OBJECTS =light.o \
30 main.o \
31 lightsettingsbase.o
32INTERFACES = lightsettingsbase.ui
33UICDECLS = lightsettingsbase.h
34UICIMPLS = lightsettingsbase.cpp
35 SRCMOC =moc_settings.cpp \
36 moc_lightsettingsbase.cpp
37 OBJMOC =moc_settings.o \
38 moc_lightsettingsbase.o
39
40
41####### Implicit rules
42
43.SUFFIXES: .cpp .cxx .cc .C .c
44
45.cpp.o:
46 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
47
48.cxx.o:
49 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
50
51.cc.o:
52 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
53
54.C.o:
55 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
56
57.c.o:
58 $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $<
59
60####### Build rules
61
62
63all: $(DESTDIR)$(TARGET)
64
65$(DESTDIR)$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) $(SUBLIBS)
66 $(SYSCONF_LINK) $(LFLAGS) -o $(DESTDIR)$(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS)
67
68moc: $(SRCMOC)
69
70tmake:
71 tmake light-and-power.pro
72
73clean:
74 -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS)
75 -rm -f *~ core
76 -rm -f allmoc.cpp
77
78####### Extension Modules
79
80listpromodules:
81 @echo
82
83listallmodules:
84 @echo
85
86listaddonpromodules:
87 @echo
88
89listaddonentmodules:
90 @echo
91
92
93REQUIRES=
94
95####### Sub-libraries
96
97
98###### Combined headers
99
100
101
102####### Compile
103
104light.o: light.cpp \
105 settings.h \
106 lightsettingsbase.h
107
108main.o: main.cpp \
109 settings.h \
110 lightsettingsbase.h
111
112lightsettingsbase.h: lightsettingsbase.ui
113 $(UIC) lightsettingsbase.ui -o $(INTERFACE_DECL_PATH)/lightsettingsbase.h
114
115lightsettingsbase.cpp: lightsettingsbase.ui
116 $(UIC) lightsettingsbase.ui -i lightsettingsbase.h -o lightsettingsbase.cpp
117
118lightsettingsbase.o: lightsettingsbase.cpp \
119 lightsettingsbase.h \
120 lightsettingsbase.ui
121
122moc_settings.o: moc_settings.cpp \
123 settings.h \
124 lightsettingsbase.h
125
126moc_lightsettingsbase.o: moc_lightsettingsbase.cpp \
127 lightsettingsbase.h
128
129moc_settings.cpp: settings.h
130 $(MOC) settings.h -o moc_settings.cpp
131
132moc_lightsettingsbase.cpp: lightsettingsbase.h
133 $(MOC) lightsettingsbase.h -o moc_lightsettingsbase.cpp
134
135
diff --git a/core/settings/light-and-power/light-and-power.pro b/core/settings/light-and-power/light-and-power.pro
new file mode 100644
index 0000000..87bb111
--- a/dev/null
+++ b/core/settings/light-and-power/light-and-power.pro
@@ -0,0 +1,12 @@
1 TEMPLATE= app
2 CONFIG += qt warn_on release
3 DESTDIR = ../../bin
4 HEADERS = settings.h
5 SOURCES = light.cpp main.cpp
6 INTERFACES= lightsettingsbase.ui
7INCLUDEPATH += $(QPEDIR)/include
8 DEPENDPATH+= ../$(QPEDIR)/include
9LIBS += -lqpe
10 TARGET = light-and-power
11
12TRANSLATIONS = ../../i18n/de/light-and-power.ts
diff --git a/core/settings/light-and-power/light-off.xpm b/core/settings/light-and-power/light-off.xpm
new file mode 100644
index 0000000..26624c7
--- a/dev/null
+++ b/core/settings/light-and-power/light-off.xpm
@@ -0,0 +1,23 @@
1/* XPM */
2static char * light_off_xpm[] = {
3"16 16 4 1",
4 " c None",
5 ".c #000000000000",
6 "Xc #6B6B6C6C6C6C",
7 "oc #FFFF6C6C0000",
8" ",
9" ",
10" ... ",
11" . . ",
12" . X. ",
13" . X. ",
14" . XXX. ",
15" . X XX. ",
16" . XX. ",
17" . XXX. ",
18" . X. ",
19" . X.. ",
20" .ooo.. ",
21" .ooo.. ",
22" .o.. ",
23" .. "};
diff --git a/core/settings/light-and-power/light-on.xpm b/core/settings/light-and-power/light-on.xpm
new file mode 100644
index 0000000..3f8e174
--- a/dev/null
+++ b/core/settings/light-and-power/light-on.xpm
@@ -0,0 +1,24 @@
1/* XPM */
2static char * light_on_xpm[] = {
3"16 16 5 1",
4 " c None",
5 ".c #FFFFFFFF0000",
6 "Xc #000000000000",
7 "oc #FFFFFFFFFFFF",
8 "Oc #FFFF6C6C0000",
9" . . ",
10" . . . ",
11" . XXX . ",
12" XoooX . ",
13" Xoooo.X ",
14" .. Xoooooo.X ",
15" Xoooo...X ..",
16" Xooo.o..X ",
17" .. Xooo..X ",
18" Xoo...X ",
19" . Xoo.X . ",
20" . Xoo.XX . ",
21" XOOOXX ",
22" XOOOXX ",
23" XOXX ",
24" XX "};
diff --git a/core/settings/light-and-power/light.cpp b/core/settings/light-and-power/light.cpp
new file mode 100644
index 0000000..24e1fab
--- a/dev/null
+++ b/core/settings/light-and-power/light.cpp
@@ -0,0 +1,133 @@
1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3**
4** This file is part of Qtopia Environment.
5**
6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file.
10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15**
16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you.
18**
19**********************************************************************/
20#include "settings.h"
21
22#include <qpe/global.h>
23#include <qpe/fontmanager.h>
24#include <qpe/config.h>
25#include <qpe/applnk.h>
26#include <qpe/qpeapplication.h>
27#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
28#include <qpe/qcopenvelope_qws.h>
29#endif
30
31#include <qlabel.h>
32#include <qcheckbox.h>
33#include <qradiobutton.h>
34#include <qtabwidget.h>
35#include <qslider.h>
36#include <qfile.h>
37#include <qtextstream.h>
38#include <qdatastream.h>
39#include <qmessagebox.h>
40#include <qcombobox.h>
41#include <qspinbox.h>
42#include <qlistbox.h>
43#include <qdir.h>
44#if QT_VERSION >= 300
45#include <qstylefactory.h>
46#endif
47
48extern int qpe_sysBrightnessSteps();
49
50LightSettings::LightSettings( QWidget* parent, const char* name, WFlags fl )
51 : LightSettingsBase( parent, name, TRUE, fl )
52{
53 // Not supported
54 auto_brightness->hide();
55
56 Config config( "qpe" );
57
58 config.setGroup( "Screensaver" );
59
60 int interval;
61 interval = config.readNumEntry( "Interval_Dim", 30 );
62 interval_dim->setValue( interval );
63 interval = config.readNumEntry( "Interval_LightOff", 20 );
64 interval_lightoff->setValue( interval );
65 interval = config.readNumEntry( "Interval", 60 );
66 if ( interval > 3600 ) interval /= 1000; // compatibility (was millisecs)
67 interval_suspend->setValue( interval );
68
69 screensaver_dim->setChecked( config.readNumEntry("Dim",1) != 0 );
70 screensaver_lightoff->setChecked( config.readNumEntry("LightOff",1) != 0 );
71 int maxbright = qpe_sysBrightnessSteps();
72 initbright = config.readNumEntry("Brightness",255);
73 brightness->setMaxValue( maxbright );
74 brightness->setTickInterval( QMAX(1,maxbright/16) );
75 brightness->setLineStep( QMAX(1,maxbright/16) );
76 brightness->setPageStep( QMAX(1,maxbright/16) );
77 brightness->setValue( (maxbright*255 - initbright*maxbright)/255 );
78
79 connect(brightness, SIGNAL(valueChanged(int)), this, SLOT(applyBrightness()));
80}
81
82LightSettings::~LightSettings()
83{
84}
85
86static void set_fl(int bright)
87{
88 QCopEnvelope e("QPE/System", "setBacklight(int)" );
89 e << bright;
90}
91
92void LightSettings::reject()
93{
94 set_fl(initbright);
95
96 QDialog::reject();
97}
98
99void LightSettings::accept()
100{
101 if ( qApp->focusWidget() )
102 qApp->focusWidget()->clearFocus();
103
104 applyBrightness();
105
106 int i_dim = (screensaver_dim->isChecked() ? interval_dim->value() : 0);
107 int i_lightoff = (screensaver_lightoff->isChecked() ? interval_lightoff->value() : 0);
108 int i_suspend = interval_suspend->value();
109 QCopEnvelope e("QPE/System", "setScreenSaverIntervals(int,int,int)" );
110 e << i_dim << i_lightoff << i_suspend;
111
112 Config config( "qpe" );
113 config.setGroup( "Screensaver" );
114 config.writeEntry( "Dim", (int)screensaver_dim->isChecked() );
115 config.writeEntry( "LightOff", (int)screensaver_lightoff->isChecked() );
116 config.writeEntry( "Interval_Dim", interval_dim->value() );
117 config.writeEntry( "Interval_LightOff", interval_lightoff->value() );
118 config.writeEntry( "Interval", interval_suspend->value() );
119 config.writeEntry( "Brightness",
120 (brightness->maxValue()-brightness->value())*255/brightness->maxValue() );
121 config.write();
122
123 QDialog::accept();
124}
125
126void LightSettings::applyBrightness()
127{
128 int bright = (brightness->maxValue()-brightness->value())*255
129 / brightness->maxValue();
130 set_fl(bright);
131}
132
133
diff --git a/core/settings/light-and-power/lightsettingsbase.ui b/core/settings/light-and-power/lightsettingsbase.ui
new file mode 100644
index 0000000..47775f7
--- a/dev/null
+++ b/core/settings/light-and-power/lightsettingsbase.ui
@@ -0,0 +1,471 @@
1<!DOCTYPE UI><UI>
2<class>LightSettingsBase</class>
3<widget>
4 <class>QDialog</class>
5 <property stdset="1">
6 <name>name</name>
7 <cstring>LightSettingsBase</cstring>
8 </property>
9 <property stdset="1">
10 <name>geometry</name>
11 <rect>
12 <x>0</x>
13 <y>0</y>
14 <width>256</width>
15 <height>316</height>
16 </rect>
17 </property>
18 <property stdset="1">
19 <name>caption</name>
20 <string>Light Settings</string>
21 </property>
22 <property>
23 <name>layoutMargin</name>
24 </property>
25 <vbox>
26 <property stdset="1">
27 <name>margin</name>
28 <number>7</number>
29 </property>
30 <property stdset="1">
31 <name>spacing</name>
32 <number>6</number>
33 </property>
34 <widget>
35 <class>QCheckBox</class>
36 <property stdset="1">
37 <name>name</name>
38 <cstring>auto_brightness</cstring>
39 </property>
40 <property stdset="1">
41 <name>text</name>
42 <string>Adjust to environment</string>
43 </property>
44 <property>
45 <name>whatsThis</name>
46 <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>
47 </property>
48 </widget>
49 <widget>
50 <class>QGroupBox</class>
51 <property stdset="1">
52 <name>name</name>
53 <cstring>GroupBox3</cstring>
54 </property>
55 <property stdset="1">
56 <name>title</name>
57 <string>Power saving</string>
58 </property>
59 <property>
60 <name>layoutMargin</name>
61 </property>
62 <property>
63 <name>layoutSpacing</name>
64 </property>
65 <grid>
66 <property stdset="1">
67 <name>margin</name>
68 <number>6</number>
69 </property>
70 <property stdset="1">
71 <name>spacing</name>
72 <number>3</number>
73 </property>
74 <widget row="1" column="1" >
75 <class>QSpinBox</class>
76 <property stdset="1">
77 <name>name</name>
78 <cstring>interval_lightoff</cstring>
79 </property>
80 <property stdset="1">
81 <name>suffix</name>
82 <string> seconds</string>
83 </property>
84 <property stdset="1">
85 <name>buttonSymbols</name>
86 <enum>PlusMinus</enum>
87 </property>
88 <property stdset="1">
89 <name>maxValue</name>
90 <number>3600</number>
91 </property>
92 <property stdset="1">
93 <name>minValue</name>
94 <number>10</number>
95 </property>
96 <property stdset="1">
97 <name>lineStep</name>
98 <number>15</number>
99 </property>
100 </widget>
101 <widget row="2" column="1" >
102 <class>QSpinBox</class>
103 <property stdset="1">
104 <name>name</name>
105 <cstring>interval_suspend</cstring>
106 </property>
107 <property stdset="1">
108 <name>suffix</name>
109 <string> seconds</string>
110 </property>
111 <property stdset="1">
112 <name>buttonSymbols</name>
113 <enum>PlusMinus</enum>
114 </property>
115 <property stdset="1">
116 <name>maxValue</name>
117 <number>3600</number>
118 </property>
119 <property stdset="1">
120 <name>minValue</name>
121 <number>10</number>
122 </property>
123 <property stdset="1">
124 <name>lineStep</name>
125 <number>15</number>
126 </property>
127 </widget>
128 <widget row="1" column="0" >
129 <class>QCheckBox</class>
130 <property stdset="1">
131 <name>name</name>
132 <cstring>screensaver_lightoff</cstring>
133 </property>
134 <property stdset="1">
135 <name>sizePolicy</name>
136 <sizepolicy>
137 <hsizetype>1</hsizetype>
138 <vsizetype>0</vsizetype>
139 </sizepolicy>
140 </property>
141 <property stdset="1">
142 <name>text</name>
143 <string>Light off after</string>
144 </property>
145 <property stdset="1">
146 <name>checked</name>
147 <bool>true</bool>
148 </property>
149 </widget>
150 <widget row="0" column="0" >
151 <class>QCheckBox</class>
152 <property stdset="1">
153 <name>name</name>
154 <cstring>screensaver_dim</cstring>
155 </property>
156 <property stdset="1">
157 <name>sizePolicy</name>
158 <sizepolicy>
159 <hsizetype>1</hsizetype>
160 <vsizetype>0</vsizetype>
161 </sizepolicy>
162 </property>
163 <property stdset="1">
164 <name>text</name>
165 <string>Dim light after</string>
166 </property>
167 <property stdset="1">
168 <name>checked</name>
169 <bool>true</bool>
170 </property>
171 </widget>
172 <widget row="0" column="1" >
173 <class>QSpinBox</class>
174 <property stdset="1">
175 <name>name</name>
176 <cstring>interval_dim</cstring>
177 </property>
178 <property stdset="1">
179 <name>suffix</name>
180 <string> seconds</string>
181 </property>
182 <property stdset="1">
183 <name>buttonSymbols</name>
184 <enum>PlusMinus</enum>
185 </property>
186 <property stdset="1">
187 <name>maxValue</name>
188 <number>3600</number>
189 </property>
190 <property stdset="1">
191 <name>minValue</name>
192 <number>10</number>
193 </property>
194 <property stdset="1">
195 <name>lineStep</name>
196 <number>15</number>
197 </property>
198 </widget>
199 <widget row="2" column="0" >
200 <class>QLabel</class>
201 <property stdset="1">
202 <name>name</name>
203 <cstring>TextLabel1_2</cstring>
204 </property>
205 <property stdset="1">
206 <name>text</name>
207 <string>Suspend after</string>
208 </property>
209 </widget>
210 </grid>
211 </widget>
212 <widget>
213 <class>QLayoutWidget</class>
214 <property stdset="1">
215 <name>name</name>
216 <cstring>Layout18</cstring>
217 </property>
218 <property>
219 <name>layoutMargin</name>
220 </property>
221 <hbox>
222 <property stdset="1">
223 <name>margin</name>
224 <number>0</number>
225 </property>
226 <property stdset="1">
227 <name>spacing</name>
228 <number>6</number>
229 </property>
230 <widget>
231 <class>QSlider</class>
232 <property stdset="1">
233 <name>name</name>
234 <cstring>brightness</cstring>
235 </property>
236 <property stdset="1">
237 <name>maxValue</name>
238 <number>255</number>
239 </property>
240 <property stdset="1">
241 <name>lineStep</name>
242 <number>16</number>
243 </property>
244 <property stdset="1">
245 <name>pageStep</name>
246 <number>16</number>
247 </property>
248 <property stdset="1">
249 <name>orientation</name>
250 <enum>Vertical</enum>
251 </property>
252 <property stdset="1">
253 <name>tickmarks</name>
254 <enum>Right</enum>
255 </property>
256 <property stdset="1">
257 <name>tickInterval</name>
258 <number>32</number>
259 </property>
260 </widget>
261 <widget>
262 <class>QLayoutWidget</class>
263 <property stdset="1">
264 <name>name</name>
265 <cstring>Layout16</cstring>
266 </property>
267 <property>
268 <name>layoutSpacing</name>
269 </property>
270 <vbox>
271 <property stdset="1">
272 <name>margin</name>
273 <number>0</number>
274 </property>
275 <property stdset="1">
276 <name>spacing</name>
277 <number>0</number>
278 </property>
279 <widget>
280 <class>QLayoutWidget</class>
281 <property stdset="1">
282 <name>name</name>
283 <cstring>Layout10</cstring>
284 </property>
285 <hbox>
286 <property stdset="1">
287 <name>margin</name>
288 <number>0</number>
289 </property>
290 <property stdset="1">
291 <name>spacing</name>
292 <number>6</number>
293 </property>
294 <widget>
295 <class>QLabel</class>
296 <property stdset="1">
297 <name>name</name>
298 <cstring>PixmapLabel1</cstring>
299 </property>
300 <property stdset="1">
301 <name>pixmap</name>
302 <pixmap>image0</pixmap>
303 </property>
304 <property stdset="1">
305 <name>scaledContents</name>
306 <bool>false</bool>
307 </property>
308 </widget>
309 <widget>
310 <class>QLabel</class>
311 <property stdset="1">
312 <name>name</name>
313 <cstring>TextLabel1</cstring>
314 </property>
315 <property stdset="1">
316 <name>text</name>
317 <string>Bright</string>
318 </property>
319 </widget>
320 <spacer>
321 <property>
322 <name>name</name>
323 <cstring>Spacer3</cstring>
324 </property>
325 <property stdset="1">
326 <name>orientation</name>
327 <enum>Horizontal</enum>
328 </property>
329 <property stdset="1">
330 <name>sizeType</name>
331 <enum>Expanding</enum>
332 </property>
333 <property>
334 <name>sizeHint</name>
335 <size>
336 <width>20</width>
337 <height>20</height>
338 </size>
339 </property>
340 </spacer>
341 </hbox>
342 </widget>
343 <widget>
344 <class>QLabel</class>
345 <property stdset="1">
346 <name>name</name>
347 <cstring>TextLabel3</cstring>
348 </property>
349 <property stdset="1">
350 <name>sizePolicy</name>
351 <sizepolicy>
352 <hsizetype>5</hsizetype>
353 <vsizetype>7</vsizetype>
354 </sizepolicy>
355 </property>
356 <property stdset="1">
357 <name>text</name>
358 <string>&lt;blockquote&gt;The brighter the screen light, the more battery power is used.&lt;/blockquote&gt;</string>
359 </property>
360 </widget>
361 <widget>
362 <class>QLayoutWidget</class>
363 <property stdset="1">
364 <name>name</name>
365 <cstring>Layout9</cstring>
366 </property>
367 <hbox>
368 <property stdset="1">
369 <name>margin</name>
370 <number>0</number>
371 </property>
372 <property stdset="1">
373 <name>spacing</name>
374 <number>6</number>
375 </property>
376 <widget>
377 <class>QLabel</class>
378 <property stdset="1">
379 <name>name</name>
380 <cstring>PixmapLabel2</cstring>
381 </property>
382 <property stdset="1">
383 <name>pixmap</name>
384 <pixmap>image1</pixmap>
385 </property>
386 <property stdset="1">
387 <name>scaledContents</name>
388 <bool>false</bool>
389 </property>
390 </widget>
391 <widget>
392 <class>QLabel</class>
393 <property stdset="1">
394 <name>name</name>
395 <cstring>TextLabel2</cstring>
396 </property>
397 <property stdset="1">
398 <name>text</name>
399 <string>Off</string>
400 </property>
401 <property stdset="1">
402 <name>alignment</name>
403 <set>AlignVCenter|AlignLeft</set>
404 </property>
405 <property>
406 <name>vAlign</name>
407 </property>
408 </widget>
409 <spacer>
410 <property>
411 <name>name</name>
412 <cstring>Spacer2</cstring>
413 </property>
414 <property stdset="1">
415 <name>orientation</name>
416 <enum>Horizontal</enum>
417 </property>
418 <property stdset="1">
419 <name>sizeType</name>
420 <enum>Expanding</enum>
421 </property>
422 <property>
423 <name>sizeHint</name>
424 <size>
425 <width>20</width>
426 <height>20</height>
427 </size>
428 </property>
429 </spacer>
430 </hbox>
431 </widget>
432 </vbox>
433 </widget>
434 </hbox>
435 </widget>
436 </vbox>
437</widget>
438<images>
439 <image>
440 <name>image0</name>
441 <data format="XPM.GZ" length="439">789c6d8ec10ac2300c86ef7b8ad0ff36a4730777111f41f1288887b4b3e8610a3a0f22bebb6dd3d54d0ca5cdffe54f9aaaa4dd764d6555dc7beecf96ec896f54b68fae7bee0fab57a1ea86fc5950ad6685d2646973bd1c43ce3ec73c46903648e79a5624443a27d20cd2b9382704747e124382f11a7c5e30b364b957b331866331b3800c38f70282121c7c628367c098c1e0eb03121ccd4b46fcb0f80b26bb4833987f76b6d6f274de5fe6a1a031d30969f55e161fe4715f7b</data>
442 </image>
443 <image>
444 <name>image1</name>
445 <data format="XPM.GZ" length="424">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523234530022130543251d2e253d856405bffcbc54105b19c856360003103711c4354b344b314b04719340dcb434b31488ac1e1a2020a6acac8c2ea60cc54862606ea232b218541b5810452c3111432c510f550c22886a1e482c115d0c2c88e6168818babaa4a42462c48082cae8e68102011a06b5d65c0041d3518e</data>
446 </image>
447</images>
448<connections>
449 <connection>
450 <sender>screensaver_dim</sender>
451 <signal>toggled(bool)</signal>
452 <receiver>interval_dim</receiver>
453 <slot>setEnabled(bool)</slot>
454 </connection>
455 <connection>
456 <sender>screensaver_lightoff</sender>
457 <signal>toggled(bool)</signal>
458 <receiver>interval_lightoff</receiver>
459 <slot>setEnabled(bool)</slot>
460 </connection>
461</connections>
462<tabstops>
463 <tabstop>auto_brightness</tabstop>
464 <tabstop>screensaver_dim</tabstop>
465 <tabstop>interval_dim</tabstop>
466 <tabstop>screensaver_lightoff</tabstop>
467 <tabstop>interval_lightoff</tabstop>
468 <tabstop>interval_suspend</tabstop>
469 <tabstop>brightness</tabstop>
470</tabstops>
471</UI>
diff --git a/core/settings/light-and-power/main.cpp b/core/settings/light-and-power/main.cpp
new file mode 100644
index 0000000..051fdec
--- a/dev/null
+++ b/core/settings/light-and-power/main.cpp
@@ -0,0 +1,38 @@
1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3**
4** This file is part of Qtopia Environment.
5**
6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file.
10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15**
16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you.
18**
19**********************************************************************/
20
21#include "settings.h"
22
23#include <qpe/qpeapplication.h>
24#include <qpe/qcopenvelope_qws.h>
25#include <qpe/global.h>
26
27
28int main(int argc, char** argv)
29{
30 QPEApplication a(argc,argv);
31
32 LightSettings dlg;
33
34 a.showMainWidget(&dlg);
35
36 return a.exec();
37}
38
diff --git a/core/settings/light-and-power/qpe-light-and-power.control b/core/settings/light-and-power/qpe-light-and-power.control
new file mode 100644
index 0000000..0ed9d84
--- a/dev/null
+++ b/core/settings/light-and-power/qpe-light-and-power.control
@@ -0,0 +1,9 @@
1Files: bin/light-and-power apps/Settings/Light.desktop
2Priority: optional
3Section: qpe/settings
4Maintainer: Warwick Allison <warwick@trolltech.com>
5Architecture: arm
6Version: $QPE_VERSION-3
7Depends: qpe-base ($QPE_VERSION)
8Description: Light and Power settings dialog
9 For the Qtopia environment.
diff --git a/core/settings/light-and-power/settings.h b/core/settings/light-and-power/settings.h
new file mode 100644
index 0000000..cec08e3
--- a/dev/null
+++ b/core/settings/light-and-power/settings.h
@@ -0,0 +1,50 @@
1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3**
4** This file is part of Qtopia Environment.
5**
6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file.
10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15**
16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you.
18**
19**********************************************************************/
20#ifndef SETTINGS_H
21#define SETTINGS_H
22
23
24#include <qstrlist.h>
25#include <qasciidict.h>
26#include "lightsettingsbase.h"
27
28
29class LightSettings : public LightSettingsBase
30{
31 Q_OBJECT
32
33public:
34 LightSettings( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
35 ~LightSettings();
36
37protected:
38 void accept();
39 void reject();
40
41private slots:
42 void applyBrightness();
43
44private:
45 int initbright;
46};
47
48
49#endif // SETTINGS_H
50