summaryrefslogtreecommitdiff
path: root/noncore/net/wellenreiter/gui/scanlist.cpp
Side-by-side diff
Diffstat (limited to 'noncore/net/wellenreiter/gui/scanlist.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/scanlist.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/noncore/net/wellenreiter/gui/scanlist.cpp b/noncore/net/wellenreiter/gui/scanlist.cpp
index aea7eb6..fd88b63 100644
--- a/noncore/net/wellenreiter/gui/scanlist.cpp
+++ b/noncore/net/wellenreiter/gui/scanlist.cpp
@@ -117,13 +117,14 @@ void MScanListView::serializeFrom( QDataStream& s)
void MScanListView::addNewItem( const QString& type,
const QString& essid,
const OMacAddress& mac,
bool wep,
int channel,
int signal,
- const GpsLocation& loc )
+ const GpsLocation& loc,
+ bool probe )
{
QString macaddr = mac.toString(true);
#ifdef DEBUG
qDebug( "MScanList::addNewItem( %s / %s / %s [%d]", (const char*) type,
(const char*) essid, (const char*) macaddr, channel );
@@ -170,13 +171,13 @@ void MScanListView::addNewItem( const QString& type,
}
}
else
{
s.sprintf( "(i) New network: ESSID '%s'", (const char*) essid );
MLogWindow::logwindow()->log( s );
- network = new MScanListItem( this, "network", essid, QString::null, 0, 0, 0 );
+ network = new MScanListItem( this, "network", essid, QString::null, 0, 0, 0, probe );
}
// insert new station as child from network
// no essid to reduce clutter, maybe later we have a nick or stationname to display!?
@@ -194,13 +195,12 @@ void MScanListView::addNewItem( const QString& type,
}
else
{
s.sprintf( "(i) New AdHoc station in '%s' [%d]", (const char*) essid, channel );
}
MLogWindow::logwindow()->log( s );
-
}
void MScanListView::addIfNotExisting( MScanListItem* network, const OMacAddress& addr, const QString& type )
{
MScanListItem* subitem = static_cast<MScanListItem*>( network->firstChild() );
@@ -407,35 +407,35 @@ void MScanListView::contextMenuRequested( QListViewItem* item, const QPoint&, in
//============================================================
// MScanListItem
//============================================================
MScanListItem::MScanListItem( QListView* parent, const QString& type, const QString& essid, const QString& macaddr,
- bool wep, int channel, int signal )
+ bool wep, int channel, int signal, bool probed )
:OListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ),
_type( type ), _essid( essid ), _macaddr( macaddr ), _wep( wep ),
_channel( channel ), _signal( signal ), _beacons( 1 )
{
#ifdef DEBUG
qDebug( "creating scanlist item" );
#endif
if ( WellenreiterConfigWindow::instance() )
WellenreiterConfigWindow::instance()->performAction( type, essid, macaddr, wep, channel, signal ); // better use signal/slot combination here
- decorateItem( type, essid, macaddr, wep, channel, signal );
+ decorateItem( type, essid, macaddr, wep, channel, signal, probed );
}
MScanListItem::MScanListItem( QListViewItem* parent, const QString& type, const QString& essid, const QString& macaddr,
bool wep, int channel, int signal )
:OListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null )
{
#ifdef DEBUG
qDebug( "creating scanlist item" );
#endif
- decorateItem( type, essid, macaddr, wep, channel, signal );
+ decorateItem( type, essid, macaddr, wep, channel, signal, false );
}
const QString& MScanListItem::essid() const
{
if ( type == "network" )
return _essid;
@@ -476,13 +476,13 @@ void MScanListItem::serializeFrom( QDataStream& s )
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 )
+void MScanListItem::decorateItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal, bool probed )
{
#ifdef DEBUG
qDebug( "decorating scanlist item %s / %s / %s [%d]",
(const char*) type,
(const char*) essid,
(const char*) macaddr,
@@ -491,12 +491,18 @@ void MScanListItem::decorateItem( QString type, QString essid, QString macaddr,
// set icon for managed or adhoc mode
QString name;
name.sprintf( "wellenreiter/%s", (const char*) type );
setPixmap( col_type, Resource::loadPixmap( name ) );
+ // special case for probed networks FIXME: This is ugly at present
+ if ( type == "network" && probed )
+ {
+ setPixmap( col_type, Resource::loadPixmap( "wellenreiter/network-probed.png" ) );
+ }
+
// set icon for wep (wireless encryption protocol)
if ( wep )
setPixmap( col_wep, Resource::loadPixmap( "wellenreiter/cracked" ) ); //FIXME: rename the pixmap!
// set channel and signal text