summaryrefslogtreecommitdiff
path: root/core
authorharlekin <harlekin>2002-03-19 01:25:52 (UTC)
committer harlekin <harlekin>2002-03-19 01:25:52 (UTC)
commit7c64492d86e8ddc90e80c380d53e2744869397cf (patch) (side-by-side diff)
tree430e49fa104ffdacdb56e817cb48ccf6002550f9 /core
parent3698b59946936e76687850fde92c45989320e7b0 (diff)
downloadopie-7c64492d86e8ddc90e80c380d53e2744869397cf.zip
opie-7c64492d86e8ddc90e80c380d53e2744869397cf.tar.gz
opie-7c64492d86e8ddc90e80c380d53e2744869397cf.tar.bz2
again
Diffstat (limited to 'core') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/desktop.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp
index 547daa9..64043e7 100644
--- a/core/launcher/desktop.cpp
+++ b/core/launcher/desktop.cpp
@@ -464,204 +464,204 @@ void Desktop::raiseLauncher()
else
launcher->raise();
}
void Desktop::executeOrModify(const QString& appLnkFile)
{
AppLnk lnk(MimeType::appsFolderName() + "/" + appLnkFile);
if ( lnk.isValid() ) {
QCString app = lnk.exec().utf8();
Global::terminateBuiltin("calibrate");
if ( QCopChannel::isRegistered("QPE/Application/" + app) ) {
MRUList::addTask(&lnk);
if ( hasVisibleWindow(app) )
QCopChannel::send("QPE/Application/" + app, "nextView()");
else
QCopChannel::send("QPE/Application/" + app, "raise()");
} else {
lnk.execute();
}
}
}
void Desktop::raiseDatebook()
{
executeOrModify("Applications/datebook.desktop");
}
void Desktop::raiseContacts()
{
executeOrModify("Applications/addressbook.desktop");
}
void Desktop::raiseMenu()
{
Global::terminateBuiltin("calibrate");
tb->startMenu()->launch();
}
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>
#include <unistd.h>
#include <errno.h>
#include <linux/ioctl.h>
#include <time.h>
#endif
static bool blanked=FALSE;
static void blankScreen()
{
if ( !qt_screen ) return;
/* Should use a big black window instead.
QGfx* g = qt_screen->screenGfx();
g->fillRect(0,0,qt_screen->width(),qt_screen->height());
delete g;
*/
blanked = TRUE;
}
static void darkScreen()
{
extern void qpe_setBacklight(int);
qpe_setBacklight(0); // force off
}
void Desktop::togglePower()
{
bool wasloggedin = loggedin;
loggedin=0;
darkScreen();
if ( wasloggedin )
blankScreen();
system("apm --suspend");
- sleep(2);
+
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);
}
-
+ sleep(1);
execAutoStart();
//qcopBridge->closeOpenConnections();
//qDebug("called togglePower()!!!!!!");
}
void Desktop::toggleLight()
{
QCopEnvelope e("QPE/System", "setBacklight(int)");
e << -2; // toggle
}
void Desktop::toggleSymbolInput()
{
tb->toggleSymbolInput();
}
void Desktop::toggleNumLockState()
{
tb->toggleNumLockState();
}
void Desktop::toggleCapsLockState()
{
tb->toggleCapsLockState();
}
void Desktop::styleChange( QStyle &s )
{
QWidget::styleChange( s );
int displayw = qApp->desktop()->width();
int displayh = qApp->desktop()->height();
QSize sz = tb->sizeHint();
tb->setGeometry( 0, displayh-sz.height(), displayw, sz.height() );
}
void DesktopApplication::shutdown()
{
if ( type() != GuiServer )
return;
ShutdownImpl *sd = new ShutdownImpl( 0, 0, WDestructiveClose );
connect( sd, SIGNAL(shutdown(ShutdownImpl::Type)),
this, SLOT(shutdown(ShutdownImpl::Type)) );
sd->showMaximized();
}
void DesktopApplication::shutdown( ShutdownImpl::Type t )
{
switch ( t ) {
case ShutdownImpl::ShutdownSystem:
execlp("shutdown", "shutdown", "-h", "now", (void*)0);
break;
case ShutdownImpl::RebootSystem:
execlp("shutdown", "shutdown", "-r", "now", (void*)0);
break;
case ShutdownImpl::RestartDesktop:
restart();
break;
case ShutdownImpl::TerminateDesktop:
prepareForTermination(FALSE);
quit();
break;
}
}
void DesktopApplication::restart()
{
prepareForTermination(TRUE);
#ifdef Q_WS_QWS
for ( int fd = 3; fd < 100; fd++ )
close( fd );
#if defined(QT_DEMO_SINGLE_FLOPPY)
execl( "/sbin/init", "qpe", 0 );
#elif defined(QT_QWS_CASSIOPEIA)
execl( "/bin/sh", "sh", 0 );
#else
execl( (qpeDir()+"/bin/qpe").latin1(), "qpe", 0 );
#endif
exit(1);
#endif
}
void Desktop::startTransferServer()
{
// start qcop bridge server
qcopBridge = new QCopBridge( 4243 );
if ( !qcopBridge->ok() ) {
delete qcopBridge;
qcopBridge = 0;
}
// start transfer server
transferServer = new TransferServer( 4242 );
if ( !transferServer->ok() ) {
delete transferServer;