Diffstat (limited to 'noncore/net/wellenreiter/gui/wellenreiter.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp index 96ab7bd..afb010c 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp @@ -34,8 +34,9 @@ Wellenreiter::Wellenreiter( QWidget* parent, const char* name, WFlags fl ) : WellenreiterBase( parent, name, fl ) { connect( button, SIGNAL( clicked() ), this, SLOT( buttonClicked() ) ); + netview->setColumnWidthMode( 1, QListView::Manual ); // // setup socket for daemon communication and start poller // @@ -85,8 +86,32 @@ void Wellenreiter::timerEvent( QTimerEvent* e ) // qDebug( "no message :(" ); } } +void Wellenreiter::addNewStation( QString type, QString essid, QString ap, bool wep, int channel, int signal ) +{ + // FIXME: this code belongs in customized QListView, not into this class + + // search, if we had an item with this essid once before + + QListViewItem* item = netview->firstChild(); + + while ( item && ( item->text( 0 ) != essid ) ) + { + qDebug( "itemtext: %s", (const char*) item->text( 0 ) ); + item = item->itemBelow(); + } + if ( item ) + { + qDebug( "found!" ); + new MScanListItem( item, type, essid, ap, wep, channel, signal ); + } + else + { + new MScanListItem( netview, type, essid, ap, wep, channel, signal ); + } +} + void Wellenreiter::buttonClicked() { // FIXME: communicate with daemon and set button text according to state @@ -94,8 +119,8 @@ void Wellenreiter::buttonClicked() button->setText( "Stop Scanning" ); // add some icons, so that we can see if this works - new MScanListItem( netview, "managed", "MyNet", "04:00:20:EF:A6:43", true, 6, 80 ); - new MScanListItem( netview, "adhoc", "YourNet", "40:03:A3:E7:56:22", false, 11, 30 ); + addNewStation( "managed", "MyNet", "04:00:20:EF:A6:43", true, 6, 80 ); + addNewStation( "adhoc", "YourNet", "40:03:A3:E7:56:22", false, 11, 30 ); } |