summaryrefslogtreecommitdiff
path: root/core/settings/light-and-power/light.cpp
Side-by-side diff
Diffstat (limited to 'core/settings/light-and-power/light.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/settings/light-and-power/light.cpp24
1 files changed, 6 insertions, 18 deletions
diff --git a/core/settings/light-and-power/light.cpp b/core/settings/light-and-power/light.cpp
index 2ea0356..c0ba60b 100644
--- a/core/settings/light-and-power/light.cpp
+++ b/core/settings/light-and-power/light.cpp
@@ -19,52 +19,36 @@
++=   -.     .`     .:
 :     =  ...= . :.=- You should have received a copy of the GNU
 -.   .:....=;==+<; General Public License along with this file;
  -_. . .   )=.  = see the file COPYING. If not, write to the
    --        :-=` Free Software Foundation, Inc.,
59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include "settings.h"
-#include <qpe/global.h>
-#include <qpe/fontmanager.h>
#include <qpe/config.h>
-#include <qpe/applnk.h>
#include <qpe/qpeapplication.h>
#include <qpe/power.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 <qgroupbox.h>
#include <qspinbox.h>
#include <qpushbutton.h>
-#include <qlistbox.h>
-#include <qdir.h>
-#if QT_VERSION >= 300
-#include <qstylefactory.h>
-#endif
#include <opie/odevice.h>
#include "sensor.h"
using namespace Opie;
LightSettings::LightSettings( QWidget* parent, const char* name, WFlags )
: LightSettingsBase( parent, name, true, WStyle_ContextHelp )
{
m_res = ODevice::inst ( )-> displayBrightnessResolution ( );
@@ -115,28 +99,32 @@ LightSettings::LightSettings( QWidget* parent, const char* name, WFlags )
brightness_ac_3-> setValue (( bright * ( m_res - 1 ) + 127 ) / 255 );
// light sensor
auto_brightness_ac_3-> setChecked ( config. readBoolEntry ( "LightSensor", false ));
m_sensordata_ac = config. readListEntry ( "LightSensorData", ';' );
// advanced settings
config. setGroup ( "Warnings" );
warnintervalBox-> setValue ( config. readNumEntry ( "checkinterval", 10000 ) / 1000 );
lowSpinBox-> setValue ( config. readNumEntry ( "powerverylow", 10 ) );
criticalSpinBox-> setValue ( config. readNumEntry ( "powercritical", 5 ) );
- if ( PowerStatusManager::readStatus ( ). acStatus ( ) != PowerStatus::Online )
+ if ( PowerStatusManager::readStatus ( ). acStatus ( ) != PowerStatus::Online ) {
connect ( brightness, SIGNAL( valueChanged ( int )), this, SLOT( setBacklight ( int )));
- else
+ tabs-> setCurrentPage ( 0 );
+ }
+ else {
connect ( brightness_ac_3, SIGNAL( valueChanged ( int )), this, SLOT( setBacklight ( int )));
+ tabs-> setCurrentPage ( 1 );
+ }
}
LightSettings::~LightSettings ( )
{
}
void LightSettings::calibrateSensor ( )
{
Sensor *s = new Sensor ( m_sensordata, this );
s-> showMaximized ( );
s-> exec ( );