summaryrefslogtreecommitdiff
authorsandman <sandman>2002-12-29 18:41:55 (UTC)
committer sandman <sandman>2002-12-29 18:41:55 (UTC)
commit7c3dceb16d9007e2c36b2b83e2a499cda3411138 (patch) (unidiff)
tree78a0945be9233099ca7e5e4e01d8b78364f009cb
parentf8673391881545af514054babe47fdc162770a72 (diff)
downloadopie-7c3dceb16d9007e2c36b2b83e2a499cda3411138.zip
opie-7c3dceb16d9007e2c36b2b83e2a499cda3411138.tar.gz
opie-7c3dceb16d9007e2c36b2b83e2a499cda3411138.tar.bz2
Power warning changes:
- interval can now be in the range (0 [Never] ... 300 [5min] ) - some code cleanup in the launcher
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/desktop.cpp34
-rw-r--r--core/launcher/desktop.h2
-rw-r--r--core/settings/light-and-power/lightsettingsbase.ui20
3 files changed, 35 insertions, 21 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp
index fa9736f..03a23dc 100644
--- a/core/launcher/desktop.cpp
+++ b/core/launcher/desktop.cpp
@@ -50,424 +50,422 @@
50#include <qmainwindow.h> 50#include <qmainwindow.h>
51#include <qmessagebox.h> 51#include <qmessagebox.h>
52#include <qtimer.h> 52#include <qtimer.h>
53#include <qwindowsystem_qws.h> 53#include <qwindowsystem_qws.h>
54 54
55#include <qvaluelist.h> 55#include <qvaluelist.h>
56 56
57#include <stdlib.h> 57#include <stdlib.h>
58#include <unistd.h> 58#include <unistd.h>
59#include <fcntl.h> 59#include <fcntl.h>
60 60
61 61
62using namespace Opie; 62using namespace Opie;
63 63
64class QCopKeyRegister 64class QCopKeyRegister
65{ 65{
66public: 66public:
67 QCopKeyRegister() : keyCode( 0 ) 67 QCopKeyRegister() : keyCode( 0 )
68 { } 68 { }
69 QCopKeyRegister( int k, const QCString &c, const QCString &m ) 69 QCopKeyRegister( int k, const QCString &c, const QCString &m )
70 : keyCode( k ), channel( c ), message( m ) 70 : keyCode( k ), channel( c ), message( m )
71 { } 71 { }
72 72
73 int getKeyCode() const 73 int getKeyCode() const
74 { 74 {
75 return keyCode; 75 return keyCode;
76 } 76 }
77 QCString getChannel() const 77 QCString getChannel() const
78 { 78 {
79 return channel; 79 return channel;
80 } 80 }
81 QCString getMessage() const 81 QCString getMessage() const
82 { 82 {
83 return message; 83 return message;
84 } 84 }
85 85
86private: 86private:
87 int keyCode; 87 int keyCode;
88 QCString channel, message; 88 QCString channel, message;
89}; 89};
90 90
91typedef QValueList<QCopKeyRegister> KeyRegisterList; 91typedef QValueList<QCopKeyRegister> KeyRegisterList;
92KeyRegisterList keyRegisterList; 92KeyRegisterList keyRegisterList;
93 93
94static Desktop* qpedesktop = 0; 94static Desktop* qpedesktop = 0;
95static int loggedin = 0; 95static int loggedin = 0;
96static void login( bool at_poweron ) 96static void login( bool at_poweron )
97{ 97{
98 if ( !loggedin ) { 98 if ( !loggedin ) {
99 Global::terminateBuiltin( "calibrate" ); 99 Global::terminateBuiltin( "calibrate" );
100 Password::authenticate( at_poweron ); 100 Password::authenticate( at_poweron );
101 loggedin = 1; 101 loggedin = 1;
102 QCopEnvelope e( "QPE/Desktop", "unlocked()" ); 102 QCopEnvelope e( "QPE/Desktop", "unlocked()" );
103 } 103 }
104} 104}
105 105
106bool Desktop::screenLocked() 106bool Desktop::screenLocked()
107{ 107{
108 return loggedin == 0; 108 return loggedin == 0;
109} 109}
110 110
111/* 111/*
112 Priority is number of alerts that are needed to pop up 112 Priority is number of alerts that are needed to pop up
113 alert. 113 alert.
114 */ 114 */
115class DesktopPowerAlerter : public QMessageBox 115class DesktopPowerAlerter : public QMessageBox
116{ 116{
117public: 117public:
118 DesktopPowerAlerter( QWidget *parent, const char *name = 0 ) 118 DesktopPowerAlerter( QWidget *parent, const char *name = 0 )
119 : QMessageBox( tr( "Battery Status" ), "Low Battery", 119 : QMessageBox( tr( "Battery Status" ), "Low Battery",
120 QMessageBox::Critical, 120 QMessageBox::Critical,
121 QMessageBox::Ok | QMessageBox::Default, 121 QMessageBox::Ok | QMessageBox::Default,
122 QMessageBox::NoButton, QMessageBox::NoButton, 122 QMessageBox::NoButton, QMessageBox::NoButton,
123 parent, name, FALSE ) 123 parent, name, FALSE )
124 { 124 {
125 currentPriority = INT_MAX; 125 currentPriority = INT_MAX;
126 alertCount = 0; 126 alertCount = 0;
127 } 127 }
128 128
129 void alert( const QString &text, int priority ); 129 void alert( const QString &text, int priority );
130 void hideEvent( QHideEvent * ); 130 void hideEvent( QHideEvent * );
131private: 131private:
132 int currentPriority; 132 int currentPriority;
133 int alertCount; 133 int alertCount;
134}; 134};
135 135
136void DesktopPowerAlerter::alert( const QString &text, int priority ) 136void DesktopPowerAlerter::alert( const QString &text, int priority )
137{ 137{
138 alertCount++; 138 alertCount++;
139 if ( alertCount < priority ) 139 if ( alertCount < priority )
140 return ; 140 return ;
141 if ( priority > currentPriority ) 141 if ( priority > currentPriority )
142 return ; 142 return ;
143 currentPriority = priority; 143 currentPriority = priority;
144 setText( text ); 144 setText( text );
145 show(); 145 show();
146} 146}
147 147
148 148
149void DesktopPowerAlerter::hideEvent( QHideEvent *e ) 149void DesktopPowerAlerter::hideEvent( QHideEvent *e )
150{ 150{
151 QMessageBox::hideEvent( e ); 151 QMessageBox::hideEvent( e );
152 alertCount = 0; 152 alertCount = 0;
153 currentPriority = INT_MAX; 153 currentPriority = INT_MAX;
154} 154}
155 155
156 156
157void DesktopApplication::switchLCD ( bool on ) 157void DesktopApplication::switchLCD ( bool on )
158{ 158{
159 if ( qApp ) { 159 if ( qApp ) {
160 DesktopApplication *dapp = (DesktopApplication *) qApp; 160 DesktopApplication *dapp = (DesktopApplication *) qApp;
161 161
162 if ( dapp-> m_screensaver ) { 162 if ( dapp-> m_screensaver ) {
163 if ( on ) { 163 if ( on ) {
164 dapp-> m_screensaver-> setDisplayState ( true ); 164 dapp-> m_screensaver-> setDisplayState ( true );
165 dapp-> m_screensaver-> setBacklight ( -3 ); 165 dapp-> m_screensaver-> setBacklight ( -3 );
166 } 166 }
167 else { 167 else {
168 dapp-> m_screensaver-> setDisplayState ( false ); 168 dapp-> m_screensaver-> setDisplayState ( false );
169 } 169 }
170 } 170 }
171 } 171 }
172} 172}
173 173
174 174
175DesktopApplication::DesktopApplication( int& argc, char **argv, Type appType ) 175DesktopApplication::DesktopApplication( int& argc, char **argv, Type appType )
176 : QPEApplication( argc, argv, appType ) 176 : QPEApplication( argc, argv, appType )
177{ 177{
178
179 Config cfg( "apm" );
180 cfg.setGroup( "Warnings" );
181 //cfg.readNumEntry( "checkinterval", 10000 )
182 m_powerVeryLow = cfg.readNumEntry( "powerverylow", 10 );
183 m_powerCritical = cfg.readNumEntry( "powercritical", 5 );
184
185 m_ps = new PowerStatus; 178 m_ps = new PowerStatus;
186 m_ps_last = new PowerStatus; 179 m_ps_last = new PowerStatus;
187 pa = new DesktopPowerAlerter( 0 ); 180 pa = new DesktopPowerAlerter( 0 );
188 181
189 m_timer = new QTimer( this ); 182 m_apm_timer = new QTimer ( this );
190 connect( m_timer, SIGNAL( timeout() ), this, SLOT( apmTimeout() ) ); 183 connect ( m_apm_timer, SIGNAL( timeout ( )), this, SLOT( apmTimeout ( )));
191 m_timer->start( 5000 ); 184 reloadPowerWarnSettings ( );
192 185
193 m_last_button = 0; 186 m_last_button = 0;
194 m_button_timer = new QTimer ( ); 187 m_button_timer = new QTimer ( );
195 connect ( m_button_timer, SIGNAL( timeout ( )), this, SLOT( sendHeldAction ( ))); 188 connect ( m_button_timer, SIGNAL( timeout ( )), this, SLOT( sendHeldAction ( )));
196 189
197 channel = new QCopChannel( "QPE/System", this ); 190 channel = new QCopChannel( "QPE/System", this );
198 connect( channel, SIGNAL( received( const QCString&, const QByteArray& ) ), 191 connect( channel, SIGNAL( received( const QCString&, const QByteArray& ) ),
199 this, SLOT( systemMessage( const QCString&, const QByteArray& ) ) ); 192 this, SLOT( systemMessage( const QCString&, const QByteArray& ) ) );
200 193
201 channel = new QCopChannel( "QPE/Launcher", this ); 194 channel = new QCopChannel( "QPE/Launcher", this );
202 connect( channel, SIGNAL( received( const QCString&, const QByteArray& ) ), 195 connect( channel, SIGNAL( received( const QCString&, const QByteArray& ) ),
203 this, SLOT( launcherMessage( const QCString&, const QByteArray& ) ) ); 196 this, SLOT( launcherMessage( const QCString&, const QByteArray& ) ) );
204 197
205 m_screensaver = new OpieScreenSaver ( ); 198 m_screensaver = new OpieScreenSaver ( );
206 m_screensaver-> setInterval ( -1 ); 199 m_screensaver-> setInterval ( -1 );
207 QWSServer::setScreenSaver( m_screensaver ); 200 QWSServer::setScreenSaver( m_screensaver );
208 201
209 rereadVolumes(); 202 rereadVolumes();
210 connect( qApp, SIGNAL( volumeChanged( bool ) ), this, SLOT( rereadVolumes() ) ); 203 connect( qApp, SIGNAL( volumeChanged( bool ) ), this, SLOT( rereadVolumes() ) );
211 204
212 apmTimeout ( ); 205 apmTimeout ( );
213 206
214 grabKeyboard ( ); 207 grabKeyboard ( );
215} 208}
216 209
217 210
218DesktopApplication::~DesktopApplication() 211DesktopApplication::~DesktopApplication()
219{ 212{
220 ungrabKeyboard ( ); 213 ungrabKeyboard ( );
221 214
222 delete m_ps; 215 delete m_ps;
223 delete m_ps_last; 216 delete m_ps_last;
224 delete pa; 217 delete pa;
225} 218}
226 219
227void DesktopApplication::apmTimeout() 220void DesktopApplication::apmTimeout()
228{ 221{
229 qpedesktop->checkMemory(); // in case no events are being generated 222 qpedesktop-> checkMemory ( ); // in case no events are being generated
230 223
231 *m_ps_last = *m_ps; 224 *m_ps_last = *m_ps;
232 *m_ps = PowerStatusManager::readStatus(); 225 *m_ps = PowerStatusManager::readStatus();
233 226
234 if ( m_ps-> acStatus ( ) != m_ps_last-> acStatus ( )) 227 if ( m_ps-> acStatus ( ) != m_ps_last-> acStatus ( ))
235 m_screensaver-> powerStatusChanged ( *m_ps ); 228 m_screensaver-> powerStatusChanged ( *m_ps );
236 229
237 if ( m_ps-> acStatus ( ) != PowerStatus::Online ) { 230 if ( m_ps-> acStatus ( ) != PowerStatus::Online ) {
238 int bat = m_ps-> batteryPercentRemaining ( ); 231 int bat = m_ps-> batteryPercentRemaining ( );
239 232
240 if ( bat < m_ps_last-> batteryPercentRemaining ( )) { 233 if ( bat < m_ps_last-> batteryPercentRemaining ( )) {
241 if ( bat <= m_powerCritical ) 234 if ( bat <= m_powerCritical )
242 pa->alert( tr( "Battery level is critical!\nKeep power off until power restored!" ), 1 ); 235 pa->alert( tr( "Battery level is critical!\nKeep power off until power restored!" ), 1 );
243 else if ( bat <= m_powerVeryLow ) 236 else if ( bat <= m_powerVeryLow )
244 pa->alert( tr( "Battery is running very low." ), 2 ); 237 pa->alert( tr( "Battery is running very low." ), 2 );
245 } 238 }
246 if ( m_ps-> backupBatteryStatus ( ) == PowerStatus::VeryLow ) 239 if ( m_ps-> backupBatteryStatus ( ) == PowerStatus::VeryLow )
247 pa->alert( tr( "The Back-up battery is very low.\nPlease charge the back-up battery." ), 2 ); 240 pa->alert( tr( "The Back-up battery is very low.\nPlease charge the back-up battery." ), 2 );
248 } 241 }
249} 242}
250 243
251 244
252void DesktopApplication::systemMessage( const QCString & msg, const QByteArray & data ) 245void DesktopApplication::systemMessage( const QCString & msg, const QByteArray & data )
253{ 246{
254 QDataStream stream ( data, IO_ReadOnly ); 247 QDataStream stream ( data, IO_ReadOnly );
255 248
256 if ( msg == "setScreenSaverInterval(int)" ) { 249 if ( msg == "setScreenSaverInterval(int)" ) {
257 int time; 250 int time;
258 stream >> time; 251 stream >> time;
259 m_screensaver-> setInterval( time ); 252 m_screensaver-> setInterval( time );
260 } 253 }
261 else if ( msg == "setScreenSaverIntervals(int,int,int)" ) { 254 else if ( msg == "setScreenSaverIntervals(int,int,int)" ) {
262 int t1, t2, t3; 255 int t1, t2, t3;
263 stream >> t1 >> t2 >> t3; 256 stream >> t1 >> t2 >> t3;
264 m_screensaver-> setIntervals( t1, t2, t3 ); 257 m_screensaver-> setIntervals( t1, t2, t3 );
265 } 258 }
266 else if ( msg == "setBacklight(int)" ) { 259 else if ( msg == "setBacklight(int)" ) {
267 int bright; 260 int bright;
268 stream >> bright; 261 stream >> bright;
269 m_screensaver-> setBacklight( bright ); 262 m_screensaver-> setBacklight( bright );
270 } 263 }
271 else if ( msg == "setScreenSaverMode(int)" ) { 264 else if ( msg == "setScreenSaverMode(int)" ) {
272 int mode; 265 int mode;
273 stream >> mode; 266 stream >> mode;
274 m_screensaver-> setMode ( mode ); 267 m_screensaver-> setMode ( mode );
275 } 268 }
276 else if ( msg == "reloadPowerWarnSettings()" ) { 269 else if ( msg == "reloadPowerWarnSettings()" ) {
277 reloadPowerWarnSettings(); 270 reloadPowerWarnSettings();
278 } 271 }
279 else if ( msg == "setDisplayState(int)" ) { 272 else if ( msg == "setDisplayState(int)" ) {
280 int state; 273 int state;
281 stream >> state; 274 stream >> state;
282 m_screensaver-> setDisplayState ( state != 0 ); 275 m_screensaver-> setDisplayState ( state != 0 );
283 } 276 }
284 else if ( msg == "suspend()" ) { 277 else if ( msg == "suspend()" ) {
285 emit power(); 278 emit power();
286 } 279 }
287 else if ( msg == "sendBusinessCard()" ) { 280 else if ( msg == "sendBusinessCard()" ) {
288 QString card = ::getenv ( "HOME" ); 281 QString card = ::getenv ( "HOME" );
289 card += "/Applications/addressbook/businesscard.vcf"; 282 card += "/Applications/addressbook/businesscard.vcf";
290 283
291 if ( QFile::exists( card ) ) { 284 if ( QFile::exists( card ) ) {
292 QCopEnvelope e ( "QPE/Obex", "send(QString,QString,QString)" ); 285 QCopEnvelope e ( "QPE/Obex", "send(QString,QString,QString)" );
293 QString mimetype = "text/x-vCard"; 286 QString mimetype = "text/x-vCard";
294 e << tr( "business card" ) << card << mimetype; 287 e << tr( "business card" ) << card << mimetype;
295 } 288 }
296 } 289 }
297} 290}
298 291
299void DesktopApplication::reloadPowerWarnSettings() 292void DesktopApplication::reloadPowerWarnSettings ( )
300{ 293{
301 Config cfg( "apm" ); 294 Config cfg ( "apm" );
302 cfg.setGroup( "Warnings" ); 295 cfg. setGroup ( "Warnings" );
303 296
304 // m_timer->changeInterval( cfg.readNumEntry( "checkinterval", 10000 ) ); 297 int iv = cfg. readNumEntry ( "checkinterval", 10000 );
305 m_powerVeryLow = cfg.readNumEntry( "powerverylow", 10 ); 298
306 m_powerCritical = cfg.readNumEntry( "powervcritical", 5 ); 299 m_apm_timer-> stop ( );
300 if ( iv )
301 m_apm_timer-> start ( iv );
302
303 m_powerVeryLow = cfg. readNumEntry ( "powerverylow", 10 );
304 m_powerCritical = cfg. readNumEntry ( "powervcritical", 5 );
307} 305}
308 306
309 307
310enum MemState { Unknown, VeryLow, Low, Normal } memstate = Unknown; 308enum MemState { Unknown, VeryLow, Low, Normal } memstate = Unknown;
311 309
312 310
313void DesktopApplication::launcherMessage( const QCString & msg, const QByteArray & data ) 311void DesktopApplication::launcherMessage( const QCString & msg, const QByteArray & data )
314{ 312{
315 QDataStream stream ( data, IO_ReadOnly ); 313 QDataStream stream ( data, IO_ReadOnly );
316 314
317 if ( msg == "deviceButton(int,int,int)" ) { 315 if ( msg == "deviceButton(int,int,int)" ) {
318 int keycode, press, autoRepeat; 316 int keycode, press, autoRepeat;
319 stream >> keycode >> press >> autoRepeat; 317 stream >> keycode >> press >> autoRepeat;
320 318
321 const ODeviceButton *db = ODevice::inst ( )-> buttonForKeycode ( keycode ); 319 const ODeviceButton *db = ODevice::inst ( )-> buttonForKeycode ( keycode );
322 320
323 if ( db ) 321 if ( db )
324 checkButtonAction ( db, keycode, press, autoRepeat ); 322 checkButtonAction ( db, keycode, press, autoRepeat );
325 } 323 }
326 else if ( msg == "keyRegister(int,QCString,QCString)" ) { 324 else if ( msg == "keyRegister(int,QCString,QCString)" ) {
327 int k; 325 int k;
328 QCString c, m; 326 QCString c, m;
329 stream >> k >> c >> m; 327 stream >> k >> c >> m;
330 328
331 keyRegisterList.append ( QCopKeyRegister ( k, c, m )); 329 keyRegisterList.append ( QCopKeyRegister ( k, c, m ));
332 } 330 }
333} 331}
334 332
335void DesktopApplication::sendHeldAction ( ) 333void DesktopApplication::sendHeldAction ( )
336{ 334{
337 if ( m_last_button ) { 335 if ( m_last_button ) {
338 m_last_button-> heldAction ( ). send ( ); 336 m_last_button-> heldAction ( ). send ( );
339 m_last_button = 0; 337 m_last_button = 0;
340 } 338 }
341} 339}
342 340
343 341
344 342
345void DesktopApplication::checkButtonAction ( const ODeviceButton *db, int keycode, bool press, bool autoRepeat ) 343void DesktopApplication::checkButtonAction ( const ODeviceButton *db, int /*keycode*/, bool press, bool autoRepeat )
346 { 344 {
347 if ( db ) { 345 if ( db ) {
348 if ( !press && !autoRepeat && m_button_timer-> isActive ( )) { 346 if ( !press && !autoRepeat && m_button_timer-> isActive ( )) {
349 m_button_timer-> stop ( ); 347 m_button_timer-> stop ( );
350 if ( !db-> pressedAction ( ). channel ( ). isEmpty ( )) { 348 if ( !db-> pressedAction ( ). channel ( ). isEmpty ( )) {
351 db-> pressedAction ( ). send ( ); 349 db-> pressedAction ( ). send ( );
352 } 350 }
353 } 351 }
354 else if ( press && !autoRepeat ) { 352 else if ( press && !autoRepeat ) {
355 m_button_timer-> stop ( ); 353 m_button_timer-> stop ( );
356 354
357 if ( !db-> heldAction ( ). channel ( ). isEmpty ( )) { 355 if ( !db-> heldAction ( ). channel ( ). isEmpty ( )) {
358 m_last_button = db; 356 m_last_button = db;
359 m_button_timer-> start ( ODevice::inst ( )-> buttonHoldTime ( ), true ); 357 m_button_timer-> start ( ODevice::inst ( )-> buttonHoldTime ( ), true );
360 } 358 }
361 } 359 }
362 } 360 }
363} 361}
364 362
365bool DesktopApplication::eventFilter ( QObject *o, QEvent *e ) 363bool DesktopApplication::eventFilter ( QObject *o, QEvent *e )
366{ 364{
367 if ( e-> type ( ) == QEvent::KeyPress || e-> type ( ) == QEvent::KeyRelease ) { 365 if ( e-> type ( ) == QEvent::KeyPress || e-> type ( ) == QEvent::KeyRelease ) {
368 QKeyEvent *ke = (QKeyEvent *) e; 366 QKeyEvent *ke = (QKeyEvent *) e;
369 367
370 const ODeviceButton *db = ODevice::inst ( )-> buttonForKeycode ( ke-> key ( )); 368 const ODeviceButton *db = ODevice::inst ( )-> buttonForKeycode ( ke-> key ( ));
371 369
372 if ( db ) { 370 if ( db ) {
373 checkButtonAction ( db, ke-> key ( ), e-> type ( ) == QEvent::KeyPress, ke-> isAutoRepeat ( )); 371 checkButtonAction ( db, ke-> key ( ), e-> type ( ) == QEvent::KeyPress, ke-> isAutoRepeat ( ));
374 return true; 372 return true;
375 } 373 }
376 } 374 }
377 return QPEApplication::eventFilter ( o, e ); 375 return QPEApplication::eventFilter ( o, e );
378} 376}
379 377
380#ifdef Q_WS_QWS 378#ifdef Q_WS_QWS
381 379
382bool DesktopApplication::qwsEventFilter( QWSEvent *e ) 380bool DesktopApplication::qwsEventFilter( QWSEvent *e )
383{ 381{
384 qpedesktop->checkMemory(); 382 qpedesktop->checkMemory();
385 383
386 if ( e->type == QWSEvent::Key ) { 384 if ( e->type == QWSEvent::Key ) {
387 QWSKeyEvent * ke = (QWSKeyEvent *) e; 385 QWSKeyEvent * ke = (QWSKeyEvent *) e;
388 ushort keycode = ke-> simpleData. keycode; 386 ushort keycode = ke-> simpleData. keycode;
389 387
390 if ( !loggedin && keycode != Key_F34 ) 388 if ( !loggedin && keycode != Key_F34 )
391 return true; 389 return true;
392 390
393 bool press = ke-> simpleData. is_press; 391 bool press = ke-> simpleData. is_press;
394 bool autoRepeat = ke-> simpleData. is_auto_repeat; 392 bool autoRepeat = ke-> simpleData. is_auto_repeat;
395 393
396 if ( !keyboardGrabbed ( )) { 394 if ( !keyboardGrabbed ( )) {
397 // app that registers key/message to be sent back to the app, when it doesn't have focus, 395 // app that registers key/message to be sent back to the app, when it doesn't have focus,
398 // when user presses key, unless keyboard has been requested from app. 396 // when user presses key, unless keyboard has been requested from app.
399 // will not send multiple repeats if user holds key 397 // will not send multiple repeats if user holds key
400 // i.e. one shot 398 // i.e. one shot
401 399
402 if ( keycode != 0 && press && !autoRepeat ) { 400 if ( keycode != 0 && press && !autoRepeat ) {
403 for ( KeyRegisterList::Iterator it = keyRegisterList.begin(); it != keyRegisterList.end(); ++it ) { 401 for ( KeyRegisterList::Iterator it = keyRegisterList.begin(); it != keyRegisterList.end(); ++it ) {
404 if (( *it ). getKeyCode ( ) == keycode ) { 402 if (( *it ). getKeyCode ( ) == keycode ) {
405 QCopEnvelope (( *it ). getChannel ( ), ( *it ). getMessage ( )); 403 QCopEnvelope (( *it ). getChannel ( ), ( *it ). getMessage ( ));
406 return true; 404 return true;
407 } 405 }
408 } 406 }
409 } 407 }
410 } 408 }
411 409
412 if ( keycode == HardKey_Suspend ) { 410 if ( keycode == HardKey_Suspend ) {
413 if ( press ) 411 if ( press )
414 emit power ( ); 412 emit power ( );
415 return true; 413 return true;
416 } 414 }
417 else if ( keycode == HardKey_Backlight ) { 415 else if ( keycode == HardKey_Backlight ) {
418 if ( press ) 416 if ( press )
419 emit backlight ( ); 417 emit backlight ( );
420 return true; 418 return true;
421 } 419 }
422 else if ( keycode == Key_F32 ) { 420 else if ( keycode == Key_F32 ) {
423 if ( press ) 421 if ( press )
424 QCopEnvelope e( "QPE/Desktop", "startSync()" ); 422 QCopEnvelope e( "QPE/Desktop", "startSync()" );
425 return true; 423 return true;
426 } 424 }
427 else if ( keycode == Key_F31 && !ke-> simpleData. modifiers ) { // Symbol Key -> show Unicode IM 425 else if ( keycode == Key_F31 && !ke-> simpleData. modifiers ) { // Symbol Key -> show Unicode IM
428 if ( press ) 426 if ( press )
429 emit symbol ( ); 427 emit symbol ( );
430 return true; 428 return true;
431 } 429 }
432 else if ( keycode == Key_NumLock ) { 430 else if ( keycode == Key_NumLock ) {
433 if ( press ) 431 if ( press )
434 emit numLockStateToggle ( ); 432 emit numLockStateToggle ( );
435 } 433 }
436 else if ( keycode == Key_CapsLock ) { 434 else if ( keycode == Key_CapsLock ) {
437 if ( press ) 435 if ( press )
438 emit capsLockStateToggle(); 436 emit capsLockStateToggle();
439 } 437 }
440 if (( press && !autoRepeat ) || ( !press && autoRepeat )) { 438 if (( press && !autoRepeat ) || ( !press && autoRepeat )) {
441 if ( m_keyclick_sound ) 439 if ( m_keyclick_sound )
442 ODevice::inst ( )-> keySound ( ); 440 ODevice::inst ( )-> keySound ( );
443 } 441 }
444 } 442 }
445 else if ( e-> type == QWSEvent::Mouse ) { 443 else if ( e-> type == QWSEvent::Mouse ) {
446 QWSMouseEvent * me = ( QWSMouseEvent * ) e; 444 QWSMouseEvent * me = ( QWSMouseEvent * ) e;
447 static bool up = true; 445 static bool up = true;
448 446
449 if ( me-> simpleData. state & LeftButton ) { 447 if ( me-> simpleData. state & LeftButton ) {
450 if ( up ) { 448 if ( up ) {
451 up = false; 449 up = false;
452 if ( m_screentap_sound ) 450 if ( m_screentap_sound )
453 ODevice::inst ( ) -> touchSound ( ); 451 ODevice::inst ( ) -> touchSound ( );
454 } 452 }
455 } 453 }
456 else { 454 else {
457 up = true; 455 up = true;
458 } 456 }
459 } 457 }
460 458
461 return QPEApplication::qwsEventFilter ( e ); 459 return QPEApplication::qwsEventFilter ( e );
462} 460}
463#endif 461#endif
464 462
465 463
466 464
467#if defined(QPE_HAVE_MEMALERTER) 465#if defined(QPE_HAVE_MEMALERTER)
468QPE_MEMALERTER_IMPL 466QPE_MEMALERTER_IMPL
469#endif 467#endif
470 468
471//=========================================================================== 469//===========================================================================
472 470
473Desktop::Desktop() : 471Desktop::Desktop() :
diff --git a/core/launcher/desktop.h b/core/launcher/desktop.h
index 6cb7ab2..db0173e 100644
--- a/core/launcher/desktop.h
+++ b/core/launcher/desktop.h
@@ -1,155 +1,155 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#ifndef __DESKTOP_H__ 21#ifndef __DESKTOP_H__
22#define __DESKTOP_H__ 22#define __DESKTOP_H__
23 23
24 24
25#include "shutdownimpl.h" 25#include "shutdownimpl.h"
26 26
27#include <qpe/qpeapplication.h> 27#include <qpe/qpeapplication.h>
28#include <opie/odevicebutton.h> 28#include <opie/odevicebutton.h>
29 29
30#include <qwidget.h> 30#include <qwidget.h>
31#include <qdatetime.h> 31#include <qdatetime.h>
32 32
33class Background; 33class Background;
34class Launcher; 34class Launcher;
35class TaskBar; 35class TaskBar;
36class PowerStatus; 36class PowerStatus;
37class QCopBridge; 37class QCopBridge;
38class TransferServer; 38class TransferServer;
39class DesktopPowerAlerter; 39class DesktopPowerAlerter;
40class PackageSlave; 40class PackageSlave;
41class OpieScreenSaver; 41class OpieScreenSaver;
42 42
43class DesktopApplication : public QPEApplication 43class DesktopApplication : public QPEApplication
44{ 44{
45 Q_OBJECT 45 Q_OBJECT
46public: 46public:
47 DesktopApplication( int& argc, char **argv, Type t ); 47 DesktopApplication( int& argc, char **argv, Type t );
48 ~DesktopApplication(); 48 ~DesktopApplication();
49 49
50 static void switchLCD ( bool on ); // only for togglePower in Desktop 50 static void switchLCD ( bool on ); // only for togglePower in Desktop
51 51
52 static void soundAlarm(); // only because QCop soundAlarm() is defined in QPE/TaskBar 52 static void soundAlarm(); // only because QCop soundAlarm() is defined in QPE/TaskBar
53 53
54signals: 54signals:
55 void menu(); 55 void menu();
56 void home(); 56 void home();
57 void launch(); 57 void launch();
58 void backlight(); 58 void backlight();
59 void power(); 59 void power();
60 void symbol(); 60 void symbol();
61 void numLockStateToggle(); 61 void numLockStateToggle();
62 void capsLockStateToggle(); 62 void capsLockStateToggle();
63 void prepareForRestart(); 63 void prepareForRestart();
64 64
65protected: 65protected:
66#ifdef Q_WS_QWS 66#ifdef Q_WS_QWS
67 67
68 bool qwsEventFilter( QWSEvent * ); 68 bool qwsEventFilter( QWSEvent * );
69#endif 69#endif
70 70
71 void shutdown(); 71 void shutdown();
72 void restart(); 72 void restart();
73 73
74public slots: 74public slots:
75 virtual void systemMessage ( const QCString &msg, const QByteArray &data ); 75 virtual void systemMessage ( const QCString &msg, const QByteArray &data );
76 virtual void launcherMessage ( const QCString &msg, const QByteArray &data ); 76 virtual void launcherMessage ( const QCString &msg, const QByteArray &data );
77 void rereadVolumes(); 77 void rereadVolumes();
78 78
79protected slots: 79protected slots:
80 void shutdown ( ShutdownImpl::Type ); 80 void shutdown ( ShutdownImpl::Type );
81 void apmTimeout ( ); 81 void apmTimeout ( );
82 void sendHeldAction ( ); 82 void sendHeldAction ( );
83 83
84protected: 84protected:
85 virtual bool eventFilter ( QObject *o, QEvent *e ); 85 virtual bool eventFilter ( QObject *o, QEvent *e );
86 void checkButtonAction ( const Opie::ODeviceButton *db, int keycode, bool press, bool autoRepeat ); 86 void checkButtonAction ( const Opie::ODeviceButton *db, int keycode, bool press, bool autoRepeat );
87 87
88private: 88private:
89 static DesktopApplication *me ( ); 89 static DesktopApplication *me ( );
90 90
91private: 91private:
92 void reloadPowerWarnSettings(); 92 void reloadPowerWarnSettings();
93 DesktopPowerAlerter *pa; 93 DesktopPowerAlerter *pa;
94 PowerStatus *m_ps, *m_ps_last; 94 PowerStatus *m_ps, *m_ps_last;
95 QTimer *cardSendTimer; 95 QTimer *cardSendTimer;
96 QCopChannel *channel; 96 QCopChannel *channel;
97 OpieScreenSaver *m_screensaver; 97 OpieScreenSaver *m_screensaver;
98 QTimer * m_timer; 98 QTimer * m_apm_timer;
99 int m_powerVeryLow; 99 int m_powerVeryLow;
100 int m_powerCritical; 100 int m_powerCritical;
101 int m_currentPowerLevel; 101 int m_currentPowerLevel;
102 102
103 const Opie::ODeviceButton *m_last_button; 103 const Opie::ODeviceButton *m_last_button;
104 QTimer *m_button_timer; 104 QTimer *m_button_timer;
105 105
106 bool m_keyclick_sound : 1; 106 bool m_keyclick_sound : 1;
107 bool m_screentap_sound : 1; 107 bool m_screentap_sound : 1;
108 bool m_alarm_sound : 1; 108 bool m_alarm_sound : 1;
109}; 109};
110 110
111 111
112class Desktop : public QWidget 112class Desktop : public QWidget
113{ 113{
114 Q_OBJECT 114 Q_OBJECT
115public: 115public:
116 Desktop(); 116 Desktop();
117 ~Desktop(); 117 ~Desktop();
118 118
119 static bool screenLocked(); 119 static bool screenLocked();
120 120
121 void show(); 121 void show();
122 void checkMemory(); 122 void checkMemory();
123 123
124public slots: 124public slots:
125 void execAutoStart(); 125 void execAutoStart();
126 void togglePower(); 126 void togglePower();
127 void toggleLight(); 127 void toggleLight();
128 void toggleNumLockState(); 128 void toggleNumLockState();
129 void toggleCapsLockState(); 129 void toggleCapsLockState();
130 void toggleSymbolInput(); 130 void toggleSymbolInput();
131 void terminateServers(); 131 void terminateServers();
132 132
133protected: 133protected:
134 void executeOrModify( const QString& appLnkFile ); 134 void executeOrModify( const QString& appLnkFile );
135 void styleChange( QStyle & ); 135 void styleChange( QStyle & );
136 void timerEvent( QTimerEvent *e ); 136 void timerEvent( QTimerEvent *e );
137 137
138 QWidget *bg; 138 QWidget *bg;
139 Launcher *launcher; 139 Launcher *launcher;
140 TaskBar *tb; 140 TaskBar *tb;
141 141
142private: 142private:
143 void startTransferServer(); 143 void startTransferServer();
144 bool recoverMemory(); 144 bool recoverMemory();
145 145
146 QCopBridge *qcopBridge; 146 QCopBridge *qcopBridge;
147 TransferServer *transferServer; 147 TransferServer *transferServer;
148 PackageSlave *packageSlave; 148 PackageSlave *packageSlave;
149 149
150 QDateTime suspendTime; 150 QDateTime suspendTime;
151}; 151};
152 152
153 153
154#endif // __DESKTOP_H__ 154#endif // __DESKTOP_H__
155 155
diff --git a/core/settings/light-and-power/lightsettingsbase.ui b/core/settings/light-and-power/lightsettingsbase.ui
index 309b95d..b583b5c 100644
--- a/core/settings/light-and-power/lightsettingsbase.ui
+++ b/core/settings/light-and-power/lightsettingsbase.ui
@@ -1,142 +1,142 @@
1<!DOCTYPE UI><UI> 1<!DOCTYPE UI><UI>
2<class>LightSettingsBase</class> 2<class>LightSettingsBase</class>
3<widget> 3<widget>
4 <class>QDialog</class> 4 <class>QDialog</class>
5 <property stdset="1"> 5 <property stdset="1">
6 <name>name</name> 6 <name>name</name>
7 <cstring>LightSettingsBase</cstring> 7 <cstring>LightSettingsBase</cstring>
8 </property> 8 </property>
9 <property stdset="1"> 9 <property stdset="1">
10 <name>geometry</name> 10 <name>geometry</name>
11 <rect> 11 <rect>
12 <x>0</x> 12 <x>0</x>
13 <y>0</y> 13 <y>0</y>
14 <width>371</width> 14 <width>367</width>
15 <height>532</height> 15 <height>532</height>
16 </rect> 16 </rect>
17 </property> 17 </property>
18 <property stdset="1"> 18 <property stdset="1">
19 <name>sizePolicy</name> 19 <name>sizePolicy</name>
20 <sizepolicy> 20 <sizepolicy>
21 <hsizetype>7</hsizetype> 21 <hsizetype>7</hsizetype>
22 <vsizetype>5</vsizetype> 22 <vsizetype>5</vsizetype>
23 </sizepolicy> 23 </sizepolicy>
24 </property> 24 </property>
25 <property stdset="1"> 25 <property stdset="1">
26 <name>caption</name> 26 <name>caption</name>
27 <string>Light and Power Settings</string> 27 <string>Light and Power Settings</string>
28 </property> 28 </property>
29 <property stdset="1"> 29 <property stdset="1">
30 <name>sizeGripEnabled</name> 30 <name>sizeGripEnabled</name>
31 <bool>false</bool> 31 <bool>false</bool>
32 </property> 32 </property>
33 <property> 33 <property>
34 <name>layoutMargin</name> 34 <name>layoutMargin</name>
35 </property> 35 </property>
36 <property> 36 <property>
37 <name>layoutSpacing</name> 37 <name>layoutSpacing</name>
38 </property> 38 </property>
39 <vbox> 39 <vbox>
40 <property stdset="1"> 40 <property stdset="1">
41 <name>margin</name> 41 <name>margin</name>
42 <number>3</number> 42 <number>3</number>
43 </property> 43 </property>
44 <property stdset="1"> 44 <property stdset="1">
45 <name>spacing</name> 45 <name>spacing</name>
46 <number>3</number> 46 <number>3</number>
47 </property> 47 </property>
48 <widget> 48 <widget>
49 <class>QTabWidget</class> 49 <class>QTabWidget</class>
50 <property stdset="1"> 50 <property stdset="1">
51 <name>name</name> 51 <name>name</name>
52 <cstring>tabs</cstring> 52 <cstring>tabs</cstring>
53 </property> 53 </property>
54 <property> 54 <property>
55 <name>layoutMargin</name> 55 <name>layoutMargin</name>
56 </property> 56 </property>
57 <property> 57 <property>
58 <name>layoutSpacing</name> 58 <name>layoutSpacing</name>
59 </property> 59 </property>
60 <widget> 60 <widget>
61 <class>QWidget</class> 61 <class>QWidget</class>
62 <property stdset="1"> 62 <property stdset="1">
63 <name>name</name> 63 <name>name</name>
64 <cstring>tab</cstring> 64 <cstring>tab</cstring>
65 </property> 65 </property>
66 <attribute> 66 <attribute>
67 <name>title</name> 67 <name>title</name>
68 <string>on Battery</string> 68 <string>on Battery</string>
69 </attribute> 69 </attribute>
70 <vbox> 70 <vbox>
71 <property stdset="1"> 71 <property stdset="1">
72 <name>margin</name> 72 <name>margin</name>
73 <number>5</number> 73 <number>5</number>
74 </property> 74 </property>
75 <property stdset="1"> 75 <property stdset="1">
76 <name>spacing</name> 76 <name>spacing</name>
77 <number>3</number> 77 <number>3</number>
78 </property> 78 </property>
79 <widget> 79 <widget>
80 <class>QGroupBox</class> 80 <class>QGroupBox</class>
81 <property stdset="1"> 81 <property stdset="1">
82 <name>name</name> 82 <name>name</name>
83 <cstring>GroupBox3</cstring> 83 <cstring>GroupBox3</cstring>
84 </property> 84 </property>
85 <property stdset="1"> 85 <property stdset="1">
86 <name>enabled</name> 86 <name>enabled</name>
87 <bool>true</bool> 87 <bool>true</bool>
88 </property> 88 </property>
89 <property stdset="1"> 89 <property stdset="1">
90 <name>title</name> 90 <name>title</name>
91 <string>General Settings</string> 91 <string>General Settings</string>
92 </property> 92 </property>
93 <property> 93 <property>
94 <name>layoutMargin</name> 94 <name>layoutMargin</name>
95 </property> 95 </property>
96 <property> 96 <property>
97 <name>layoutSpacing</name> 97 <name>layoutSpacing</name>
98 </property> 98 </property>
99 <grid> 99 <grid>
100 <property stdset="1"> 100 <property stdset="1">
101 <name>margin</name> 101 <name>margin</name>
102 <number>5</number> 102 <number>5</number>
103 </property> 103 </property>
104 <property stdset="1"> 104 <property stdset="1">
105 <name>spacing</name> 105 <name>spacing</name>
106 <number>3</number> 106 <number>3</number>
107 </property> 107 </property>
108 <widget row="1" column="1" > 108 <widget row="1" column="1" >
109 <class>QSpinBox</class> 109 <class>QSpinBox</class>
110 <property stdset="1"> 110 <property stdset="1">
111 <name>name</name> 111 <name>name</name>
112 <cstring>interval_lightoff</cstring> 112 <cstring>interval_lightoff</cstring>
113 </property> 113 </property>
114 <property stdset="1"> 114 <property stdset="1">
115 <name>suffix</name> 115 <name>suffix</name>
116 <string> sec</string> 116 <string> sec</string>
117 </property> 117 </property>
118 <property stdset="1"> 118 <property stdset="1">
119 <name>specialValueText</name> 119 <name>specialValueText</name>
120 <string>never</string> 120 <string>never</string>
121 </property> 121 </property>
122 <property stdset="1"> 122 <property stdset="1">
123 <name>buttonSymbols</name> 123 <name>buttonSymbols</name>
124 <enum>PlusMinus</enum> 124 <enum>PlusMinus</enum>
125 </property> 125 </property>
126 <property stdset="1"> 126 <property stdset="1">
127 <name>maxValue</name> 127 <name>maxValue</name>
128 <number>3600</number> 128 <number>3600</number>
129 </property> 129 </property>
130 <property stdset="1"> 130 <property stdset="1">
131 <name>minValue</name> 131 <name>minValue</name>
132 <number>0</number> 132 <number>0</number>
133 </property> 133 </property>
134 <property stdset="1"> 134 <property stdset="1">
135 <name>lineStep</name> 135 <name>lineStep</name>
136 <number>10</number> 136 <number>10</number>
137 </property> 137 </property>
138 </widget> 138 </widget>
139 <widget row="1" column="0" > 139 <widget row="1" column="0" >
140 <class>QLabel</class> 140 <class>QLabel</class>
141 <property stdset="1"> 141 <property stdset="1">
142 <name>name</name> 142 <name>name</name>
@@ -937,265 +937,281 @@
937 <name>name</name> 937 <name>name</name>
938 <cstring>Spacer5</cstring> 938 <cstring>Spacer5</cstring>
939 </property> 939 </property>
940 <property stdset="1"> 940 <property stdset="1">
941 <name>orientation</name> 941 <name>orientation</name>
942 <enum>Vertical</enum> 942 <enum>Vertical</enum>
943 </property> 943 </property>
944 <property stdset="1"> 944 <property stdset="1">
945 <name>sizeType</name> 945 <name>sizeType</name>
946 <enum>Expanding</enum> 946 <enum>Expanding</enum>
947 </property> 947 </property>
948 <property> 948 <property>
949 <name>sizeHint</name> 949 <name>sizeHint</name>
950 <size> 950 <size>
951 <width>20</width> 951 <width>20</width>
952 <height>20</height> 952 <height>20</height>
953 </size> 953 </size>
954 </property> 954 </property>
955 </spacer> 955 </spacer>
956 </vbox> 956 </vbox>
957 </widget> 957 </widget>
958 <widget> 958 <widget>
959 <class>QWidget</class> 959 <class>QWidget</class>
960 <property stdset="1"> 960 <property stdset="1">
961 <name>name</name> 961 <name>name</name>
962 <cstring>tab</cstring> 962 <cstring>tab</cstring>
963 </property> 963 </property>
964 <attribute> 964 <attribute>
965 <name>title</name> 965 <name>title</name>
966 <string>Warnings</string> 966 <string>Warnings</string>
967 </attribute> 967 </attribute>
968 <vbox> 968 <vbox>
969 <property stdset="1"> 969 <property stdset="1">
970 <name>margin</name> 970 <name>margin</name>
971 <number>5</number> 971 <number>5</number>
972 </property> 972 </property>
973 <property stdset="1"> 973 <property stdset="1">
974 <name>spacing</name> 974 <name>spacing</name>
975 <number>3</number> 975 <number>3</number>
976 </property> 976 </property>
977 <widget> 977 <widget>
978 <class>QGroupBox</class> 978 <class>QGroupBox</class>
979 <property stdset="1"> 979 <property stdset="1">
980 <name>name</name> 980 <name>name</name>
981 <cstring>GroupBox5</cstring> 981 <cstring>GroupBox5</cstring>
982 </property> 982 </property>
983 <property stdset="1"> 983 <property stdset="1">
984 <name>title</name> 984 <name>title</name>
985 <string>Warnings</string> 985 <string>Warnings</string>
986 </property> 986 </property>
987 <property> 987 <property>
988 <name>layoutMargin</name> 988 <name>layoutMargin</name>
989 </property> 989 </property>
990 <property> 990 <property>
991 <name>layoutSpacing</name> 991 <name>layoutSpacing</name>
992 </property> 992 </property>
993 <grid> 993 <grid>
994 <property stdset="1"> 994 <property stdset="1">
995 <name>margin</name> 995 <name>margin</name>
996 <number>5</number> 996 <number>5</number>
997 </property> 997 </property>
998 <property stdset="1"> 998 <property stdset="1">
999 <name>spacing</name> 999 <name>spacing</name>
1000 <number>3</number> 1000 <number>3</number>
1001 </property> 1001 </property>
1002 <widget row="0" column="0" > 1002 <widget row="0" column="0" >
1003 <class>QLabel</class> 1003 <class>QLabel</class>
1004 <property stdset="1"> 1004 <property stdset="1">
1005 <name>name</name> 1005 <name>name</name>
1006 <cstring>TextLabel1</cstring> 1006 <cstring>TextLabel1</cstring>
1007 </property> 1007 </property>
1008 <property stdset="1"> 1008 <property stdset="1">
1009 <name>sizePolicy</name> 1009 <name>sizePolicy</name>
1010 <sizepolicy> 1010 <sizepolicy>
1011 <hsizetype>3</hsizetype> 1011 <hsizetype>3</hsizetype>
1012 <vsizetype>5</vsizetype> 1012 <vsizetype>5</vsizetype>
1013 </sizepolicy> 1013 </sizepolicy>
1014 </property> 1014 </property>
1015 <property stdset="1"> 1015 <property stdset="1">
1016 <name>text</name> 1016 <name>text</name>
1017 <string>Low power warning interval</string> 1017 <string>Low power warning interval</string>
1018 </property> 1018 </property>
1019 <property stdset="1"> 1019 <property stdset="1">
1020 <name>alignment</name> 1020 <name>alignment</name>
1021 <set>WordBreak|AlignVCenter|AlignLeft</set> 1021 <set>WordBreak|AlignVCenter|AlignLeft</set>
1022 </property> 1022 </property>
1023 <property> 1023 <property>
1024 <name>wordwrap</name> 1024 <name>wordwrap</name>
1025 </property> 1025 </property>
1026 </widget> 1026 </widget>
1027 <widget row="1" column="1" > 1027 <widget row="1" column="1" >
1028 <class>QSpinBox</class> 1028 <class>QSpinBox</class>
1029 <property stdset="1"> 1029 <property stdset="1">
1030 <name>name</name> 1030 <name>name</name>
1031 <cstring>lowSpinBox</cstring> 1031 <cstring>lowSpinBox</cstring>
1032 </property> 1032 </property>
1033 <property stdset="1"> 1033 <property stdset="1">
1034 <name>suffix</name> 1034 <name>suffix</name>
1035 <string> %</string> 1035 <string> %</string>
1036 </property> 1036 </property>
1037 <property stdset="1"> 1037 <property stdset="1">
1038 <name>buttonSymbols</name> 1038 <name>buttonSymbols</name>
1039 <enum>PlusMinus</enum> 1039 <enum>PlusMinus</enum>
1040 </property> 1040 </property>
1041 <property stdset="1"> 1041 <property stdset="1">
1042 <name>maxValue</name> 1042 <name>maxValue</name>
1043 <number>80</number> 1043 <number>80</number>
1044 </property> 1044 </property>
1045 <property stdset="1"> 1045 <property stdset="1">
1046 <name>minValue</name> 1046 <name>minValue</name>
1047 <number>2</number> 1047 <number>2</number>
1048 </property> 1048 </property>
1049 <property> 1049 <property>
1050 <name>whatsThis</name> 1050 <name>whatsThis</name>
1051 <string>At what battery level should the low power warning pop up</string> 1051 <string>At what battery level should the low power warning pop up</string>
1052 </property> 1052 </property>
1053 </widget> 1053 </widget>
1054 <widget row="0" column="1" > 1054 <widget row="0" column="1" >
1055 <class>QSpinBox</class> 1055 <class>QSpinBox</class>
1056 <property stdset="1"> 1056 <property stdset="1">
1057 <name>name</name> 1057 <name>name</name>
1058 <cstring>warnintervalBox</cstring> 1058 <cstring>warnintervalBox</cstring>
1059 </property> 1059 </property>
1060 <property stdset="1"> 1060 <property stdset="1">
1061 <name>suffix</name> 1061 <name>suffix</name>
1062 <string> sec</string> 1062 <string> sec</string>
1063 </property> 1063 </property>
1064 <property stdset="1"> 1064 <property stdset="1">
1065 <name>specialValueText</name>
1066 <string>never</string>
1067 </property>
1068 <property stdset="1">
1069 <name>wrapping</name>
1070 <bool>true</bool>
1071 </property>
1072 <property stdset="1">
1065 <name>buttonSymbols</name> 1073 <name>buttonSymbols</name>
1066 <enum>PlusMinus</enum> 1074 <enum>PlusMinus</enum>
1067 </property> 1075 </property>
1068 <property stdset="1"> 1076 <property stdset="1">
1069 <name>maxValue</name> 1077 <name>maxValue</name>
1070 <number>60</number> 1078 <number>300</number>
1071 </property> 1079 </property>
1072 <property stdset="1"> 1080 <property stdset="1">
1073 <name>minValue</name> 1081 <name>minValue</name>
1082 <number>0</number>
1083 </property>
1084 <property stdset="1">
1085 <name>lineStep</name>
1086 <number>5</number>
1087 </property>
1088 <property stdset="1">
1089 <name>value</name>
1074 <number>5</number> 1090 <number>5</number>
1075 </property> 1091 </property>
1076 <property> 1092 <property>
1077 <name>whatsThis</name> 1093 <name>whatsThis</name>
1078 <string>how often should be checked for low power. This determines the rate popups occure in low power situations</string> 1094 <string>how often should be checked for low power. This determines the rate popups occure in low power situations</string>
1079 </property> 1095 </property>
1080 </widget> 1096 </widget>
1081 <widget row="2" column="1" > 1097 <widget row="2" column="1" >
1082 <class>QSpinBox</class> 1098 <class>QSpinBox</class>
1083 <property stdset="1"> 1099 <property stdset="1">
1084 <name>name</name> 1100 <name>name</name>
1085 <cstring>criticalSpinBox</cstring> 1101 <cstring>criticalSpinBox</cstring>
1086 </property> 1102 </property>
1087 <property stdset="1"> 1103 <property stdset="1">
1088 <name>prefix</name> 1104 <name>prefix</name>
1089 <string></string> 1105 <string></string>
1090 </property> 1106 </property>
1091 <property stdset="1"> 1107 <property stdset="1">
1092 <name>suffix</name> 1108 <name>suffix</name>
1093 <string> %</string> 1109 <string> %</string>
1094 </property> 1110 </property>
1095 <property stdset="1"> 1111 <property stdset="1">
1096 <name>buttonSymbols</name> 1112 <name>buttonSymbols</name>
1097 <enum>PlusMinus</enum> 1113 <enum>PlusMinus</enum>
1098 </property> 1114 </property>
1099 <property stdset="1"> 1115 <property stdset="1">
1100 <name>maxValue</name> 1116 <name>maxValue</name>
1101 <number>80</number> 1117 <number>80</number>
1102 </property> 1118 </property>
1103 <property stdset="1"> 1119 <property stdset="1">
1104 <name>minValue</name> 1120 <name>minValue</name>
1105 <number>2</number> 1121 <number>2</number>
1106 </property> 1122 </property>
1107 <property> 1123 <property>
1108 <name>whatsThis</name> 1124 <name>whatsThis</name>
1109 <string>At what battery level should the critical power warning pop up</string> 1125 <string>At what battery level should the critical power warning pop up</string>
1110 </property> 1126 </property>
1111 </widget> 1127 </widget>
1112 <widget row="1" column="0" > 1128 <widget row="1" column="0" >
1113 <class>QLabel</class> 1129 <class>QLabel</class>
1114 <property stdset="1"> 1130 <property stdset="1">
1115 <name>name</name> 1131 <name>name</name>
1116 <cstring>TextLabel2</cstring> 1132 <cstring>TextLabel2</cstring>
1117 </property> 1133 </property>
1118 <property stdset="1"> 1134 <property stdset="1">
1119 <name>sizePolicy</name> 1135 <name>sizePolicy</name>
1120 <sizepolicy> 1136 <sizepolicy>
1121 <hsizetype>1</hsizetype> 1137 <hsizetype>1</hsizetype>
1122 <vsizetype>5</vsizetype> 1138 <vsizetype>5</vsizetype>
1123 </sizepolicy> 1139 </sizepolicy>
1124 </property> 1140 </property>
1125 <property stdset="1"> 1141 <property stdset="1">
1126 <name>text</name> 1142 <name>text</name>
1127 <string>very low battery warning at</string> 1143 <string>very low battery warning at</string>
1128 </property> 1144 </property>
1129 </widget> 1145 </widget>
1130 <widget row="2" column="0" > 1146 <widget row="2" column="0" >
1131 <class>QLabel</class> 1147 <class>QLabel</class>
1132 <property stdset="1"> 1148 <property stdset="1">
1133 <name>name</name> 1149 <name>name</name>
1134 <cstring>TextLabel3</cstring> 1150 <cstring>TextLabel3</cstring>
1135 </property> 1151 </property>
1136 <property stdset="1"> 1152 <property stdset="1">
1137 <name>sizePolicy</name> 1153 <name>sizePolicy</name>
1138 <sizepolicy> 1154 <sizepolicy>
1139 <hsizetype>1</hsizetype> 1155 <hsizetype>1</hsizetype>
1140 <vsizetype>5</vsizetype> 1156 <vsizetype>5</vsizetype>
1141 </sizepolicy> 1157 </sizepolicy>
1142 </property> 1158 </property>
1143 <property stdset="1"> 1159 <property stdset="1">
1144 <name>text</name> 1160 <name>text</name>
1145 <string>critical power warning at</string> 1161 <string>critical power warning at</string>
1146 </property> 1162 </property>
1147 </widget> 1163 </widget>
1148 </grid> 1164 </grid>
1149 </widget> 1165 </widget>
1150 <spacer> 1166 <spacer>
1151 <property> 1167 <property>
1152 <name>name</name> 1168 <name>name</name>
1153 <cstring>Spacer1</cstring> 1169 <cstring>Spacer1</cstring>
1154 </property> 1170 </property>
1155 <property stdset="1"> 1171 <property stdset="1">
1156 <name>orientation</name> 1172 <name>orientation</name>
1157 <enum>Vertical</enum> 1173 <enum>Vertical</enum>
1158 </property> 1174 </property>
1159 <property stdset="1"> 1175 <property stdset="1">
1160 <name>sizeType</name> 1176 <name>sizeType</name>
1161 <enum>Expanding</enum> 1177 <enum>Expanding</enum>
1162 </property> 1178 </property>
1163 <property> 1179 <property>
1164 <name>sizeHint</name> 1180 <name>sizeHint</name>
1165 <size> 1181 <size>
1166 <width>20</width> 1182 <width>20</width>
1167 <height>20</height> 1183 <height>20</height>
1168 </size> 1184 </size>
1169 </property> 1185 </property>
1170 </spacer> 1186 </spacer>
1171 </vbox> 1187 </vbox>
1172 </widget> 1188 </widget>
1173 </widget> 1189 </widget>
1174 </vbox> 1190 </vbox>
1175</widget> 1191</widget>
1176<images> 1192<images>
1177 <image> 1193 <image>
1178 <name>image0</name> 1194 <name>image0</name>
1179 <data format="XPM.GZ" length="424">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523234530022130543251d2e253d856405bffcbc54105b19c856360003103711c4354b324b364b06719340dcb434b36488ac1e1a2020a6acac8c2ea60cc54862606ea232b218541b5810452c3111432c510f550c22886a1e482c115d0c2c88e6168818babaa4a42462c48082cae8e68102011a06b5d65c004336518f</data> 1195 <data format="XPM.GZ" length="424">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523234530022130543251d2e253d856405bffcbc54105b19c856360003103711c4354b324b364b06719340dcb434b36488ac1e1a2020a6acac8c2ea60cc54862606ea232b218541b5810452c3111432c510f550c22886a1e482c115d0c2c88e6168818babaa4a42462c48082cae8e68102011a06b5d65c004336518f</data>
1180 </image> 1196 </image>
1181 <image> 1197 <image>
1182 <name>image1</name> 1198 <name>image1</name>
1183 <data format="XPM.GZ" length="439">789c6d8ec10ac2300c86ef7b8ad0ff36a4730777111f41f1288887b4b3e8610a3a0f22bebb6dd3d54d0ca5cdffe54f9aaaa4dd764d6555dc7beecf96ec896f54b68fae7bee0fab57a1ea86fc5950ad6685d2646973bd1c43ce3ec73c46903648e79a5624443a27d20cd2b9382704747e124382f11a7c5e30b364b957b331866331b3800c38f70282121c7c628367c098c1e0eb03121ccd4b46fcb0f80b26bb4833987f76b6d6f274de5fe6a1a031d30969f55e161fe4715f7b</data> 1199 <data format="XPM.GZ" length="439">789c6d8ec10ac2300c86ef7b8ad0ff36a4730777111f41f1288887b4b3e8610a3a0f22bebb6dd3d54d0ca5cdffe54f9aaaa4dd764d6555dc7beecf96ec896f54b68fae7bee0fab57a1ea86fc5950ad6685d2646973bd1c43ce3ec73c46903648e79a5624443a27d20cd2b9382704747e124382f11a7c5e30b364b957b331866331b3800c38f70282121c7c628367c098c1e0eb03121ccd4b46fcb0f80b26bb4833987f76b6d6f274de5fe6a1a031d30969f55e161fe4715f7b</data>
1184 </image> 1200 </image>
1185 <image> 1201 <image>
1186 <name>image2</name> 1202 <name>image2</name>
1187 <data format="XPM.GZ" length="424">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523234530022130543251d2e253d856405bffcbc54105b19c856360003103711c4354b344b314b04719340dcb434b31488ac1e1a2020a6acac8c2ea60cc54862606ea232b218541b5810452c3111432c510f550c22886a1e482c115d0c2c88e6168818babaa4a42462c48082cae8e68102011a06b5d65c0041d3518e</data> 1203 <data format="XPM.GZ" length="424">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523234530022130543251d2e253d856405bffcbc54105b19c856360003103711c4354b344b314b04719340dcb434b31488ac1e1a2020a6acac8c2ea60cc54862606ea232b218541b5810452c3111432c510f550c22886a1e482c115d0c2c88e6168818babaa4a42462c48082cae8e68102011a06b5d65c0041d3518e</data>
1188 </image> 1204 </image>
1189</images> 1205</images>
1190<connections> 1206<connections>
1191 <connection> 1207 <connection>
1192 <sender>CalibrateLightSensor</sender> 1208 <sender>CalibrateLightSensor</sender>
1193 <signal>clicked()</signal> 1209 <signal>clicked()</signal>
1194 <receiver>LightSettingsBase</receiver> 1210 <receiver>LightSettingsBase</receiver>
1195 <slot>calibrateSensor()</slot> 1211 <slot>calibrateSensor()</slot>
1196 </connection> 1212 </connection>
1197 <connection> 1213 <connection>
1198 <sender>CalibrateLightSensorAC</sender> 1214 <sender>CalibrateLightSensorAC</sender>
1199 <signal>clicked()</signal> 1215 <signal>clicked()</signal>
1200 <receiver>LightSettingsBase</receiver> 1216 <receiver>LightSettingsBase</receiver>
1201 <slot>calibrateSensorAC()</slot> 1217 <slot>calibrateSensorAC()</slot>