summaryrefslogtreecommitdiff
path: root/core/launcher/desktop.cpp
Unidiff
Diffstat (limited to 'core/launcher/desktop.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/desktop.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp
index 3546e28..9863187 100644
--- a/core/launcher/desktop.cpp
+++ b/core/launcher/desktop.cpp
@@ -369,163 +369,163 @@ DesktopApplication::DesktopApplication( int& argc, char **argv, Type appType )
369 369
370DesktopApplication::~DesktopApplication() 370DesktopApplication::~DesktopApplication()
371{ 371{
372 delete ps; 372 delete ps;
373 delete pa; 373 delete pa;
374} 374}
375 375
376void DesktopApplication::desktopMessage( const QCString &msg, const QByteArray &data ) 376void DesktopApplication::desktopMessage( const QCString &msg, const QByteArray &data )
377{ 377{
378 QDataStream stream( data, IO_ReadOnly ); 378 QDataStream stream( data, IO_ReadOnly );
379 if ( msg == "keyRegister(int key, QString channel, QString message)" ) { 379 if ( msg == "keyRegister(int key, QString channel, QString message)" ) {
380 int k; 380 int k;
381 QString c, m; 381 QString c, m;
382 stream >> k; 382 stream >> k;
383 stream >> c; 383 stream >> c;
384 stream >> m; 384 stream >> m;
385 385
386 qWarning( "KeyRegisterReceived: %i, %s, %s", k, ( const char* ) c, ( const char * ) m ); 386 qWarning( "KeyRegisterReceived: %i, %s, %s", k, ( const char* ) c, ( const char * ) m );
387 keyRegisterList.append( QCopKeyRegister( k, c, m ) ); 387 keyRegisterList.append( QCopKeyRegister( k, c, m ) );
388 } 388 }
389} 389}
390 390
391 391
392void DesktopApplication::systemMessage( const QCString & msg, const QByteArray & data ) 392void DesktopApplication::systemMessage( const QCString & msg, const QByteArray & data )
393{ 393{
394 QDataStream stream ( data, IO_ReadOnly ); 394 QDataStream stream ( data, IO_ReadOnly );
395 395
396 if ( msg == "setScreenSaverInterval(int)" ) { 396 if ( msg == "setScreenSaverInterval(int)" ) {
397 int time; 397 int time;
398 stream >> time; 398 stream >> time;
399 m_screensaver-> setInterval( time ); 399 m_screensaver-> setInterval( time );
400 } 400 }
401 else if ( msg == "setScreenSaverIntervals(int,int,int)" ) { 401 else if ( msg == "setScreenSaverIntervals(int,int,int)" ) {
402 int t1, t2, t3; 402 int t1, t2, t3;
403 stream >> t1 >> t2 >> t3; 403 stream >> t1 >> t2 >> t3;
404 m_screensaver-> setIntervals( t1, t2, t3 ); 404 m_screensaver-> setIntervals( t1, t2, t3 );
405 } 405 }
406 else if ( msg == "setBacklight(int)" ) { 406 else if ( msg == "setBacklight(int)" ) {
407 int bright; 407 int bright;
408 stream >> bright; 408 stream >> bright;
409 m_screensaver-> setBacklight( bright ); 409 m_screensaver-> setBacklight( bright );
410 } 410 }
411 else if ( msg == "setScreenSaverMode(int)" ) { 411 else if ( msg == "setScreenSaverMode(int)" ) {
412 int mode; 412 int mode;
413 stream >> mode; 413 stream >> mode;
414 m_screensaver-> setMode ( mode ); 414 m_screensaver-> setMode ( mode );
415 } 415 }
416 else if ( msg == "setDisplayState(int)" ) { 416 else if ( msg == "setDisplayState(int)" ) {
417 int state; 417 int state;
418 stream >> state; 418 stream >> state;
419 m_screensaver-> setDisplayState ( state != 0 ); 419 m_screensaver-> setDisplayState ( state != 0 );
420 } 420 }
421 else if ( msg == "suspend()" ) { 421 else if ( msg == "suspend()" ) {
422 emit power(); 422 emit power();
423 } 423 }
424} 424}
425 425
426enum MemState { Unknown, VeryLow, Low, Normal } memstate = Unknown; 426enum MemState { Unknown, VeryLow, Low, Normal } memstate = Unknown;
427 427
428#ifdef Q_WS_QWS 428#ifdef Q_WS_QWS
429bool DesktopApplication::qwsEventFilter( QWSEvent *e ) 429bool DesktopApplication::qwsEventFilter( QWSEvent *e )
430{ 430{
431 qpedesktop->checkMemory(); 431 qpedesktop->checkMemory();
432 432
433 if ( e->type == QWSEvent::Key ) { 433 if ( e->type == QWSEvent::Key ) {
434 QWSKeyEvent * ke = ( QWSKeyEvent * ) e; 434 QWSKeyEvent * ke = ( QWSKeyEvent * ) e;
435 if ( !loggedin && ke->simpleData.keycode != Key_F34 ) 435 if ( !loggedin && ke->simpleData.keycode != Key_F34 )
436 return TRUE; 436 return TRUE;
437 bool press = ke->simpleData.is_press; 437 bool press = ke->simpleData.is_press;
438 bool autoRepeat = ke->simpleData.is_auto_repeat; 438 bool autoRepeat = ke->simpleData.is_auto_repeat;
439 439
440 /* 440 /*
441 app that registers key/message to be sent back to the app, when it doesn't have focus, 441 app that registers key/message to be sent back to the app, when it doesn't have focus,
442 when user presses key, unless keyboard has been requested from app. 442 when user presses key, unless keyboard has been requested from app.
443 will not send multiple repeats if user holds key 443 will not send multiple repeats if user holds key
444 i.e. one shot 444 i.e. one shot
445 */ 445 */
446 if ( !keyRegisterList.isEmpty() && ke->simpleData.keycode !=0 && press) { 446 if ( !keyRegisterList.isEmpty() && ke->simpleData.keycode !=0 && press) {
447// qDebug("<<<<<<<<<<<<<keycode %d", ke->simpleData.keycode); 447// qDebug("<<<<<<<<<<<<<keycode %d", ke->simpleData.keycode);
448 KeyRegisterList::Iterator it; 448 KeyRegisterList::Iterator it;
449 for ( it = keyRegisterList.begin(); it != keyRegisterList.end(); ++it ) { 449 for ( it = keyRegisterList.begin(); it != keyRegisterList.end(); ++it ) {
450 if ( ( *it ).getKeyCode() == ke->simpleData.keycode && !autoRepeat && !keyboardGrabbed() ) { 450 if ( ( *it ).getKeyCode() == ke->simpleData.keycode && !autoRepeat && !keyboardGrabbed() ) {
451 if ( press ) 451 if ( press )
452 qDebug( "press" ); 452 qDebug( "press" );
453 else 453 else
454 qDebug( "release" ); 454 qDebug( "release" );
455 QCopEnvelope( ( *it ).getChannel().utf8(), ( *it ).getMessage().utf8() ); 455 QCopEnvelope( ( *it ).getChannel().utf8(), ( *it ).getMessage().utf8() );
456 } 456 }
457 } 457 }
458 } 458 }
459 459
460 if ( !keyboardGrabbed() ) { 460 if ( !keyboardGrabbed() ) {
461 if ( ke->simpleData.keycode == Key_F9 ) { 461 if ( ke->simpleData.keycode == Key_F9 ) {
462 if ( press ) 462 if ( press )
463 emit datebook(); 463 emit datebook();
464 return TRUE; 464 return TRUE;
465 } 465 }
466 if ( ke->simpleData.keycode == Key_F10 ) { 466 if ( ke->simpleData.keycode == Key_F10 ) {
467 if ( !press && cardSendTimer ) { 467 if ( !press && cardSendTimer ) {
468 emit contacts(); 468 emit contacts();
469 delete cardSendTimer; 469 delete cardSendTimer;
470 } 470 }
471 else if ( press ) { 471 else if ( press ) {
472 cardSendTimer = new QTimer(); 472 cardSendTimer = new QTimer();
473 cardSendTimer->start( 2000, TRUE ); 473 cardSendTimer->start( 2000, TRUE );
474 connect( cardSendTimer, SIGNAL( timeout() ), this, SLOT( sendCard() ) ); 474 connect( cardSendTimer, SIGNAL( timeout() ), this, SLOT( sendCard() ) );
475 } 475 }
476 return TRUE; 476 return TRUE;
477 } 477 }
478 /* menu key now opens application menu/toolbar 478// menu key now opens application menu/toolbar
479 if ( ke->simpleData.keycode == Key_F11 ) { 479 if ( ke->simpleData.keycode == Key_F11 ) {
480 if ( press ) emit menu(); 480 if ( press ) emit menu();
481 return TRUE; 481 return TRUE;
482 } 482 }
483 */ 483
484 if ( ke->simpleData.keycode == Key_F12 ) { 484 if ( ke->simpleData.keycode == Key_F12 ) {
485 while ( activePopupWidget() ) 485 while ( activePopupWidget() )
486 activePopupWidget() ->close(); 486 activePopupWidget() ->close();
487 if ( press ) 487 if ( press )
488 emit launch(); 488 emit launch();
489 return TRUE; 489 return TRUE;
490 } 490 }
491 if ( ke->simpleData.keycode == Key_F13 ) { 491 if ( ke->simpleData.keycode == Key_F13 ) {
492 if ( press ) 492 if ( press )
493 emit email(); 493 emit email();
494 return TRUE; 494 return TRUE;
495 } 495 }
496 } 496 }
497 497
498 if ( ke->simpleData.keycode == Key_F34 ) { 498 if ( ke->simpleData.keycode == Key_F34 ) {
499 if ( press ) 499 if ( press )
500 emit power(); 500 emit power();
501 return TRUE; 501 return TRUE;
502 } 502 }
503 // This was used for the iPAQ PowerButton 503 // This was used for the iPAQ PowerButton
504 // See main.cpp for new KeyboardFilter 504 // See main.cpp for new KeyboardFilter
505 // 505 //
506 // if ( ke->simpleData.keycode == Key_SysReq ) { 506 // if ( ke->simpleData.keycode == Key_SysReq ) {
507 // if ( press ) emit power(); 507 // if ( press ) emit power();
508 // return TRUE; 508 // return TRUE;
509 // } 509 // }
510 if ( ke->simpleData.keycode == Key_F35 ) { 510 if ( ke->simpleData.keycode == Key_F35 ) {
511 if ( press ) 511 if ( press )
512 emit backlight(); 512 emit backlight();
513 return TRUE; 513 return TRUE;
514 } 514 }
515 if ( ke->simpleData.keycode == Key_F32 ) { 515 if ( ke->simpleData.keycode == Key_F32 ) {
516 if ( press ) 516 if ( press )
517 QCopEnvelope e( "QPE/Desktop", "startSync()" ); 517 QCopEnvelope e( "QPE/Desktop", "startSync()" );
518 return TRUE; 518 return TRUE;
519 } 519 }
520 if ( ke->simpleData.keycode == Key_F31 && !ke->simpleData.modifiers ) { 520 if ( ke->simpleData.keycode == Key_F31 && !ke->simpleData.modifiers ) {
521 if ( press ) 521 if ( press )
522 emit symbol(); 522 emit symbol();
523 return TRUE; 523 return TRUE;
524 } 524 }
525 if ( ke->simpleData.keycode == Key_NumLock ) { 525 if ( ke->simpleData.keycode == Key_NumLock ) {
526 if ( press ) 526 if ( press )
527 emit numLockStateToggle(); 527 emit numLockStateToggle();
528 } 528 }
529 if ( ke->simpleData.keycode == Key_CapsLock ) { 529 if ( ke->simpleData.keycode == Key_CapsLock ) {
530 if ( press ) 530 if ( press )
531 emit capsLockStateToggle(); 531 emit capsLockStateToggle();