Fix handling of networks consisting of more than one AP

pull/1/head
Timothy Pearson 11 years ago
parent 847414368a
commit 54f5a904e4

@ -91,6 +91,17 @@
<bool>true</bool>
</property>
</column>
<column>
<property name="text">
<string>APs</string>
</property>
<property name="clickable">
<bool>true</bool>
</property>
<property name="resizable">
<bool>true</bool>
</property>
</column>
<property name="name">
<cstring>lvEssids</cstring>
</property>

@ -53,19 +53,27 @@ class NetworkListViewItem : public TDEListViewItem
, _net(net)
{
TQ_UINT8 strength = net.getStrength();
if (strength > 80)
if (strength > 80) {
setPixmap(1, TDEGlobal::iconLoader()->loadIcon("nm_signal_100", TDEIcon::Small));
else if (strength > 55)
}
else if (strength > 55) {
setPixmap(1, TDEGlobal::iconLoader()->loadIcon("nm_signal_75", TDEIcon::Small));
else if (strength > 30)
}
else if (strength > 30) {
setPixmap(1, TDEGlobal::iconLoader()->loadIcon("nm_signal_50", TDEIcon::Small));
else if (strength > 5)
}
else if (strength > 5) {
setPixmap(1, TDEGlobal::iconLoader()->loadIcon("nm_signal_25", TDEIcon::Small));
else
}
else {
setPixmap(1, TDEGlobal::iconLoader()->loadIcon("nm_signal_00", TDEIcon::Small));
}
if (net.isEncrypted())
if (net.isEncrypted()) {
setPixmap(2, TDEGlobal::iconLoader()->loadIcon("lock", TDEIcon::Small));
}
setText(3, TQString("%1").arg(net.getAPCount()));
}
WirelessNetwork _net;

@ -60,7 +60,7 @@ class WirelessDeviceTrayPrivate
~WirelessDeviceTrayPrivate() {}
TQString dev;
TQGuardedPtr<TDENetworkWiFiAPInfo> activeAccessPoint;
TDENetworkWiFiAPInfo* activeAccessPoint;
};
TQStringList WirelessDeviceTray::getToolTipText()
@ -204,7 +204,7 @@ void WirelessDeviceTray::addWirelessNetworks(TDEPopupMenu* menu)
continue;
}
wirelessNetworkItem = new WirelessNetworkItem (menu,
wirelessNetworkItem = new WirelessNetworkItem (popup,
d->dev,
net,
(*it)->UUID,
@ -234,7 +234,7 @@ void WirelessDeviceTray::addWirelessNetworks(TDEPopupMenu* menu)
}
WirelessNetworkItem* wirelessNetworkItem;
wirelessNetworkItem = new WirelessNetworkItem (menu,
wirelessNetworkItem = new WirelessNetworkItem (newpopup,
d->dev,
*it,
NULL,

@ -145,8 +145,8 @@ WirelessNetworkItem::paint (TQPainter *p, const TQColorGroup &/*cg*/, bool highl
pmAdHoc.convertFromImage(pmAdHocImg);
}
p->drawPixmap (parent->sizeHint ().width () - pbarStrength->width () - _space - pmAdHoc.size ().width () - spacer - 6, y + _border, pmAdHoc);
}
}
p->drawPixmap (parent->sizeHint ().width () - pbarStrength->width () - _space, y +_border, TQPixmap::grabWidget (pbarStrength));
}
@ -195,7 +195,7 @@ WirelessNetworkItem::WirelessNetworkItem (TQWidget* p, TQString dev, WirelessNet
_border ++;
_width = kapp->fontMetrics().size(AlignLeft | AlignVCenter | DontClip | ShowPrefix, getDisplayText()).width(); /* essid */
_width += SmallIcon (NULL, TQIconSet::Automatic).width (); /* pmLock */
_width += SmallIcon (NULL, TQIconSet::Automatic).width (); /* pmLock */
_width += _space; /* pmLock <-> pbarStrength */
_width += 100; /* pbarStrength */
_width += _space; /* pbarStrength -> contextMenu */
@ -237,7 +237,7 @@ WirelessNetworkItem::WirelessNetworkItem (TQWidget* p, TQString dev, WirelessNet
_border ++;
_width = kapp->fontMetrics().size(AlignLeft | AlignVCenter | DontClip | ShowPrefix, getDisplayText()).width(); /* essid */
_width += SmallIcon (NULL, TQIconSet::Automatic).width (); /* pmLock */
_width += SmallIcon (NULL, TQIconSet::Automatic).width (); /* pmLock */
_width += _space; /* pmLock <-> pbarStrength */
_width += 100; /* pbarStrength */
_width += _space; /* pbarStrength -> contextMenu */

@ -96,6 +96,9 @@ bool WirelessNetwork::contains(const TDEMACAddress ap)
apInfo = nm->findAccessPointByBSSID(ap);
}
}
else {
apInfo = nm->findAccessPointByBSSID(ap);
}
if (apInfo) {
if ( (d->match & MATCH_SSID) && (getSsid() != apInfo->SSID)) {
@ -120,6 +123,11 @@ bool WirelessNetwork::addAP(const TDEMACAddress ap, const TQString dev)
return false;
}
const int WirelessNetwork::getAPCount() const
{
return d->aps.count();
}
const TQByteArray WirelessNetwork::getSsid() const
{
TDEGlobalNetworkManager* nm = TDEGlobal::networkManager();

@ -80,6 +80,9 @@ class WirelessNetwork
// strength of the best AP
TQ_UINT8 getStrength() const;
// number of APs in this net
const int getAPCount() const;
void setActive(bool active);
bool getActive() const;

Loading…
Cancel
Save