summaryrefslogtreecommitdiff
path: root/core/launcher/desktop.cpp
Side-by-side diff
Diffstat (limited to 'core/launcher/desktop.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/desktop.cpp48
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
@@ -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>
@@ -528,28 +538,32 @@ static void darkScreen()
qpe_setBacklight(0); // force off
}
void Desktop::togglePower()
{
- bool wasloggedin = loggedin;
- loggedin=0;
- darkScreen();
- if ( wasloggedin )
- blankScreen();
- system("apm --suspend");
- QWSServer::screenSaverActivate( FALSE );
- {
- QCopEnvelope("QPE/Card", "mtabChanged()" ); // might have changed while asleep
- QCopEnvelope e("QPE/System", "setBacklight(int)");
- e << -3; // Force on
- }
- if ( wasloggedin )
- login(TRUE);
- //qcopBridge->closeOpenConnections();
- //qDebug("called 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 ) {
+ login(TRUE);
+ }
+
+ //qcopBridge->closeOpenConnections();
+ //qDebug("called togglePower()!!!!!!");
}
void Desktop::toggleLight()
{
QCopEnvelope e("QPE/System", "setBacklight(int)");
e << -2; // toggle