summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-10-20 23:00:49 (UTC)
committer llornkcor <llornkcor>2002-10-20 23:00:49 (UTC)
commit8bbd3bca858939b15b8775b4811149b8d83bb6cc (patch) (side-by-side diff)
tree3ec2f82cf31c49debdf46f21746c71c0d69ec1db
parent706b3e155ad713f388606b4ae15c70a2be4c2294 (diff)
downloadopie-8bbd3bca858939b15b8775b4811149b8d83bb6cc.zip
opie-8bbd3bca858939b15b8775b4811149b8d83bb6cc.tar.gz
opie-8bbd3bca858939b15b8775b4811149b8d83bb6cc.tar.bz2
better implementation of F11 menu handling
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/desktop.cpp23
-rw-r--r--core/launcher/desktop.h1
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 )
if ( !press && cardSendTimer ) {
emit contacts();
delete cardSendTimer;
}
else if ( press ) {
cardSendTimer = new QTimer();
cardSendTimer->start( 2000, TRUE );
connect( cardSendTimer, SIGNAL( timeout() ), this, SLOT( sendCard() ) );
}
return TRUE;
}
// menu key now opens application menu/toolbar
- if ( ke->simpleData.keycode == Key_F11 ) {
- if ( press ) emit menu();
- return TRUE;
- }
+// if ( ke->simpleData.keycode == Key_F11 ) {
+// if ( press ) emit menu();
+// return TRUE;
+// }
if ( ke->simpleData.keycode == Key_F12 ) {
while ( activePopupWidget() )
activePopupWidget() ->close();
if ( press )
emit launch();
return TRUE;
}
if ( ke->simpleData.keycode == Key_F13 ) {
if ( press )
emit email();
return TRUE;
@@ -1038,12 +1038,27 @@ void Desktop::keyClick()
void Desktop::screenClick()
{
if ( touchclick )
ODevice::inst ( ) -> touchSound ( );
}
void Desktop::soundAlarm()
{
if ( qpedesktop-> alarmsound )
ODevice::inst ( ) -> alarmSound ( );
}
+bool Desktop::eventFilter( QObject *, QEvent *ev )
+{
+ if ( ev->type() == QEvent::KeyPress ) {
+ QKeyEvent *ke = (QKeyEvent *)ev;
+ if ( ke->key() == Qt::Key_F11 ) { // menu key
+ QWidget *active = qApp->activeWindow();
+ if ( active && active->isPopup() ) {
+ active->close();
+ }
+ raiseMenu();
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
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:
void toggleNumLockState();
void toggleCapsLockState();
void toggleSymbolInput();
void terminateServers();
void rereadVolumes();
void home ( );
protected:
void executeOrModify( const QString& appLnkFile );
void styleChange( QStyle & );
void timerEvent( QTimerEvent *e );
+ bool eventFilter( QObject *, QEvent * );
QWidget *bg;
Launcher *launcher;
TaskBar *tb;
private:
void startTransferServer();
bool recoverMemory();
QCopBridge *qcopBridge;
TransferServer *transferServer;
PackageSlave *packageSlave;