-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 | |||
@@ -95,5 +95,5 @@ int Calibration::interval ( ) const | |||
95 | void Calibration::setStartPoint ( const QPoint &p ) | 95 | void Calibration::setStartPoint ( const QPoint &p ) |
96 | { | 96 | { |
97 | m_p [0] = p; | 97 | m_p [0] = QPoint ( p. x ( ), m_scale. height ( ) - p. y ( ) - 1 ); |
98 | checkPoints ( ); | 98 | checkPoints ( ); |
99 | update ( ); | 99 | update ( ); |
@@ -102,10 +102,10 @@ void Calibration::setStartPoint ( const QPoint &p ) | |||
102 | QPoint Calibration::startPoint ( ) const | 102 | QPoint Calibration::startPoint ( ) const |
103 | { | 103 | { |
104 | return m_p [0]; | 104 | return QPoint ( m_p [0]. x ( ), m_scale. height ( ) - m_p [0]. y ( ) - 1 ); |
105 | } | 105 | } |
106 | 106 | ||
107 | void Calibration::setEndPoint ( const QPoint &p ) | 107 | void Calibration::setEndPoint ( const QPoint &p ) |
108 | { | 108 | { |
109 | m_p [1] = p; | 109 | m_p [1] = QPoint ( p. x ( ), m_scale. height ( ) - p. y ( ) - 1 ); |
110 | checkPoints ( ); | 110 | checkPoints ( ); |
111 | update ( ); | 111 | update ( ); |
@@ -114,5 +114,5 @@ void Calibration::setEndPoint ( const QPoint &p ) | |||
114 | QPoint Calibration::endPoint ( ) const | 114 | QPoint Calibration::endPoint ( ) const |
115 | { | 115 | { |
116 | return m_p [1]; | 116 | return QPoint ( m_p [1]. x ( ), m_scale. height ( ) - m_p [1]. y ( ) - 1 ); |
117 | } | 117 | } |
118 | 118 | ||
@@ -205,10 +205,10 @@ void Calibration::mouseMoveEvent ( QMouseEvent *e ) | |||
205 | 205 | ||
206 | if ( i == 0 ) { | 206 | if ( i == 0 ) { |
207 | r |= QRect ( 0, 0, nx [0] - 0 + 1, ny [0] - 0 + 1 ); | 207 | r |= QRect ( 0, ny [0], nx [0] - 0 + 1, 1 ); |
208 | r |= QRect ( 0, 0, ox [0] - 0 + 1, oy [0] - 0 + 1 ); | 208 | r |= QRect ( 0, oy [0], ox [0] - 0 + 1, 1 ); |
209 | } | 209 | } |
210 | else if ( i == 1 ) { | 210 | else if ( i == 1 ) { |
211 | r |= QRect ( nx [1], ny [1], width ( ) - nx [1], height ( ) - ny [1] ); | 211 | r |= QRect ( nx [1], ny [1], width ( ) - nx [1], 1 ); |
212 | r |= QRect ( ox [1], oy [1], width ( ) - ox [1], height ( ) - oy [1] ); | 212 | r |= QRect ( ox [1], oy [1], width ( ) - ox [1], 1 ); |
213 | } | 213 | } |
214 | } | 214 | } |
@@ -254,6 +254,5 @@ void Calibration::paintEvent ( QPaintEvent * ) | |||
254 | p. setPen ( g. highlight ( )); | 254 | p. setPen ( g. highlight ( )); |
255 | 255 | ||
256 | p. drawLine ( BRD, BRD, ex, BRD ); | 256 | p. drawLine ( BRD, ey, ex, ey ); |
257 | p. drawLine ( ex, BRD, ex, ey ); | ||
258 | 257 | ||
259 | for ( int i = 1; i < m_steps; i++ ) { | 258 | for ( int i = 1; i < m_steps; i++ ) { |
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 | |||
@@ -29,8 +29,5 @@ | |||
29 | #include "settings.h" | 29 | #include "settings.h" |
30 | 30 | ||
31 | #include <qpe/global.h> | ||
32 | #include <qpe/fontmanager.h> | ||
33 | #include <qpe/config.h> | 31 | #include <qpe/config.h> |
34 | #include <qpe/applnk.h> | ||
35 | #include <qpe/qpeapplication.h> | 32 | #include <qpe/qpeapplication.h> |
36 | #include <qpe/power.h> | 33 | #include <qpe/power.h> |
@@ -39,22 +36,9 @@ | |||
39 | #endif | 36 | #endif |
40 | 37 | ||
41 | #include <qlabel.h> | ||
42 | #include <qcheckbox.h> | 38 | #include <qcheckbox.h> |
43 | #include <qradiobutton.h> | ||
44 | #include <qtabwidget.h> | 39 | #include <qtabwidget.h> |
45 | #include <qslider.h> | 40 | #include <qslider.h> |
46 | #include <qfile.h> | ||
47 | #include <qtextstream.h> | ||
48 | #include <qdatastream.h> | ||
49 | #include <qmessagebox.h> | ||
50 | #include <qcombobox.h> | ||
51 | #include <qgroupbox.h> | ||
52 | #include <qspinbox.h> | 41 | #include <qspinbox.h> |
53 | #include <qpushbutton.h> | 42 | #include <qpushbutton.h> |
54 | #include <qlistbox.h> | ||
55 | #include <qdir.h> | ||
56 | #if QT_VERSION >= 300 | ||
57 | #include <qstylefactory.h> | ||
58 | #endif | ||
59 | 43 | ||
60 | #include <opie/odevice.h> | 44 | #include <opie/odevice.h> |
@@ -125,8 +109,12 @@ LightSettings::LightSettings( QWidget* parent, const char* name, WFlags ) | |||
125 | criticalSpinBox-> setValue ( config. readNumEntry ( "powercritical", 5 ) ); | 109 | criticalSpinBox-> setValue ( config. readNumEntry ( "powercritical", 5 ) ); |
126 | 110 | ||
127 | if ( PowerStatusManager::readStatus ( ). acStatus ( ) != PowerStatus::Online ) | 111 | if ( PowerStatusManager::readStatus ( ). acStatus ( ) != PowerStatus::Online ) { |
128 | connect ( brightness, SIGNAL( valueChanged ( int )), this, SLOT( setBacklight ( int ))); | 112 | connect ( brightness, SIGNAL( valueChanged ( int )), this, SLOT( setBacklight ( int ))); |
129 | else | 113 | tabs-> setCurrentPage ( 0 ); |
114 | } | ||
115 | else { | ||
130 | connect ( brightness_ac_3, SIGNAL( valueChanged ( int )), this, SLOT( setBacklight ( int ))); | 116 | connect ( brightness_ac_3, SIGNAL( valueChanged ( int )), this, SLOT( setBacklight ( int ))); |
117 | tabs-> setCurrentPage ( 1 ); | ||
118 | } | ||
131 | } | 119 | } |
132 | 120 | ||
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 | |||
@@ -12,5 +12,5 @@ | |||
12 | <x>0</x> | 12 | <x>0</x> |
13 | <y>0</y> | 13 | <y>0</y> |
14 | <width>387</width> | 14 | <width>379</width> |
15 | <height>532</height> | 15 | <height>532</height> |
16 | </rect> | 16 | </rect> |
@@ -50,5 +50,5 @@ | |||
50 | <property stdset="1"> | 50 | <property stdset="1"> |
51 | <name>name</name> | 51 | <name>name</name> |
52 | <cstring>TabWidget3</cstring> | 52 | <cstring>tabs</cstring> |
53 | </property> | 53 | </property> |
54 | <property> | 54 | <property> |
@@ -964,5 +964,5 @@ | |||
964 | <attribute> | 964 | <attribute> |
965 | <name>title</name> | 965 | <name>title</name> |
966 | <string>Advanced Settings</string> | 966 | <string>Warnings</string> |
967 | </attribute> | 967 | </attribute> |
968 | <vbox> | 968 | <vbox> |
@@ -1296,5 +1296,5 @@ | |||
1296 | <tabstop>auto_brightness</tabstop> | 1296 | <tabstop>auto_brightness</tabstop> |
1297 | <tabstop>CalibrateLightSensor</tabstop> | 1297 | <tabstop>CalibrateLightSensor</tabstop> |
1298 | <tabstop>TabWidget3</tabstop> | 1298 | <tabstop>tabs</tabstop> |
1299 | <tabstop>interval_lightoff_ac_3</tabstop> | 1299 | <tabstop>interval_lightoff_ac_3</tabstop> |
1300 | <tabstop>interval_suspend_ac_3</tabstop> | 1300 | <tabstop>interval_suspend_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 | |||
@@ -37,10 +37,10 @@ Sensor::Sensor ( QStringList ¶ms, QWidget *parent, const char *name ) | |||
37 | : SensorBase ( parent, name, true, WStyle_ContextHelp ), m_params ( params ) | 37 | : SensorBase ( parent, name, true, WStyle_ContextHelp ), m_params ( params ) |
38 | { | 38 | { |
39 | int steps = 5; | 39 | int steps = 12; |
40 | int inter = 5; | 40 | int inter = 2; |
41 | 41 | ||
42 | int smin = 0; | 42 | int smin = 40; |
43 | int smax = 255; | 43 | int smax = 215; |
44 | int lmin = 0; | 44 | int lmin = 1; |
45 | int lmax = 255; | 45 | int lmax = 255; |
46 | 46 | ||
@@ -51,5 +51,5 @@ Sensor::Sensor ( QStringList ¶ms, QWidget *parent, const char *name ) | |||
51 | case 3: smin = params [2]. toInt ( ); | 51 | case 3: smin = params [2]. toInt ( ); |
52 | case 2: steps = params [1]. toInt ( ); | 52 | case 2: steps = params [1]. toInt ( ); |
53 | case 1: inter = params [0]. toInt ( ); | 53 | case 1: inter = params [0]. toInt ( ) / 1000; |
54 | } | 54 | } |
55 | 55 | ||
@@ -62,6 +62,6 @@ Sensor::Sensor ( QStringList ¶ms, QWidget *parent, const char *name ) | |||
62 | m_calib-> setLineSteps ( steps ); | 62 | m_calib-> setLineSteps ( steps ); |
63 | m_calib-> setInterval ( inter ); | 63 | m_calib-> setInterval ( inter ); |
64 | m_calib-> setStartPoint ( QPoint ( smin, lmin )); | 64 | m_calib-> setStartPoint ( QPoint ( smin, lmax )); |
65 | m_calib-> setEndPoint ( QPoint ( smax, lmax )); | 65 | m_calib-> setEndPoint ( QPoint ( smax, lmin )); |
66 | 66 | ||
67 | interval-> setValue ( inter ); | 67 | interval-> setValue ( inter ); |
@@ -75,10 +75,10 @@ void Sensor::accept ( ) | |||
75 | { | 75 | { |
76 | m_params. clear ( ); | 76 | m_params. clear ( ); |
77 | m_params << QString::number ( m_calib-> interval ( )) | 77 | m_params << QString::number ( m_calib-> interval ( ) * 1000 ) |
78 | << QString::number ( m_calib-> lineSteps ( )) | 78 | << QString::number ( m_calib-> lineSteps ( )) |
79 | << QString::number ( m_calib-> startPoint ( ). x ( )) | 79 | << QString::number ( m_calib-> startPoint ( ). x ( )) |
80 | << QString::number ( m_calib-> endPoint ( ). x ( )) | 80 | << QString::number ( m_calib-> endPoint ( ). x ( )) |
81 | << QString::number ( m_calib-> startPoint ( ). y ( )) | 81 | << QString::number ( m_calib-> endPoint ( ). y ( )) |
82 | << QString::number ( m_calib-> endPoint ( ). y ( )); | 82 | << QString::number ( m_calib-> startPoint ( ). y ( )); |
83 | 83 | ||
84 | QDialog::accept ( ); | 84 | QDialog::accept ( ); |
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 | |||
@@ -12,5 +12,5 @@ | |||
12 | <x>0</x> | 12 | <x>0</x> |
13 | <y>0</y> | 13 | <y>0</y> |
14 | <width>293</width> | 14 | <width>289</width> |
15 | <height>443</height> | 15 | <height>443</height> |
16 | </rect> | 16 | </rect> |
@@ -781,9 +781,13 @@ | |||
781 | <property stdset="1"> | 781 | <property stdset="1"> |
782 | <name>maxValue</name> | 782 | <name>maxValue</name> |
783 | <number>127</number> | 783 | <number>63</number> |
784 | </property> | 784 | </property> |
785 | <property stdset="1"> | 785 | <property stdset="1"> |
786 | <name>lineStep</name> | 786 | <name>lineStep</name> |
787 | <number>10</number> | 787 | <number>5</number> |
788 | </property> | ||
789 | <property stdset="1"> | ||
790 | <name>pageStep</name> | ||
791 | <number>5</number> | ||
788 | </property> | 792 | </property> |
789 | <property stdset="1"> | 793 | <property stdset="1"> |