author | llornkcor <llornkcor> | 2002-10-20 23:00:49 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-10-20 23:00:49 (UTC) |
commit | 8bbd3bca858939b15b8775b4811149b8d83bb6cc (patch) (unidiff) | |
tree | 3ec2f82cf31c49debdf46f21746c71c0d69ec1db | |
parent | 706b3e155ad713f388606b4ae15c70a2be4c2294 (diff) | |
download | opie-8bbd3bca858939b15b8775b4811149b8d83bb6cc.zip opie-8bbd3bca858939b15b8775b4811149b8d83bb6cc.tar.gz opie-8bbd3bca858939b15b8775b4811149b8d83bb6cc.tar.bz2 |
better implementation of F11 menu handling
-rw-r--r-- | core/launcher/desktop.cpp | 23 | ||||
-rw-r--r-- | core/launcher/desktop.h | 1 |
2 files changed, 20 insertions, 4 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp index 9863187..387650b 100644 --- a/core/launcher/desktop.cpp +++ b/core/launcher/desktop.cpp | |||
@@ -467,28 +467,28 @@ bool DesktopApplication::qwsEventFilter( QWSEvent *e ) | |||
467 | if ( !press && cardSendTimer ) { | 467 | if ( !press && cardSendTimer ) { |
468 | emit contacts(); | 468 | emit contacts(); |
469 | delete cardSendTimer; | 469 | delete cardSendTimer; |
470 | } | 470 | } |
471 | else if ( press ) { | 471 | else if ( press ) { |
472 | cardSendTimer = new QTimer(); | 472 | cardSendTimer = new QTimer(); |
473 | cardSendTimer->start( 2000, TRUE ); | 473 | cardSendTimer->start( 2000, TRUE ); |
474 | connect( cardSendTimer, SIGNAL( timeout() ), this, SLOT( sendCard() ) ); | 474 | connect( cardSendTimer, SIGNAL( timeout() ), this, SLOT( sendCard() ) ); |
475 | } | 475 | } |
476 | return TRUE; | 476 | return TRUE; |
477 | } | 477 | } |
478 | // menu key now opens application menu/toolbar | 478 | // menu key now opens application menu/toolbar |
479 | if ( ke->simpleData.keycode == Key_F11 ) { | 479 | // if ( ke->simpleData.keycode == Key_F11 ) { |
480 | if ( press ) emit menu(); | 480 | // if ( press ) emit menu(); |
481 | return TRUE; | 481 | // return TRUE; |
482 | } | 482 | // } |
483 | 483 | ||
484 | if ( ke->simpleData.keycode == Key_F12 ) { | 484 | if ( ke->simpleData.keycode == Key_F12 ) { |
485 | while ( activePopupWidget() ) | 485 | while ( activePopupWidget() ) |
486 | activePopupWidget() ->close(); | 486 | activePopupWidget() ->close(); |
487 | if ( press ) | 487 | if ( press ) |
488 | emit launch(); | 488 | emit launch(); |
489 | return TRUE; | 489 | return TRUE; |
490 | } | 490 | } |
491 | if ( ke->simpleData.keycode == Key_F13 ) { | 491 | if ( ke->simpleData.keycode == Key_F13 ) { |
492 | if ( press ) | 492 | if ( press ) |
493 | emit email(); | 493 | emit email(); |
494 | return TRUE; | 494 | return TRUE; |
@@ -1038,12 +1038,27 @@ void Desktop::keyClick() | |||
1038 | void Desktop::screenClick() | 1038 | void Desktop::screenClick() |
1039 | { | 1039 | { |
1040 | if ( touchclick ) | 1040 | if ( touchclick ) |
1041 | ODevice::inst ( ) -> touchSound ( ); | 1041 | ODevice::inst ( ) -> touchSound ( ); |
1042 | } | 1042 | } |
1043 | 1043 | ||
1044 | void Desktop::soundAlarm() | 1044 | void Desktop::soundAlarm() |
1045 | { | 1045 | { |
1046 | if ( qpedesktop-> alarmsound ) | 1046 | if ( qpedesktop-> alarmsound ) |
1047 | ODevice::inst ( ) -> alarmSound ( ); | 1047 | ODevice::inst ( ) -> alarmSound ( ); |
1048 | } | 1048 | } |
1049 | 1049 | ||
1050 | bool Desktop::eventFilter( QObject *, QEvent *ev ) | ||
1051 | { | ||
1052 | if ( ev->type() == QEvent::KeyPress ) { | ||
1053 | QKeyEvent *ke = (QKeyEvent *)ev; | ||
1054 | if ( ke->key() == Qt::Key_F11 ) { // menu key | ||
1055 | QWidget *active = qApp->activeWindow(); | ||
1056 | if ( active && active->isPopup() ) { | ||
1057 | active->close(); | ||
1058 | } | ||
1059 | raiseMenu(); | ||
1060 | return TRUE; | ||
1061 | } | ||
1062 | } | ||
1063 | return FALSE; | ||
1064 | } | ||
diff --git a/core/launcher/desktop.h b/core/launcher/desktop.h index 5de85f4..04c2f61 100644 --- a/core/launcher/desktop.h +++ b/core/launcher/desktop.h | |||
@@ -116,24 +116,25 @@ public slots: | |||
116 | void toggleNumLockState(); | 116 | void toggleNumLockState(); |
117 | void toggleCapsLockState(); | 117 | void toggleCapsLockState(); |
118 | void toggleSymbolInput(); | 118 | void toggleSymbolInput(); |
119 | void terminateServers(); | 119 | void terminateServers(); |
120 | void rereadVolumes(); | 120 | void rereadVolumes(); |
121 | 121 | ||
122 | void home ( ); | 122 | void home ( ); |
123 | 123 | ||
124 | protected: | 124 | protected: |
125 | void executeOrModify( const QString& appLnkFile ); | 125 | void executeOrModify( const QString& appLnkFile ); |
126 | void styleChange( QStyle & ); | 126 | void styleChange( QStyle & ); |
127 | void timerEvent( QTimerEvent *e ); | 127 | void timerEvent( QTimerEvent *e ); |
128 | bool eventFilter( QObject *, QEvent * ); | ||
128 | 129 | ||
129 | QWidget *bg; | 130 | QWidget *bg; |
130 | Launcher *launcher; | 131 | Launcher *launcher; |
131 | TaskBar *tb; | 132 | TaskBar *tb; |
132 | 133 | ||
133 | private: | 134 | private: |
134 | void startTransferServer(); | 135 | void startTransferServer(); |
135 | bool recoverMemory(); | 136 | bool recoverMemory(); |
136 | 137 | ||
137 | QCopBridge *qcopBridge; | 138 | QCopBridge *qcopBridge; |
138 | TransferServer *transferServer; | 139 | TransferServer *transferServer; |
139 | PackageSlave *packageSlave; | 140 | PackageSlave *packageSlave; |