author | sandman <sandman> | 2002-11-25 01:14:19 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-11-25 01:14:19 (UTC) |
commit | 1b4665ddf28fdb59810b90138a5a88f87a2d9bc6 (patch) (side-by-side diff) | |
tree | 14254d02145e88f1970f3c26af4ad006ab00c15a | |
parent | da8050fe68a443773447ee176793a30df256ea9b (diff) | |
download | opie-1b4665ddf28fdb59810b90138a5a88f87a2d9bc6.zip opie-1b4665ddf28fdb59810b90138a5a88f87a2d9bc6.tar.gz opie-1b4665ddf28fdb59810b90138a5a88f87a2d9bc6.tar.bz2 |
*** empty log message ***
-rw-r--r-- | core/launcher/desktop.cpp | 23 | ||||
-rw-r--r-- | core/launcher/desktop.h | 1 | ||||
-rw-r--r-- | core/launcher/startmenu.cpp | 7 |
3 files changed, 10 insertions, 21 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp index 3e8c731..34b52d2 100644 --- a/core/launcher/desktop.cpp +++ b/core/launcher/desktop.cpp @@ -307,100 +307,100 @@ bool DesktopApplication::qwsEventFilter( QWSEvent *e ) qpedesktop->checkMemory(); if ( e->type == QWSEvent::Key ) { QWSKeyEvent * ke = ( QWSKeyEvent * ) e; if ( !loggedin && ke->simpleData.keycode != Key_F34 ) return TRUE; bool press = ke->simpleData.is_press; bool autoRepeat = ke->simpleData.is_auto_repeat; /* app that registers key/message to be sent back to the app, when it doesn't have focus, when user presses key, unless keyboard has been requested from app. will not send multiple repeats if user holds key i.e. one shot */ if ( !keyRegisterList.isEmpty() && ke->simpleData.keycode !=0 && press) { // qDebug("<<<<<<<<<<<<<keycode %d", ke->simpleData.keycode); KeyRegisterList::Iterator it; for ( it = keyRegisterList.begin(); it != keyRegisterList.end(); ++it ) { if ( ( *it ).getKeyCode() == ke->simpleData.keycode && !autoRepeat && !keyboardGrabbed() ) { if ( press ) qDebug( "press" ); else qDebug( "release" ); QCopEnvelope( ( *it ).getChannel().utf8(), ( *it ).getMessage().utf8() ); } } } if ( !keyboardGrabbed() ) { if ( ke->simpleData.keycode == Key_F9 ) { if ( press ) emit datebook(); return TRUE; } if ( ke->simpleData.keycode == Key_F10 ) { 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; } -// 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; } } if ( ke->simpleData.keycode == Key_F34 ) { if ( press ) emit power(); return TRUE; } // This was used for the iPAQ PowerButton // See main.cpp for new KeyboardFilter // // if ( ke->simpleData.keycode == Key_SysReq ) { // if ( press ) emit power(); // return TRUE; // } if ( ke->simpleData.keycode == Key_F35 ) { if ( press ) emit backlight(); return TRUE; } if ( ke->simpleData.keycode == Key_F32 ) { if ( press ) QCopEnvelope e( "QPE/Desktop", "startSync()" ); return TRUE; } if ( ke->simpleData.keycode == Key_F31 && !ke->simpleData.modifiers ) { if ( press ) emit symbol(); return TRUE; } if ( ke->simpleData.keycode == Key_NumLock ) { if ( press ) emit numLockStateToggle(); } if ( ke->simpleData.keycode == Key_CapsLock ) { if ( press ) @@ -858,63 +858,48 @@ void Desktop::startTransferServer() delete transferServer; transferServer = 0; } if ( !transferServer || !qcopBridge ) startTimer( 2000 ); } void Desktop::timerEvent( QTimerEvent *e ) { killTimer( e->timerId() ); startTransferServer(); } void Desktop::terminateServers() { delete transferServer; delete qcopBridge; transferServer = 0; qcopBridge = 0; } void Desktop::rereadVolumes() { Config cfg( "qpe" ); cfg.setGroup( "Volume" ); touchclick = cfg.readBoolEntry( "TouchSound" ); keyclick = cfg.readBoolEntry( "KeySound" ); alarmsound = cfg.readBoolEntry( "AlarmSound" ); } void Desktop::keyClick() { if ( keyclick ) ODevice::inst ( ) -> keySound ( ); } 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 f6059b8..13f28b3 100644 --- a/core/launcher/desktop.h +++ b/core/launcher/desktop.h @@ -85,69 +85,68 @@ private: PowerStatus *m_ps, *m_ps_last; QTimer *cardSendTimer; QCopChannel *channel; OpieScreenSaver *m_screensaver; QTimer * m_timer; int m_powerVeryLow; int m_powerCritical; int m_currentPowerLevel; }; class Desktop : public QWidget { Q_OBJECT public: Desktop(); ~Desktop(); static bool screenLocked(); void show(); void checkMemory(); void keyClick(); void screenClick(); static void soundAlarm(); public slots: void raiseDatebook(); void raiseContacts(); void raiseMenu(); void raiseLauncher(); void raiseEmail(); void execAutoStart(); void togglePower(); void toggleLight(); 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; QDateTime suspendTime; bool keyclick, touchclick, alarmsound; }; #endif // __DESKTOP_H__ diff --git a/core/launcher/startmenu.cpp b/core/launcher/startmenu.cpp index d9382d2..e663072 100644 --- a/core/launcher/startmenu.cpp +++ b/core/launcher/startmenu.cpp @@ -202,99 +202,104 @@ bool StartMenu::loadMenu( AppLnkSet *folder, QPopupMenu *menu ) QListIterator<AppLnk> it( folder->children() ); bool f=TRUE; for ( ; it.current(); ++it ) { AppLnk *app = it.current(); if ( app->type() == "Separator" ) { // No tr if ( lot ) { menu->insertSeparator(); } } else { f = FALSE; QString t = app->type(); QPopupMenu* pmenu = typpop.find(t); if ( ltabs ) { if ( !pmenu && lot ) pmenu = menu; } else { if ( !pmenu ) pmenu = menu; else pmenu = 0; } if ( pmenu ) { QString t = app->name(); t.replace(QRegExp("&"),"&&"); // escape shortcut character pmenu->insertItem( app->pixmap(), t, app->id() ); } result=TRUE; } } } if ( sepId && ( menu-> idAt ( 0 ) == sepId )) { // no tabs entries menu-> removeItem ( sepId ); sepId = 0; } if ( !menu-> count ( )) // if we don't do this QPopupMenu will insert a dummy Separator, which won't go away later sepId = menu-> insertSeparator ( ); return result; } void StartMenu::launch() { int y = mapToGlobal( QPoint() ).y() - launchMenu->sizeHint().height(); if ( launchMenu->isVisible() ) launchMenu->hide(); - else + else { + QWidget *active = qApp->activeWindow(); + if ( active && active->isPopup() ) + active->close(); + launchMenu->popup( QPoint( 1, y ) ); } +} const AppLnk* StartMenu::execToLink(const QString& appname) { const AppLnk* a = apps->findExec( appname ); return a; } void StartPopupMenu::keyPressEvent( QKeyEvent *e ) { if ( e->key() == Key_F33 || e->key() == Key_Space ) { // "OK" button, little hacky QKeyEvent ke(QEvent::KeyPress, Key_Enter, 13, 0); QPopupMenu::keyPressEvent( &ke ); } else { QPopupMenu::keyPressEvent( e ); } } static int compareAppletPositions(const void *a, const void *b) { const MenuApplet* aa = *(const MenuApplet**)a; const MenuApplet* ab = *(const MenuApplet**)b; int d = aa->iface->position() - ab->iface->position(); if ( d ) return d; return QString::compare(aa->library->library(),ab->library->library()); } void StartMenu::clearApplets() { launchMenu-> hide(); for ( QIntDictIterator<MenuApplet> it ( applets ); it. current ( ); ++it ) { MenuApplet *applet = it. current ( ); if ( launchMenu ) { launchMenu-> removeItem ( applet-> id ); delete applet-> popup; } applet-> iface-> release(); applet-> library-> unload(); delete applet-> library; } applets.clear(); } void StartMenu::loadApplets() |