summaryrefslogtreecommitdiff
path: root/core/launcher/desktop.cpp
Unidiff
Diffstat (limited to 'core/launcher/desktop.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/desktop.cpp58
1 files changed, 23 insertions, 35 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp
index ab4f14a..7662e48 100644
--- a/core/launcher/desktop.cpp
+++ b/core/launcher/desktop.cpp
@@ -40,12 +40,14 @@
40#include <qpe/global.h> 40#include <qpe/global.h>
41 41
42#if defined( QT_QWS_CUSTOM ) || defined( QT_QWS_IPAQ ) 42#if defined( QT_QWS_CUSTOM ) || defined( QT_QWS_IPAQ )
43#include <qpe/custom.h> 43#include <qpe/custom.h>
44#endif 44#endif
45 45
46#include <opie/odevice.h>
47
46#include <qgfx_qws.h> 48#include <qgfx_qws.h>
47#include <qmainwindow.h> 49#include <qmainwindow.h>
48#include <qmessagebox.h> 50#include <qmessagebox.h>
49#include <qtimer.h> 51#include <qtimer.h>
50#include <qwindowsystem_qws.h> 52#include <qwindowsystem_qws.h>
51 53
@@ -264,13 +266,13 @@ bool DesktopApplication::qwsEventFilter( QWSEvent *e )
264 if ( ke->simpleData.keycode == Key_NumLock ) { 266 if ( ke->simpleData.keycode == Key_NumLock ) {
265 if ( press ) emit numLockStateToggle(); 267 if ( press ) emit numLockStateToggle();
266 } 268 }
267 if ( ke->simpleData.keycode == Key_CapsLock ) { 269 if ( ke->simpleData.keycode == Key_CapsLock ) {
268 if ( press ) emit capsLockStateToggle(); 270 if ( press ) emit capsLockStateToggle();
269 } 271 }
270 if ( press ) 272 if (( press && !autoRepeat ) || ( !press && autoRepeat ))
271 qpedesktop->keyClick(); 273 qpedesktop->keyClick();
272 } else { 274 } else {
273 if ( e->type == QWSEvent::Mouse ) { 275 if ( e->type == QWSEvent::Mouse ) {
274 QWSMouseEvent *me = (QWSMouseEvent *)e; 276 QWSMouseEvent *me = (QWSMouseEvent *)e;
275 static bool up = TRUE; 277 static bool up = TRUE;
276 if ( me->simpleData.state&LeftButton ) { 278 if ( me->simpleData.state&LeftButton ) {
@@ -324,28 +326,20 @@ void DesktopApplication::sendCard()
324} 326}
325 327
326#if defined(QPE_HAVE_MEMALERTER) 328#if defined(QPE_HAVE_MEMALERTER)
327QPE_MEMALERTER_IMPL 329QPE_MEMALERTER_IMPL
328#endif 330#endif
329 331
330#if defined(CUSTOM_SOUND_IMPL)
331CUSTOM_SOUND_IMPL
332#endif
333
334//=========================================================================== 332//===========================================================================
335 333
336Desktop::Desktop() : 334Desktop::Desktop() :
337 QWidget( 0, 0, WStyle_Tool | WStyle_Customize ), 335 QWidget( 0, 0, WStyle_Tool | WStyle_Customize ),
338 qcopBridge( 0 ), 336 qcopBridge( 0 ),
339 transferServer( 0 ), 337 transferServer( 0 ),
340 packageSlave( 0 ) 338 packageSlave( 0 )
341{ 339{
342#ifdef CUSTOM_SOUND_INIT
343 CUSTOM_SOUND_INIT;
344#endif
345
346 qpedesktop = this; 340 qpedesktop = this;
347 341
348// bg = new Info( this ); 342// bg = new Info( this );
349 tb = new TaskBar; 343 tb = new TaskBar;
350 344
351 launcher = new Launcher( 0, 0, WStyle_Customize | QWidget::WGroupLeader ); 345 launcher = new Launcher( 0, 0, WStyle_Customize | QWidget::WGroupLeader );
@@ -753,44 +747,38 @@ void Desktop::rereadVolumes()
753// touchclick = cfg.readBoolEntry("Touch"); 747// touchclick = cfg.readBoolEntry("Touch");
754// keyclick = cfg.readBoolEntry("Key"); 748// keyclick = cfg.readBoolEntry("Key");
755} 749}
756 750
757void Desktop::keyClick() 751void Desktop::keyClick()
758{ 752{
759#ifdef CUSTOM_SOUND_KEYCLICK 753 if ( keyclick )
760 if ( keyclick ) 754 ODevice::inst ( )-> keySound ( );
761 CUSTOM_SOUND_KEYCLICK;
762#endif
763} 755}
764 756
765void Desktop::screenClick() 757void Desktop::screenClick()
766{ 758{
767#ifdef CUSTOM_SOUND_TOUCH 759 if ( touchclick )
768 if ( touchclick ) 760 ODevice::inst ( )-> touchSound ( );
769 CUSTOM_SOUND_TOUCH;
770#endif
771} 761}
772 762
773void Desktop::soundAlarm() 763void Desktop::soundAlarm()
774{ 764{
775#ifdef CUSTOM_SOUND_ALARM 765 if ( qpedesktop-> alarmsound )
776 if (qpedesktop->alarmsound) 766 ODevice::inst ( )-> alarmSound ( );
777 CUSTOM_SOUND_ALARM;
778#endif
779} 767}
780 768
781bool Desktop::eventFilter( QObject *w, QEvent *ev ) 769bool Desktop::eventFilter( QObject *, QEvent *ev )
782{ 770{
783 if ( ev->type() == QEvent::KeyPress ) { 771 if ( ev-> type ( ) == QEvent::KeyPress ) {
784 QKeyEvent *ke = (QKeyEvent *)ev; 772 QKeyEvent *ke = (QKeyEvent *) ev;
785 if ( ke->key() == Qt::Key_F11 ) { // menu key 773 if ( ke-> key ( ) == Qt::Key_F11 ) { // menu key
786 QWidget *active = qApp->activeWindow(); 774 QWidget *active = qApp-> activeWindow ( );
787 if ( active && active->isPopup() ) { 775
788 active->close(); 776 if ( active && active-> isPopup ( ))
789 } 777 active->close();
790 raiseMenu();
791 return TRUE;
792 }
793 }
794 return FALSE;
795}
796 778
779 raiseMenu ( );
780 return true;
781 }
782 }
783 return false;
784}