summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/irdaapplet/irda.cpp438
-rw-r--r--core/applets/irdaapplet/irda.h70
2 files changed, 273 insertions, 235 deletions
diff --git a/core/applets/irdaapplet/irda.cpp b/core/applets/irdaapplet/irda.cpp
index cea836e..d57104b 100644
--- a/core/applets/irdaapplet/irda.cpp
+++ b/core/applets/irdaapplet/irda.cpp
@@ -41,145 +41,161 @@
41 41
42//=========================================================================== 42//===========================================================================
43 43
44IrdaApplet::IrdaApplet ( QWidget *parent, const char *name ) 44IrdaApplet::IrdaApplet ( QWidget *parent, const char *name ) :
45 : QWidget ( parent, name ) 45 QWidget ( parent, name ),
46 m_irda_active( false ),
47 m_irda_discovery_active( false ),
48 m_receive_active( false ),
49 m_receive_state_changed( false ),
50 m_popup( 0 ),
51 m_wasOn( false ),
52 m_wasDiscover( false )
46{ 53{
47 setFixedHeight( AppLnk::smallIconSize() ); 54 setFixedHeight( AppLnk::smallIconSize() );
48 setFixedWidth( AppLnk::smallIconSize() ); 55 setFixedWidth( AppLnk::smallIconSize() );
49 56
50 m_sockfd = ::socket ( PF_INET, SOCK_DGRAM, IPPROTO_IP ); 57 if (m_sockfd = ::socket ( PF_INET, SOCK_DGRAM, IPPROTO_IP ) == -1)
51 58 perror ( "failed grabbing IrDA socket" );
52 m_irdaOnPixmap = Opie::Core::OResource::loadPixmap( "irdaapplet/irdaon", Opie::Core::OResource::SmallIcon ); 59
53 m_irdaOffPixmap = Opie::Core::OResource::loadPixmap( "irdaapplet/irdaoff", Opie::Core::OResource::SmallIcon ); 60 m_irdaOnPixmap =
54 m_irdaDiscoveryOnPixmap = Opie::Core::OResource::loadPixmap( "irdaapplet/magglass", Opie::Core::OResource::SmallIcon ); 61 Opie::Core::OResource::loadPixmap( "irdaapplet/irdaon",
55 m_receiveActivePixmap = Opie::Core::OResource::loadPixmap( "irdaapplet/receive", Opie::Core::OResource::SmallIcon ); 62 Opie::Core::OResource::SmallIcon );
56 63 m_irdaOffPixmap =
57 m_irda_active = false; 64 Opie::Core::OResource::loadPixmap( "irdaapplet/irdaoff",
58 m_irda_discovery_active = false; 65 Opie::Core::OResource::SmallIcon );
59 m_receive_active = false; 66 m_irdaDiscoveryOnPixmap =
60 m_receive_state_changed = false; 67 Opie::Core::OResource::loadPixmap( "irdaapplet/magglass",
61 m_popup = 0; 68 Opie::Core::OResource::SmallIcon );
62 m_wasOn = false; 69 m_receiveActivePixmap =
63 m_wasDiscover = false; 70 Opie::Core::OResource::loadPixmap( "irdaapplet/receive",
64 71 Opie::Core::OResource::SmallIcon );
65 QCopChannel* chan = new QCopChannel("QPE/IrDaApplet", this ); 72
66 connect(chan, SIGNAL(received(const QCString&,const QByteArray&) ), 73 QCopChannel* chan = new QCopChannel("QPE/IrDaApplet", this );
67 this, SLOT(slotMessage(const QCString&,const QByteArray&) ) ); 74 connect(chan, SIGNAL(received(const QCString&,const QByteArray&) ), this,
75 SLOT(slotMessage(const QCString&,const QByteArray&) ) );
68} 76}
69 77
70int IrdaApplet::position() 78int IrdaApplet::position()
71{ 79{
72 return 6; 80 return 6;
73} 81}
74 82
75void IrdaApplet::show() 83void IrdaApplet::show()
76{ 84{
77 QWidget::show ( ); 85 QWidget::show ( );
78 startTimer ( 2000 ); 86 startTimer ( 2000 );
79} 87}
80 88
81IrdaApplet::~IrdaApplet() 89IrdaApplet::~IrdaApplet()
82{ 90{
83 if ( m_sockfd >= 0 ) 91 if ( m_sockfd >= 0 )
84 ::close ( m_sockfd ); 92 ::close ( m_sockfd );
85} 93}
86 94
87void IrdaApplet::popup ( QString message, QString icon ) 95void IrdaApplet::popup ( QString message, QString icon )
88{ 96{
89 if ( !m_popup ) 97 if ( !m_popup )
90 m_popup = new QPopupMenu ( this ); 98 m_popup = new QPopupMenu ( this );
91 99
92 m_popup-> clear ( ); 100 m_popup-> clear ( );
93 101
94 if ( icon. isEmpty ( )) 102 if ( icon. isEmpty ( ))
95 m_popup-> insertItem ( message, 0 ); 103 m_popup-> insertItem ( message, 0 );
96 else 104 else
97 m_popup-> insertItem ( QIconSet ( Opie::Core::OResource::loadPixmap ( icon, Opie::Core::OResource::SmallIcon )), 105 m_popup-> insertItem ( QIconSet (
98 message, 0 ); 106 Opie::Core::OResource::loadPixmap (
99 107 icon,
100 QPoint p = mapToGlobal ( QPoint ( 0, 0 )); 108 Opie::Core::OResource::SmallIcon
101 QSize s = m_popup-> sizeHint ( ); 109 )
102 m_popup-> popup ( QPoint ( p. x ( ) + ( width ( ) / 2 ) - ( s. width ( ) / 2 ), 110 ),
103 p. y ( ) - s. height ( ))); 111 message, 0
104 112 );
105 QTimer::singleShot ( 2000, this, SLOT( popupTimeout())); 113
114 QPoint p = mapToGlobal ( QPoint ( 0, 0 ));
115 QSize s = m_popup-> sizeHint ( );
116 m_popup-> popup ( QPoint (
117 p. x ( ) + ( width ( ) / 2 ) - ( s. width ( ) / 2 ),
118 p. y ( ) - s. height ( )
119 )
120 );
121
122 QTimer::singleShot ( 2000, this, SLOT( popupTimeout()));
106} 123}
107 124
108void IrdaApplet::popupTimeout ( ) 125void IrdaApplet::popupTimeout ( )
109{ 126{
110 m_popup-> hide ( ); 127 m_popup-> hide ( );
111} 128}
112 129
113bool IrdaApplet::checkIrdaStatus ( ) 130bool IrdaApplet::checkIrdaStatus ( )
114{ 131{
115 struct ifreq ifr; 132 struct ifreq ifr;
116 strcpy ( ifr. ifr_name, "irda0" ); 133 strcpy ( ifr. ifr_name, "irda0" );
117 134
118 if ( ::ioctl ( m_sockfd, SIOCGIFFLAGS, &ifr ) < 0 ) 135 if ( m_sockfd < 0 || ::ioctl ( m_sockfd, SIOCGIFFLAGS, &ifr ) < 0 )
119 return false; 136 return false;
120 137
121 return ( ifr. ifr_flags & IFF_UP ); 138 return ( ifr. ifr_flags & IFF_UP );
122} 139}
123 140
124bool IrdaApplet::setIrdaStatus ( bool b ) 141bool IrdaApplet::setIrdaStatus ( bool b )
125{ 142{
126 struct ifreq ifr; 143 struct ifreq ifr;
127 strcpy ( ifr. ifr_name, "irda0" ); 144 strcpy ( ifr. ifr_name, "irda0" );
128 145
129 if ( ::ioctl ( m_sockfd, SIOCGIFFLAGS, &ifr ) < 0 ) 146 if ( m_sockfd < 0 || ::ioctl ( m_sockfd, SIOCGIFFLAGS, &ifr ) < 0 )
130 return false; 147 return false;
131 148
132 if ( b ) { 149 if ( b )
133 ifr. ifr_flags |= IFF_UP; 150 ifr. ifr_flags |= IFF_UP;
134 } 151 else {
135 else { 152 setIrdaDiscoveryStatus ( 0 );
136 setIrdaDiscoveryStatus ( 0 ); 153 setIrdaReceiveStatus ( 0 );
137 setIrdaReceiveStatus ( 0 ); 154 ifr. ifr_flags &= ~IFF_UP;
138 ifr. ifr_flags &= ~IFF_UP; 155 }
139 }
140 156
141 if ( ::ioctl ( m_sockfd, SIOCSIFFLAGS, &ifr ) < 0 ) 157 if ( m_sockfd < 0 || ::ioctl ( m_sockfd, SIOCSIFFLAGS, &ifr ) < 0 )
142 return false; 158 return false;
143 159
144 return true; 160 return true;
145} 161}
146 162
147bool IrdaApplet::checkIrdaDiscoveryStatus ( ) 163bool IrdaApplet::checkIrdaDiscoveryStatus ( )
148{ 164{
149 QFile discovery ( "/proc/sys/net/irda/discovery" ); 165 QFile discovery ( "/proc/sys/net/irda/discovery" );
150 166
151 QString streamIn = "0"; 167 QString streamIn = "0";
152 168
153 if ( discovery. open ( IO_ReadOnly )) { 169 if ( discovery. open ( IO_ReadOnly )) {
154 QTextStream stream ( &discovery ); 170 QTextStream stream ( &discovery );
155 streamIn = stream. read ( ); 171 streamIn = stream. read ( );
156 } 172 }
157 173
158 return streamIn. toInt ( ) > 0; 174 return streamIn. toInt ( ) > 0;
159} 175}
160 176
161 177
162bool IrdaApplet::setIrdaDiscoveryStatus ( bool d ) 178bool IrdaApplet::setIrdaDiscoveryStatus ( bool d )
163{ 179{
164 QFile discovery ( "/proc/sys/net/irda/discovery" ); 180 QFile discovery ( "/proc/sys/net/irda/discovery" );
165 181
166 if ( discovery. open ( IO_WriteOnly | IO_Raw )) { 182 if ( discovery. open ( IO_WriteOnly | IO_Raw )) {
167 discovery.putch ( d ? '1' : '0' ); 183 discovery.putch ( d ? '1' : '0' );
168 return true; 184 return true;
169 } 185 }
170 return false; 186 return false;
171} 187}
172 188
173 189
174bool IrdaApplet::setIrdaReceiveStatus ( bool d ) 190bool IrdaApplet::setIrdaReceiveStatus ( bool d )
175{ 191{
176 QCopEnvelope e ( "QPE/Obex", "receive(int)" ); 192 QCopEnvelope e ( "QPE/Obex", "receive(int)" );
177 e << ( d ? 1 : 0 ); 193 e << ( d ? 1 : 0 );
178 194
179 m_receive_active = d; 195 m_receive_active = d;
180 m_receive_state_changed = true; 196 m_receive_state_changed = true;
181 197
182 return true; 198 return true;
183} 199}
184 200
185 201
@@ -188,155 +204,178 @@ void IrdaApplet::showDiscovered ( )
188 //static Sound snd_found ( "irdaapplet/irdaon" ); 204 //static Sound snd_found ( "irdaapplet/irdaon" );
189 //static Sound snd_lost ( "irdaapplet/irdaoff" ); 205 //static Sound snd_lost ( "irdaapplet/irdaoff" );
190 206
191 QFile discovery ( "/proc/net/irda/discovery" ); 207 QFile discovery ( "/proc/net/irda/discovery" );
192 208
193 if ( discovery. open ( IO_ReadOnly )) { 209 if ( discovery. open ( IO_ReadOnly )) {
194 bool qcopsend = false; 210 bool qcopsend = false;
195 211
196 QString discoveredDevice; 212 QString discoveredDevice;
197 QString deviceAddr; 213 QString deviceAddr;
198 214
199 // since it is /proc we _must_ use QTextStream 215 /*!
200 QStringList list = QStringList::split ( "\n", QTextStream ( &discovery ). read ( )); 216 * @note To read /proc, it makes more sense to use QTextStream.
217 */
218 QStringList list =
219 QStringList::split ( "\n", QTextStream ( &discovery ). read ( ));
201 220
202 QMap <QString, QString>::Iterator it; 221 QMap <QString, QString>::Iterator it;
203 222
204 for ( it = m_devices. begin ( ); it != m_devices. end ( ); ++it ) 223 for ( it = m_devices. begin ( ); it != m_devices. end ( ); ++it )
205 it. data ( ). prepend ( "+++" ); 224 it. data ( ). prepend ( "+++" );
206 225
207 for ( QStringList::Iterator lit = list. begin ( ); lit != list. end ( ); ++lit ) { 226 for ( QStringList::Iterator lit = list. begin ( );
208 const QString &line = *lit; 227 lit != list. end ( ); ++lit
228 )
229 {
230 const QString &line = *lit;
209 231
210 if ( line. startsWith ( "nickname:" )) { 232 if ( line. startsWith ( "nickname:" )) {
211 discoveredDevice = line. mid ( line. find ( ':' ) + 2, line. find ( ',' ) - line. find ( ':' ) - 2 ); 233 discoveredDevice =
212 deviceAddr = line. mid ( line. find ( "daddr:" ) + 9, 8 ); 234 line. mid ( line. find ( ':' ) + 2, line. find ( ',' ) -
235 line. find ( ':' ) - 2 );
236 deviceAddr = line. mid ( line. find ( "daddr:" ) + 9, 8 );
213 237
214 // odebug << discoveredDevice + "(" + deviceAddr + ")" << oendl; 238 // odebug << discoveredDevice + "(" + deviceAddr + ")" << oendl;
215 239
216 if ( !m_devices. contains ( deviceAddr )) { 240 if ( !m_devices. contains ( deviceAddr )) {
217 popup ( tr( "Found:" ) + " " + discoveredDevice ); 241 popup ( tr( "Found:" ) + " " + discoveredDevice );
218 //snd_found. play ( ); 242 //snd_found. play ( );
219 qcopsend = true; 243 qcopsend = true;
220 } 244 }
221 m_devices. replace ( deviceAddr, discoveredDevice ); 245 m_devices. replace ( deviceAddr, discoveredDevice );
222 } 246 }
223 } 247 }
224 248
225 for ( it = m_devices. begin ( ); it != m_devices. end ( ); ) { 249 for ( it = m_devices. begin ( ); it != m_devices. end ( ); ) {
226 // odebug << "IrdaMon: delete " + it.currentKey() + "=" + *devicesAvailable[it.currentKey()] + "?" << oendl; 250 // odebug << "IrdaMon: delete " + it.currentKey() + "=" +
251 // *devicesAvailable[it.currentKey()] + "?" << oendl;
227 252
228 if ( it. data ( ). left ( 3 ) == "+++" ) { 253 if ( it. data ( ). left ( 3 ) == "+++" ) {
229 popup ( tr( "Lost:" ) + " " + it. data ( ). mid ( 3 )); 254 popup ( tr( "Lost:" ) + " " + it. data ( ). mid ( 3 ));
230 //snd_lost. play ( ); 255 //snd_lost. play ( );
231 256
232 QMap <QString, QString>::Iterator tmp = it; 257 QMap <QString, QString>::Iterator tmp = it;
233 tmp++; 258 tmp++;
234 m_devices. remove ( it ); // in contrast to QValueListIterator this remove doesn't return the next Iterator 259 m_devices. remove ( it );
235 it = tmp; 260 ///< @note In contrast to QValueListIterator this remove doesn't
261 ///< return the next Iterator
236 262
237 qcopsend = true; 263 it = tmp;
238 } 264 qcopsend = true;
239 else 265 } else
240 it++; 266 it++;
241 } 267 }
242 // XXX if( qcopsend ) { 268 // XXX if( qcopsend ) {
243 QCopEnvelope e ( "QPE/Network", "irdaSend(bool)" ); 269 QCopEnvelope e ( "QPE/Network", "irdaSend(bool)" );
244 e << ( m_devices. count ( ) > 0 ); 270 e << ( m_devices. count ( ) > 0 );
245 // } 271 // }
246 } 272 }
247} 273}
248 274
249void IrdaApplet::mousePressEvent ( QMouseEvent * ) 275void IrdaApplet::mousePressEvent ( QMouseEvent * )
250{ 276{
251 QPopupMenu *menu = new QPopupMenu ( this ); 277 QPopupMenu *menu = new QPopupMenu ( this );
252 QString cmd; 278 QString cmd;
253 279
254 /* Refresh active state */ 280 /* Refresh active state */
255 timerEvent ( 0 ); 281 timerEvent ( 0 );
256 282
257 //menu->insertItem( tr("More..."), 4 ); 283 //menu->insertItem( tr("More..."), 4 );
258 284
259 if ( m_irda_active && !m_devices. isEmpty ( )) { 285 if ( m_irda_active && !m_devices. isEmpty ( )) {
260 menu-> insertItem ( tr( "Discovered Device:" ), 9 ); 286 menu-> insertItem ( tr( "Discovered Device:" ), 9 );
261 287
262 for ( QMap<QString, QString>::Iterator it = m_devices. begin ( ); it != m_devices. end ( ); ++it ) 288 for ( QMap<QString, QString>::Iterator it = m_devices. begin ( );
263 menu-> insertItem ( *it ); 289 it != m_devices. end ( ); ++it )
264 290 {
265 menu-> insertSeparator ( ); 291 menu-> insertItem ( *it );
266 } 292 }
267 293
268 menu-> insertItem ( m_irda_active ? tr( "Disable IrDA" ) : tr( "Enable IrDA" ), 0 ); 294 menu-> insertSeparator ( );
269 295 }
270 if ( m_irda_active ) { 296
271 menu-> insertItem ( m_irda_discovery_active ? tr( "Disable Discovery" ) : tr( "Enable Discovery" ), 1 ); 297 menu-> insertItem ( m_irda_active ? tr( "Disable IrDA" ) : tr( "Enable IrDA" ), 0 );
272 298
273 /* Only Receive if OBEX is installed */ 299 if ( m_irda_active ) {
274 if( Ir::supported() ) 300 menu-> insertItem (
275 menu-> insertItem ( m_receive_active ? tr( "Disable Receive" ) : tr( "Enable Receive" ), 2 ); 301 m_irda_discovery_active ? tr( "Disable Discovery" ) :
276 } 302 tr( "Enable Discovery" ), 1
277 303 );
278 QPoint p = mapToGlobal ( QPoint ( 0, 0 ) ); 304
279 QSize s = menu-> sizeHint ( ); 305 /* Only Receive if OBEX is installed */
280 306 if( Ir::supported() )
281 p = QPoint ( p. x ( ) + ( width ( ) / 2 ) - ( s. width ( ) / 2 ), p. y ( ) - s. height ( )); 307 menu-> insertItem (
282 308 m_receive_active ? tr( "Disable Receive" ) :
283 switch ( menu-> exec ( p )) { 309 tr( "Enable Receive" ), 2
284 case 0: 310 );
285 setIrdaStatus ( !m_irda_active ); 311 }
286 timerEvent ( 0 ); 312
287 break; 313 QPoint p = mapToGlobal ( QPoint ( 0, 0 ) );
288 case 1: 314 QSize s = menu-> sizeHint ( );
289 setIrdaDiscoveryStatus ( !m_irda_discovery_active ); 315
290 timerEvent ( 0 ); 316 p = QPoint ( p. x ( ) + ( width ( ) / 2 ) - ( s. width ( ) / 2 ), p. y ( ) -
291 break; 317 s. height ( ));
292 case 2: 318
293 setIrdaReceiveStatus ( !m_receive_active ); 319 switch ( menu-> exec ( p )) {
294 timerEvent( 0 ); 320 case 0:
295 break; 321 setIrdaStatus ( !m_irda_active );
296 } 322 timerEvent ( 0 );
297 323 break;
298 delete menu; 324 case 1:
325 setIrdaDiscoveryStatus ( !m_irda_discovery_active );
326 timerEvent ( 0 );
327 break;
328 case 2:
329 setIrdaReceiveStatus ( !m_receive_active );
330 timerEvent( 0 );
331 break;
332 }
333
334 delete menu;
299} 335}
300 336
301void IrdaApplet::timerEvent ( QTimerEvent * ) 337void IrdaApplet::timerEvent ( QTimerEvent * )
302{ 338{
303 bool oldactive = m_irda_active; 339 bool oldactive = m_irda_active;
304 bool olddiscovery = m_irda_discovery_active; 340 bool olddiscovery = m_irda_discovery_active;
305 bool receiveUpdate = false; 341 bool receiveUpdate = false;
306 342
307 if ( m_receive_state_changed ) { 343 if ( m_receive_state_changed ) {
308 receiveUpdate = true; 344 receiveUpdate = true;
309 m_receive_state_changed = false; 345 m_receive_state_changed = false;
310 } 346 }
311 347
312 m_irda_active = checkIrdaStatus ( ); 348 m_irda_active = checkIrdaStatus ( );
313 m_irda_discovery_active = checkIrdaDiscoveryStatus ( ); 349 m_irda_discovery_active = checkIrdaDiscoveryStatus ( );
314 350
315 if ( m_irda_discovery_active ) 351 if ( m_irda_discovery_active )
316 showDiscovered ( ); 352 showDiscovered ( );
317 353
318 if (( m_irda_active != oldactive ) || ( m_irda_discovery_active != olddiscovery ) || receiveUpdate ) 354 if (( m_irda_active != oldactive ) ||
319 update ( ); 355 ( m_irda_discovery_active != olddiscovery ) || receiveUpdate )
356 {
357 update ( );
358 }
320} 359}
321 360
322void IrdaApplet::paintEvent ( QPaintEvent * ) 361void IrdaApplet::paintEvent ( QPaintEvent * )
323{ 362{
324 QPainter p( this ); 363 QPainter p( this );
325 364
326 p.drawPixmap( 0, 1, m_irda_active ? m_irdaOnPixmap : m_irdaOffPixmap ); 365 p.drawPixmap( 0, 1, m_irda_active ? m_irdaOnPixmap : m_irdaOffPixmap );
327 366
328 if ( m_irda_discovery_active ) 367 if ( m_irda_discovery_active )
329 p.drawPixmap( 0, 1, m_irdaDiscoveryOnPixmap ); 368 p.drawPixmap( 0, 1, m_irdaDiscoveryOnPixmap );
330 369
331 if ( m_receive_active ) 370 if ( m_receive_active )
332 p.drawPixmap( 0, 1, m_receiveActivePixmap ); 371 p.drawPixmap( 0, 1, m_receiveActivePixmap );
333} 372}
334/* 373
335 * We know 3 calls 374/*!
336 * a) enable 375 * We recognize 3 events:
337 * b) disable 376 * - enable: Attempt to enable the IrDA device
338 * a and b will temp enable the IrDa device and disable will disable it again if it wasn't on 377 * - disable: Attempt to disable the IrDA device if it was already enabled
339 * c) listDevices: We will return a list of known devices 378 * - listDevices: Returns a list of known IrDA devices
340 */ 379 */
341void IrdaApplet::slotMessage( const QCString& str, const QByteArray& ) { 380void IrdaApplet::slotMessage( const QCString& str, const QByteArray& ) {
342 if ( str == "enableIrda()") { 381 if ( str == "enableIrda()") {
@@ -368,3 +407,4 @@ void IrdaApplet::slotMessage( const QCString& str, const QByteArray& ) {
368} 407}
369 408
370EXPORT_OPIE_APPLET_v1( IrdaApplet ) 409EXPORT_OPIE_APPLET_v1( IrdaApplet )
410
diff --git a/core/applets/irdaapplet/irda.h b/core/applets/irdaapplet/irda.h
index f713bbe..2cbf4f7 100644
--- a/core/applets/irdaapplet/irda.h
+++ b/core/applets/irdaapplet/irda.h
@@ -23,55 +23,53 @@
23 23
24class IrdaApplet : public QWidget 24class IrdaApplet : public QWidget
25{ 25{
26 Q_OBJECT 26 Q_OBJECT
27 27
28public: 28 public:
29 IrdaApplet( QWidget *parent = 0, const char *name = 0 ); 29 IrdaApplet( QWidget *parent = 0, const char *name = 0 );
30 ~IrdaApplet(); 30 ~IrdaApplet();
31 static int position(); 31 static int position();
32 32
33 virtual void show ( ); 33 virtual void show ( );
34 34
35protected: 35 protected:
36 virtual void timerEvent ( QTimerEvent * ); 36 virtual void timerEvent ( QTimerEvent * );
37 virtual void mousePressEvent ( QMouseEvent * ); 37 virtual void mousePressEvent ( QMouseEvent * );
38 virtual void paintEvent ( QPaintEvent* ); 38 virtual void paintEvent ( QPaintEvent* );
39 39
40private slots: 40 private slots:
41 void popupTimeout ( ); 41 void popupTimeout ( );
42 void slotMessage( const QCString& , const QByteArray& ); 42 void slotMessage( const QCString& , const QByteArray& );
43 43
44private: 44 private:
45 void popup( QString message, QString icon = QString::null ); 45 void popup( QString message, QString icon = QString::null );
46 46
47 bool checkIrdaStatus ( ); 47 bool checkIrdaStatus ( );
48 bool setIrdaStatus ( bool ); 48 bool setIrdaStatus ( bool );
49 bool checkIrdaDiscoveryStatus (); 49 bool checkIrdaDiscoveryStatus ();
50 bool setIrdaDiscoveryStatus ( bool ); 50 bool setIrdaDiscoveryStatus ( bool );
51 bool setIrdaReceiveStatus ( bool ); 51 bool setIrdaReceiveStatus ( bool );
52 52
53 void showDiscovered(); 53 void showDiscovered();
54 54
55private: 55 QPixmap m_irdaOnPixmap;
56 QPixmap m_irdaOnPixmap; 56 QPixmap m_irdaOffPixmap;
57 QPixmap m_irdaOffPixmap; 57 QPixmap m_irdaDiscoveryOnPixmap;
58 QPixmap m_irdaDiscoveryOnPixmap; 58 QPixmap m_receiveActivePixmap;
59 QPixmap m_receiveActivePixmap;
60 59
61 bool m_irda_active; 60 bool m_irda_active;
62 bool m_irda_discovery_active; 61 bool m_irda_discovery_active;
63 bool m_receive_active; 62 bool m_receive_active;
64 bool m_receive_state_changed; 63 bool m_receive_state_changed;
65 64
66 QPopupMenu *m_popup; 65 QPopupMenu *m_popup;
67 66
68 int m_sockfd; 67 int m_sockfd;
69 68
70 QMap <QString, QString> m_devices; 69 QMap <QString, QString> m_devices;
71 70
72 bool m_wasOn; // if IrDa was enabled 71 bool m_wasOn; ///< If IrDA was enabled this is true
73 bool m_wasDiscover; 72 bool m_wasDiscover;
74}; 73};
75
76
77#endif // __OPIE_IRDA_APPLET_H__ 74#endif // __OPIE_IRDA_APPLET_H__
75