author | sandman <sandman> | 2002-06-27 12:56:22 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-06-27 12:56:22 (UTC) |
commit | 56d22ac17fdc194a20fd0deba673943f85e940ea (patch) (unidiff) | |
tree | 564c333bfa77e1dbae9a553e2c208eecefdeea1e /core/applets/irdaapplet/irda.h | |
parent | 88b644d1c106008fc15f6a3c496e40296e9029d4 (diff) | |
download | opie-56d22ac17fdc194a20fd0deba673943f85e940ea.zip opie-56d22ac17fdc194a20fd0deba673943f85e940ea.tar.gz opie-56d22ac17fdc194a20fd0deba673943f85e940ea.tar.bz2 |
Fix an endless loop error when device is lost.
Diffstat (limited to 'core/applets/irdaapplet/irda.h') (more/less context) (show whitespace changes)
-rw-r--r-- | core/applets/irdaapplet/irda.h | 73 |
1 files changed, 37 insertions, 36 deletions
diff --git a/core/applets/irdaapplet/irda.h b/core/applets/irdaapplet/irda.h index e878946..1b5faa6 100644 --- a/core/applets/irdaapplet/irda.h +++ b/core/applets/irdaapplet/irda.h | |||
@@ -1,71 +1,72 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2002 L.J. Potter ljp@llornkcor.com | 2 | ** Copyright (C) 2002 L.J. Potter ljp@llornkcor.com, |
3 | ** Robert Griebl sandman@handhelds.org | ||
3 | ** All rights reserved. | 4 | ** All rights reserved. |
4 | ** | 5 | ** |
5 | ** 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 |
6 | ** 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 |
7 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
8 | ** packaging of this file. | 9 | ** packaging of this file. |
9 | ** | 10 | ** |
10 | ** 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 |
11 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
12 | ** | 13 | ** |
13 | **********************************************************************/ | 14 | **********************************************************************/ |
14 | 15 | ||
15 | #ifndef SCREENSHOT_APPLET_H__ | 16 | #ifndef __OPIE_IRDA_APPLET_H__ |
16 | #define SCREENSHOT_APPLET_H__ | 17 | #define __OPIE_IRDA_APPLET_H__ |
17 | |||
18 | |||
19 | 18 | ||
20 | #include <qwidget.h> | 19 | #include <qwidget.h> |
21 | #include <qframe.h> | ||
22 | #include <qpixmap.h> | 20 | #include <qpixmap.h> |
23 | #include <qguardedptr.h> | ||
24 | #include <qtimer.h> | ||
25 | #include <qfile.h> | ||
26 | #include <qpopupmenu.h> | 21 | #include <qpopupmenu.h> |
27 | #include <qdict.h> | 22 | #include <qmap.h> |
28 | 23 | ||
29 | class IrdaApplet : public QWidget | 24 | class IrdaApplet : public QWidget |
30 | { | 25 | { |
31 | Q_OBJECT | 26 | Q_OBJECT |
27 | |||
32 | public: | 28 | public: |
33 | IrdaApplet( QWidget *parent = 0, const char *name=0 ); | 29 | IrdaApplet( QWidget *parent = 0, const char *name=0 ); |
34 | ~IrdaApplet(); | 30 | ~IrdaApplet(); |
35 | 31 | ||
32 | virtual void show ( ); | ||
33 | |||
36 | protected: | 34 | protected: |
37 | void timerEvent(QTimerEvent *te ); | 35 | virtual void timerEvent ( QTimerEvent * ); |
36 | virtual void mousePressEvent ( QMouseEvent * ); | ||
37 | virtual void paintEvent ( QPaintEvent* ); | ||
38 | |||
39 | private slots: | ||
40 | void popupTimeout ( ); | ||
38 | 41 | ||
39 | private: | 42 | private: |
40 | void mousePressEvent( QMouseEvent * ); | 43 | void popup( QString message, QString icon = QString::null ); |
41 | void paintEvent( QPaintEvent* ); | ||
42 | int checkIrdaStatus(); | ||
43 | int setIrdaStatus(int); | ||
44 | int checkIrdaDiscoveryStatus(); | ||
45 | int setIrdaDiscoveryStatus(int); | ||
46 | int setIrdaReceiveStatus(int); | ||
47 | void showDiscovered(); | ||
48 | int sockfd; | ||
49 | 44 | ||
50 | public slots: | 45 | bool checkIrdaStatus ( ); |
51 | void show(); | 46 | bool setIrdaStatus ( bool ); |
47 | bool checkIrdaDiscoveryStatus (); | ||
48 | bool setIrdaDiscoveryStatus ( bool ); | ||
49 | bool setIrdaReceiveStatus ( bool ); | ||
52 | 50 | ||
53 | private slots: | 51 | void showDiscovered(); |
54 | void popupTimeout(); | ||
55 | 52 | ||
56 | private: | 53 | private: |
57 | QPixmap irdaOnPixmap; | 54 | QPixmap m_irdaOnPixmap; |
58 | QPixmap irdaOffPixmap; | 55 | QPixmap m_irdaOffPixmap; |
59 | QPixmap irdaDiscoveryOnPixmap; | 56 | QPixmap m_irdaDiscoveryOnPixmap; |
60 | QPixmap receiveActivePixmap; | 57 | QPixmap m_receiveActivePixmap; |
61 | int irdaactive; // bool and bitfields later bool irdaactive :1 ; | 58 | |
62 | int irdaDiscoveryActive; | 59 | bool m_irda_active; |
63 | bool receiveActive : 1; | 60 | bool m_irda_discovery_active; |
64 | bool receiveStateChanged; | 61 | bool m_receive_active; |
65 | QPopupMenu *popupMenu; | 62 | bool m_receive_state_changed; |
66 | void popup(QString message, QString icon=""); | 63 | |
67 | QDict<QString> devicesAvailable; | 64 | QPopupMenu *m_popup; |
65 | |||
66 | int m_sockfd; | ||
67 | |||
68 | QMap <QString, QString> m_devices; | ||
68 | }; | 69 | }; |
69 | 70 | ||
70 | 71 | ||
71 | #endif // __SCREENSHOT_APPLET_H__ | 72 | #endif // __OPIE_IRDA_APPLET_H__ |