summaryrefslogtreecommitdiff
path: root/core/settings/light-and-power
Side-by-side diff
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 @@
+moc_*
+Makefile
+lightsettingsbase.h
+lightsettingsbase.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 @@
+#############################################################################
+
+####### Compiler, tools and options
+
+CXX = $(SYSCONF_CXX) $(QT_CXX_MT)
+CXXFLAGS= $(SYSCONF_CXXFLAGS_QT) $(SYSCONF_CXXFLAGS)
+CC = $(SYSCONF_CC) $(QT_C_MT)
+CFLAGS = $(SYSCONF_CFLAGS)
+INCPATH = -I$(QPEDIR)/include
+LFLAGS = $(SYSCONF_LFLAGS_QT) $(SYSCONF_RPATH_QT) $(SYSCONF_LFLAGS) $(QT_LFLAGS_MT)
+LIBS = $(SUBLIBS) -lqpe $(SYSCONF_LIBS_QT) $(SYSCONF_LIBS) $(SYSCONF_LIBS_QTAPP)
+MOC = $(SYSCONF_MOC)
+UIC = $(SYSCONF_UIC)
+
+####### Target
+
+DESTDIR = ../../bin/
+VER_MAJ = 1
+VER_MIN = 0
+VER_PATCH = 0
+TARGET = light-and-power
+TARGET1 = lib$(TARGET).so.$(VER_MAJ)
+
+####### Files
+
+HEADERS = settings.h
+SOURCES = light.cpp \
+ main.cpp
+OBJECTS = light.o \
+ main.o \
+ lightsettingsbase.o
+INTERFACES = lightsettingsbase.ui
+UICDECLS = lightsettingsbase.h
+UICIMPLS = lightsettingsbase.cpp
+SRCMOC = moc_settings.cpp \
+ moc_lightsettingsbase.cpp
+OBJMOC = moc_settings.o \
+ moc_lightsettingsbase.o
+
+
+####### Implicit rules
+
+.SUFFIXES: .cpp .cxx .cc .C .c
+
+.cpp.o:
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
+
+.cxx.o:
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
+
+.cc.o:
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
+
+.C.o:
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
+
+.c.o:
+ $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $<
+
+####### Build rules
+
+
+all: $(DESTDIR)$(TARGET)
+
+$(DESTDIR)$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) $(SUBLIBS)
+ $(SYSCONF_LINK) $(LFLAGS) -o $(DESTDIR)$(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS)
+
+moc: $(SRCMOC)
+
+tmake:
+ tmake light-and-power.pro
+
+clean:
+ -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS)
+ -rm -f *~ core
+ -rm -f allmoc.cpp
+
+####### Extension Modules
+
+listpromodules:
+ @echo
+
+listallmodules:
+ @echo
+
+listaddonpromodules:
+ @echo
+
+listaddonentmodules:
+ @echo
+
+
+REQUIRES=
+
+####### Sub-libraries
+
+
+###### Combined headers
+
+
+
+####### Compile
+
+light.o: light.cpp \
+ settings.h \
+ lightsettingsbase.h
+
+main.o: main.cpp \
+ settings.h \
+ lightsettingsbase.h
+
+lightsettingsbase.h: lightsettingsbase.ui
+ $(UIC) lightsettingsbase.ui -o $(INTERFACE_DECL_PATH)/lightsettingsbase.h
+
+lightsettingsbase.cpp: lightsettingsbase.ui
+ $(UIC) lightsettingsbase.ui -i lightsettingsbase.h -o lightsettingsbase.cpp
+
+lightsettingsbase.o: lightsettingsbase.cpp \
+ lightsettingsbase.h \
+ lightsettingsbase.ui
+
+moc_settings.o: moc_settings.cpp \
+ settings.h \
+ lightsettingsbase.h
+
+moc_lightsettingsbase.o: moc_lightsettingsbase.cpp \
+ lightsettingsbase.h
+
+moc_settings.cpp: settings.h
+ $(MOC) settings.h -o moc_settings.cpp
+
+moc_lightsettingsbase.cpp: lightsettingsbase.h
+ $(MOC) lightsettingsbase.h -o moc_lightsettingsbase.cpp
+
+
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 @@
+TEMPLATE = app
+CONFIG += qt warn_on release
+DESTDIR = ../../bin
+HEADERS = settings.h
+SOURCES = light.cpp main.cpp
+INTERFACES = lightsettingsbase.ui
+INCLUDEPATH += $(QPEDIR)/include
+DEPENDPATH += ../$(QPEDIR)/include
+LIBS += -lqpe
+TARGET = light-and-power
+
+TRANSLATIONS = ../../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 @@
+/* XPM */
+static char * light_off_xpm[] = {
+"16 16 4 1",
+" c None",
+". c #000000000000",
+"X c #6B6B6C6C6C6C",
+"o c #FFFF6C6C0000",
+" ",
+" ",
+" ... ",
+" . . ",
+" . X. ",
+" . X. ",
+" . XXX. ",
+" . X XX. ",
+" . XX. ",
+" . XXX. ",
+" . X. ",
+" . X.. ",
+" .ooo.. ",
+" .ooo.. ",
+" .o.. ",
+" .. "};
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 @@
+/* XPM */
+static char * light_on_xpm[] = {
+"16 16 5 1",
+" c None",
+". c #FFFFFFFF0000",
+"X c #000000000000",
+"o c #FFFFFFFFFFFF",
+"O c #FFFF6C6C0000",
+" . . ",
+" . . . ",
+" . XXX . ",
+" XoooX . ",
+" Xoooo.X ",
+" .. Xoooooo.X ",
+" Xoooo...X ..",
+" Xooo.o..X ",
+" .. Xooo..X ",
+" Xoo...X ",
+" . Xoo.X . ",
+" . Xoo.XX . ",
+" XOOOXX ",
+" XOOOXX ",
+" XOXX ",
+" 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 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qtopia Environment.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+#include "settings.h"
+
+#include <qpe/global.h>
+#include <qpe/fontmanager.h>
+#include <qpe/config.h>
+#include <qpe/applnk.h>
+#include <qpe/qpeapplication.h>
+#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
+#include <qpe/qcopenvelope_qws.h>
+#endif
+
+#include <qlabel.h>
+#include <qcheckbox.h>
+#include <qradiobutton.h>
+#include <qtabwidget.h>
+#include <qslider.h>
+#include <qfile.h>
+#include <qtextstream.h>
+#include <qdatastream.h>
+#include <qmessagebox.h>
+#include <qcombobox.h>
+#include <qspinbox.h>
+#include <qlistbox.h>
+#include <qdir.h>
+#if QT_VERSION >= 300
+#include <qstylefactory.h>
+#endif
+
+extern int qpe_sysBrightnessSteps();
+
+LightSettings::LightSettings( QWidget* parent, const char* name, WFlags fl )
+ : LightSettingsBase( parent, name, TRUE, fl )
+{
+ // Not supported
+ auto_brightness->hide();
+
+ Config config( "qpe" );
+
+ config.setGroup( "Screensaver" );
+
+ int interval;
+ interval = config.readNumEntry( "Interval_Dim", 30 );
+ interval_dim->setValue( interval );
+ interval = config.readNumEntry( "Interval_LightOff", 20 );
+ interval_lightoff->setValue( interval );
+ interval = config.readNumEntry( "Interval", 60 );
+ if ( interval > 3600 ) interval /= 1000; // compatibility (was millisecs)
+ interval_suspend->setValue( interval );
+
+ screensaver_dim->setChecked( config.readNumEntry("Dim",1) != 0 );
+ screensaver_lightoff->setChecked( config.readNumEntry("LightOff",1) != 0 );
+ int maxbright = qpe_sysBrightnessSteps();
+ initbright = config.readNumEntry("Brightness",255);
+ brightness->setMaxValue( maxbright );
+ brightness->setTickInterval( QMAX(1,maxbright/16) );
+ brightness->setLineStep( QMAX(1,maxbright/16) );
+ brightness->setPageStep( QMAX(1,maxbright/16) );
+ brightness->setValue( (maxbright*255 - initbright*maxbright)/255 );
+
+ connect(brightness, SIGNAL(valueChanged(int)), this, SLOT(applyBrightness()));
+}
+
+LightSettings::~LightSettings()
+{
+}
+
+static void set_fl(int bright)
+{
+ QCopEnvelope e("QPE/System", "setBacklight(int)" );
+ e << bright;
+}
+
+void LightSettings::reject()
+{
+ set_fl(initbright);
+
+ QDialog::reject();
+}
+
+void LightSettings::accept()
+{
+ if ( qApp->focusWidget() )
+ qApp->focusWidget()->clearFocus();
+
+ applyBrightness();
+
+ int i_dim = (screensaver_dim->isChecked() ? interval_dim->value() : 0);
+ int i_lightoff = (screensaver_lightoff->isChecked() ? interval_lightoff->value() : 0);
+ int i_suspend = interval_suspend->value();
+ QCopEnvelope e("QPE/System", "setScreenSaverIntervals(int,int,int)" );
+ e << i_dim << i_lightoff << i_suspend;
+
+ Config config( "qpe" );
+ config.setGroup( "Screensaver" );
+ config.writeEntry( "Dim", (int)screensaver_dim->isChecked() );
+ config.writeEntry( "LightOff", (int)screensaver_lightoff->isChecked() );
+ config.writeEntry( "Interval_Dim", interval_dim->value() );
+ config.writeEntry( "Interval_LightOff", interval_lightoff->value() );
+ config.writeEntry( "Interval", interval_suspend->value() );
+ config.writeEntry( "Brightness",
+ (brightness->maxValue()-brightness->value())*255/brightness->maxValue() );
+ config.write();
+
+ QDialog::accept();
+}
+
+void LightSettings::applyBrightness()
+{
+ int bright = (brightness->maxValue()-brightness->value())*255
+ / brightness->maxValue();
+ set_fl(bright);
+}
+
+
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 @@
+<!DOCTYPE UI><UI>
+<class>LightSettingsBase</class>
+<widget>
+ <class>QDialog</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>LightSettingsBase</cstring>
+ </property>
+ <property stdset="1">
+ <name>geometry</name>
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>256</width>
+ <height>316</height>
+ </rect>
+ </property>
+ <property stdset="1">
+ <name>caption</name>
+ <string>Light Settings</string>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>7</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>auto_brightness</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Adjust to environment</string>
+ </property>
+ <property>
+ <name>whatsThis</name>
+ <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>
+ </property>
+ </widget>
+ <widget>
+ <class>QGroupBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>GroupBox3</cstring>
+ </property>
+ <property stdset="1">
+ <name>title</name>
+ <string>Power saving</string>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <grid>
+ <property stdset="1">
+ <name>margin</name>
+ <number>6</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>3</number>
+ </property>
+ <widget row="1" column="1" >
+ <class>QSpinBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>interval_lightoff</cstring>
+ </property>
+ <property stdset="1">
+ <name>suffix</name>
+ <string> seconds</string>
+ </property>
+ <property stdset="1">
+ <name>buttonSymbols</name>
+ <enum>PlusMinus</enum>
+ </property>
+ <property stdset="1">
+ <name>maxValue</name>
+ <number>3600</number>
+ </property>
+ <property stdset="1">
+ <name>minValue</name>
+ <number>10</number>
+ </property>
+ <property stdset="1">
+ <name>lineStep</name>
+ <number>15</number>
+ </property>
+ </widget>
+ <widget row="2" column="1" >
+ <class>QSpinBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>interval_suspend</cstring>
+ </property>
+ <property stdset="1">
+ <name>suffix</name>
+ <string> seconds</string>
+ </property>
+ <property stdset="1">
+ <name>buttonSymbols</name>
+ <enum>PlusMinus</enum>
+ </property>
+ <property stdset="1">
+ <name>maxValue</name>
+ <number>3600</number>
+ </property>
+ <property stdset="1">
+ <name>minValue</name>
+ <number>10</number>
+ </property>
+ <property stdset="1">
+ <name>lineStep</name>
+ <number>15</number>
+ </property>
+ </widget>
+ <widget row="1" column="0" >
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>screensaver_lightoff</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Light off after</string>
+ </property>
+ <property stdset="1">
+ <name>checked</name>
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget row="0" column="0" >
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>screensaver_dim</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Dim light after</string>
+ </property>
+ <property stdset="1">
+ <name>checked</name>
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget row="0" column="1" >
+ <class>QSpinBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>interval_dim</cstring>
+ </property>
+ <property stdset="1">
+ <name>suffix</name>
+ <string> seconds</string>
+ </property>
+ <property stdset="1">
+ <name>buttonSymbols</name>
+ <enum>PlusMinus</enum>
+ </property>
+ <property stdset="1">
+ <name>maxValue</name>
+ <number>3600</number>
+ </property>
+ <property stdset="1">
+ <name>minValue</name>
+ <number>10</number>
+ </property>
+ <property stdset="1">
+ <name>lineStep</name>
+ <number>15</number>
+ </property>
+ </widget>
+ <widget row="2" column="0" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel1_2</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Suspend after</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout18</cstring>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>QSlider</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>brightness</cstring>
+ </property>
+ <property stdset="1">
+ <name>maxValue</name>
+ <number>255</number>
+ </property>
+ <property stdset="1">
+ <name>lineStep</name>
+ <number>16</number>
+ </property>
+ <property stdset="1">
+ <name>pageStep</name>
+ <number>16</number>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Vertical</enum>
+ </property>
+ <property stdset="1">
+ <name>tickmarks</name>
+ <enum>Right</enum>
+ </property>
+ <property stdset="1">
+ <name>tickInterval</name>
+ <number>32</number>
+ </property>
+ </widget>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout16</cstring>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>0</number>
+ </property>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout10</cstring>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>PixmapLabel1</cstring>
+ </property>
+ <property stdset="1">
+ <name>pixmap</name>
+ <pixmap>image0</pixmap>
+ </property>
+ <property stdset="1">
+ <name>scaledContents</name>
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Bright</string>
+ </property>
+ </widget>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer3</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Horizontal</enum>
+ </property>
+ <property stdset="1">
+ <name>sizeType</name>
+ <enum>Expanding</enum>
+ </property>
+ <property>
+ <name>sizeHint</name>
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel3</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>7</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>&lt;blockquote&gt;The brighter the screen light, the more battery power is used.&lt;/blockquote&gt;</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout9</cstring>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>PixmapLabel2</cstring>
+ </property>
+ <property stdset="1">
+ <name>pixmap</name>
+ <pixmap>image1</pixmap>
+ </property>
+ <property stdset="1">
+ <name>scaledContents</name>
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Off</string>
+ </property>
+ <property stdset="1">
+ <name>alignment</name>
+ <set>AlignVCenter|AlignLeft</set>
+ </property>
+ <property>
+ <name>vAlign</name>
+ </property>
+ </widget>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer2</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Horizontal</enum>
+ </property>
+ <property stdset="1">
+ <name>sizeType</name>
+ <enum>Expanding</enum>
+ </property>
+ <property>
+ <name>sizeHint</name>
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<images>
+ <image>
+ <name>image0</name>
+ <data format="XPM.GZ" length="439">789c6d8ec10ac2300c86ef7b8ad0ff36a4730777111f41f1288887b4b3e8610a3a0f22bebb6dd3d54d0ca5cdffe54f9aaaa4dd764d6555dc7beecf96ec896f54b68fae7bee0fab57a1ea86fc5950ad6685d2646973bd1c43ce3ec73c46903648e79a5624443a27d20cd2b9382704747e124382f11a7c5e30b364b957b331866331b3800c38f70282121c7c628367c098c1e0eb03121ccd4b46fcb0f80b26bb4833987f76b6d6f274de5fe6a1a031d30969f55e161fe4715f7b</data>
+ </image>
+ <image>
+ <name>image1</name>
+ <data format="XPM.GZ" length="424">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523234530022130543251d2e253d856405bffcbc54105b19c856360003103711c4354b344b314b04719340dcb434b31488ac1e1a2020a6acac8c2ea60cc54862606ea232b218541b5810452c3111432c510f550c22886a1e482c115d0c2c88e6168818babaa4a42462c48082cae8e68102011a06b5d65c0041d3518e</data>
+ </image>
+</images>
+<connections>
+ <connection>
+ <sender>screensaver_dim</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>interval_dim</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>screensaver_lightoff</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>interval_lightoff</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>auto_brightness</tabstop>
+ <tabstop>screensaver_dim</tabstop>
+ <tabstop>interval_dim</tabstop>
+ <tabstop>screensaver_lightoff</tabstop>
+ <tabstop>interval_lightoff</tabstop>
+ <tabstop>interval_suspend</tabstop>
+ <tabstop>brightness</tabstop>
+</tabstops>
+</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 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qtopia Environment.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "settings.h"
+
+#include <qpe/qpeapplication.h>
+#include <qpe/qcopenvelope_qws.h>
+#include <qpe/global.h>
+
+
+int main(int argc, char** argv)
+{
+ QPEApplication a(argc,argv);
+
+ LightSettings dlg;
+
+ a.showMainWidget(&dlg);
+
+ return a.exec();
+}
+
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 @@
+Files: bin/light-and-power apps/Settings/Light.desktop
+Priority: optional
+Section: qpe/settings
+Maintainer: Warwick Allison <warwick@trolltech.com>
+Architecture: arm
+Version: $QPE_VERSION-3
+Depends: qpe-base ($QPE_VERSION)
+Description: Light and Power settings dialog
+ 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 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qtopia Environment.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+#ifndef SETTINGS_H
+#define SETTINGS_H
+
+
+#include <qstrlist.h>
+#include <qasciidict.h>
+#include "lightsettingsbase.h"
+
+
+class LightSettings : public LightSettingsBase
+{
+ Q_OBJECT
+
+public:
+ LightSettings( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~LightSettings();
+
+protected:
+ void accept();
+ void reject();
+
+private slots:
+ void applyBrightness();
+
+private:
+ int initbright;
+};
+
+
+#endif // SETTINGS_H
+