-rw-r--r-- | noncore/net/wellenreiter/gui/scanlistitem.cpp | 10 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/scanlistitem.h | 4 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 39 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiterbase.cpp | 7 |
4 files changed, 45 insertions, 15 deletions
diff --git a/noncore/net/wellenreiter/gui/scanlistitem.cpp b/noncore/net/wellenreiter/gui/scanlistitem.cpp index 9532a01..189a12d 100644 --- a/noncore/net/wellenreiter/gui/scanlistitem.cpp +++ b/noncore/net/wellenreiter/gui/scanlistitem.cpp | |||
@@ -56,10 +56,14 @@ void MScanListItem::decorateItem( QString type, QString essid, QString macaddr, | |||
56 | setPixmap( col_wep, Resource::loadPixmap( "wellenreiter/cracked" ) ); // rename the pixmap! | 56 | setPixmap( col_wep, Resource::loadPixmap( "wellenreiter/cracked" ) ); // rename the pixmap! |
57 | 57 | ||
58 | // set channel and signal text | 58 | // set channel and signal text |
59 | setText( col_sig, QString::number( signal ) ); | 59 | |
60 | setText( col_channel, QString::number( channel ) ); | 60 | if ( signal != -1 ) |
61 | //setText | 61 | setText( col_sig, QString::number( signal ) ); |
62 | if ( channel != -1 ) | ||
63 | setText( col_channel, QString::number( channel ) ); | ||
62 | 64 | ||
63 | listView()->triggerUpdate(); | 65 | listView()->triggerUpdate(); |
66 | |||
67 | this->type = type; | ||
64 | 68 | ||
65 | } | 69 | } |
diff --git a/noncore/net/wellenreiter/gui/scanlistitem.h b/noncore/net/wellenreiter/gui/scanlistitem.h index dd8219a..cd9d883 100644 --- a/noncore/net/wellenreiter/gui/scanlistitem.h +++ b/noncore/net/wellenreiter/gui/scanlistitem.h | |||
@@ -45,6 +45,10 @@ class MScanListItem: public QListViewItem | |||
45 | 45 | ||
46 | virtual void decorateItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal ); | 46 | virtual void decorateItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal ); |
47 | 47 | ||
48 | public: | ||
49 | |||
50 | QString type; | ||
51 | |||
48 | }; | 52 | }; |
49 | 53 | ||
50 | #endif | 54 | #endif |
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp index d1ace46..9c8630f 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp | |||
@@ -154,25 +154,37 @@ void Wellenreiter::addNewItem( QString type, QString essid, QString macaddr, boo | |||
154 | 154 | ||
155 | // search, if we had an item with this essid once before | 155 | // search, if we had an item with this essid once before |
156 | 156 | ||
157 | QListViewItem* item = netview->firstChild(); | 157 | //MScanListItem* item = dynamic_cast<MScanListItem*>( netview->firstChild() ); |
158 | MScanListItem* item = static_cast<MScanListItem*>( netview->firstChild() ); | ||
158 | 159 | ||
159 | while ( item && ( item->text( 0 ) != essid ) ) | 160 | while ( item && ( item->text( 0 ) != essid ) ) |
160 | { | 161 | { |
161 | qDebug( "itemtext: %s", (const char*) item->text( 0 ) ); | 162 | qDebug( "itemtext: %s", (const char*) item->text( 0 ) ); |
162 | item = item->itemBelow(); | 163 | item = dynamic_cast<MScanListItem*>( item->itemBelow() ); |
163 | } | 164 | } |
164 | if ( item ) | 165 | if ( item ) |
165 | { | 166 | { |
166 | qDebug( "found!" ); | 167 | qDebug( "found!" ); |
167 | 168 | ||
168 | if ( macaddr != item->text( 2 ) ) | 169 | // check, if it is the same item (based on MACaddr) |
169 | new MScanListItem( item, type, essid, macaddr, wep, channel, signal ); | 170 | |
170 | else | 171 | if ( macaddr == item->text( 2 ) ) |
171 | qDebug( "already there. ignoring..." ); | 172 | { |
173 | qDebug( "already had item with mac %s", (const char*) item->text( 2 ) ); | ||
174 | return; | ||
175 | } | ||
176 | |||
177 | // another item belonging to the same net, so: insert the new item as child | ||
178 | |||
179 | new MScanListItem( item, type, essid, macaddr, wep, channel, signal ); | ||
172 | } | 180 | } |
181 | |||
173 | else | 182 | else |
174 | { | 183 | { |
175 | new MScanListItem( netview, type, essid, macaddr, wep, channel, signal ); | 184 | qDebug( "inserting new network" ); |
185 | MScanListItem* network = new MScanListItem( netview, "networks", essid, QString::null, 0, 0, 0 ); | ||
186 | |||
187 | new MScanListItem( network, type, essid, macaddr, wep, channel, signal ); | ||
176 | } | 188 | } |
177 | } | 189 | } |
178 | 190 | ||
@@ -183,13 +195,16 @@ void Wellenreiter::buttonClicked() | |||
183 | 195 | ||
184 | button->setText( "Stop Scanning" ); | 196 | button->setText( "Stop Scanning" ); |
185 | 197 | ||
186 | // add some icons, so that we can see if this works | 198 | // add some test stations, so that we can see if the GUI part works |
187 | |||
188 | addNewItem( "managed", "DummyNet", "04:00:20:EF:A6:43", true, 6, 80 ); | ||
189 | addNewItem( "adhoc", "DummyNet", "40:03:A3:E7:56:22", false, 11, 30 ); | ||
190 | 199 | ||
200 | addNewItem( "managed", "Vanille", "04:00:20:EF:A6:43", true, 6, 80 ); | ||
201 | addNewItem( "managed", "Vanille", "04:00:20:EF:A6:23", true, 11, 10 ); | ||
202 | addNewItem( "adhoc", "ELAN", "40:03:43:E7:16:22", false, 3, 10 ); | ||
203 | addNewItem( "adhoc", "ELAN", "40:03:53:E7:56:62", false, 3, 15 ); | ||
204 | addNewItem( "adhoc", "ELAN", "40:03:63:E7:56:E2", false, 3, 20 ); | ||
205 | |||
191 | QString command ("98"); | 206 | QString command ("98"); |
192 | 207 | ||
193 | sendcomm( DAEMONADDR, DAEMONPORT, (const char*) command ); | 208 | //sendcomm( DAEMONADDR, DAEMONPORT, (const char*) command ); |
194 | 209 | ||
195 | } | 210 | } |
diff --git a/noncore/net/wellenreiter/gui/wellenreiterbase.cpp b/noncore/net/wellenreiter/gui/wellenreiterbase.cpp index 9b6424d..b1845b9 100644 --- a/noncore/net/wellenreiter/gui/wellenreiterbase.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiterbase.cpp | |||
@@ -60,11 +60,18 @@ WellenreiterBase::WellenreiterBase( QWidget* parent, const char* name, WFlags f | |||
60 | 60 | ||
61 | netview = new QListView( ap, "netview" ); | 61 | netview = new QListView( ap, "netview" ); |
62 | netview->addColumn( tr( "SSID" ) ); | 62 | netview->addColumn( tr( "SSID" ) ); |
63 | netview->setColumnAlignment( 0, AlignLeft || AlignVCenter ); | ||
63 | netview->addColumn( tr( "Sig" ) ); | 64 | netview->addColumn( tr( "Sig" ) ); |
65 | netview->setColumnAlignment( 1, AlignCenter ); | ||
64 | netview->addColumn( tr( "AP" ) ); | 66 | netview->addColumn( tr( "AP" ) ); |
67 | netview->setColumnAlignment( 2, AlignCenter ); | ||
65 | netview->addColumn( tr( "Chn" ) ); | 68 | netview->addColumn( tr( "Chn" ) ); |
69 | netview->setColumnAlignment( 3, AlignCenter ); | ||
66 | netview->addColumn( tr( "W" ) ); | 70 | netview->addColumn( tr( "W" ) ); |
71 | netview->setColumnAlignment( 4, AlignCenter ); | ||
67 | netview->addColumn( tr( "T" ) ); | 72 | netview->addColumn( tr( "T" ) ); |
73 | netview->setColumnAlignment( 5, AlignCenter ); | ||
74 | |||
68 | netview->setFrameShape( QListView::StyledPanel ); | 75 | netview->setFrameShape( QListView::StyledPanel ); |
69 | netview->setFrameShadow( QListView::Sunken ); | 76 | netview->setFrameShadow( QListView::Sunken ); |
70 | netview->setRootIsDecorated( TRUE ); | 77 | netview->setRootIsDecorated( TRUE ); |