author | sandman <sandman> | 2002-10-28 23:46:23 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-10-28 23:46:23 (UTC) |
commit | 4251429b30aaf4175c74f714ee01d59368c950f4 (patch) (side-by-side diff) | |
tree | 717fb8fd8f17780c86b4bca84acd490f3191d0bf /core/settings/light-and-power/light.cpp | |
parent | a775c3be38fc7fbd5d120e7e3c1dd3a80a250293 (diff) | |
download | opie-4251429b30aaf4175c74f714ee01d59368c950f4.zip opie-4251429b30aaf4175c74f714ee01d59368c950f4.tar.gz opie-4251429b30aaf4175c74f714ee01d59368c950f4.tar.bz2 |
- some minor UI fixes
- parameters for sensor light range were reversed
- added reasonable calibration default values (at least on my 3870)
- l&p now automatically shows the 'right' (Batt/AC) tab when started
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.cpp | 24 |
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 ( ); |