author | sandman <sandman> | 2002-10-13 16:12:08 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-10-13 16:12:08 (UTC) |
commit | 467451d6d19a2cf5245afa2d219b7d2b1cd008f5 (patch) (side-by-side diff) | |
tree | 8c59b58615a817377c0ae1db10a4093387fdaa77 /core | |
parent | 92aabc976e4a8e58d7db0bba42cb8d0f3ebe8982 (diff) | |
download | opie-467451d6d19a2cf5245afa2d219b7d2b1cd008f5.zip opie-467451d6d19a2cf5245afa2d219b7d2b1cd008f5.tar.gz opie-467451d6d19a2cf5245afa2d219b7d2b1cd008f5.tar.bz2 |
- added qcop "QPE/System" "setDisplayState(int)" to toggle the LCD on/off
- removed qcop "QPE/Desktop" "home()" -- this is now handled via
qcop "QPE/Application/qpe" "raise()"
- renamed qcop "QPE/Desktop" "suspend()" to qcop "QPE/System" "suspend()"
-rw-r--r-- | core/launcher/desktop.cpp | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp index 6ee7132..0e60839 100644 --- a/core/launcher/desktop.cpp +++ b/core/launcher/desktop.cpp @@ -173,14 +173,16 @@ public: // Make sure the LCD is in fact on, (if opie was killed while the LCD is off it would still be off) ODevice::inst ( ) -> setDisplayStatus ( true ); } void restore() { - if ( !m_lcd_status ) // We must have turned it off + if ( !m_lcd_status ) { // We must have turned it off ODevice::inst ( ) -> setDisplayStatus ( true ); + m_lcd_status = true; + } setBacklight ( -3 ); } bool save( int level ) { switch ( level ) { @@ -300,12 +302,20 @@ public: bright = backlight ( ); ODevice::inst ( ) -> setDisplayBrightness ( bright ); m_backlight_bright = bright; } + void setDisplayState ( bool on ) + { + if ( m_lcd_status != on ) { + ODevice::inst ( ) -> setDisplayStatus ( on ); + m_lcd_status = on; + } + } + private: int m_disable_suspend; bool m_enable_dim; bool m_enable_lightoff; bool m_enable_onlylcdoff; @@ -374,18 +384,12 @@ void DesktopApplication::desktopMessage( const QCString &msg, const QByteArray & 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 ( ); - } #endif } void DesktopApplication::systemMessage( const QCString & msg, const QByteArray & data ) { @@ -409,12 +413,20 @@ void DesktopApplication::systemMessage( const QCString & msg, const QByteArray & } else if ( msg == "setScreenSaverMode(int)" ) { int mode; stream >> mode; m_screensaver-> setMode ( mode ); } + else if ( msg == "setDisplayState(int)" ) { + int state; + stream >> state; + m_screensaver-> setDisplayState ( state != 0 ); + } + else if ( msg == "suspend()" ) { + emit power(); + } #endif } enum MemState { Unknown, VeryLow, Low, Normal } memstate = Unknown; #ifdef Q_WS_QWS @@ -625,12 +637,14 @@ Desktop::Desktop() : rereadVolumes(); packageSlave = new PackageSlave( this ); connect( qApp, SIGNAL( volumeChanged( bool ) ), this, SLOT( rereadVolumes() ) ); qApp->installEventFilter( this ); + + qApp-> setMainWidget ( launcher ); } void Desktop::show() { login( TRUE ); QWidget::show(); |