Diffstat (limited to 'core/applets/irdaapplet/irda.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/applets/irdaapplet/irda.cpp | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/core/applets/irdaapplet/irda.cpp b/core/applets/irdaapplet/irda.cpp index f850424..a47f33d 100644 --- a/core/applets/irdaapplet/irda.cpp +++ b/core/applets/irdaapplet/irda.cpp | |||
@@ -1,77 +1,72 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2002 David Woodhouse <dwmw2@infradead.org> | 2 | ** Copyright (C) 2002 David Woodhouse <dwmw2@infradead.org> |
3 | ** Max Reiss <harlekin@handhelds.org> [trivial stuff] | 3 | ** Max Reiss <harlekin@handhelds.org> [trivial stuff] |
4 | ** Robert Griebl <sandman@handhelds.org> | 4 | ** Robert Griebl <sandman@handhelds.org> |
5 | ** Holger Freyther <zecke@handhelds.org> QCOP Interface | 5 | ** Holger Freyther <zecke@handhelds.org> QCOP Interface |
6 | ** | 6 | ** |
7 | ** This file may be distributed and/or modified under the terms of the | 7 | ** This file may be distributed and/or modified under the terms of the |
8 | ** GNU General Public License version 2 as published by the Free Software | 8 | ** GNU General Public License version 2 as published by the Free Software |
9 | ** Foundation and appearing in the file LICENSE.GPL included in the | 9 | ** Foundation and appearing in the file LICENSE.GPL included in the |
10 | ** packaging of this file. | 10 | ** packaging of this file. |
11 | ** | 11 | ** |
12 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 12 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
13 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 13 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
14 | ** | 14 | ** |
15 | **********************************************************************/ | 15 | **********************************************************************/ |
16 | 16 | ||
17 | #include <qcopchannel_qws.h> | ||
18 | 17 | ||
19 | #include <qpe/qpeapplication.h> | ||
20 | #include <qpe/resource.h> | 18 | #include <qpe/resource.h> |
21 | #include <qpe/ir.h> | ||
22 | #include <qpe/qcopenvelope_qws.h> | 19 | #include <qpe/qcopenvelope_qws.h> |
23 | #include <qpe/sound.h> | ||
24 | 20 | ||
25 | #include <qpainter.h> | 21 | #include <qpainter.h> |
26 | #include <qfile.h> | 22 | #include <qfile.h> |
27 | #include <qtimer.h> | 23 | #include <qtimer.h> |
28 | #include <qtextstream.h> | 24 | #include <qtextstream.h> |
29 | #include <qpopupmenu.h> | ||
30 | 25 | ||
31 | #include <unistd.h> | 26 | #include <unistd.h> |
32 | #include <net/if.h> | 27 | #include <net/if.h> |
33 | #include <netinet/in.h> | 28 | #include <netinet/in.h> |
34 | #include <sys/types.h> | 29 | #include <sys/types.h> |
35 | #include <sys/socket.h> | 30 | #include <sys/socket.h> |
36 | #include <sys/ioctl.h> | 31 | #include <sys/ioctl.h> |
37 | 32 | ||
38 | #include "irda.h" | 33 | #include "irda.h" |
39 | 34 | ||
40 | //=========================================================================== | 35 | //=========================================================================== |
41 | 36 | ||
42 | IrdaApplet::IrdaApplet ( QWidget *parent, const char *name ) | 37 | IrdaApplet::IrdaApplet ( QWidget *parent, const char *name ) |
43 | : QWidget ( parent, name ) | 38 | : QWidget ( parent, name ) |
44 | { | 39 | { |
45 | setFixedHeight ( 18 ); | 40 | setFixedHeight ( 18 ); |
46 | setFixedWidth ( 14 ); | 41 | setFixedWidth ( 14 ); |
47 | 42 | ||
48 | m_sockfd = ::socket ( PF_INET, SOCK_DGRAM, IPPROTO_IP ); | 43 | m_sockfd = ::socket ( PF_INET, SOCK_DGRAM, IPPROTO_IP ); |
49 | 44 | ||
50 | m_irdaOnPixmap = Resource::loadPixmap( "irdaapplet/irdaon" ); | 45 | m_irdaOnPixmap = Resource::loadPixmap( "irdaapplet/irdaon" ); |
51 | m_irdaOffPixmap = Resource::loadPixmap( "irdaapplet/irdaoff" ); | 46 | m_irdaOffPixmap = Resource::loadPixmap( "irdaapplet/irdaoff" ); |
52 | m_irdaDiscoveryOnPixmap = Resource::loadPixmap( "irdaapplet/magglass" ); | 47 | m_irdaDiscoveryOnPixmap = Resource::loadPixmap( "irdaapplet/magglass" ); |
53 | m_receiveActivePixmap = Resource::loadPixmap( "irdaapplet/receive" ); | 48 | m_receiveActivePixmap = Resource::loadPixmap( "irdaapplet/receive" ); |
54 | 49 | ||
55 | m_irda_active = false; | 50 | m_irda_active = false; |
56 | m_irda_discovery_active = false; | 51 | m_irda_discovery_active = false; |
57 | m_receive_active = false; | 52 | m_receive_active = false; |
58 | m_receive_state_changed = false; | 53 | m_receive_state_changed = false; |
59 | m_popup = 0; | 54 | m_popup = 0; |
60 | m_wasOn = false; | 55 | m_wasOn = false; |
61 | m_wasDiscover = false; | 56 | m_wasDiscover = false; |
62 | 57 | ||
63 | QCopChannel* chan = new QCopChannel("QPE/IrDaApplet", this ); | 58 | QCopChannel* chan = new QCopChannel("QPE/IrDaApplet", this ); |
64 | connect(chan, SIGNAL(received(const QCString&,const QByteArray&) ), | 59 | connect(chan, SIGNAL(received(const QCString&,const QByteArray&) ), |
65 | this, SLOT(slotMessage(const QCString&, const QByteArray& ) ) ); | 60 | this, SLOT(slotMessage(const QCString&, const QByteArray& ) ) ); |
66 | } | 61 | } |
67 | 62 | ||
68 | void IrdaApplet::show() | 63 | void IrdaApplet::show() |
69 | { | 64 | { |
70 | QWidget::show ( ); | 65 | QWidget::show ( ); |
71 | startTimer ( 2000 ); | 66 | startTimer ( 2000 ); |
72 | } | 67 | } |
73 | 68 | ||
74 | IrdaApplet::~IrdaApplet() | 69 | IrdaApplet::~IrdaApplet() |
75 | { | 70 | { |
76 | if ( m_sockfd >= 0 ) | 71 | if ( m_sockfd >= 0 ) |
77 | ::close ( m_sockfd ); | 72 | ::close ( m_sockfd ); |