-rw-r--r-- | core/launcher/desktop.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp index 1a33b36..6ee7132 100644 --- a/core/launcher/desktop.cpp +++ b/core/launcher/desktop.cpp @@ -302,53 +302,53 @@ public: m_backlight_bright = bright; } private: int m_disable_suspend; bool m_enable_dim; bool m_enable_lightoff; bool m_enable_onlylcdoff; bool m_lcd_status; int m_backlight_bright; bool m_backlight_forcedoff; }; void DesktopApplication::switchLCD ( bool on ) { if ( qApp ) { DesktopApplication *dapp = (DesktopApplication *) qApp; if ( dapp-> m_screensaver ) { if ( on ) - dapp-> m_screensaver-> restore ( ); //setBacklight ( on ? -3 : -1 ); - else - dapp-> m_screensaver-> save ( 1 ); - - } + dapp-> m_screensaver-> restore ( ); //setBacklight ( on ? -3 : -1 ); + else + dapp-> m_screensaver-> save ( 1 ); + + } } } DesktopApplication::DesktopApplication( int& argc, char **argv, Type appType ) : QPEApplication( argc, argv, appType ) { QTimer * t = new QTimer( this ); connect( t, SIGNAL( timeout() ), this, SLOT( psTimeout() ) ); t->start( 10000 ); ps = new PowerStatus; pa = new DesktopPowerAlerter( 0 ); channel = new QCopChannel( "QPE/Desktop", this ); connect( channel, SIGNAL( received( const QCString&, const QByteArray& ) ), this, SLOT( desktopMessage( const QCString&, const QByteArray& ) ) ); channel = new QCopChannel( "QPE/System", this ); connect( channel, SIGNAL( received( const QCString&, const QByteArray& ) ), this, SLOT( systemMessage( const QCString&, const QByteArray& ) ) ); m_screensaver = new QPEScreenSaver; @@ -360,49 +360,49 @@ DesktopApplication::DesktopApplication( int& argc, char **argv, Type appType ) DesktopApplication::~DesktopApplication() { delete ps; delete pa; } void DesktopApplication::desktopMessage( const QCString &msg, const QByteArray &data ) { #ifdef Q_WS_QWS QDataStream stream( data, IO_ReadOnly ); if ( msg == "keyRegister(int key, QString channel, QString message)" ) { int k; QString c, m; stream >> k; stream >> c; stream >> m; qWarning( "KeyRegisterReceived: %i, %s, %s", k, ( const char* ) c, ( const char * ) m ); keyRegisterList.append( QCopKeyRegister( k, c, m ) ); } else if ( msg == "suspend()" ) { emit power(); } else if ( msg == "home()" ) { - qpedesktop-> home ( ); + qpedesktop-> home ( ); } #endif } void DesktopApplication::systemMessage( const QCString & msg, const QByteArray & data ) { #ifdef Q_WS_QWS QDataStream stream ( data, IO_ReadOnly ); if ( msg == "setScreenSaverInterval(int)" ) { int time; stream >> time; m_screensaver-> setInterval( time ); } else if ( msg == "setScreenSaverIntervals(int,int,int)" ) { int t1, t2, t3; stream >> t1 >> t2 >> t3; m_screensaver-> setIntervals( t1, t2, t3 ); } else if ( msg == "setBacklight(int)" ) { int bright; stream >> bright; m_screensaver-> setBacklight( bright ); @@ -654,103 +654,103 @@ void Desktop::checkMemory() #if defined(QPE_HAVE_MEMALERTER) static bool ignoreNormal = FALSE; static bool existingMessage = FALSE; if ( existingMessage ) return ; // don't show a second message while still on first existingMessage = TRUE; switch ( memstate ) { case Unknown: break; case Low: memstate = Unknown; if ( recoverMemory() ) ignoreNormal = TRUE; else QMessageBox::warning( 0 , "Memory Status", "The memory smacks of shortage. \n" "Please save data. " ); break; case Normal: memstate = Unknown; if ( ignoreNormal ) ignoreNormal = FALSE; - else - QMessageBox::information ( 0 , "Memory Status", - "There is enough memory again." ); +// else +// QMessageBox::information ( 0 , "Memory Status", +// "There is enough memory again." ); break; case VeryLow: memstate = Unknown; QMessageBox::critical( 0 , "Memory Status", "The memory is very low. \n" "Please end this application \n" "immediately." ); recoverMemory(); } existingMessage = FALSE; #endif } static bool isVisibleWindow( int wid ) { const QList<QWSWindow> &list = qwsServer->clientWindows(); QWSWindow* w; for ( QListIterator<QWSWindow> it( list ); ( w = it.current() ); ++it ) { if ( w->winId() == wid ) return !w->isFullyObscured(); } return FALSE; } static bool hasVisibleWindow( const QString& clientname ) { const QList<QWSWindow> &list = qwsServer->clientWindows(); QWSWindow* w; for ( QListIterator<QWSWindow> it( list ); ( w = it.current() ); ++it ) { if ( w->client() ->identity() == clientname && !w->isFullyObscured() ) return TRUE; } return FALSE; } void Desktop::raiseLauncher() { Config cfg( "qpe" ); //F12 'Home' cfg.setGroup( "AppsKey" ); QString tempItem; tempItem = cfg.readEntry( "Middle", "Home" ); if ( tempItem == "Home" || tempItem.isEmpty() ) { - home ( ); + home ( ); } else { QCopEnvelope e( "QPE/System", "execute(QString)" ); e << tempItem; } } void Desktop::home ( ) -{ +{ if ( isVisibleWindow( launcher->winId() ) ) launcher->nextView(); 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(); } } } |