-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 | |||
@@ -339,36 +339,36 @@ bool DesktopApplication::qwsEventFilter( QWSEvent *e ) | |||
339 | emit datebook(); | 339 | emit datebook(); |
340 | return TRUE; | 340 | return TRUE; |
341 | } | 341 | } |
342 | if ( ke->simpleData.keycode == Key_F10 ) { | 342 | if ( ke->simpleData.keycode == Key_F10 ) { |
343 | if ( !press && cardSendTimer ) { | 343 | if ( !press && cardSendTimer ) { |
344 | emit contacts(); | 344 | emit contacts(); |
345 | delete cardSendTimer; | 345 | delete cardSendTimer; |
346 | } | 346 | } |
347 | else if ( press ) { | 347 | else if ( press ) { |
348 | cardSendTimer = new QTimer(); | 348 | cardSendTimer = new QTimer(); |
349 | cardSendTimer->start( 2000, TRUE ); | 349 | cardSendTimer->start( 2000, TRUE ); |
350 | connect( cardSendTimer, SIGNAL( timeout() ), this, SLOT( sendCard() ) ); | 350 | connect( cardSendTimer, SIGNAL( timeout() ), this, SLOT( sendCard() ) ); |
351 | } | 351 | } |
352 | return TRUE; | 352 | return TRUE; |
353 | } | 353 | } |
354 | 354 | ||
355 | // if ( ke->simpleData.keycode == Key_F11 ) { | 355 | if ( ke->simpleData.keycode == Key_F11 ) { |
356 | // if ( press ) emit menu(); | 356 | if ( press ) emit menu(); |
357 | // return TRUE; | 357 | return TRUE; |
358 | // } | 358 | } |
359 | 359 | ||
360 | if ( ke->simpleData.keycode == Key_F12 ) { | 360 | if ( ke->simpleData.keycode == Key_F12 ) { |
361 | while ( activePopupWidget() ) | 361 | while ( activePopupWidget() ) |
362 | activePopupWidget() ->close(); | 362 | activePopupWidget() ->close(); |
363 | if ( press ) | 363 | if ( press ) |
364 | emit launch(); | 364 | emit launch(); |
365 | return TRUE; | 365 | return TRUE; |
366 | } | 366 | } |
367 | if ( ke->simpleData.keycode == Key_F13 ) { | 367 | if ( ke->simpleData.keycode == Key_F13 ) { |
368 | if ( press ) | 368 | if ( press ) |
369 | emit email(); | 369 | emit email(); |
370 | return TRUE; | 370 | return TRUE; |
371 | } | 371 | } |
372 | } | 372 | } |
373 | 373 | ||
374 | if ( ke->simpleData.keycode == Key_F34 ) { | 374 | if ( ke->simpleData.keycode == Key_F34 ) { |
@@ -890,31 +890,16 @@ void Desktop::keyClick() | |||
890 | if ( keyclick ) | 890 | if ( keyclick ) |
891 | ODevice::inst ( ) -> keySound ( ); | 891 | ODevice::inst ( ) -> keySound ( ); |
892 | } | 892 | } |
893 | 893 | ||
894 | void Desktop::screenClick() | 894 | void Desktop::screenClick() |
895 | { | 895 | { |
896 | if ( touchclick ) | 896 | if ( touchclick ) |
897 | ODevice::inst ( ) -> touchSound ( ); | 897 | ODevice::inst ( ) -> touchSound ( ); |
898 | } | 898 | } |
899 | 899 | ||
900 | void Desktop::soundAlarm() | 900 | void Desktop::soundAlarm() |
901 | { | 901 | { |
902 | if ( qpedesktop-> alarmsound ) | 902 | if ( qpedesktop-> alarmsound ) |
903 | ODevice::inst ( ) -> alarmSound ( ); | 903 | ODevice::inst ( ) -> alarmSound ( ); |
904 | } | 904 | } |
905 | 905 | ||
906 | bool Desktop::eventFilter( QObject *, QEvent *ev ) | ||
907 | { | ||
908 | if ( ev->type() == QEvent::KeyPress ) { | ||
909 | QKeyEvent *ke = (QKeyEvent *)ev; | ||
910 | if ( ke->key() == Qt::Key_F11 ) { // menu key | ||
911 | QWidget *active = qApp->activeWindow(); | ||
912 | if ( active && active->isPopup() ) { | ||
913 | active->close(); | ||
914 | } | ||
915 | raiseMenu(); | ||
916 | return TRUE; | ||
917 | } | ||
918 | } | ||
919 | return FALSE; | ||
920 | } | ||
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 | |||
@@ -117,33 +117,32 @@ public slots: | |||
117 | void raiseEmail(); | 117 | void raiseEmail(); |
118 | void execAutoStart(); | 118 | void execAutoStart(); |
119 | void togglePower(); | 119 | void togglePower(); |
120 | void toggleLight(); | 120 | void toggleLight(); |
121 | void toggleNumLockState(); | 121 | void toggleNumLockState(); |
122 | void toggleCapsLockState(); | 122 | void toggleCapsLockState(); |
123 | void toggleSymbolInput(); | 123 | void toggleSymbolInput(); |
124 | void terminateServers(); | 124 | void terminateServers(); |
125 | void rereadVolumes(); | 125 | void rereadVolumes(); |
126 | 126 | ||
127 | void home ( ); | 127 | void home ( ); |
128 | 128 | ||
129 | protected: | 129 | protected: |
130 | void executeOrModify( const QString& appLnkFile ); | 130 | void executeOrModify( const QString& appLnkFile ); |
131 | void styleChange( QStyle & ); | 131 | void styleChange( QStyle & ); |
132 | void timerEvent( QTimerEvent *e ); | 132 | void timerEvent( QTimerEvent *e ); |
133 | bool eventFilter( QObject *, QEvent * ); | ||
134 | 133 | ||
135 | QWidget *bg; | 134 | QWidget *bg; |
136 | Launcher *launcher; | 135 | Launcher *launcher; |
137 | TaskBar *tb; | 136 | TaskBar *tb; |
138 | 137 | ||
139 | private: | 138 | private: |
140 | void startTransferServer(); | 139 | void startTransferServer(); |
141 | bool recoverMemory(); | 140 | bool recoverMemory(); |
142 | 141 | ||
143 | QCopBridge *qcopBridge; | 142 | QCopBridge *qcopBridge; |
144 | TransferServer *transferServer; | 143 | TransferServer *transferServer; |
145 | PackageSlave *packageSlave; | 144 | PackageSlave *packageSlave; |
146 | 145 | ||
147 | QDateTime suspendTime; | 146 | QDateTime suspendTime; |
148 | bool keyclick, touchclick, alarmsound; | 147 | bool keyclick, touchclick, alarmsound; |
149 | }; | 148 | }; |
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 | |||
@@ -234,34 +234,39 @@ bool StartMenu::loadMenu( AppLnkSet *folder, QPopupMenu *menu ) | |||
234 | menu-> removeItem ( sepId ); | 234 | menu-> removeItem ( sepId ); |
235 | sepId = 0; | 235 | sepId = 0; |
236 | } | 236 | } |
237 | if ( !menu-> count ( )) // if we don't do this QPopupMenu will insert a dummy Separator, which won't go away later | 237 | if ( !menu-> count ( )) // if we don't do this QPopupMenu will insert a dummy Separator, which won't go away later |
238 | sepId = menu-> insertSeparator ( ); | 238 | sepId = menu-> insertSeparator ( ); |
239 | 239 | ||
240 | return result; | 240 | return result; |
241 | } | 241 | } |
242 | 242 | ||
243 | 243 | ||
244 | void StartMenu::launch() | 244 | void StartMenu::launch() |
245 | { | 245 | { |
246 | int y = mapToGlobal( QPoint() ).y() - launchMenu->sizeHint().height(); | 246 | int y = mapToGlobal( QPoint() ).y() - launchMenu->sizeHint().height(); |
247 | 247 | ||
248 | if ( launchMenu->isVisible() ) | 248 | if ( launchMenu->isVisible() ) |
249 | launchMenu->hide(); | 249 | launchMenu->hide(); |
250 | else | 250 | else { |
251 | QWidget *active = qApp->activeWindow(); | ||
252 | if ( active && active->isPopup() ) | ||
253 | active->close(); | ||
254 | |||
251 | launchMenu->popup( QPoint( 1, y ) ); | 255 | launchMenu->popup( QPoint( 1, y ) ); |
256 | } | ||
252 | } | 257 | } |
253 | 258 | ||
254 | const AppLnk* StartMenu::execToLink(const QString& appname) | 259 | const AppLnk* StartMenu::execToLink(const QString& appname) |
255 | { | 260 | { |
256 | const AppLnk* a = apps->findExec( appname ); | 261 | const AppLnk* a = apps->findExec( appname ); |
257 | return a; | 262 | return a; |
258 | } | 263 | } |
259 | 264 | ||
260 | void StartPopupMenu::keyPressEvent( QKeyEvent *e ) | 265 | void StartPopupMenu::keyPressEvent( QKeyEvent *e ) |
261 | { | 266 | { |
262 | if ( e->key() == Key_F33 || e->key() == Key_Space ) { | 267 | if ( e->key() == Key_F33 || e->key() == Key_Space ) { |
263 | // "OK" button, little hacky | 268 | // "OK" button, little hacky |
264 | QKeyEvent ke(QEvent::KeyPress, Key_Enter, 13, 0); | 269 | QKeyEvent ke(QEvent::KeyPress, Key_Enter, 13, 0); |
265 | QPopupMenu::keyPressEvent( &ke ); | 270 | QPopupMenu::keyPressEvent( &ke ); |
266 | } else { | 271 | } else { |
267 | QPopupMenu::keyPressEvent( e ); | 272 | QPopupMenu::keyPressEvent( e ); |