-rw-r--r-- | core/launcher/desktop.cpp | 40 | ||||
-rw-r--r-- | core/launcher/desktop.h | 1 |
2 files changed, 10 insertions, 31 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp index 4640a12..68949e6 100644 --- a/core/launcher/desktop.cpp +++ b/core/launcher/desktop.cpp | |||
@@ -49,24 +49,26 @@ | |||
49 | #include <qgfx_qws.h> | 49 | #include <qgfx_qws.h> |
50 | #include <qmainwindow.h> | 50 | #include <qmainwindow.h> |
51 | #include <qmessagebox.h> | 51 | #include <qmessagebox.h> |
52 | #include <qtimer.h> | 52 | #include <qtimer.h> |
53 | #include <qwindowsystem_qws.h> | 53 | #include <qwindowsystem_qws.h> |
54 | 54 | ||
55 | #include <qvaluelist.h> | 55 | #include <qvaluelist.h> |
56 | 56 | ||
57 | #include <stdlib.h> | 57 | #include <stdlib.h> |
58 | #include <unistd.h> | 58 | #include <unistd.h> |
59 | #include <fcntl.h> | 59 | #include <fcntl.h> |
60 | 60 | ||
61 | using namespace Opie; | ||
62 | |||
61 | class QCopKeyRegister | 63 | class QCopKeyRegister |
62 | { | 64 | { |
63 | public: | 65 | public: |
64 | QCopKeyRegister() : keyCode( 0 ) | 66 | QCopKeyRegister() : keyCode( 0 ) |
65 | { } | 67 | { } |
66 | QCopKeyRegister( int k, const QString &c, const QString &m ) | 68 | QCopKeyRegister( int k, const QString &c, const QString &m ) |
67 | : keyCode( k ), channel( c ), message( m ) | 69 | : keyCode( k ), channel( c ), message( m ) |
68 | { } | 70 | { } |
69 | 71 | ||
70 | int getKeyCode() const | 72 | int getKeyCode() const |
71 | { | 73 | { |
72 | return keyCode; | 74 | return keyCode; |
@@ -168,25 +170,25 @@ public: | |||
168 | 170 | ||
169 | m_backlight_bright = -1; | 171 | m_backlight_bright = -1; |
170 | m_backlight_forcedoff = false; | 172 | m_backlight_forcedoff = false; |
171 | 173 | ||
172 | // Make sure the LCD is in fact on, (if opie was killed while the LCD is off it would still be off) | 174 | // Make sure the LCD is in fact on, (if opie was killed while the LCD is off it would still be off) |
173 | ODevice::inst ( ) -> setDisplayStatus ( true ); | 175 | ODevice::inst ( ) -> setDisplayStatus ( true ); |
174 | } | 176 | } |
175 | void restore() | 177 | void restore() |
176 | { | 178 | { |
177 | if ( !m_lcd_status ) // We must have turned it off | 179 | if ( !m_lcd_status ) // We must have turned it off |
178 | ODevice::inst ( ) -> setDisplayStatus ( true ); | 180 | ODevice::inst ( ) -> setDisplayStatus ( true ); |
179 | 181 | ||
180 | setBacklight ( -1 ); | 182 | setBacklight ( -3 ); |
181 | } | 183 | } |
182 | bool save( int level ) | 184 | bool save( int level ) |
183 | { | 185 | { |
184 | switch ( level ) { | 186 | switch ( level ) { |
185 | case 0: | 187 | case 0: |
186 | if ( m_disable_suspend > 0 && m_enable_dim ) { | 188 | if ( m_disable_suspend > 0 && m_enable_dim ) { |
187 | if ( backlight() > 1 ) | 189 | if ( backlight() > 1 ) |
188 | setBacklight( 1 ); // lowest non-off | 190 | setBacklight( 1 ); // lowest non-off |
189 | } | 191 | } |
190 | return true; | 192 | return true; |
191 | break; | 193 | break; |
192 | case 1: | 194 | case 1: |
@@ -310,26 +312,31 @@ private: | |||
310 | bool m_lcd_status; | 312 | bool m_lcd_status; |
311 | 313 | ||
312 | int m_backlight_bright; | 314 | int m_backlight_bright; |
313 | bool m_backlight_forcedoff; | 315 | bool m_backlight_forcedoff; |
314 | }; | 316 | }; |
315 | 317 | ||
316 | 318 | ||
317 | void DesktopApplication::switchLCD ( bool on ) | 319 | void DesktopApplication::switchLCD ( bool on ) |
318 | { | 320 | { |
319 | if ( qApp ) { | 321 | if ( qApp ) { |
320 | DesktopApplication *dapp = (DesktopApplication *) qApp; | 322 | DesktopApplication *dapp = (DesktopApplication *) qApp; |
321 | 323 | ||
322 | if ( dapp-> m_screensaver ) | 324 | if ( dapp-> m_screensaver ) { |
323 | dapp-> m_screensaver-> setBacklight ( on ? -3 : -1 ); | 325 | if ( on ) |
326 | dapp-> m_screensaver-> restore ( ); //setBacklight ( on ? -3 : -1 ); | ||
327 | else | ||
328 | dapp-> m_screensaver-> save ( 1 ); | ||
329 | |||
330 | } | ||
324 | } | 331 | } |
325 | } | 332 | } |
326 | 333 | ||
327 | 334 | ||
328 | DesktopApplication::DesktopApplication( int& argc, char **argv, Type appType ) | 335 | DesktopApplication::DesktopApplication( int& argc, char **argv, Type appType ) |
329 | : QPEApplication( argc, argv, appType ) | 336 | : QPEApplication( argc, argv, appType ) |
330 | { | 337 | { |
331 | 338 | ||
332 | QTimer * t = new QTimer( this ); | 339 | QTimer * t = new QTimer( this ); |
333 | connect( t, SIGNAL( timeout() ), this, SLOT( psTimeout() ) ); | 340 | connect( t, SIGNAL( timeout() ), this, SLOT( psTimeout() ) ); |
334 | t->start( 10000 ); | 341 | t->start( 10000 ); |
335 | ps = new PowerStatus; | 342 | ps = new PowerStatus; |
@@ -997,39 +1004,12 @@ void Desktop::keyClick() | |||
997 | void Desktop::screenClick() | 1004 | void Desktop::screenClick() |
998 | { | 1005 | { |
999 | if ( touchclick ) | 1006 | if ( touchclick ) |
1000 | ODevice::inst ( ) -> touchSound ( ); | 1007 | ODevice::inst ( ) -> touchSound ( ); |
1001 | } | 1008 | } |
1002 | 1009 | ||
1003 | void Desktop::soundAlarm() | 1010 | void Desktop::soundAlarm() |
1004 | { | 1011 | { |
1005 | if ( qpedesktop-> alarmsound ) | 1012 | if ( qpedesktop-> alarmsound ) |
1006 | ODevice::inst ( ) -> alarmSound ( ); | 1013 | ODevice::inst ( ) -> alarmSound ( ); |
1007 | } | 1014 | } |
1008 | 1015 | ||
1009 | bool Desktop::eventFilter( QObject *, QEvent *ev ) | ||
1010 | { | ||
1011 | if ( ev-> type ( ) == QEvent::KeyPress ) { | ||
1012 | QKeyEvent * ke = ( QKeyEvent * ) ev; | ||
1013 | if ( ke-> key ( ) == Qt::Key_F11 ) { // menu key | ||
1014 | QWidget * active = qApp-> activeWindow ( ); | ||
1015 | |||
1016 | if ( active && active-> isPopup ( ) ) | ||
1017 | active->close(); | ||
1018 | |||
1019 | /* | ||
1020 | * On iPAQ 38xx that key is not the "menu key" but the mail key | ||
1021 | * To not confuse the users, make it launch the mail app on 38xx | ||
1022 | */ | ||
1023 | if ( ODevice::inst() ->model() == OMODEL_iPAQ_H38xx ) { | ||
1024 | QCopEnvelope e( "QPE/System", "execute(QString)" ); | ||
1025 | e << QString( "mail" ); | ||
1026 | return true; | ||
1027 | } | ||
1028 | else { | ||
1029 | raiseMenu ( ); | ||
1030 | return true; | ||
1031 | } | ||
1032 | } | ||
1033 | } | ||
1034 | return false; | ||
1035 | } | ||
diff --git a/core/launcher/desktop.h b/core/launcher/desktop.h index b9ff39f..f7c3e3f 100644 --- a/core/launcher/desktop.h +++ b/core/launcher/desktop.h | |||
@@ -113,25 +113,24 @@ public slots: | |||
113 | void togglePower(); | 113 | void togglePower(); |
114 | void toggleLight(); | 114 | void toggleLight(); |
115 | void toggleNumLockState(); | 115 | void toggleNumLockState(); |
116 | void toggleCapsLockState(); | 116 | void toggleCapsLockState(); |
117 | void toggleSymbolInput(); | 117 | void toggleSymbolInput(); |
118 | void terminateServers(); | 118 | void terminateServers(); |
119 | void rereadVolumes(); | 119 | void rereadVolumes(); |
120 | 120 | ||
121 | protected: | 121 | protected: |
122 | void executeOrModify( const QString& appLnkFile ); | 122 | void executeOrModify( const QString& appLnkFile ); |
123 | void styleChange( QStyle & ); | 123 | void styleChange( QStyle & ); |
124 | void timerEvent( QTimerEvent *e ); | 124 | void timerEvent( QTimerEvent *e ); |
125 | bool eventFilter( QObject *, QEvent * ); | ||
126 | 125 | ||
127 | QWidget *bg; | 126 | QWidget *bg; |
128 | Launcher *launcher; | 127 | Launcher *launcher; |
129 | TaskBar *tb; | 128 | TaskBar *tb; |
130 | 129 | ||
131 | private: | 130 | private: |
132 | void startTransferServer(); | 131 | void startTransferServer(); |
133 | bool recoverMemory(); | 132 | bool recoverMemory(); |
134 | 133 | ||
135 | QCopBridge *qcopBridge; | 134 | QCopBridge *qcopBridge; |
136 | TransferServer *transferServer; | 135 | TransferServer *transferServer; |
137 | PackageSlave *packageSlave; | 136 | PackageSlave *packageSlave; |