author | harlekin <harlekin> | 2002-03-07 11:05:40 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-03-07 11:05:40 (UTC) |
commit | a2f42b6df21b2e5d52b49376542d0f4c7443a897 (patch) (unidiff) | |
tree | bfbacf25dd213cdb2b7a86a007e4598a1634bb18 /core/launcher/desktop.cpp | |
parent | 09444065297662fca1396abf8c0c9dd00380699f (diff) | |
download | opie-a2f42b6df21b2e5d52b49376542d0f4c7443a897.zip opie-a2f42b6df21b2e5d52b49376542d0f4c7443a897.tar.gz opie-a2f42b6df21b2e5d52b49376542d0f4c7443a897.tar.bz2 |
beginning support for autostart
-rw-r--r-- | core/launcher/desktop.cpp | 48 |
1 files changed, 31 insertions, 17 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp index a00fae2..4587ec6 100644 --- a/core/launcher/desktop.cpp +++ b/core/launcher/desktop.cpp | |||
@@ -52,7 +52,6 @@ | |||
52 | #include <stdlib.h> | 52 | #include <stdlib.h> |
53 | #include <unistd.h> | 53 | #include <unistd.h> |
54 | 54 | ||
55 | |||
56 | class QCopKeyRegister | 55 | class QCopKeyRegister |
57 | { | 56 | { |
58 | public: | 57 | public: |
@@ -497,6 +496,17 @@ void Desktop::raiseEmail() | |||
497 | executeOrModify("Applications/qtmail.desktop"); | 496 | executeOrModify("Applications/qtmail.desktop"); |
498 | } | 497 | } |
499 | 498 | ||
499 | // autoStarts apps on resume and start | ||
500 | void Desktop::execAutoStart() | ||
501 | { | ||
502 | QString appName; | ||
503 | Config cfg( "autostart" ); | ||
504 | cfg.setGroup( "AutoStart" ); | ||
505 | appName = cfg.readEntry("Apps", ""); | ||
506 | QCopEnvelope e("QPE/System", "execute(QString)"); | ||
507 | e << QString(appName); | ||
508 | } | ||
509 | |||
500 | #if defined(QPE_HAVE_TOGGLELIGHT) | 510 | #if defined(QPE_HAVE_TOGGLELIGHT) |
501 | #include <qpe/config.h> | 511 | #include <qpe/config.h> |
502 | 512 | ||
@@ -531,22 +541,26 @@ static void darkScreen() | |||
531 | 541 | ||
532 | void Desktop::togglePower() | 542 | void Desktop::togglePower() |
533 | { | 543 | { |
534 | bool wasloggedin = loggedin; | 544 | bool wasloggedin = loggedin; |
535 | loggedin=0; | 545 | loggedin=0; |
536 | darkScreen(); | 546 | darkScreen(); |
537 | if ( wasloggedin ) | 547 | if ( wasloggedin ) |
538 | blankScreen(); | 548 | blankScreen(); |
539 | system("apm --suspend"); | 549 | |
540 | QWSServer::screenSaverActivate( FALSE ); | 550 | system("apm --suspend"); |
541 | { | 551 | execAutoStart(); |
542 | QCopEnvelope("QPE/Card", "mtabChanged()" ); // might have changed while asleep | 552 | QWSServer::screenSaverActivate( FALSE ); |
543 | QCopEnvelope e("QPE/System", "setBacklight(int)"); | 553 | { |
544 | e << -3; // Force on | 554 | QCopEnvelope("QPE/Card", "mtabChanged()" ); // might have changed while asleep |
545 | } | 555 | QCopEnvelope e("QPE/System", "setBacklight(int)"); |
546 | if ( wasloggedin ) | 556 | e << -3; // Force on |
547 | login(TRUE); | 557 | } |
548 | //qcopBridge->closeOpenConnections(); | 558 | if ( wasloggedin ) { |
549 | //qDebug("called togglePower()!!!!!!"); | 559 | login(TRUE); |
560 | } | ||
561 | |||
562 | //qcopBridge->closeOpenConnections(); | ||
563 | //qDebug("called togglePower()!!!!!!"); | ||
550 | } | 564 | } |
551 | 565 | ||
552 | void Desktop::toggleLight() | 566 | void Desktop::toggleLight() |