summaryrefslogtreecommitdiff
path: root/core/launcher/desktop.cpp
Unidiff
Diffstat (limited to 'core/launcher/desktop.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/launcher/desktop.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp
index 68949e6..1a33b36 100644
--- a/core/launcher/desktop.cpp
+++ b/core/launcher/desktop.cpp
@@ -371,24 +371,27 @@ void DesktopApplication::desktopMessage( const QCString &msg, const QByteArray &
371 int k; 371 int k;
372 QString c, m; 372 QString c, m;
373 stream >> k; 373 stream >> k;
374 stream >> c; 374 stream >> c;
375 stream >> m; 375 stream >> m;
376 376
377 qWarning( "KeyRegisterReceived: %i, %s, %s", k, ( const char* ) c, ( const char * ) m ); 377 qWarning( "KeyRegisterReceived: %i, %s, %s", k, ( const char* ) c, ( const char * ) m );
378 keyRegisterList.append( QCopKeyRegister( k, c, m ) ); 378 keyRegisterList.append( QCopKeyRegister( k, c, m ) );
379 } 379 }
380 else if ( msg == "suspend()" ) { 380 else if ( msg == "suspend()" ) {
381 emit power(); 381 emit power();
382 } 382 }
383 else if ( msg == "home()" ) {
384 qpedesktop-> home ( );
385 }
383#endif 386#endif
384} 387}
385 388
386 389
387void DesktopApplication::systemMessage( const QCString & msg, const QByteArray & data ) 390void DesktopApplication::systemMessage( const QCString & msg, const QByteArray & data )
388{ 391{
389#ifdef Q_WS_QWS 392#ifdef Q_WS_QWS
390 QDataStream stream ( data, IO_ReadOnly ); 393 QDataStream stream ( data, IO_ReadOnly );
391 394
392 if ( msg == "setScreenSaverInterval(int)" ) { 395 if ( msg == "setScreenSaverInterval(int)" ) {
393 int time; 396 int time;
394 stream >> time; 397 stream >> time;
@@ -708,35 +711,40 @@ static bool hasVisibleWindow( const QString& clientname )
708 return TRUE; 711 return TRUE;
709 } 712 }
710 return FALSE; 713 return FALSE;
711} 714}
712 715
713void Desktop::raiseLauncher() 716void Desktop::raiseLauncher()
714{ 717{
715 Config cfg( "qpe" ); //F12 'Home' 718 Config cfg( "qpe" ); //F12 'Home'
716 cfg.setGroup( "AppsKey" ); 719 cfg.setGroup( "AppsKey" );
717 QString tempItem; 720 QString tempItem;
718 tempItem = cfg.readEntry( "Middle", "Home" ); 721 tempItem = cfg.readEntry( "Middle", "Home" );
719 if ( tempItem == "Home" || tempItem.isEmpty() ) { 722 if ( tempItem == "Home" || tempItem.isEmpty() ) {
720 if ( isVisibleWindow( launcher->winId() ) ) 723 home ( );
721 launcher->nextView();
722 else
723 launcher->raise();
724 } 724 }
725 else { 725 else {
726 QCopEnvelope e( "QPE/System", "execute(QString)" ); 726 QCopEnvelope e( "QPE/System", "execute(QString)" );
727 e << tempItem; 727 e << tempItem;
728 } 728 }
729} 729}
730 730
731void Desktop::home ( )
732 {
733 if ( isVisibleWindow( launcher->winId() ) )
734 launcher->nextView();
735 else
736 launcher->raise();
737}
738
731void Desktop::executeOrModify( const QString& appLnkFile ) 739void Desktop::executeOrModify( const QString& appLnkFile )
732{ 740{
733 AppLnk lnk( MimeType::appsFolderName() + "/" + appLnkFile ); 741 AppLnk lnk( MimeType::appsFolderName() + "/" + appLnkFile );
734 if ( lnk.isValid() ) { 742 if ( lnk.isValid() ) {
735 QCString app = lnk.exec().utf8(); 743 QCString app = lnk.exec().utf8();
736 Global::terminateBuiltin( "calibrate" ); 744 Global::terminateBuiltin( "calibrate" );
737 if ( QCopChannel::isRegistered( "QPE/Application/" + app ) ) { 745 if ( QCopChannel::isRegistered( "QPE/Application/" + app ) ) {
738 // MRUList::addTask( &lnk ); 746 // MRUList::addTask( &lnk );
739 if ( hasVisibleWindow( app ) ) 747 if ( hasVisibleWindow( app ) )
740 QCopChannel::send( "QPE/Application/" + app, "nextView()" ); 748 QCopChannel::send( "QPE/Application/" + app, "nextView()" );
741 else 749 else
742 QCopChannel::send( "QPE/Application/" + app, "raise()" ); 750 QCopChannel::send( "QPE/Application/" + app, "raise()" );
@@ -828,24 +836,26 @@ void Desktop::execAutoStart()
828#include <fcntl.h> 836#include <fcntl.h>
829#include <unistd.h> 837#include <unistd.h>
830#include <errno.h> 838#include <errno.h>
831#include <linux/ioctl.h> 839#include <linux/ioctl.h>
832#include <time.h> 840#include <time.h>
833#endif 841#endif
834 842
835 843
836void Desktop::togglePower() 844void Desktop::togglePower()
837{ 845{
838 static bool excllock = false; 846 static bool excllock = false;
839 847
848 qDebug ( "togglePower (locked == %d)", excllock ? 1 : 0 );
849
840 if ( excllock ) 850 if ( excllock )
841 return ; 851 return ;
842 852
843 excllock = true; 853 excllock = true;
844 854
845 bool wasloggedin = loggedin; 855 bool wasloggedin = loggedin;
846 loggedin = 0; 856 loggedin = 0;
847 suspendTime = QDateTime::currentDateTime(); 857 suspendTime = QDateTime::currentDateTime();
848 858
849 ODevice::inst ( ) -> suspend ( ); 859 ODevice::inst ( ) -> suspend ( );
850 860
851 QWSServer::screenSaverActivate ( false ); 861 QWSServer::screenSaverActivate ( false );