summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/desktop.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp
index 6771a66..693e77f 100644
--- a/core/launcher/desktop.cpp
+++ b/core/launcher/desktop.cpp
@@ -1,91 +1,89 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#include "desktop.h" 21#include "desktop.h"
22#include "info.h" 22#include "info.h"
23#include "launcher.h" 23#include "launcher.h"
24#include "mrulist.h" 24#include "mrulist.h"
25#include "qcopbridge.h" 25#include "qcopbridge.h"
26#include "shutdownimpl.h" 26#include "shutdownimpl.h"
27#include "startmenu.h" 27#include "startmenu.h"
28#include "taskbar.h" 28#include "taskbar.h"
29#include "transferserver.h" 29#include "transferserver.h"
30#include "irserver.h" 30#include "irserver.h"
31#include "packageslave.h" 31#include "packageslave.h"
32 32
33#include <qpe/applnk.h> 33#include <qpe/applnk.h>
34#include <qpe/mimetype.h> 34#include <qpe/mimetype.h>
35#include <qpe/password.h> 35#include <qpe/password.h>
36#include <qpe/config.h> 36#include <qpe/config.h>
37#include <qpe/power.h> 37#include <qpe/power.h>
38#include <qpe/timeconversion.h> 38#include <qpe/timeconversion.h>
39#include <qpe/qcopenvelope_qws.h> 39#include <qpe/qcopenvelope_qws.h>
40#include <qpe/global.h> 40#include <qpe/global.h>
41#ifdef QT_QWS_CUSTOM 41#include <qpe/custom.h>
42#include "qpe/custom.h"
43#endif
44 42
45#include <qgfx_qws.h> 43#include <qgfx_qws.h>
46#include <qmainwindow.h> 44#include <qmainwindow.h>
47#include <qmessagebox.h> 45#include <qmessagebox.h>
48#include <qtimer.h> 46#include <qtimer.h>
49#include <qwindowsystem_qws.h> 47#include <qwindowsystem_qws.h>
50 48
51#include <qvaluelist.h> 49#include <qvaluelist.h>
52 50
53#include <stdlib.h> 51#include <stdlib.h>
54#include <unistd.h> 52#include <unistd.h>
55 53
56class QCopKeyRegister 54class QCopKeyRegister
57{ 55{
58public: 56public:
59 QCopKeyRegister() : keyCode(0) { } 57 QCopKeyRegister() : keyCode(0) { }
60 QCopKeyRegister(int k, const QString &c, const QString &m) 58 QCopKeyRegister(int k, const QString &c, const QString &m)
61 : keyCode(k), channel(c), message(m) { } 59 : keyCode(k), channel(c), message(m) { }
62 60
63 int getKeyCode() const { return keyCode; } 61 int getKeyCode() const { return keyCode; }
64 QString getChannel() const { return channel; } 62 QString getChannel() const { return channel; }
65 QString getMessage() const { return message; } 63 QString getMessage() const { return message; }
66 64
67private: 65private:
68 int keyCode; 66 int keyCode;
69 QString channel, message; 67 QString channel, message;
70}; 68};
71 69
72typedef QValueList<QCopKeyRegister> KeyRegisterList; 70typedef QValueList<QCopKeyRegister> KeyRegisterList;
73KeyRegisterList keyRegisterList; 71KeyRegisterList keyRegisterList;
74 72
75static Desktop* qpedesktop = 0; 73static Desktop* qpedesktop = 0;
76static int loggedin=0; 74static int loggedin=0;
77static void login(bool at_poweron) 75static void login(bool at_poweron)
78{ 76{
79 if ( !loggedin ) { 77 if ( !loggedin ) {
80 Global::terminateBuiltin("calibrate"); 78 Global::terminateBuiltin("calibrate");
81 Password::authenticate(at_poweron); 79 Password::authenticate(at_poweron);
82 loggedin=1; 80 loggedin=1;
83 QCopEnvelope e( "QPE/Desktop", "unlocked()" ); 81 QCopEnvelope e( "QPE/Desktop", "unlocked()" );
84 } 82 }
85} 83}
86 84
87bool Desktop::screenLocked() 85bool Desktop::screenLocked()
88{ 86{
89 return loggedin == 0; 87 return loggedin == 0;
90} 88}
91 89
@@ -724,69 +722,69 @@ void Desktop::startTransferServer()
724} 722}
725 723
726void Desktop::timerEvent( QTimerEvent *e ) 724void Desktop::timerEvent( QTimerEvent *e )
727{ 725{
728 killTimer( e->timerId() ); 726 killTimer( e->timerId() );
729 startTransferServer(); 727 startTransferServer();
730} 728}
731 729
732void Desktop::terminateServers() 730void Desktop::terminateServers()
733{ 731{
734 delete transferServer; 732 delete transferServer;
735 delete qcopBridge; 733 delete qcopBridge;
736 transferServer = 0; 734 transferServer = 0;
737 qcopBridge = 0; 735 qcopBridge = 0;
738} 736}
739 737
740void Desktop::rereadVolumes() 738void Desktop::rereadVolumes()
741{ 739{
742 Config cfg("qpe"); 740 Config cfg("qpe");
743 cfg.setGroup("Volume"); 741 cfg.setGroup("Volume");
744 touchclick = cfg.readBoolEntry("TouchSound"); 742 touchclick = cfg.readBoolEntry("TouchSound");
745 keyclick = cfg.readBoolEntry("KeySound"); 743 keyclick = cfg.readBoolEntry("KeySound");
746 alarmsound = cfg.readBoolEntry("AlarmSound"); 744 alarmsound = cfg.readBoolEntry("AlarmSound");
747// Config cfg("Sound"); 745// Config cfg("Sound");
748// cfg.setGroup("System"); 746// cfg.setGroup("System");
749// touchclick = cfg.readBoolEntry("Touch"); 747// touchclick = cfg.readBoolEntry("Touch");
750// keyclick = cfg.readBoolEntry("Key"); 748// keyclick = cfg.readBoolEntry("Key");
751} 749}
752 750
753void Desktop::keyClick() 751void Desktop::keyClick()
754{ 752{
755#ifdef CUSTOM_SOUND_KEYCLICK 753#ifdef CUSTOM_SOUND_KEYCLICK
756 if ( keyclick ) 754 if ( keyclick )
757 CUSTOM_SOUND_KEYCLICK; 755 CUSTOM_SOUND_KEYCLICK;
758#endif 756#endif
759} 757}
760 758
761void Desktop::screenClick() 759void Desktop::screenClick()
762{ 760{
763#ifdef CUSTOM_SOUND_TOUCH 761#ifdef CUSTOM_SOUND_TOUCH
764 if ( touchclick ) 762 if ( touchclick )
765 CUSTOM_SOUND_TOUCH; 763 CUSTOM_SOUND_TOUCH;
766#endif 764#endif
767} 765}
768 766
769void Desktop::soundAlarm() 767void Desktop::soundAlarm()
770{ 768{
771#ifdef CUSTOM_SOUND_ALARM 769#ifdef CUSTOM_SOUND_ALARM
772 if (alarmsound) 770 if (qpedesktop->alarmsound)
773 CUSTOM_SOUND_ALARM; 771 CUSTOM_SOUND_ALARM;
774#endif 772#endif
775} 773}
776 774
777bool Desktop::eventFilter( QObject *w, QEvent *ev ) 775bool Desktop::eventFilter( QObject *w, QEvent *ev )
778{ 776{
779 if ( ev->type() == QEvent::KeyPress ) { 777 if ( ev->type() == QEvent::KeyPress ) {
780 QKeyEvent *ke = (QKeyEvent *)ev; 778 QKeyEvent *ke = (QKeyEvent *)ev;
781 if ( ke->key() == Qt::Key_F11 ) { // menu key 779 if ( ke->key() == Qt::Key_F11 ) { // menu key
782 QWidget *active = qApp->activeWindow(); 780 QWidget *active = qApp->activeWindow();
783 if ( active && active->isPopup() ) { 781 if ( active && active->isPopup() ) {
784 active->close(); 782 active->close();
785 } 783 }
786 raiseMenu(); 784 raiseMenu();
787 return TRUE; 785 return TRUE;
788 } 786 }
789 } 787 }
790 return FALSE; 788 return FALSE;
791} 789}
792 790