author | harlekin <harlekin> | 2002-08-29 18:11:07 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-08-29 18:11:07 (UTC) |
commit | e268d442ac16f94b8575c1f32e0e1962ce8b926f (patch) (unidiff) | |
tree | 0e518120be6910893b1f24c2caa7bfa664bca922 | |
parent | 6707dd2b7abf2fac4aef4025cf8e554577d0891c (diff) | |
download | opie-e268d442ac16f94b8575c1f32e0e1962ce8b926f.zip opie-e268d442ac16f94b8575c1f32e0e1962ce8b926f.tar.gz opie-e268d442ac16f94b8575c1f32e0e1962ce8b926f.tar.bz2 |
launch for ipaq 38xx mail on button F11 instead of showing the menu
-rw-r--r-- | core/launcher/desktop.cpp | 58 |
1 files changed, 32 insertions, 26 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp index 5aba8dd..8756d37 100644 --- a/core/launcher/desktop.cpp +++ b/core/launcher/desktop.cpp | |||
@@ -197,13 +197,12 @@ bool DesktopApplication::qwsEventFilter( QWSEvent *e ) | |||
197 | 197 | ||
198 | /* | 198 | /* |
199 | app that registers key/message to be sent back to the app, when it doesn't have focus, | 199 | app that registers key/message to be sent back to the app, when it doesn't have focus, |
200 | when user presses key, unless keyboard has been requested from app. | 200 | when user presses key, unless keyboard has been requested from app. |
201 | will not send multiple repeats if user holds key | 201 | will not send multiple repeats if user holds key |
202 | i.e. one shot | 202 | i.e. one shot |
203 | |||
204 | */ | 203 | */ |
205 | if (!keyRegisterList.isEmpty()) { | 204 | if (!keyRegisterList.isEmpty()) { |
206 | KeyRegisterList::Iterator it; | 205 | KeyRegisterList::Iterator it; |
207 | for( it = keyRegisterList.begin(); it != keyRegisterList.end(); ++it ) { | 206 | for( it = keyRegisterList.begin(); it != keyRegisterList.end(); ++it ) { |
208 | if ((*it).getKeyCode() == ke->simpleData.keycode && !autoRepeat && !keyboardGrabbed() && press) { | 207 | if ((*it).getKeyCode() == ke->simpleData.keycode && !autoRepeat && !keyboardGrabbed() && press) { |
209 | if(press) qDebug("press"); else qDebug("release"); | 208 | if(press) qDebug("press"); else qDebug("release"); |
@@ -528,35 +527,36 @@ void Desktop::raiseMenu() | |||
528 | { | 527 | { |
529 | Config cfg( "qpe" ); //F11, 'Menu | 528 | Config cfg( "qpe" ); //F11, 'Menu |
530 | cfg.setGroup( "AppsKey" ); | 529 | cfg.setGroup( "AppsKey" ); |
531 | QString tempItem; | 530 | QString tempItem; |
532 | tempItem = cfg.readEntry( "Right2nd" , "Popup Menu" ); | 531 | tempItem = cfg.readEntry( "Right2nd" , "Popup Menu" ); |
533 | if ( tempItem == "Popup Menu" || tempItem.isEmpty() ) { | 532 | if ( tempItem == "Popup Menu" || tempItem.isEmpty() ) { |
534 | Global::terminateBuiltin("calibrate"); | 533 | Global::terminateBuiltin( "calibrate" ); |
535 | tb->startMenu()->launch(); | 534 | tb->startMenu()->launch(); |
536 | } else { | 535 | } else { |
537 | QCopEnvelope e("QPE/System","execute(QString)"); | 536 | QCopEnvelope e("QPE/System","execute(QString)"); |
538 | e << tempItem; | 537 | e << tempItem; |
539 | } | 538 | } |
540 | } | 539 | } |
541 | 540 | ||
542 | void Desktop::raiseEmail() | 541 | void Desktop::raiseEmail() |
543 | { | 542 | { |
544 | Config cfg( "qpe" ); //F13, 'Mail' | 543 | Config cfg( "qpe" ); //F13, 'Mail' // only in zaurus, on ipaq mail key is F11 |
545 | cfg.setGroup( "AppsKey" ); | 544 | cfg.setGroup( "AppsKey" ); |
546 | QString tempItem; | 545 | QString tempItem; |
547 | tempItem = cfg.readEntry( "RightEnd", "Mail" ); | 546 | tempItem = cfg.readEntry( "RightEnd", "Mail" ); |
548 | if ( tempItem == "Mail" || tempItem == "qtmail" || tempItem.isEmpty() ) { | 547 | if ( tempItem == "Mail" || tempItem == "qtmail" || tempItem.isEmpty() ) { |
549 | tempItem = "mail"; | 548 | tempItem = "mail"; |
550 | } | 549 | } |
551 | QCopEnvelope e("QPE/System","execute(QString)"); | 550 | QCopEnvelope e("QPE/System","execute(QString)"); |
552 | e << tempItem; | 551 | e << tempItem; |
553 | } | 552 | } |
554 | 553 | ||
555 | // autoStarts apps on resume and start | 554 | // autoStarts apps on resume and start |
556 | void Desktop::execAutoStart() { | 555 | void Desktop::execAutoStart() |
556 | { | ||
557 | QString appName; | 557 | QString appName; |
558 | int delay; | 558 | int delay; |
559 | QDateTime now = QDateTime::currentDateTime(); | 559 | QDateTime now = QDateTime::currentDateTime(); |
560 | Config cfg( "autostart" ); | 560 | Config cfg( "autostart" ); |
561 | cfg.setGroup( "AutoStart" ); | 561 | cfg.setGroup( "AutoStart" ); |
562 | appName = cfg.readEntry( "Apps", "" ); | 562 | appName = cfg.readEntry( "Apps", "" ); |
@@ -761,46 +761,52 @@ void Desktop::rereadVolumes() | |||
761 | { | 761 | { |
762 | Config cfg("qpe"); | 762 | Config cfg("qpe"); |
763 | cfg.setGroup("Volume"); | 763 | cfg.setGroup("Volume"); |
764 | touchclick = cfg.readBoolEntry("TouchSound"); | 764 | touchclick = cfg.readBoolEntry("TouchSound"); |
765 | keyclick = cfg.readBoolEntry("KeySound"); | 765 | keyclick = cfg.readBoolEntry("KeySound"); |
766 | alarmsound = cfg.readBoolEntry("AlarmSound"); | 766 | alarmsound = cfg.readBoolEntry("AlarmSound"); |
767 | // Config cfg("Sound"); | ||
768 | // cfg.setGroup("System"); | ||
769 | // touchclick = cfg.readBoolEntry("Touch"); | ||
770 | // keyclick = cfg.readBoolEntry("Key"); | ||
771 | } | 767 | } |
772 | 768 | ||
773 | void Desktop::keyClick() | 769 | void Desktop::keyClick() |
774 | { | 770 | { |
775 | if ( keyclick ) | 771 | if ( keyclick ) |
776 | ODevice::inst ( )-> keySound ( ); | 772 | ODevice::inst ( )-> keySound ( ); |
777 | } | 773 | } |
778 | 774 | ||
779 | void Desktop::screenClick() | 775 | void Desktop::screenClick() |
780 | { | 776 | { |
781 | if ( touchclick ) | 777 | if ( touchclick ) |
782 | ODevice::inst ( )-> touchSound ( ); | 778 | ODevice::inst ( )-> touchSound ( ); |
783 | } | 779 | } |
784 | 780 | ||
785 | void Desktop::soundAlarm() | 781 | void Desktop::soundAlarm() |
786 | { | 782 | { |
787 | if ( qpedesktop-> alarmsound ) | 783 | if ( qpedesktop-> alarmsound ) |
788 | ODevice::inst ( )-> alarmSound ( ); | 784 | ODevice::inst ( )-> alarmSound ( ); |
789 | } | 785 | } |
790 | 786 | ||
791 | bool Desktop::eventFilter( QObject *, QEvent *ev ) | 787 | bool Desktop::eventFilter( QObject *, QEvent *ev ) |
792 | { | 788 | { |
793 | if ( ev-> type ( ) == QEvent::KeyPress ) { | 789 | if ( ev-> type ( ) == QEvent::KeyPress ) { |
794 | QKeyEvent *ke = (QKeyEvent *) ev; | 790 | QKeyEvent *ke = (QKeyEvent *) ev; |
795 | if ( ke-> key ( ) == Qt::Key_F11 ) { // menu key | 791 | if ( ke-> key ( ) == Qt::Key_F11 ) { // menu key |
796 | QWidget *active = qApp-> activeWindow ( ); | 792 | QWidget *active = qApp-> activeWindow ( ); |
797 | 793 | ||
798 | if ( active && active-> isPopup ( )) | 794 | if ( active && active-> isPopup ( )) |
799 | active->close(); | 795 | active->close(); |
800 | 796 | ||
801 | raiseMenu ( ); | 797 | /* |
802 | return true; | 798 | * On iPAQ 38xx that key is not the "menu key" but the mail key |
799 | * To not confuse the users, make it launch the mail app on 38xx | ||
800 | */ | ||
801 | if (ODevice::inst()->model() == OMODEL_iPAQ_H38xx ) { | ||
802 | QCopEnvelope e( "QPE/System", "execute(QString)" ); | ||
803 | e << QString( "mail" ); | ||
804 | return true; | ||
805 | } else { | ||
806 | raiseMenu ( ); | ||
807 | return true; | ||
808 | } | ||
809 | } | ||
803 | } | 810 | } |
804 | } | 811 | return false; |
805 | return false; | ||
806 | } | 812 | } |