summaryrefslogtreecommitdiff
path: root/noncore/net/wellenreiter/gui/scanlist.cpp
Unidiff
Diffstat (limited to 'noncore/net/wellenreiter/gui/scanlist.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/scanlist.cpp36
1 files changed, 34 insertions, 2 deletions
diff --git a/noncore/net/wellenreiter/gui/scanlist.cpp b/noncore/net/wellenreiter/gui/scanlist.cpp
index 6d032aa..ab19701 100644
--- a/noncore/net/wellenreiter/gui/scanlist.cpp
+++ b/noncore/net/wellenreiter/gui/scanlist.cpp
@@ -18,15 +18,42 @@
18 18
19#include <assert.h> 19#include <assert.h>
20 20
21#include "manufacturers.h"
22
21MScanListView::MScanListView( QWidget* parent, const char* name ) 23MScanListView::MScanListView( QWidget* parent, const char* name )
22 :QListView( parent, name ) 24 :QListView( parent, name ), _manufacturerdb( 0 )
23{ 25{
26
27 setFrameShape( QListView::StyledPanel );
28 setFrameShadow( QListView::Sunken );
29
30 addColumn( tr( "Net/Station" ) );
31 setColumnAlignment( 0, AlignLeft || AlignVCenter );
32 addColumn( tr( "B" ) );
33 setColumnAlignment( 1, AlignCenter );
34 addColumn( tr( "AP" ) );
35 setColumnAlignment( 2, AlignCenter );
36 addColumn( tr( "Chn" ) );
37 setColumnAlignment( 3, AlignCenter );
38 addColumn( tr( "W" ) );
39 setColumnAlignment( 4, AlignCenter );
40 addColumn( tr( "T" ) );
41 setColumnAlignment( 5, AlignCenter );
42 addColumn( tr( "Manufacturer" ) );
43 setColumnAlignment( 6, AlignCenter );
44 setRootIsDecorated( true );
45 setAllColumnsShowFocus( true );
24}; 46};
25 47
26MScanListView::~MScanListView() 48MScanListView::~MScanListView()
27{ 49{
28}; 50};
29 51
52void MScanListView::setManufacturerDB( ManufacturerDB* manufacturerdb )
53{
54 _manufacturerdb = manufacturerdb;
55}
56
30void MScanListView::addNewItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal ) 57void MScanListView::addNewItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal )
31{ 58{
32 // FIXME: scanlistitem needs a proper encapsulation and not such a damn dealing with text(...) 59 // FIXME: scanlistitem needs a proper encapsulation and not such a damn dealing with text(...)
@@ -84,7 +111,10 @@ void MScanListView::addNewItem( QString type, QString essid, QString macaddr, bo
84 if ( item ) 111 if ( item )
85 { 112 {
86 // we have already seen this item, it's a dupe 113 // we have already seen this item, it's a dupe
114 #ifdef DEBUG
87 qDebug( "%s is a dupe - ignoring...", (const char*) macaddr ); 115 qDebug( "%s is a dupe - ignoring...", (const char*) macaddr );
116 #endif
117 item->receivedBeacon();
88 return; 118 return;
89 } 119 }
90 } 120 }
@@ -102,7 +132,9 @@ void MScanListView::addNewItem( QString type, QString essid, QString macaddr, bo
102 132
103 qDebug( "inserting new station %s", (const char*) macaddr ); 133 qDebug( "inserting new station %s", (const char*) macaddr );
104 134
105 new MScanListItem( network, type, "", macaddr, wep, channel, signal ); 135 MScanListItem* station = new MScanListItem( network, type, "", macaddr, wep, channel, signal );
136 if ( _manufacturerdb )
137 station->setManufacturer( _manufacturerdb->lookup( macaddr ) );
106 138
107 if ( type == "managed" ) 139 if ( type == "managed" )
108 { 140 {