summaryrefslogtreecommitdiff
path: root/core/launcher
Unidiff
Diffstat (limited to 'core/launcher') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/desktop.cpp37
-rw-r--r--core/launcher/desktop.h23
2 files changed, 36 insertions, 24 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp
index 4926b97..33bea36 100644
--- a/core/launcher/desktop.cpp
+++ b/core/launcher/desktop.cpp
@@ -357,191 +357,191 @@ public:
357 void setDisplayState ( bool on ) 357 void setDisplayState ( bool on )
358 { 358 {
359 if ( m_lcd_status != on ) { 359 if ( m_lcd_status != on ) {
360 ODevice::inst ( ) -> setDisplayStatus ( on ); 360 ODevice::inst ( ) -> setDisplayStatus ( on );
361 m_lcd_status = on; 361 m_lcd_status = on;
362 } 362 }
363 } 363 }
364 364
365private: 365private:
366 int m_disable_suspend; 366 int m_disable_suspend;
367 bool m_enable_dim; 367 bool m_enable_dim;
368 bool m_enable_lightoff; 368 bool m_enable_lightoff;
369 bool m_enable_onlylcdoff; 369 bool m_enable_onlylcdoff;
370 370
371 int m_disable_suspend_ac; 371 int m_disable_suspend_ac;
372 bool m_enable_dim_ac; 372 bool m_enable_dim_ac;
373 bool m_enable_lightoff_ac; 373 bool m_enable_lightoff_ac;
374 bool m_enable_onlylcdoff_ac; 374 bool m_enable_onlylcdoff_ac;
375 375
376 bool m_lcd_status; 376 bool m_lcd_status;
377 377
378 int m_backlight_normal; 378 int m_backlight_normal;
379 int m_backlight_current; 379 int m_backlight_current;
380 bool m_backlight_forcedoff; 380 bool m_backlight_forcedoff;
381}; 381};
382 382
383void DesktopApplication::switchLCD ( bool on ) 383void DesktopApplication::switchLCD ( bool on )
384{ 384{
385 if ( qApp ) { 385 if ( qApp ) {
386 DesktopApplication *dapp = (DesktopApplication *) qApp; 386 DesktopApplication *dapp = (DesktopApplication *) qApp;
387 387
388 if ( dapp-> m_screensaver ) { 388 if ( dapp-> m_screensaver ) {
389 if ( on ) { 389 if ( on ) {
390 dapp-> m_screensaver-> setDisplayState ( true ); 390 dapp-> m_screensaver-> setDisplayState ( true );
391 dapp-> m_screensaver-> setBacklight ( -3 ); 391 dapp-> m_screensaver-> setBacklight ( -3 );
392 } 392 }
393 else { 393 else {
394 dapp-> m_screensaver-> setDisplayState ( false ); 394 dapp-> m_screensaver-> setDisplayState ( false );
395 } 395 }
396 } 396 }
397 } 397 }
398} 398}
399 399
400 400
401DesktopApplication::DesktopApplication( int& argc, char **argv, Type appType ) 401DesktopApplication::DesktopApplication( int& argc, char **argv, Type appType )
402 : QPEApplication( argc, argv, appType ) 402 : QPEApplication( argc, argv, appType )
403{ 403{
404 404
405 //FIXME, need also a method for setting different timer ( changed runtime )
406 m_timer = new QTimer( this ); 405 m_timer = new QTimer( this );
407 connect( m_timer, SIGNAL( timeout() ), this, SLOT( psTimeout() ) ); 406 connect( m_timer, SIGNAL( timeout() ), this, SLOT( apmTimeout() ) );
408 Config cfg( "qpe" ); 407 Config cfg( "apm" );
409 cfg.setGroup( "APM" ); 408 cfg.setGroup( "Warnings" );
410 m_timer->start( cfg.readNumEntry( "check_interval", 10000 ) ); 409 m_timer->start( 5000 );
411 m_powerVeryLow = cfg.readNumEntry( "power_verylow", 10 ); 410 //cfg.readNumEntry( "checkinterval", 10000 )
412 m_powerCritical = cfg.readNumEntry( "power_critical", 5 ); 411 m_powerVeryLow = cfg.readNumEntry( "powerverylow", 10 );
412 m_powerCritical = cfg.readNumEntry( "powercritical", 5 );
413 ps = new PowerStatus; 413 ps = new PowerStatus;
414 pa = new DesktopPowerAlerter( 0 ); 414 pa = new DesktopPowerAlerter( 0 );
415 415
416 channel = new QCopChannel( "QPE/Desktop", this ); 416 channel = new QCopChannel( "QPE/Desktop", this );
417 connect( channel, SIGNAL( received( const QCString&, const QByteArray& ) ), 417 connect( channel, SIGNAL( received( const QCString&, const QByteArray& ) ),
418 this, SLOT( desktopMessage( const QCString&, const QByteArray& ) ) ); 418 this, SLOT( desktopMessage( const QCString&, const QByteArray& ) ) );
419 419
420 channel = new QCopChannel( "QPE/System", this ); 420 channel = new QCopChannel( "QPE/System", this );
421 connect( channel, SIGNAL( received( const QCString&, const QByteArray& ) ), 421 connect( channel, SIGNAL( received( const QCString&, const QByteArray& ) ),
422 this, SLOT( systemMessage( const QCString&, const QByteArray& ) ) ); 422 this, SLOT( systemMessage( const QCString&, const QByteArray& ) ) );
423 423
424 m_screensaver = new QPEScreenSaver; 424 m_screensaver = new QPEScreenSaver;
425 425
426 m_screensaver-> setInterval ( -1 ); 426 m_screensaver-> setInterval ( -1 );
427 QWSServer::setScreenSaver( m_screensaver ); 427 QWSServer::setScreenSaver( m_screensaver );
428} 428}
429 429
430 430
431DesktopApplication::~DesktopApplication() 431DesktopApplication::~DesktopApplication()
432{ 432{
433 delete ps; 433 delete ps;
434 delete pa; 434 delete pa;
435} 435}
436 436
437void DesktopApplication::desktopMessage( const QCString &msg, const QByteArray &data ) 437void DesktopApplication::desktopMessage( const QCString &msg, const QByteArray &data )
438{ 438{
439 QDataStream stream( data, IO_ReadOnly ); 439 QDataStream stream( data, IO_ReadOnly );
440 if ( msg == "keyRegister(int key, QString channel, QString message)" ) { 440 if ( msg == "keyRegister(int key, QString channel, QString message)" ) {
441 int k; 441 int k;
442 QString c, m; 442 QString c, m;
443 stream >> k; 443 stream >> k;
444 stream >> c; 444 stream >> c;
445 stream >> m; 445 stream >> m;
446 446
447 qWarning( "KeyRegisterReceived: %i, %s, %s", k, ( const char* ) c, ( const char * ) m ); 447 qWarning( "KeyRegisterReceived: %i, %s, %s", k, ( const char* ) c, ( const char * ) m );
448 keyRegisterList.append( QCopKeyRegister( k, c, m ) ); 448 keyRegisterList.append( QCopKeyRegister( k, c, m ) );
449 } 449 }
450} 450}
451 451
452 452
453void DesktopApplication::systemMessage( const QCString & msg, const QByteArray & data ) 453void DesktopApplication::systemMessage( const QCString & msg, const QByteArray & data )
454{ 454{
455 QDataStream stream ( data, IO_ReadOnly ); 455 QDataStream stream ( data, IO_ReadOnly );
456 456
457 if ( msg == "setScreenSaverInterval(int)" ) { 457 if ( msg == "setScreenSaverInterval(int)" ) {
458 int time; 458 int time;
459 stream >> time; 459 stream >> time;
460 m_screensaver-> setInterval( time ); 460 m_screensaver-> setInterval( time );
461 } 461 }
462 else if ( msg == "setScreenSaverIntervals(int,int,int)" ) { 462 else if ( msg == "setScreenSaverIntervals(int,int,int)" ) {
463 int t1, t2, t3; 463 int t1, t2, t3;
464 stream >> t1 >> t2 >> t3; 464 stream >> t1 >> t2 >> t3;
465 m_screensaver-> setIntervals( t1, t2, t3 ); 465 m_screensaver-> setIntervals( t1, t2, t3 );
466 } 466 }
467 else if ( msg == "setScreenSaverIntervalsAC(int,int,int)" ) { 467 else if ( msg == "setScreenSaverIntervalsAC(int,int,int)" ) {
468 int t1, t2, t3; 468 int t1, t2, t3;
469 stream >> t1 >> t2 >> t3; 469 stream >> t1 >> t2 >> t3;
470 m_screensaver-> setIntervalsAC( t1, t2, t3 ); 470 m_screensaver-> setIntervalsAC( t1, t2, t3 );
471 } 471 }
472 else if ( msg == "setBacklight(int)" ) { 472 else if ( msg == "setBacklight(int)" ) {
473 int bright; 473 int bright;
474 stream >> bright; 474 stream >> bright;
475 m_screensaver-> setBacklight( bright ); 475 m_screensaver-> setBacklight( bright );
476 } 476 }
477 else if ( msg == "setScreenSaverMode(int)" ) { 477 else if ( msg == "setScreenSaverMode(int)" ) {
478 int mode; 478 int mode;
479 stream >> mode; 479 stream >> mode;
480 m_screensaver-> setMode ( mode ); 480 m_screensaver-> setMode ( mode );
481 } 481 }
482 else if ( msg == "reloadPowerWarnSettings()" ) { 482 else if ( msg == "reloadPowerWarnSettings()" ) {
483 reloadPowerWarnSettings(); 483 reloadPowerWarnSettings();
484 } 484 }
485 else if ( msg == "setDisplayState(int)" ) { 485 else if ( msg == "setDisplayState(int)" ) {
486 int state; 486 int state;
487 stream >> state; 487 stream >> state;
488 m_screensaver-> setDisplayState ( state != 0 ); 488 m_screensaver-> setDisplayState ( state != 0 );
489 } 489 }
490 else if ( msg == "suspend()" ) { 490 else if ( msg == "suspend()" ) {
491 emit power(); 491 emit power();
492 } 492 }
493} 493}
494 494
495void DesktopApplication::reloadPowerWarnSettings() { 495void DesktopApplication::reloadPowerWarnSettings() {
496 Config cfg( "apm" ); 496 Config cfg( "apm" );
497 cfg.setGroup( "Warnings" ); 497 cfg.setGroup( "Warnings" );
498 498
499 m_timer->changeInterval( cfg.readNumEntry( "checkinterval", 10000 ) ); 499 // m_timer->changeInterval( cfg.readNumEntry( "checkinterval", 10000 ) );
500 m_powerVeryLow = cfg.readNumEntry( "powerverylow", 10 ); 500 m_powerVeryLow = cfg.readNumEntry( "powerverylow", 10 );
501 m_powerCritical = cfg.readNumEntry( "powervcritical", 5 ); 501 m_powerCritical = cfg.readNumEntry( "powervcritical", 5 );
502} 502}
503 503
504 504
505enum MemState { Unknown, VeryLow, Low, Normal } memstate = Unknown; 505enum MemState { Unknown, VeryLow, Low, Normal } memstate = Unknown;
506 506
507#ifdef Q_WS_QWS 507#ifdef Q_WS_QWS
508bool DesktopApplication::qwsEventFilter( QWSEvent *e ) 508bool DesktopApplication::qwsEventFilter( QWSEvent *e )
509{ 509{
510 qpedesktop->checkMemory(); 510 qpedesktop->checkMemory();
511 511
512 if ( e->type == QWSEvent::Key ) { 512 if ( e->type == QWSEvent::Key ) {
513 QWSKeyEvent * ke = ( QWSKeyEvent * ) e; 513 QWSKeyEvent * ke = ( QWSKeyEvent * ) e;
514 if ( !loggedin && ke->simpleData.keycode != Key_F34 ) 514 if ( !loggedin && ke->simpleData.keycode != Key_F34 )
515 return TRUE; 515 return TRUE;
516 bool press = ke->simpleData.is_press; 516 bool press = ke->simpleData.is_press;
517 bool autoRepeat = ke->simpleData.is_auto_repeat; 517 bool autoRepeat = ke->simpleData.is_auto_repeat;
518 518
519 /* 519 /*
520 app that registers key/message to be sent back to the app, when it doesn't have focus, 520 app that registers key/message to be sent back to the app, when it doesn't have focus,
521 when user presses key, unless keyboard has been requested from app. 521 when user presses key, unless keyboard has been requested from app.
522 will not send multiple repeats if user holds key 522 will not send multiple repeats if user holds key
523 i.e. one shot 523 i.e. one shot
524 */ 524 */
525 if ( !keyRegisterList.isEmpty() && ke->simpleData.keycode !=0 && press) { 525 if ( !keyRegisterList.isEmpty() && ke->simpleData.keycode !=0 && press) {
526// qDebug("<<<<<<<<<<<<<keycode %d", ke->simpleData.keycode); 526// qDebug("<<<<<<<<<<<<<keycode %d", ke->simpleData.keycode);
527 KeyRegisterList::Iterator it; 527 KeyRegisterList::Iterator it;
528 for ( it = keyRegisterList.begin(); it != keyRegisterList.end(); ++it ) { 528 for ( it = keyRegisterList.begin(); it != keyRegisterList.end(); ++it ) {
529 if ( ( *it ).getKeyCode() == ke->simpleData.keycode && !autoRepeat && !keyboardGrabbed() ) { 529 if ( ( *it ).getKeyCode() == ke->simpleData.keycode && !autoRepeat && !keyboardGrabbed() ) {
530 if ( press ) 530 if ( press )
531 qDebug( "press" ); 531 qDebug( "press" );
532 else 532 else
533 qDebug( "release" ); 533 qDebug( "release" );
534 QCopEnvelope( ( *it ).getChannel().utf8(), ( *it ).getMessage().utf8() ); 534 QCopEnvelope( ( *it ).getChannel().utf8(), ( *it ).getMessage().utf8() );
535 } 535 }
536 } 536 }
537 } 537 }
538 538
539 if ( !keyboardGrabbed() ) { 539 if ( !keyboardGrabbed() ) {
540 if ( ke->simpleData.keycode == Key_F9 ) { 540 if ( ke->simpleData.keycode == Key_F9 ) {
541 if ( press ) 541 if ( press )
542 emit datebook(); 542 emit datebook();
543 return TRUE; 543 return TRUE;
544 } 544 }
545 if ( ke->simpleData.keycode == Key_F10 ) { 545 if ( ke->simpleData.keycode == Key_F10 ) {
546 if ( !press && cardSendTimer ) { 546 if ( !press && cardSendTimer ) {
547 emit contacts(); 547 emit contacts();
@@ -587,118 +587,129 @@ bool DesktopApplication::qwsEventFilter( QWSEvent *e )
587 // return TRUE; 587 // return TRUE;
588 // } 588 // }
589 if ( ke->simpleData.keycode == Key_F35 ) { 589 if ( ke->simpleData.keycode == Key_F35 ) {
590 if ( press ) 590 if ( press )
591 emit backlight(); 591 emit backlight();
592 return TRUE; 592 return TRUE;
593 } 593 }
594 if ( ke->simpleData.keycode == Key_F32 ) { 594 if ( ke->simpleData.keycode == Key_F32 ) {
595 if ( press ) 595 if ( press )
596 QCopEnvelope e( "QPE/Desktop", "startSync()" ); 596 QCopEnvelope e( "QPE/Desktop", "startSync()" );
597 return TRUE; 597 return TRUE;
598 } 598 }
599 if ( ke->simpleData.keycode == Key_F31 && !ke->simpleData.modifiers ) { 599 if ( ke->simpleData.keycode == Key_F31 && !ke->simpleData.modifiers ) {
600 if ( press ) 600 if ( press )
601 emit symbol(); 601 emit symbol();
602 return TRUE; 602 return TRUE;
603 } 603 }
604 if ( ke->simpleData.keycode == Key_NumLock ) { 604 if ( ke->simpleData.keycode == Key_NumLock ) {
605 if ( press ) 605 if ( press )
606 emit numLockStateToggle(); 606 emit numLockStateToggle();
607 } 607 }
608 if ( ke->simpleData.keycode == Key_CapsLock ) { 608 if ( ke->simpleData.keycode == Key_CapsLock ) {
609 if ( press ) 609 if ( press )
610 emit capsLockStateToggle(); 610 emit capsLockStateToggle();
611 } 611 }
612 if ( ( press && !autoRepeat ) || ( !press && autoRepeat ) ) 612 if ( ( press && !autoRepeat ) || ( !press && autoRepeat ) )
613 qpedesktop->keyClick(); 613 qpedesktop->keyClick();
614 } 614 }
615 else { 615 else {
616 if ( e->type == QWSEvent::Mouse ) { 616 if ( e->type == QWSEvent::Mouse ) {
617 QWSMouseEvent * me = ( QWSMouseEvent * ) e; 617 QWSMouseEvent * me = ( QWSMouseEvent * ) e;
618 static bool up = TRUE; 618 static bool up = TRUE;
619 if ( me->simpleData.state & LeftButton ) { 619 if ( me->simpleData.state & LeftButton ) {
620 if ( up ) { 620 if ( up ) {
621 up = FALSE; 621 up = FALSE;
622 qpedesktop->screenClick(); 622 qpedesktop->screenClick();
623 } 623 }
624 } 624 }
625 else { 625 else {
626 up = TRUE; 626 up = TRUE;
627 } 627 }
628 } 628 }
629 } 629 }
630 630
631 return QPEApplication::qwsEventFilter( e ); 631 return QPEApplication::qwsEventFilter( e );
632} 632}
633#endif 633#endif
634 634
635void DesktopApplication::psTimeout() 635void DesktopApplication::psTimeout( int batRemaining )
636{ 636{
637 qpedesktop->checkMemory(); // in case no events are being generated
638
639 *ps = PowerStatusManager::readStatus(); 637 *ps = PowerStatusManager::readStatus();
640 638
639 // maybe now since its triggered by apm change there might be to few warnings
641 // if ( ( ps->batteryStatus() == PowerStatus::VeryLow ) ) { 640 // if ( ( ps->batteryStatus() == PowerStatus::VeryLow ) ) {
642 if ( ( ps->batteryPercentRemaining() == m_powerVeryLow ) ) { 641 if ( ( batRemaining == m_powerVeryLow ) ) {
643 pa->alert( tr( "Battery is running very low." ), 6 ); 642 pa->alert( tr( "Battery is running very low." ), 6 );
644 } 643 }
645 644
646 // if ( ps->batteryStatus() == PowerStatus::Critical ) { 645 // if ( ps->batteryStatus() == PowerStatus::Critical ) {
647 if ( ps->batteryPercentRemaining() == m_powerCritical ) { 646 if ( batRemaining == m_powerCritical ) {
648 pa->alert( tr( "Battery level is critical!\n" 647 pa->alert( tr( "Battery level is critical!\n"
649 "Keep power off until power restored!" ), 1 ); 648 "Keep power off until power restored!" ), 1 );
650 } 649 }
651 650
652 if ( ps->backupBatteryStatus() == PowerStatus::VeryLow ) { 651 if ( ps->backupBatteryStatus() == PowerStatus::VeryLow ) {
653 pa->alert( tr( "The Back-up battery is very low.\nPlease charge the back-up battery." ), 3 ); 652 pa->alert( tr( "The Back-up battery is very low.\nPlease charge the back-up battery." ), 3 );
654 } 653 }
655} 654}
656 655
656void DesktopApplication::apmTimeout()
657{
658 qpedesktop->checkMemory(); // in case no events are being generated
659
660 *ps = PowerStatusManager::readStatus();
661
662 if ( m_currentPowerLevel != ps->batteryPercentRemaining() ) {
663 // not very nice, since psTimeout parses the again
664 m_currentPowerLevel = ps->batteryPercentRemaining();
665 psTimeout( m_currentPowerLevel );
666 }
667}
657 668
658void DesktopApplication::sendCard() 669void DesktopApplication::sendCard()
659{ 670{
660 delete cardSendTimer; 671 delete cardSendTimer;
661 cardSendTimer = 0; 672 cardSendTimer = 0;
662 QString card = getenv( "HOME" ); 673 QString card = getenv( "HOME" );
663 card += "/Applications/addressbook/businesscard.vcf"; 674 card += "/Applications/addressbook/businesscard.vcf";
664 675
665 if ( QFile::exists( card ) ) { 676 if ( QFile::exists( card ) ) {
666 QCopEnvelope e( "QPE/Obex", "send(QString,QString,QString)" ); 677 QCopEnvelope e( "QPE/Obex", "send(QString,QString,QString)" );
667 QString mimetype = "text/x-vCard"; 678 QString mimetype = "text/x-vCard";
668 e << tr( "business card" ) << card << mimetype; 679 e << tr( "business card" ) << card << mimetype;
669 } 680 }
670} 681}
671 682
672#if defined(QPE_HAVE_MEMALERTER) 683#if defined(QPE_HAVE_MEMALERTER)
673QPE_MEMALERTER_IMPL 684QPE_MEMALERTER_IMPL
674#endif 685#endif
675 686
676//=========================================================================== 687//===========================================================================
677 688
678Desktop::Desktop() : 689Desktop::Desktop() :
679 QWidget( 0, 0, WStyle_Tool | WStyle_Customize ), 690 QWidget( 0, 0, WStyle_Tool | WStyle_Customize ),
680 qcopBridge( 0 ), 691 qcopBridge( 0 ),
681 transferServer( 0 ), 692 transferServer( 0 ),
682 packageSlave( 0 ) 693 packageSlave( 0 )
683{ 694{
684 qpedesktop = this; 695 qpedesktop = this;
685 696
686 // bg = new Info( this ); 697 // bg = new Info( this );
687 tb = new TaskBar; 698 tb = new TaskBar;
688 699
689 launcher = new Launcher( 0, 0, WStyle_Customize | QWidget::WGroupLeader ); 700 launcher = new Launcher( 0, 0, WStyle_Customize | QWidget::WGroupLeader );
690 701
691 connect( launcher, SIGNAL( busy() ), tb, SLOT( startWait() ) ); 702 connect( launcher, SIGNAL( busy() ), tb, SLOT( startWait() ) );
692 connect( launcher, SIGNAL( notBusy( const QString& ) ), tb, SLOT( stopWait( const QString& ) ) ); 703 connect( launcher, SIGNAL( notBusy( const QString& ) ), tb, SLOT( stopWait( const QString& ) ) );
693 704
694 int displayw = qApp->desktop() ->width(); 705 int displayw = qApp->desktop() ->width();
695 int displayh = qApp->desktop() ->height(); 706 int displayh = qApp->desktop() ->height();
696 707
697 708
698 QSize sz = tb->sizeHint(); 709 QSize sz = tb->sizeHint();
699 710
700 setGeometry( 0, displayh - sz.height(), displayw, sz.height() ); 711 setGeometry( 0, displayh - sz.height(), displayw, sz.height() );
701 tb->setGeometry( 0, displayh - sz.height(), displayw, sz.height() ); 712 tb->setGeometry( 0, displayh - sz.height(), displayw, sz.height() );
702 713
703 tb->show(); 714 tb->show();
704 launcher->showMaximized(); 715 launcher->showMaximized();
diff --git a/core/launcher/desktop.h b/core/launcher/desktop.h
index 15d8ef7..8308811 100644
--- a/core/launcher/desktop.h
+++ b/core/launcher/desktop.h
@@ -32,109 +32,110 @@
32class Background; 32class Background;
33class Launcher; 33class Launcher;
34class TaskBar; 34class TaskBar;
35class PowerStatus; 35class PowerStatus;
36class QCopBridge; 36class QCopBridge;
37class TransferServer; 37class TransferServer;
38class DesktopPowerAlerter; 38class DesktopPowerAlerter;
39class PackageSlave; 39class PackageSlave;
40class QPEScreenSaver; 40class QPEScreenSaver;
41 41
42class DesktopApplication : public QPEApplication 42class DesktopApplication : public QPEApplication
43{ 43{
44 Q_OBJECT 44 Q_OBJECT
45public: 45public:
46 DesktopApplication( int& argc, char **argv, Type t ); 46 DesktopApplication( int& argc, char **argv, Type t );
47 ~DesktopApplication(); 47 ~DesktopApplication();
48 48
49 static void switchLCD ( bool on ); // only for togglePower in Desktop 49 static void switchLCD ( bool on ); // only for togglePower in Desktop
50 50
51signals: 51signals:
52 void menu(); 52 void menu();
53 void home(); 53 void home();
54 void datebook(); 54 void datebook();
55 void contacts(); 55 void contacts();
56 void launch(); 56 void launch();
57 void email(); 57 void email();
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 desktopMessage ( const QCString &msg, const QByteArray &data ); 75 virtual void desktopMessage ( const QCString &msg, const QByteArray &data );
76 virtual void systemMessage ( const QCString &msg, const QByteArray &data ); 76 virtual void systemMessage ( const QCString &msg, const QByteArray &data );
77 77
78protected slots: 78protected slots:
79 void shutdown( ShutdownImpl::Type ); 79 void shutdown( ShutdownImpl::Type );
80 void psTimeout(); 80 void psTimeout( int );
81 void apmTimeout();
81 void sendCard(); 82 void sendCard();
82private: 83private:
83 void reloadPowerWarnSettings(); 84 void reloadPowerWarnSettings();
84 DesktopPowerAlerter *pa; 85 DesktopPowerAlerter *pa;
85 PowerStatus *ps; 86 PowerStatus *ps;
86 QTimer *cardSendTimer; 87 QTimer *cardSendTimer;
87 QCopChannel *channel; 88 QCopChannel *channel;
88 QPEScreenSaver *m_screensaver; 89 QPEScreenSaver *m_screensaver;
89 QTimer * m_timer; 90 QTimer * m_timer;
90 int m_powerVeryLow; 91 int m_powerVeryLow;
91 int m_powerCritical; 92 int m_powerCritical;
92 93 int m_currentPowerLevel;
93}; 94};
94 95
95 96
96class Desktop : public QWidget 97class Desktop : public QWidget
97{ 98{
98 Q_OBJECT 99 Q_OBJECT
99public: 100public:
100 Desktop(); 101 Desktop();
101 ~Desktop(); 102 ~Desktop();
102 103
103 static bool screenLocked(); 104 static bool screenLocked();
104 105
105 void show(); 106 void show();
106 void checkMemory(); 107 void checkMemory();
107 108
108 void keyClick(); 109 void keyClick();
109 void screenClick(); 110 void screenClick();
110 static void soundAlarm(); 111 static void soundAlarm();
111 112
112public slots: 113public slots:
113 void raiseDatebook(); 114 void raiseDatebook();
114 void raiseContacts(); 115 void raiseContacts();
115 void raiseMenu(); 116 void raiseMenu();
116 void raiseLauncher(); 117 void raiseLauncher();
117 void raiseEmail(); 118 void raiseEmail();
118 void execAutoStart(); 119 void execAutoStart();
119 void togglePower(); 120 void togglePower();
120 void toggleLight(); 121 void toggleLight();
121 void toggleNumLockState(); 122 void toggleNumLockState();
122 void toggleCapsLockState(); 123 void toggleCapsLockState();
123 void toggleSymbolInput(); 124 void toggleSymbolInput();
124 void terminateServers(); 125 void terminateServers();
125 void rereadVolumes(); 126 void rereadVolumes();
126 127
127 void home ( ); 128 void home ( );
128 129
129protected: 130protected:
130 void executeOrModify( const QString& appLnkFile ); 131 void executeOrModify( const QString& appLnkFile );
131 void styleChange( QStyle & ); 132 void styleChange( QStyle & );
132 void timerEvent( QTimerEvent *e ); 133 void timerEvent( QTimerEvent *e );
133 bool eventFilter( QObject *, QEvent * ); 134 bool eventFilter( QObject *, QEvent * );
134 135
135 QWidget *bg; 136 QWidget *bg;
136 Launcher *launcher; 137 Launcher *launcher;
137 TaskBar *tb; 138 TaskBar *tb;
138 139
139private: 140private:
140 void startTransferServer(); 141 void startTransferServer();