summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/desktop.cpp76
1 files changed, 38 insertions, 38 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp
index 1ec477c..5aba8dd 100644
--- a/core/launcher/desktop.cpp
+++ b/core/launcher/desktop.cpp
@@ -439,162 +439,162 @@ void Desktop::checkMemory()
439 } 439 }
440 existingMessage = FALSE; 440 existingMessage = FALSE;
441#endif 441#endif
442} 442}
443 443
444static bool isVisibleWindow(int wid) 444static bool isVisibleWindow(int wid)
445{ 445{
446 const QList<QWSWindow> &list = qwsServer->clientWindows(); 446 const QList<QWSWindow> &list = qwsServer->clientWindows();
447 QWSWindow* w; 447 QWSWindow* w;
448 for (QListIterator<QWSWindow> it(list); (w=it.current()); ++it) { 448 for (QListIterator<QWSWindow> it(list); (w=it.current()); ++it) {
449 if ( w->winId() == wid ) 449 if ( w->winId() == wid )
450 return !w->isFullyObscured(); 450 return !w->isFullyObscured();
451 } 451 }
452 return FALSE; 452 return FALSE;
453} 453}
454 454
455static bool hasVisibleWindow(const QString& clientname) 455static bool hasVisibleWindow(const QString& clientname)
456{ 456{
457 const QList<QWSWindow> &list = qwsServer->clientWindows(); 457 const QList<QWSWindow> &list = qwsServer->clientWindows();
458 QWSWindow* w; 458 QWSWindow* w;
459 for (QListIterator<QWSWindow> it(list); (w=it.current()); ++it) { 459 for (QListIterator<QWSWindow> it(list); (w=it.current()); ++it) {
460 if ( w->client()->identity() == clientname && !w->isFullyObscured() ) 460 if ( w->client()->identity() == clientname && !w->isFullyObscured() )
461 return TRUE; 461 return TRUE;
462 } 462 }
463 return FALSE; 463 return FALSE;
464} 464}
465 465
466void Desktop::raiseLauncher() 466void Desktop::raiseLauncher()
467{ 467{
468 Config cfg("qpe"); //F12 'Home' 468 Config cfg("qpe"); //F12 'Home'
469 cfg.setGroup("AppsKey"); 469 cfg.setGroup("AppsKey");
470 QString tempItem; 470 QString tempItem;
471 tempItem = cfg.readEntry("Middle","Home"); 471 tempItem = cfg.readEntry("Middle","Home");
472 if(tempItem == "Home" || tempItem.isEmpty()) { 472 if(tempItem == "Home" || tempItem.isEmpty()) {
473 if ( isVisibleWindow(launcher->winId()) ) 473 if ( isVisibleWindow(launcher->winId()) )
474 launcher->nextView(); 474 launcher->nextView();
475 else 475 else
476 launcher->raise(); 476 launcher->raise();
477 } else { 477 } else {
478 QCopEnvelope e("QPE/System","execute(QString)"); 478 QCopEnvelope e("QPE/System","execute(QString)");
479 e << tempItem; 479 e << tempItem;
480 } 480 }
481} 481}
482 482
483void Desktop::executeOrModify(const QString& appLnkFile) 483void Desktop::executeOrModify(const QString& appLnkFile)
484{ 484{
485 AppLnk lnk(MimeType::appsFolderName() + "/" + appLnkFile); 485 AppLnk lnk(MimeType::appsFolderName() + "/" + appLnkFile);
486 if ( lnk.isValid() ) { 486 if ( lnk.isValid() ) {
487 QCString app = lnk.exec().utf8(); 487 QCString app = lnk.exec().utf8();
488 Global::terminateBuiltin("calibrate"); 488 Global::terminateBuiltin("calibrate");
489 if ( QCopChannel::isRegistered("QPE/Application/" + app) ) { 489 if ( QCopChannel::isRegistered("QPE/Application/" + app) ) {
490 MRUList::addTask(&lnk); 490 MRUList::addTask(&lnk);
491 if ( hasVisibleWindow(app) ) 491 if ( hasVisibleWindow(app) )
492 QCopChannel::send("QPE/Application/" + app, "nextView()"); 492 QCopChannel::send("QPE/Application/" + app, "nextView()");
493 else 493 else
494 QCopChannel::send("QPE/Application/" + app, "raise()"); 494 QCopChannel::send("QPE/Application/" + app, "raise()");
495 } else { 495 } else {
496 lnk.execute(); 496 lnk.execute();
497 } 497 }
498 } 498 }
499} 499}
500 500
501void Desktop::raiseDatebook() 501void Desktop::raiseDatebook()
502{ 502{
503 Config cfg("qpe"); //F9 'Activity' 503 Config cfg( "qpe" ); //F9 'Activity'
504 cfg.setGroup("AppsKey"); 504 cfg.setGroup( "AppsKey" );
505 QString tempItem; 505 QString tempItem;
506 tempItem = cfg.readEntry("LeftEnd","Calender"); 506 tempItem = cfg.readEntry( "LeftEnd" , "Calender" );
507 if(tempItem == "Calender" || tempItem.isEmpty()) executeOrModify("Applications/datebook.desktop"); 507 if ( tempItem == "Calender" || tempItem.isEmpty() ) {
508 else { 508 tempItem = "datebook";
509 QCopEnvelope e("QPE/System","execute(QString)");
510 e << tempItem;
511 } 509 }
510 QCopEnvelope e( "QPE/System", "execute(QString)" );
511 e << tempItem;
512} 512}
513 513
514void Desktop::raiseContacts() 514void Desktop::raiseContacts()
515{ 515{
516 Config cfg("qpe"); //F10, 'Contacts' 516 Config cfg( "qpe" ); //F10, 'Contacts'
517 cfg.setGroup("AppsKey"); 517 cfg.setGroup( "AppsKey" );
518 QString tempItem; 518 QString tempItem;
519 tempItem = cfg.readEntry("Left2nd","Address Book"); 519 tempItem = cfg.readEntry( "Left2nd", "Address Book" );
520 if(tempItem == "Address Book" || tempItem.isEmpty()) executeOrModify("Applications/addressbook.desktop"); 520 if ( tempItem == "Address Book" || tempItem.isEmpty() ) {
521 else { 521 tempItem = "addressbook";
522 QCopEnvelope e("QPE/System","execute(QString)");
523 e << tempItem;
524 } 522 }
523 QCopEnvelope e("QPE/System","execute(QString)");
524 e << tempItem;
525} 525}
526 526
527void Desktop::raiseMenu() 527void Desktop::raiseMenu()
528{ 528{
529 Config cfg("qpe"); //F11, 'Menu' 529 Config cfg( "qpe" ); //F11, 'Menu
530 cfg.setGroup("AppsKey"); 530 cfg.setGroup( "AppsKey" );
531 QString tempItem; 531 QString tempItem;
532 tempItem = cfg.readEntry("Right2nd","Popup Menu"); 532 tempItem = cfg.readEntry( "Right2nd" , "Popup Menu" );
533 if(tempItem == "Popup Menu" || tempItem.isEmpty()) { 533 if ( tempItem == "Popup Menu" || tempItem.isEmpty() ) {
534 Global::terminateBuiltin("calibrate"); 534 Global::terminateBuiltin("calibrate");
535 tb->startMenu()->launch(); 535 tb->startMenu()->launch();
536 } else { 536 } else {
537 QCopEnvelope e("QPE/System","execute(QString)"); 537 QCopEnvelope e("QPE/System","execute(QString)");
538 e << tempItem; 538 e << tempItem;
539 } 539 }
540} 540}
541 541
542void Desktop::raiseEmail() 542void Desktop::raiseEmail()
543{ 543{
544 Config cfg("qpe"); //F13, 'Mail' 544 Config cfg( "qpe" ); //F13, 'Mail'
545 cfg.setGroup("AppsKey"); 545 cfg.setGroup( "AppsKey" );
546 QString tempItem; 546 QString tempItem;
547 tempItem = cfg.readEntry("RightEnd","Mail"); 547 tempItem = cfg.readEntry( "RightEnd", "Mail" );
548 if(tempItem == "Mail" || tempItem == "qtmail" || tempItem.isEmpty()) executeOrModify("Applications/qtmail.desktop"); 548 if ( tempItem == "Mail" || tempItem == "qtmail" || tempItem.isEmpty() ) {
549 else { 549 tempItem = "mail";
550 QCopEnvelope e("QPE/System","execute(QString)");
551 e << tempItem;
552 } 550 }
551 QCopEnvelope e("QPE/System","execute(QString)");
552 e << tempItem;
553} 553}
554 554
555// autoStarts apps on resume and start 555// autoStarts apps on resume and start
556void Desktop::execAutoStart() { 556void Desktop::execAutoStart() {
557 QString appName; 557 QString appName;
558 int delay; 558 int delay;
559 QDateTime now = QDateTime::currentDateTime(); 559 QDateTime now = QDateTime::currentDateTime();
560 Config cfg( "autostart" ); 560 Config cfg( "autostart" );
561 cfg.setGroup( "AutoStart" ); 561 cfg.setGroup( "AutoStart" );
562 appName = cfg.readEntry( "Apps", "" ); 562 appName = cfg.readEntry( "Apps", "" );
563 delay = ( cfg.readEntry( "Delay", "0" ) ).toInt(); 563 delay = ( cfg.readEntry( "Delay", "0" ) ).toInt();
564 // If the time between suspend and resume was longer then the 564 // If the time between suspend and resume was longer then the
565 // value saved as delay, start the app 565 // value saved as delay, start the app
566 if ( suspendTime.secsTo( now ) >= ( delay * 60 ) && !appName.isEmpty() ) { 566 if ( suspendTime.secsTo( now ) >= ( delay * 60 ) && !appName.isEmpty() ) {
567 QCopEnvelope e( "QPE/System", "execute(QString)" ); 567 QCopEnvelope e( "QPE/System", "execute(QString)" );
568 e << QString( appName ); 568 e << QString( appName );
569 } 569 }
570} 570}
571 571
572#if defined(QPE_HAVE_TOGGLELIGHT) 572#if defined(QPE_HAVE_TOGGLELIGHT)
573#include <qpe/config.h> 573#include <qpe/config.h>
574 574
575#include <sys/ioctl.h> 575#include <sys/ioctl.h>
576#include <sys/types.h> 576#include <sys/types.h>
577#include <fcntl.h> 577#include <fcntl.h>
578#include <unistd.h> 578#include <unistd.h>
579#include <errno.h> 579#include <errno.h>
580#include <linux/ioctl.h> 580#include <linux/ioctl.h>
581#include <time.h> 581#include <time.h>
582#endif 582#endif
583 583
584static bool blanked=FALSE; 584static bool blanked=FALSE;
585 585
586static void blankScreen() 586static void blankScreen()
587{ 587{
588 if ( !qt_screen ) return; 588 if ( !qt_screen ) return;
589 /* Should use a big black window instead. 589 /* Should use a big black window instead.
590 QGfx* g = qt_screen->screenGfx(); 590 QGfx* g = qt_screen->screenGfx();
591 g->fillRect(0,0,qt_screen->width(),qt_screen->height()); 591 g->fillRect(0,0,qt_screen->width(),qt_screen->height());
592 delete g; 592 delete g;
593 */ 593 */
594 blanked = TRUE; 594 blanked = TRUE;
595} 595}
596 596
597static void darkScreen() 597static void darkScreen()
598{ 598{
599 extern void qpe_setBacklight(int); 599 extern void qpe_setBacklight(int);
600 qpe_setBacklight(0); // force off 600 qpe_setBacklight(0); // force off