summaryrefslogtreecommitdiff
authormickeyl <mickeyl>2003-04-13 01:03:40 (UTC)
committer mickeyl <mickeyl>2003-04-13 01:03:40 (UTC)
commit64d6b3e723b9b2fc3b1f3eea6da6344c5f26ce1e (patch) (side-by-side diff)
tree86ab7afb2d22626c4f8a68e6353bd318770480f7
parent0a2d3731e93a4738a4a3e4b2fce8d011a43b0966 (diff)
downloadopie-64d6b3e723b9b2fc3b1f3eea6da6344c5f26ce1e.zip
opie-64d6b3e723b9b2fc3b1f3eea6da6344c5f26ce1e.tar.gz
opie-64d6b3e723b9b2fc3b1f3eea6da6344c5f26ce1e.tar.bz2
adjust for new icon size
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/scanlist.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/net/wellenreiter/gui/scanlist.cpp b/noncore/net/wellenreiter/gui/scanlist.cpp
index 1ef24d2..a8cadd8 100644
--- a/noncore/net/wellenreiter/gui/scanlist.cpp
+++ b/noncore/net/wellenreiter/gui/scanlist.cpp
@@ -121,181 +121,181 @@ void MScanListView::addNewItem( QString type, QString essid, QString macaddr, bo
item = static_cast<MScanListItem*> ( item->itemBelow() );
}
if ( item )
{
// animate the item
/*
const QPixmap* pixmap = item->pixmap( 0 );
const QPixmap* nextpixmap = ani2;
if ( pixmap == ani1 )
nextpixmap = ani2;
else if ( pixmap == ani2 )
nextpixmap = ani3;
else if ( pixmap == ani3 )
nextpixmap = ani4;
else if ( pixmap == ani4 )
nextpixmap = ani1;
item->setPixmap( 0, *nextpixmap ); */
//qDebug( "current pixmap %d, next %d", pixmap, nextpixmap );
// we have already seen this net, check all childs if MAC exists
network = item;
item = static_cast<MScanListItem*> ( item->firstChild() );
assert( item ); // this shouldn't fail
while ( item && ( item->text( 2 ) != macaddr ) )
{
qDebug( "subitemtext: %s", (const char*) item->text( 2 ) );
item = static_cast<MScanListItem*> ( item->itemBelow() );
}
if ( item )
{
// we have already seen this item, it's a dupe
#ifdef DEBUG
qDebug( "%s is a dupe - ignoring...", (const char*) macaddr );
#endif
item->receivedBeacon();
return;
}
}
else
{
s.sprintf( "(i) new network: '%s'", (const char*) essid );
- network = new MScanListItem( this, "networks", essid, QString::null, 0, 0, 0 );
+ network = new MScanListItem( this, "network", essid, QString::null, 0, 0, 0 );
}
// insert new station as child from network
// no essid to reduce clutter, maybe later we have a nick or stationname to display!?
qDebug( "inserting new station %s", (const char*) macaddr );
MScanListItem* station = new MScanListItem( network, type, "", macaddr, wep, channel, signal );
if ( _manufacturerdb )
station->setManufacturer( _manufacturerdb->lookup( macaddr ) );
if ( type == "managed" )
{
s.sprintf( "(i) new AP in '%s' [%d]", (const char*) essid, channel );
}
else
{
s.sprintf( "(i) new adhoc station in '%s' [%d]", (const char*) essid, channel );
}
}
void MScanListView::traffic( QString type, QString from, QString to, QString via, QString additional )
{
if ( type != "toDS" ) return;
qDebug( "MScanList::traffic( [%s] | %s -> %s (via %s)",
(const char*) type, (const char*) from,
(const char*) to, (const char*) via );
QString s;
MScanListItem* network;
QListViewItemIterator it( this );
while ( it.current() && it.current()->text( col_ap ) != via ) ++it;
MScanListItem* item = static_cast<MScanListItem*>( it.current() );
if ( item ) // AP has been shown up, so just add our new "from" - station
{
network = static_cast<MScanListItem*>( item->parent() );
MScanListItem* subitem = static_cast<MScanListItem*>( network->firstChild() );
while ( subitem && ( subitem->text( col_ap ) != from ) )
{
qDebug( "subitemtext: %s", (const char*) subitem->text( col_ap ) );
subitem = static_cast<MScanListItem*> ( subitem->itemBelow() );
}
if ( subitem )
{
// we have already seen this item, it's a dupe
#ifdef DEBUG
qDebug( "%s is a dupe - ignoring...", (const char*) from );
#endif
subitem->receivedBeacon(); //FIXME: sent data bit
return;
}
// Hey, it seems to be a new item :-D
MScanListItem* station = new MScanListItem( item->parent(), "adhoc", /* network->text( col_essid ) */ "", from, false, -1, -1 );
if ( _manufacturerdb )
station->setManufacturer( _manufacturerdb->lookup( from ) );
}
else
{
qDebug( "D'Oh! Station without AP... ignoring for now... will handle this in alpha-4 version :-D" );
}
}
//============================================================
// MScanListItem
//============================================================
MScanListItem::MScanListItem( QListView* parent, QString type, QString essid, QString macaddr,
bool wep, int channel, int signal )
:OListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ),
_type( type ), _essid( essid ), _macaddr( macaddr ), _wep( wep ),
_channel( channel ), _signal( signal ), _beacons( 1 )
{
qDebug( "creating scanlist item" );
- if ( WellenreiterConfigWindow::instance() && type == "networks" )
+ if ( WellenreiterConfigWindow::instance() && type == "network" )
playSound( WellenreiterConfigWindow::instance()->soundOnNetwork() );
decorateItem( type, essid, macaddr, wep, channel, signal );
}
MScanListItem::MScanListItem( QListViewItem* parent, QString type, QString essid, QString macaddr,
bool wep, int channel, int signal )
:OListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null )
{
qDebug( "creating scanlist item" );
decorateItem( type, essid, macaddr, wep, channel, signal );
}
OListViewItem* MScanListItem::childFactory()
{
return new MScanListItem( this );
}
void MScanListItem::serializeTo( QDataStream& s ) const
{
qDebug( "serializing MScanListItem" );
OListViewItem::serializeTo( s );
s << _type;
s << (Q_UINT8) ( _wep ? 'y' : 'n' );
}
void MScanListItem::serializeFrom( QDataStream& s )
{
qDebug( "serializing MScanListItem" );
OListViewItem::serializeFrom( s );
char wep;
s >> _type;
s >> (Q_UINT8) wep;
_wep = (wep == 'y');
QString name;
name.sprintf( "wellenreiter/%s", (const char*) _type );
setPixmap( col_type, Resource::loadPixmap( name ) );
if ( _wep )
setPixmap( col_wep, Resource::loadPixmap( "wellenreiter/cracked" ) ); //FIXME: rename the pixmap!
listView()->triggerUpdate();
}
void MScanListItem::decorateItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal )
{
qDebug( "decorating scanlist item %s / %s / %s [%d]",
(const char*) type,