author | sandman <sandman> | 2002-09-30 23:09:04 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-09-30 23:09:04 (UTC) |
commit | 61fdbd044d40cb3c93eab5a1ba262964a9413c66 (patch) (unidiff) | |
tree | db5cadc832dc402b53fc910b1d0ba3c7f26474ee /core/launcher/desktop.cpp | |
parent | 37a8266f4a32d07a27d453897febf1f25963a4d0 (diff) | |
download | opie-61fdbd044d40cb3c93eab5a1ba262964a9413c66.zip opie-61fdbd044d40cb3c93eab5a1ba262964a9413c66.tar.gz opie-61fdbd044d40cb3c93eab5a1ba262964a9413c66.tar.bz2 |
Removed the button mapping for H3800, since this is now handled in the
ODevice iPAQ keyfilter
-rw-r--r-- | core/launcher/desktop.cpp | 40 |
1 files changed, 10 insertions, 30 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 | |||
@@ -55,12 +55,14 @@ | |||
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 ) |
@@ -174,13 +176,13 @@ public: | |||
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 ) { |
@@ -316,14 +318,19 @@ private: | |||
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 ) |
@@ -1003,33 +1010,6 @@ void Desktop::screenClick() | |||
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 | } | ||