-rw-r--r-- | core/settings/light-and-power/calibration.cpp | 19 | ||||
-rw-r--r-- | core/settings/light-and-power/light.cpp | 24 | ||||
-rw-r--r-- | core/settings/light-and-power/lightsettingsbase.ui | 8 | ||||
-rw-r--r-- | core/settings/light-and-power/sensor.cpp | 22 | ||||
-rw-r--r-- | core/settings/light-and-power/sensorbase.ui | 10 |
5 files changed, 37 insertions, 46 deletions
diff --git a/core/settings/light-and-power/calibration.cpp b/core/settings/light-and-power/calibration.cpp index 307de1f..6a3360f 100644 --- a/core/settings/light-and-power/calibration.cpp +++ b/core/settings/light-and-power/calibration.cpp @@ -96,3 +96,3 @@ void Calibration::setStartPoint ( const QPoint &p ) { - m_p [0] = p; + m_p [0] = QPoint ( p. x ( ), m_scale. height ( ) - p. y ( ) - 1 ); checkPoints ( ); @@ -103,3 +103,3 @@ QPoint Calibration::startPoint ( ) const { - return m_p [0]; + return QPoint ( m_p [0]. x ( ), m_scale. height ( ) - m_p [0]. y ( ) - 1 ); } @@ -108,3 +108,3 @@ void Calibration::setEndPoint ( const QPoint &p ) { - m_p [1] = p; + m_p [1] = QPoint ( p. x ( ), m_scale. height ( ) - p. y ( ) - 1 ); checkPoints ( ); @@ -115,3 +115,3 @@ QPoint Calibration::endPoint ( ) const { - return m_p [1]; + return QPoint ( m_p [1]. x ( ), m_scale. height ( ) - m_p [1]. y ( ) - 1 ); } @@ -206,8 +206,8 @@ void Calibration::mouseMoveEvent ( QMouseEvent *e ) if ( i == 0 ) { - r |= QRect ( 0, 0, nx [0] - 0 + 1, ny [0] - 0 + 1 ); - r |= QRect ( 0, 0, ox [0] - 0 + 1, oy [0] - 0 + 1 ); + r |= QRect ( 0, ny [0], nx [0] - 0 + 1, 1 ); + r |= QRect ( 0, oy [0], ox [0] - 0 + 1, 1 ); } else if ( i == 1 ) { - r |= QRect ( nx [1], ny [1], width ( ) - nx [1], height ( ) - ny [1] ); - r |= QRect ( ox [1], oy [1], width ( ) - ox [1], height ( ) - oy [1] ); + r |= QRect ( nx [1], ny [1], width ( ) - nx [1], 1 ); + r |= QRect ( ox [1], oy [1], width ( ) - ox [1], 1 ); } @@ -255,4 +255,3 @@ void Calibration::paintEvent ( QPaintEvent * ) - p. drawLine ( BRD, BRD, ex, BRD ); - p. drawLine ( ex, BRD, ex, ey ); + p. drawLine ( BRD, ey, ex, ey ); 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 @@ -30,6 +30,3 @@ -#include <qpe/global.h> -#include <qpe/fontmanager.h> #include <qpe/config.h> -#include <qpe/applnk.h> #include <qpe/qpeapplication.h> @@ -40,20 +37,7 @@ -#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 @@ -126,6 +110,10 @@ LightSettings::LightSettings( QWidget* parent, const char* name, WFlags ) - 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 ); + } } diff --git a/core/settings/light-and-power/lightsettingsbase.ui b/core/settings/light-and-power/lightsettingsbase.ui index 4df6024..04c6726 100644 --- a/core/settings/light-and-power/lightsettingsbase.ui +++ b/core/settings/light-and-power/lightsettingsbase.ui @@ -13,3 +13,3 @@ <y>0</y> - <width>387</width> + <width>379</width> <height>532</height> @@ -51,3 +51,3 @@ <name>name</name> - <cstring>TabWidget3</cstring> + <cstring>tabs</cstring> </property> @@ -965,3 +965,3 @@ <name>title</name> - <string>Advanced Settings</string> + <string>Warnings</string> </attribute> @@ -1297,3 +1297,3 @@ <tabstop>CalibrateLightSensor</tabstop> - <tabstop>TabWidget3</tabstop> + <tabstop>tabs</tabstop> <tabstop>interval_lightoff_ac_3</tabstop> diff --git a/core/settings/light-and-power/sensor.cpp b/core/settings/light-and-power/sensor.cpp index ddd71d6..c1df04d 100644 --- a/core/settings/light-and-power/sensor.cpp +++ b/core/settings/light-and-power/sensor.cpp @@ -38,8 +38,8 @@ Sensor::Sensor ( QStringList ¶ms, QWidget *parent, const char *name ) { - int steps = 5; - int inter = 5; + int steps = 12; + int inter = 2; - int smin = 0; - int smax = 255; - int lmin = 0; + int smin = 40; + int smax = 215; + int lmin = 1; int lmax = 255; @@ -52,3 +52,3 @@ Sensor::Sensor ( QStringList ¶ms, QWidget *parent, const char *name ) case 2: steps = params [1]. toInt ( ); - case 1: inter = params [0]. toInt ( ); + case 1: inter = params [0]. toInt ( ) / 1000; } @@ -63,4 +63,4 @@ Sensor::Sensor ( QStringList ¶ms, QWidget *parent, const char *name ) m_calib-> setInterval ( inter ); - m_calib-> setStartPoint ( QPoint ( smin, lmin )); - m_calib-> setEndPoint ( QPoint ( smax, lmax )); + m_calib-> setStartPoint ( QPoint ( smin, lmax )); + m_calib-> setEndPoint ( QPoint ( smax, lmin )); @@ -76,3 +76,3 @@ void Sensor::accept ( ) m_params. clear ( ); - m_params << QString::number ( m_calib-> interval ( )) + m_params << QString::number ( m_calib-> interval ( ) * 1000 ) << QString::number ( m_calib-> lineSteps ( )) @@ -80,4 +80,4 @@ void Sensor::accept ( ) << QString::number ( m_calib-> endPoint ( ). x ( )) - << QString::number ( m_calib-> startPoint ( ). y ( )) - << QString::number ( m_calib-> endPoint ( ). y ( )); + << QString::number ( m_calib-> endPoint ( ). y ( )) + << QString::number ( m_calib-> startPoint ( ). y ( )); diff --git a/core/settings/light-and-power/sensorbase.ui b/core/settings/light-and-power/sensorbase.ui index 98fce88..64b9a27 100644 --- a/core/settings/light-and-power/sensorbase.ui +++ b/core/settings/light-and-power/sensorbase.ui @@ -13,3 +13,3 @@ <y>0</y> - <width>293</width> + <width>289</width> <height>443</height> @@ -782,3 +782,3 @@ <name>maxValue</name> - <number>127</number> + <number>63</number> </property> @@ -786,3 +786,7 @@ <name>lineStep</name> - <number>10</number> + <number>5</number> + </property> + <property stdset="1"> + <name>pageStep</name> + <number>5</number> </property> |