-rw-r--r-- | core/launcher/desktop.cpp | 18 |
1 files changed, 16 insertions, 2 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 @@ -49,13 +49,12 @@ #include <qvaluelist.h> #include <stdlib.h> #include <unistd.h> - class QCopKeyRegister { public: QCopKeyRegister() : keyCode(0) { } QCopKeyRegister(int k, const QString &c, const QString &m) : keyCode(k), channel(c), message(m) { } @@ -494,12 +493,23 @@ void Desktop::raiseMenu() void Desktop::raiseEmail() { executeOrModify("Applications/qtmail.desktop"); } +// autoStarts apps on resume and start +void Desktop::execAutoStart() +{ + QString appName; + Config cfg( "autostart" ); + cfg.setGroup( "AutoStart" ); + appName = cfg.readEntry("Apps", ""); + QCopEnvelope e("QPE/System", "execute(QString)"); + e << QString(appName); +} + #if defined(QPE_HAVE_TOGGLELIGHT) #include <qpe/config.h> #include <sys/ioctl.h> #include <sys/types.h> #include <fcntl.h> @@ -533,21 +543,25 @@ void Desktop::togglePower() { bool wasloggedin = loggedin; loggedin=0; darkScreen(); if ( wasloggedin ) blankScreen(); + system("apm --suspend"); + execAutoStart(); QWSServer::screenSaverActivate( FALSE ); { QCopEnvelope("QPE/Card", "mtabChanged()" ); // might have changed while asleep QCopEnvelope e("QPE/System", "setBacklight(int)"); e << -3; // Force on } - if ( wasloggedin ) + if ( wasloggedin ) { login(TRUE); + } + //qcopBridge->closeOpenConnections(); //qDebug("called togglePower()!!!!!!"); } void Desktop::toggleLight() { |