author | mickeyl <mickeyl> | 2003-03-02 16:38:17 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-03-02 16:38:17 (UTC) |
commit | d0e64d0c7961de1c3ecb886ae76c6701f268d767 (patch) (unidiff) | |
tree | 2ea00b7cd496bb0720b9730bbf993f2013a87d3e /noncore/net/wellenreiter/gui/scanlistitem.cpp | |
parent | a0ae7d2b8cfef3f643c4aa536bdf25d7da510142 (diff) | |
download | opie-d0e64d0c7961de1c3ecb886ae76c6701f268d767.zip opie-d0e64d0c7961de1c3ecb886ae76c6701f268d767.tar.gz opie-d0e64d0c7961de1c3ecb886ae76c6701f268d767.tar.bz2 |
first attempt to add session persistence
Diffstat (limited to 'noncore/net/wellenreiter/gui/scanlistitem.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/gui/scanlistitem.cpp | 121 |
1 files changed, 0 insertions, 121 deletions
diff --git a/noncore/net/wellenreiter/gui/scanlistitem.cpp b/noncore/net/wellenreiter/gui/scanlistitem.cpp deleted file mode 100644 index 4aecd2b..0000000 --- a/noncore/net/wellenreiter/gui/scanlistitem.cpp +++ b/dev/null | |||
@@ -1,121 +0,0 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of Opie Environment. | ||
5 | ** | ||
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 | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
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. | ||
13 | ** | ||
14 | **********************************************************************/ | ||
15 | |||
16 | #include "scanlistitem.h" | ||
17 | #include <assert.h> | ||
18 | #include <qdatetime.h> | ||
19 | #include <qpixmap.h> | ||
20 | |||
21 | #ifdef QWS | ||
22 | #include <qpe/resource.h> | ||
23 | #else | ||
24 | #include "resource.h" | ||
25 | #endif | ||
26 | |||
27 | const int col_type = 0; | ||
28 | const int col_essid = 0; | ||
29 | const int col_sig = 1; | ||
30 | const int col_ap = 2; | ||
31 | const int col_channel = 3; | ||
32 | const int col_wep = 4; | ||
33 | const int col_traffic = 5; | ||
34 | const int col_manuf = 6; | ||
35 | const int col_firstseen = 7; | ||
36 | const int col_lastseen = 8; | ||
37 | |||
38 | MScanListItem::MScanListItem( QListView* parent, QString type, QString essid, QString macaddr, | ||
39 | bool wep, int channel, int signal ) | ||
40 | :OListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ), | ||
41 | _type( type ), _essid( essid ), _macaddr( macaddr ), _wep( wep ), | ||
42 | _channel( channel ), _signal( signal ), _beacons( 0 ) | ||
43 | { | ||
44 | qDebug( "creating scanlist item" ); | ||
45 | decorateItem( type, essid, macaddr, wep, channel, signal ); | ||
46 | } | ||
47 | |||
48 | MScanListItem::MScanListItem( QListViewItem* parent, QString type, QString essid, QString macaddr, | ||
49 | bool wep, int channel, int signal ) | ||
50 | :OListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ) | ||
51 | { | ||
52 | qDebug( "creating scanlist item" ); | ||
53 | decorateItem( type, essid, macaddr, wep, channel, signal ); | ||
54 | } | ||
55 | |||
56 | void MScanListItem::decorateItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal ) | ||
57 | { | ||
58 | qDebug( "decorating scanlist item %s / %s / %s [%d]", | ||
59 | (const char*) type, | ||
60 | (const char*) essid, | ||
61 | (const char*) macaddr, | ||
62 | channel ); | ||
63 | |||
64 | // set icon for managed or adhoc mode | ||
65 | QString name; | ||
66 | name.sprintf( "wellenreiter/%s", (const char*) type ); | ||
67 | setPixmap( col_type, Resource::loadPixmap( name ) ); | ||
68 | |||
69 | // set icon for wep (wireless encryption protocol) | ||
70 | if ( wep ) | ||
71 | setPixmap( col_wep, Resource::loadPixmap( "wellenreiter/cracked" ) ); //FIXME: rename the pixmap! | ||
72 | |||
73 | // set channel and signal text | ||
74 | |||
75 | if ( signal != -1 ) | ||
76 | setText( col_sig, QString::number( signal ) ); | ||
77 | if ( channel != -1 ) | ||
78 | setText( col_channel, QString::number( channel ) ); | ||
79 | |||
80 | setText( col_firstseen, QTime::currentTime().toString() ); | ||
81 | //setText( col_lastseen, QTime::currentTime().toString() ); | ||
82 | |||
83 | listView()->triggerUpdate(); | ||
84 | |||
85 | this->type = type; | ||
86 | _type = type; | ||
87 | _essid = essid; | ||
88 | _macaddr = macaddr; | ||
89 | _channel = channel; | ||
90 | _beacons = 0; | ||
91 | _signal = 0; | ||
92 | } | ||
93 | |||
94 | void MScanListItem::setManufacturer( const QString& manufacturer ) | ||
95 | { | ||
96 | setText( col_manuf, manufacturer ); | ||
97 | } | ||
98 | |||
99 | void MScanListItem::receivedBeacon() | ||
100 | { | ||
101 | _beacons++; | ||
102 | #ifdef DEBUG | ||
103 | qDebug( "MScanListItem %s: received beacon #%d", (const char*) _macaddr, _beacons ); | ||
104 | #endif | ||
105 | setText( col_sig, QString::number( _beacons ) ); | ||
106 | setText( col_lastseen, QTime::currentTime().toString() ); | ||
107 | } | ||
108 | |||
109 | void MScanListItem::dump( QTextStream& t ) const | ||
110 | { | ||
111 | qDebug( "dumping scanlistitem at <%d>", this ); | ||
112 | t << "<ITEM type=" << _type; | ||
113 | t << " ESSID='" << _essid; | ||
114 | t << "' MAC=" << _macaddr; | ||
115 | t << " WEP=" << _wep; | ||
116 | t << " CHANNEL=" << _channel; | ||
117 | t << " SIGNAL=" << _signal; | ||
118 | t << " BEACONS=" << _beacons; | ||
119 | t << ">\n"; | ||
120 | } | ||
121 | |||