summaryrefslogtreecommitdiff
path: root/core/settings/light-and-power
Unidiff
Diffstat (limited to 'core/settings/light-and-power') (more/less context) (ignore whitespace changes)
-rw-r--r--core/settings/light-and-power/light.cpp14
-rw-r--r--core/settings/light-and-power/sensor.cpp8
2 files changed, 11 insertions, 11 deletions
diff --git a/core/settings/light-and-power/light.cpp b/core/settings/light-and-power/light.cpp
index 4baff8e..ce45836 100644
--- a/core/settings/light-and-power/light.cpp
+++ b/core/settings/light-and-power/light.cpp
@@ -163,61 +163,61 @@ LightSettings::LightSettings( QWidget* parent, const char* name, WFlags )
163 163
164 // light sensor 164 // light sensor
165 auto_brightness_ac-> setChecked ( config. readBoolEntry ( "LightSensor", false )); 165 auto_brightness_ac-> setChecked ( config. readBoolEntry ( "LightSensor", false ));
166 m_sensordata_ac = config. readListEntry ( "LightSensorData", ';' ); 166 m_sensordata_ac = config. readListEntry ( "LightSensorData", ';' );
167 167
168 // warnings 168 // warnings
169 config. setGroup ( "Warnings" ); 169 config. setGroup ( "Warnings" );
170 warnintervalBox-> setValue ( config. readNumEntry ( "checkinterval", 10000 ) / 1000 ); 170 warnintervalBox-> setValue ( config. readNumEntry ( "checkinterval", 10000 ) / 1000 );
171 lowSpinBox-> setValue ( config. readNumEntry ( "powerverylow", 10 ) ); 171 lowSpinBox-> setValue ( config. readNumEntry ( "powerverylow", 10 ) );
172 criticalSpinBox-> setValue ( config. readNumEntry ( "powercritical", 5 ) ); 172 criticalSpinBox-> setValue ( config. readNumEntry ( "powercritical", 5 ) );
173 173
174 m_resettimer = new QTimer ( this ); 174 m_resettimer = new QTimer ( this );
175 connect ( m_resettimer, SIGNAL( timeout ( )), this, SLOT( resetBacklight ( ))); 175 connect ( m_resettimer, SIGNAL( timeout()), this, SLOT( resetBacklight()));
176 176
177 if ( PowerStatusManager::readStatus ( ). acStatus ( ) != PowerStatus::Online ) { 177 if ( PowerStatusManager::readStatus ( ). acStatus ( ) != PowerStatus::Online ) {
178 tabs-> setCurrentPage ( 0 ); 178 tabs-> setCurrentPage ( 0 );
179 } 179 }
180 else { 180 else {
181 tabs-> setCurrentPage ( 1 ); 181 tabs-> setCurrentPage ( 1 );
182 } 182 }
183 183
184 connect ( brightness, SIGNAL( valueChanged ( int )), this, SLOT( setBacklight ( int ))); 184 connect ( brightness, SIGNAL( valueChanged(int)), this, SLOT( setBacklight(int)));
185 connect ( brightness_ac, SIGNAL( valueChanged ( int )), this, SLOT( setBacklight ( int ))); 185 connect ( brightness_ac, SIGNAL( valueChanged(int)), this, SLOT( setBacklight(int)));
186 if (m_cres) { 186 if (m_cres) {
187 connect ( contrast, SIGNAL( valueChanged ( int )), this, SLOT( setContrast ( int ))); 187 connect ( contrast, SIGNAL( valueChanged(int)), this, SLOT( setContrast(int)));
188 connect ( contrast_ac, SIGNAL( valueChanged ( int )), this, SLOT( setContrast ( int ))); 188 connect ( contrast_ac, SIGNAL( valueChanged(int)), this, SLOT( setContrast(int)));
189 } 189 }
190 connect( frequency, SIGNAL( activated(int) ), this, SLOT( setFrequency(int) ) ); 190 connect( frequency, SIGNAL( activated(int) ), this, SLOT( setFrequency(int) ) );
191 connect( frequency_ac, SIGNAL( activated(int) ), this, SLOT( setFrequency(int) ) ); 191 connect( frequency_ac, SIGNAL( activated(int) ), this, SLOT( setFrequency(int) ) );
192 connect( closeHingeAction, SIGNAL( activated(int) ), this, SLOT( setCloseHingeAction(int) ) ); 192 connect( closeHingeAction, SIGNAL( activated(int) ), this, SLOT( setCloseHingeAction(int) ) );
193 connect( closeHingeAction_ac, SIGNAL( activated(int) ), this, SLOT( setCloseHingeAction(int) ) ); 193 connect( closeHingeAction_ac, SIGNAL( activated(int) ), this, SLOT( setCloseHingeAction(int) ) );
194} 194}
195 195
196LightSettings::~LightSettings ( ) 196LightSettings::~LightSettings ( )
197{ 197{
198} 198}
199 199
200void LightSettings::calibrateSensor ( ) 200void LightSettings::calibrateSensor ( )
201{ 201{
202 Sensor *s = new Sensor ( m_sensordata, this ); 202 Sensor *s = new Sensor ( m_sensordata, this );
203 connect ( s, SIGNAL( viewBacklight ( int )), this, SLOT( setBacklight ( int ))); 203 connect ( s, SIGNAL( viewBacklight(int)), this, SLOT( setBacklight(int)));
204 QPEApplication::execDialog( s ); 204 QPEApplication::execDialog( s );
205 delete s; 205 delete s;
206} 206}
207 207
208void LightSettings::calibrateSensorAC ( ) 208void LightSettings::calibrateSensorAC ( )
209{ 209{
210 Sensor *s = new Sensor ( m_sensordata_ac, this ); 210 Sensor *s = new Sensor ( m_sensordata_ac, this );
211 connect ( s, SIGNAL( viewBacklight ( int )), this, SLOT( setBacklight ( int ))); 211 connect ( s, SIGNAL( viewBacklight(int)), this, SLOT( setBacklight(int)));
212 QPEApplication::execDialog ( s ); 212 QPEApplication::execDialog ( s );
213 delete s; 213 delete s;
214} 214}
215 215
216void LightSettings::setBacklight ( int bright ) 216void LightSettings::setBacklight ( int bright )
217{ 217{
218 QCopEnvelope e ( "QPE/System", "setBacklight(int)" ); 218 QCopEnvelope e ( "QPE/System", "setBacklight(int)" );
219 e << bright; 219 e << bright;
220 220
221 if ( bright != -1 ) { 221 if ( bright != -1 ) {
222 m_resettimer-> stop ( ); 222 m_resettimer-> stop ( );
223 m_resettimer-> start ( 4000, true ); 223 m_resettimer-> start ( 4000, true );
diff --git a/core/settings/light-and-power/sensor.cpp b/core/settings/light-and-power/sensor.cpp
index 41de851..013e655 100644
--- a/core/settings/light-and-power/sensor.cpp
+++ b/core/settings/light-and-power/sensor.cpp
@@ -64,29 +64,29 @@ Sensor::Sensor ( QStringList &params, QWidget *parent, const char *name )
64 m_calib = new Calibration ( frame ); 64 m_calib = new Calibration ( frame );
65 lay-> add ( m_calib ); 65 lay-> add ( m_calib );
66 66
67 m_calib-> setScale ( QSize ( xscale, yscale )); 67 m_calib-> setScale ( QSize ( xscale, yscale ));
68 m_calib-> setLineSteps ( steps ); 68 m_calib-> setLineSteps ( steps );
69 m_calib-> setInterval ( inter ); 69 m_calib-> setInterval ( inter );
70 m_calib-> setStartPoint ( QPoint ( smin * xscale / 256, lmax * yscale / 256 )); 70 m_calib-> setStartPoint ( QPoint ( smin * xscale / 256, lmax * yscale / 256 ));
71 m_calib-> setEndPoint ( QPoint ( smax * xscale / 256, lmin * yscale / 256 )); 71 m_calib-> setEndPoint ( QPoint ( smax * xscale / 256, lmin * yscale / 256 ));
72 72
73 interval-> setValue ( inter ); 73 interval-> setValue ( inter );
74 linesteps-> setValue ( steps ); 74 linesteps-> setValue ( steps );
75 75
76 connect ( interval, SIGNAL( valueChanged ( int )), m_calib, SLOT( setInterval ( int ))); 76 connect ( interval, SIGNAL( valueChanged(int)), m_calib, SLOT( setInterval(int)));
77 connect ( linesteps, SIGNAL( valueChanged ( int )), m_calib, SLOT( setLineSteps ( int ))); 77 connect ( linesteps, SIGNAL( valueChanged(int)), m_calib, SLOT( setLineSteps(int)));
78 78
79 connect ( m_calib, SIGNAL( startPointChanged ( const QPoint & )), this, SLOT( pointDrag ( const QPoint & ))); 79 connect ( m_calib, SIGNAL( startPointChanged(const QPoint&)), this, SLOT( pointDrag(const QPoint&)));
80 connect ( m_calib, SIGNAL( endPointChanged ( const QPoint & )), this, SLOT( pointDrag ( const QPoint & ))); 80 connect ( m_calib, SIGNAL( endPointChanged(const QPoint&)), this, SLOT( pointDrag(const QPoint&)));
81} 81}
82 82
83void Sensor::accept ( ) 83void Sensor::accept ( )
84{ 84{
85 int xscale = ODevice::inst ( )-> lightSensorResolution ( ); 85 int xscale = ODevice::inst ( )-> lightSensorResolution ( );
86 int yscale = ODevice::inst ( )-> displayBrightnessResolution ( ); 86 int yscale = ODevice::inst ( )-> displayBrightnessResolution ( );
87 87
88 m_params. clear ( ); 88 m_params. clear ( );
89 m_params << QString::number ( m_calib-> interval ( ) * 1000 ) 89 m_params << QString::number ( m_calib-> interval ( ) * 1000 )
90 << QString::number ( m_calib-> lineSteps ( )) 90 << QString::number ( m_calib-> lineSteps ( ))
91 << QString::number ( m_calib-> startPoint ( ). x ( ) * 256 / xscale ) 91 << QString::number ( m_calib-> startPoint ( ). x ( ) * 256 / xscale )
92 << QString::number ( m_calib-> endPoint ( ). x ( ) * 256 / xscale ) 92 << QString::number ( m_calib-> endPoint ( ). x ( ) * 256 / xscale )