summaryrefslogtreecommitdiff
path: root/core/settings/light-and-power/light.cpp
Unidiff
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.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/settings/light-and-power/light.cpp b/core/settings/light-and-power/light.cpp
index d6d09a1..b21215b 100644
--- a/core/settings/light-and-power/light.cpp
+++ b/core/settings/light-and-power/light.cpp
@@ -12,48 +12,49 @@
12    .%`+i>       _;_. 12    .%`+i>       _;_.
13    .i_,=:_.      -<s. This file is distributed in the hope that 13    .i_,=:_.      -<s. This file is distributed in the hope that
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15    : ..    .:,     . . . without even the implied warranty of 15    : ..    .:,     . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
18..}^=.=       =       ; Public License for more details. 18..}^=.=       =       ; Public License for more details.
19++=   -.     .`     .: 19++=   -.     .`     .:
20 :     =  ...= . :.=- You should have received a copy of the GNU 20 :     =  ...= . :.=- You should have received a copy of the GNU
21 -.   .:....=;==+<; General Public License along with this file; 21 -.   .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the 22  -_. . .   )=.  = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc., 23    --        :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330, 24 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28 28
29#include "light.h" 29#include "light.h"
30 30
31#include <qpe/config.h> 31#include <qpe/config.h>
32#include <qpe/power.h> 32#include <qpe/power.h>
33#if defined(Q_WS_QWS) && !defined(QT_NO_COP) 33#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
34#include <qpe/qcopenvelope_qws.h> 34#include <qpe/qcopenvelope_qws.h>
35#endif 35#endif
36#include <qpe/qpeapplication.h>
36 37
37#include <qlabel.h> 38#include <qlabel.h>
38#include <qcheckbox.h> 39#include <qcheckbox.h>
39#include <qtabwidget.h> 40#include <qtabwidget.h>
40#include <qslider.h> 41#include <qslider.h>
41#include <qspinbox.h> 42#include <qspinbox.h>
42#include <qpushbutton.h> 43#include <qpushbutton.h>
43#include <qgroupbox.h> 44#include <qgroupbox.h>
44#include <qcombobox.h> 45#include <qcombobox.h>
45 46
46#include <opie/odevice.h> 47#include <opie/odevice.h>
47 48
48#include "sensor.h" 49#include "sensor.h"
49 50
50using namespace Opie; 51using namespace Opie;
51 52
52LightSettings::LightSettings( QWidget* parent, const char* name, WFlags ) 53LightSettings::LightSettings( QWidget* parent, const char* name, WFlags )
53 : LightSettingsBase( parent, name, false, WStyle_ContextHelp ) 54 : LightSettingsBase( parent, name, false, WStyle_ContextHelp )
54{ 55{
55 m_bres = ODevice::inst ( )-> displayBrightnessResolution ( ); 56 m_bres = ODevice::inst ( )-> displayBrightnessResolution ( );
56 m_cres = ODevice::inst ( )-> displayContrastResolution ( ); 57 m_cres = ODevice::inst ( )-> displayContrastResolution ( );
57 58
58 // check whether to show the light sensor stuff 59 // check whether to show the light sensor stuff
59 60
@@ -180,50 +181,49 @@ LightSettings::LightSettings( QWidget* parent, const char* name, WFlags )
180 else { 181 else {
181 tabs-> setCurrentPage ( 1 ); 182 tabs-> setCurrentPage ( 1 );
182 } 183 }
183 184
184 connect ( brightness, SIGNAL( valueChanged ( int )), this, SLOT( setBacklight ( int ))); 185 connect ( brightness, SIGNAL( valueChanged ( int )), this, SLOT( setBacklight ( int )));
185 connect ( brightness_ac, SIGNAL( valueChanged ( int )), this, SLOT( setBacklight ( int ))); 186 connect ( brightness_ac, SIGNAL( valueChanged ( int )), this, SLOT( setBacklight ( int )));
186 if (m_cres) { 187 if (m_cres) {
187 connect ( contrast, SIGNAL( valueChanged ( int )), this, SLOT( setContrast ( int ))); 188 connect ( contrast, SIGNAL( valueChanged ( int )), this, SLOT( setContrast ( int )));
188 connect ( contrast_ac, SIGNAL( valueChanged ( int )), this, SLOT( setContrast ( int ))); 189 connect ( contrast_ac, SIGNAL( valueChanged ( int )), this, SLOT( setContrast ( int )));
189 } 190 }
190 connect( frequency, SIGNAL( activated(int) ), this, SLOT( setFrequency(int) ) ); 191 connect( frequency, SIGNAL( activated(int) ), this, SLOT( setFrequency(int) ) );
191 connect( frequency_ac, SIGNAL( activated(int) ), this, SLOT( setFrequency(int) ) ); 192 connect( frequency_ac, SIGNAL( activated(int) ), this, SLOT( setFrequency(int) ) );
192 connect( closeHingeAction, SIGNAL( activated(int) ), this, SLOT( setCloseHingeAction(int) ) ); 193 connect( closeHingeAction, SIGNAL( activated(int) ), this, SLOT( setCloseHingeAction(int) ) );
193 connect( closeHingeAction_ac, SIGNAL( activated(int) ), this, SLOT( setCloseHingeAction(int) ) ); 194 connect( closeHingeAction_ac, SIGNAL( activated(int) ), this, SLOT( setCloseHingeAction(int) ) );
194} 195}
195 196
196LightSettings::~LightSettings ( ) 197LightSettings::~LightSettings ( )
197{ 198{
198} 199}
199 200
200void LightSettings::calibrateSensor ( ) 201void LightSettings::calibrateSensor ( )
201{ 202{
202 Sensor *s = new Sensor ( m_sensordata, this ); 203 Sensor *s = new Sensor ( m_sensordata, this );
203 connect ( s, SIGNAL( viewBacklight ( int )), this, SLOT( setBacklight ( int ))); 204 connect ( s, SIGNAL( viewBacklight ( int )), this, SLOT( setBacklight ( int )));
204 s-> showMaximized ( ); 205 QPEApplication::execDialog( s );
205 s-> exec ( );
206 delete s; 206 delete s;
207} 207}
208 208
209void LightSettings::calibrateSensorAC ( ) 209void LightSettings::calibrateSensorAC ( )
210{ 210{
211 Sensor *s = new Sensor ( m_sensordata_ac, this ); 211 Sensor *s = new Sensor ( m_sensordata_ac, this );
212 connect ( s, SIGNAL( viewBacklight ( int )), this, SLOT( setBacklight ( int ))); 212 connect ( s, SIGNAL( viewBacklight ( int )), this, SLOT( setBacklight ( int )));
213 s-> showMaximized ( ); 213 s-> showMaximized ( );
214 s-> exec ( ); 214 s-> exec ( );
215 delete s; 215 delete s;
216} 216}
217 217
218void LightSettings::setBacklight ( int bright ) 218void LightSettings::setBacklight ( int bright )
219{ 219{
220 QCopEnvelope e ( "QPE/System", "setBacklight(int)" ); 220 QCopEnvelope e ( "QPE/System", "setBacklight(int)" );
221 e << bright; 221 e << bright;
222 222
223 if ( bright != -1 ) { 223 if ( bright != -1 ) {
224 m_resettimer-> stop ( ); 224 m_resettimer-> stop ( );
225 m_resettimer-> start ( 4000, true ); 225 m_resettimer-> start ( 4000, true );
226 } 226 }
227} 227}
228 228
229void LightSettings::setContrast ( int contr ) 229void LightSettings::setContrast ( int contr )