|
|
@ -69,9 +69,11 @@ TQStringList WirelessDeviceTray::getToolTipText()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TQStringList tooltip = DeviceTrayComponent::getToolTipText();
|
|
|
|
TQStringList tooltip = DeviceTrayComponent::getToolTipText();
|
|
|
|
|
|
|
|
|
|
|
|
TDENetworkWiFiAPInfo * ap = d->dev->getActiveAccessPoint();
|
|
|
|
TDENetworkConnectionManager* deviceConnMan = d->dev->connectionManager();
|
|
|
|
if (ap)
|
|
|
|
TDENetworkWiFiAPInfo * ap = deviceConnMan->findAccessPointByBSSID(deviceConnMan->deviceInformation().wiFiInfo.activeAccessPointBSSID);
|
|
|
|
tooltip.append(i18n("Network: %1").arg(ap->getDisplaySsid()));
|
|
|
|
if (ap) {
|
|
|
|
|
|
|
|
tooltip.append(i18n("Network: %1").arg(ap->friendlySSID()));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return tooltip;
|
|
|
|
return tooltip;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -79,29 +81,27 @@ TQStringList WirelessDeviceTray::getToolTipText()
|
|
|
|
void WirelessDeviceTray::newConnection()
|
|
|
|
void WirelessDeviceTray::newConnection()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// create a new wireless connection
|
|
|
|
// create a new wireless connection
|
|
|
|
Connection* conn = new TDEWiFiConnection();
|
|
|
|
TDENetworkConnection* conn = new TDEWiFiConnection();
|
|
|
|
|
|
|
|
|
|
|
|
// open a dialog for editing the connection
|
|
|
|
// open a dialog for editing the connection
|
|
|
|
use_new_wireless_essid = 0; // deactivate autofill for now
|
|
|
|
use_new_wireless_essid = 0; // deactivate autofill for now
|
|
|
|
ConnectionSettingsDialogImpl* dlg = new ConnectionSettingsDialogImpl(conn, true, NULL, tray(), "connect_something", false, TQt::WDestructiveClose);
|
|
|
|
ConnectionSettingsDialogImpl* dlg = new ConnectionSettingsDialogImpl(conn, true, tray(), "connect_something", false, TQt::WDestructiveClose);
|
|
|
|
dlg->show();
|
|
|
|
dlg->show();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool WirelessDeviceTray::findMatchingNetwork(const TDEWiFiConnection* conn, const TQValueList<WirelessNetwork>& nets, WirelessNetwork& net)
|
|
|
|
bool WirelessDeviceTray::findMatchingNetwork(const TDEWiFiConnection* conn, const TQValueList<WirelessNetwork>& nets, WirelessNetwork& net)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Wireless* wireless = conn->getWirelessSetting();
|
|
|
|
const TDEWiFiConnection* wireless = dynamic_cast<const TDEWiFiConnection*>(conn);
|
|
|
|
WirelessSecurity* security = conn->getWirelessSecuritySetting();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!wireless && !security)
|
|
|
|
if (!wireless) {
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for (TQValueList<WirelessNetwork>::ConstIterator it = nets.begin(); it != nets.end(); ++it)
|
|
|
|
for (TQValueList<WirelessNetwork>::ConstIterator it = nets.begin(); it != nets.end(); ++it) {
|
|
|
|
{
|
|
|
|
if (wireless->SSID == (*it).getSsid()) {
|
|
|
|
if (wireless->getEssid() == (*it).getSsid())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
net = *it;
|
|
|
|
net = *it;
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -109,16 +109,14 @@ bool WirelessDeviceTray::findMatchingNetwork(const TDEWiFiConnection* conn, cons
|
|
|
|
TDEWiFiConnection* WirelessDeviceTray::findMatchingConnection(const WirelessNetwork& net, const TQValueList<TDEWiFiConnection*>& connections)
|
|
|
|
TDEWiFiConnection* WirelessDeviceTray::findMatchingConnection(const WirelessNetwork& net, const TQValueList<TDEWiFiConnection*>& connections)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// try to find a connection matching this network
|
|
|
|
// try to find a connection matching this network
|
|
|
|
for (TQValueList<TDEWiFiConnection*>::ConstIterator it = connections.begin(); it != connections.end(); ++it)
|
|
|
|
for (TQValueList<TDEWiFiConnection*>::ConstIterator it = connections.begin(); it != connections.end(); ++it) {
|
|
|
|
{
|
|
|
|
const TDEWiFiConnection* wireless = dynamic_cast<const TDEWiFiConnection*>(*it);
|
|
|
|
Wireless* wireless = (*it)->getWirelessSetting();
|
|
|
|
|
|
|
|
WirelessSecurity* security = (*it)->getWirelessSecuritySetting();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// should not happen but its ever better to check
|
|
|
|
if (!wireless) {
|
|
|
|
if (!wireless || !security)
|
|
|
|
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (wireless->getEssid() == net.getSsid())
|
|
|
|
if (wireless->SSID == net.getSsid())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return *it;
|
|
|
|
return *it;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -138,10 +136,13 @@ void WirelessDeviceTray::addWirelessNetworks(KPopupMenu* menu)
|
|
|
|
TQValueList<TDEWiFiConnection*> conns = WirelessManager::getWirelessConnections();
|
|
|
|
TQValueList<TDEWiFiConnection*> conns = WirelessManager::getWirelessConnections();
|
|
|
|
|
|
|
|
|
|
|
|
// get the currently active connection
|
|
|
|
// get the currently active connection
|
|
|
|
NMProxy* nm = NMProxy::getInstance();
|
|
|
|
TDEGlobalNetworkManager* nm = KGlobal::networkManager();
|
|
|
|
Connection* active_conn = nm->getActiveConnection(d->dev);
|
|
|
|
TDENetworkConnectionManager* deviceConnMan = d->dev->connectionManager();
|
|
|
|
if (active_conn)
|
|
|
|
TDENetworkConnection* active_conn = NULL;
|
|
|
|
kdDebug() << active_conn->getObjectPath().data() << endl;
|
|
|
|
if ((!(deviceConnMan->deviceInformation().statusFlags & TDENetworkConnectionStatus::Disconnected))
|
|
|
|
|
|
|
|
&& (!(deviceConnMan->deviceInformation().statusFlags & TDENetworkConnectionStatus::Invalid))) {
|
|
|
|
|
|
|
|
active_conn = nm->findConnectionByUUID(deviceConnMan->deviceInformation().activeConnectionUUID);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// add all wireless connections in range
|
|
|
|
// add all wireless connections in range
|
|
|
|
// (we may have more then one connection per network)
|
|
|
|
// (we may have more then one connection per network)
|
|
|
@ -160,7 +161,7 @@ void WirelessDeviceTray::addWirelessNetworks(KPopupMenu* menu)
|
|
|
|
*it,
|
|
|
|
*it,
|
|
|
|
false);
|
|
|
|
false);
|
|
|
|
int id = menu->insertItem (wirelessNetworkItem, -1, -1);
|
|
|
|
int id = menu->insertItem (wirelessNetworkItem, -1, -1);
|
|
|
|
menu->setItemChecked(id, ((Connection*)(*it) == active_conn));
|
|
|
|
menu->setItemChecked(id, ((TDENetworkConnection*)(*it) == active_conn));
|
|
|
|
menu->connectItem(id, wirelessNetworkItem, TQT_SLOT(slotActivate()));
|
|
|
|
menu->connectItem(id, wirelessNetworkItem, TQT_SLOT(slotActivate()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -177,11 +178,11 @@ void WirelessDeviceTray::addWirelessNetworks(KPopupMenu* menu)
|
|
|
|
if ( findMatchingNetwork(*it, nets, net) )
|
|
|
|
if ( findMatchingNetwork(*it, nets, net) )
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
|
|
Info* info = (*it)->getInfoSetting();
|
|
|
|
TDEWiFiConnection* wireless = dynamic_cast<const TDEWiFiConnection*>(*it);
|
|
|
|
Wireless* wireless = (*it)->getWirelessSetting();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!info || !wireless)
|
|
|
|
if (!wireless) {
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
wirelessNetworkItem = new WirelessNetworkItem (menu,
|
|
|
|
wirelessNetworkItem = new WirelessNetworkItem (menu,
|
|
|
|
d->dev,
|
|
|
|
d->dev,
|
|
|
@ -201,7 +202,6 @@ void WirelessDeviceTray::addWirelessNetworks(KPopupMenu* menu)
|
|
|
|
|
|
|
|
|
|
|
|
// // List available unsaved networks
|
|
|
|
// // List available unsaved networks
|
|
|
|
TQPopupMenu* newpopup = new TQPopupMenu(menu);
|
|
|
|
TQPopupMenu* newpopup = new TQPopupMenu(menu);
|
|
|
|
TDEWiFiConnection* newconn;
|
|
|
|
|
|
|
|
uint newnetworkItemsAdded = 0;
|
|
|
|
uint newnetworkItemsAdded = 0;
|
|
|
|
TQValueList<WirelessNetwork> newnets = WirelessManager::getWirelessNetworks(0, WirelessNetwork::MATCH_SSID);
|
|
|
|
TQValueList<WirelessNetwork> newnets = WirelessManager::getWirelessNetworks(0, WirelessNetwork::MATCH_SSID);
|
|
|
|
|
|
|
|
|
|
|
@ -234,23 +234,23 @@ void WirelessDeviceTray::addWirelessNetworks(KPopupMenu* menu)
|
|
|
|
|
|
|
|
|
|
|
|
void WirelessDeviceTray::addMenuItems(KPopupMenu* menu)
|
|
|
|
void WirelessDeviceTray::addMenuItems(KPopupMenu* menu)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
NMProxy* nm = NMProxy::getInstance();
|
|
|
|
// get the currently active connection
|
|
|
|
TQT_DBusError err;
|
|
|
|
TDEGlobalNetworkManager* nm = KGlobal::networkManager();
|
|
|
|
|
|
|
|
|
|
|
|
// device title
|
|
|
|
// device title
|
|
|
|
Subhead* subhead = new Subhead (menu, "subhead", TQString("Wireless Connection (%1)").arg(d->dev->getInterface()), SmallIcon("wireless", TQIconSet::Automatic));
|
|
|
|
Subhead* subhead = new Subhead (menu, "subhead", TQString("Wireless Connection (%1)").arg(d->dev->deviceNode()), SmallIcon("wireless", TQIconSet::Automatic));
|
|
|
|
menu->insertItem (subhead, -1, -1);
|
|
|
|
menu->insertItem (subhead, -1, -1);
|
|
|
|
|
|
|
|
|
|
|
|
// bolding subhead instead
|
|
|
|
// bolding subhead instead
|
|
|
|
//menu->insertSeparator();
|
|
|
|
//menu->insertSeparator();
|
|
|
|
|
|
|
|
|
|
|
|
if (!nm->getWirelessEnabled(err))
|
|
|
|
if (!nm->wiFiEnabled())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// wireless disabled -> do not show any connections
|
|
|
|
// wireless disabled -> do not show any connections
|
|
|
|
subhead = new Subhead(menu, "subhead2", i18n("Wireless disabled"), SmallIcon("no", TQIconSet::Automatic));
|
|
|
|
subhead = new Subhead(menu, "subhead2", i18n("Wireless disabled"), SmallIcon("no", TQIconSet::Automatic));
|
|
|
|
menu->insertItem(subhead, -1, -1);
|
|
|
|
menu->insertItem(subhead, -1, -1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (!nm->getWirelessHardwareEnabled(err))
|
|
|
|
else if (!nm->wiFiHardwareEnabled())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// wireless disabled -> do not show any connections
|
|
|
|
// wireless disabled -> do not show any connections
|
|
|
|
subhead = new Subhead(menu, "subhead2", i18n("Wireless disabled by Killswitch"), SmallIcon("no", TQIconSet::Automatic));
|
|
|
|
subhead = new Subhead(menu, "subhead2", i18n("Wireless disabled by Killswitch"), SmallIcon("no", TQIconSet::Automatic));
|
|
|
@ -263,33 +263,49 @@ void WirelessDeviceTray::addMenuItems(KPopupMenu* menu)
|
|
|
|
|
|
|
|
|
|
|
|
// bring the device down
|
|
|
|
// bring the device down
|
|
|
|
KAction* deactivate = tray()->actionCollection()->action("deactivate_device");
|
|
|
|
KAction* deactivate = tray()->actionCollection()->action("deactivate_device");
|
|
|
|
if (deactivate)
|
|
|
|
if (deactivate) {
|
|
|
|
deactivate->plug(menu);
|
|
|
|
deactivate->plug(menu);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
menu->insertSeparator();
|
|
|
|
menu->insertSeparator();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void WirelessDeviceTray::setPixmapForStates(TDENetworkConnectionStatus::TDENetworkConnectionStatus states, TQString pixmap) {
|
|
|
|
|
|
|
|
TDENetworkConnectionStatus::TDENetworkConnectionStatus flag = (TDENetworkConnectionStatus::TDENetworkConnectionStatus)0x80000000;
|
|
|
|
|
|
|
|
while (flag > 0) {
|
|
|
|
|
|
|
|
if (states & flag) {
|
|
|
|
|
|
|
|
setPixmapForState(flag, pixmap);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
flag = (TDENetworkConnectionStatus::TDENetworkConnectionStatus)(flag >> 1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WirelessDeviceTray::slotUpdateDeviceState(TDENetworkConnectionStatus::TDENetworkConnectionStatus state)
|
|
|
|
void WirelessDeviceTray::slotUpdateDeviceState(TDENetworkConnectionStatus::TDENetworkConnectionStatus state)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
slotCheckActiveAccessPoint();
|
|
|
|
slotCheckActiveAccessPoint();
|
|
|
|
if (state == NM_DEVICE_STATE_ACTIVATED)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// trigger an update of the connections seen bssids property
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TDENetworkWiFiAPInfo * ap = d->dev->getActiveAccessPoint();
|
|
|
|
if (state == TDENetworkConnectionStatus::Connected) {
|
|
|
|
|
|
|
|
// trigger an update of the connections seen bssids property
|
|
|
|
|
|
|
|
TDENetworkConnectionManager* deviceConnMan = d->dev->connectionManager();
|
|
|
|
|
|
|
|
TDENetworkWiFiAPInfo * ap = deviceConnMan->findAccessPointByBSSID(deviceConnMan->deviceInformation().wiFiInfo.activeAccessPointBSSID);
|
|
|
|
if (ap) {
|
|
|
|
if (ap) {
|
|
|
|
int strength = ap->getStrength();
|
|
|
|
int strength = (ap->signalQuality*100.0);
|
|
|
|
|
|
|
|
|
|
|
|
if (strength > 80)
|
|
|
|
if (strength > 80) {
|
|
|
|
setPixmapForState((TDENetworkConnectionStatus::TDENetworkConnectionStatus)state, "nm_signal_100");
|
|
|
|
setPixmapForStates(state, "nm_signal_100");
|
|
|
|
else if (strength > 55)
|
|
|
|
}
|
|
|
|
setPixmapForState((TDENetworkConnectionStatus::TDENetworkConnectionStatus)state, "nm_signal_75");
|
|
|
|
else if (strength > 55) {
|
|
|
|
else if (strength > 30)
|
|
|
|
setPixmapForStates(state, "nm_signal_75");
|
|
|
|
setPixmapForState((TDENetworkConnectionStatus::TDENetworkConnectionStatus)state, "nm_signal_50");
|
|
|
|
}
|
|
|
|
else if (strength > 5)
|
|
|
|
else if (strength > 30) {
|
|
|
|
setPixmapForState((TDENetworkConnectionStatus::TDENetworkConnectionStatus)state, "nm_signal_25");
|
|
|
|
setPixmapForStates(state, "nm_signal_50");
|
|
|
|
else
|
|
|
|
}
|
|
|
|
setPixmapForState((TDENetworkConnectionStatus::TDENetworkConnectionStatus)state, "nm_signal_00");
|
|
|
|
else if (strength > 5) {
|
|
|
|
|
|
|
|
setPixmapForStates(state, "nm_signal_25");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
setPixmapForStates(state, "nm_signal_00");
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -298,42 +314,64 @@ void WirelessDeviceTray::slotCheckActiveAccessPoint()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// the active AP changed, if a connection is already active we have roamed
|
|
|
|
// the active AP changed, if a connection is already active we have roamed
|
|
|
|
// thus add the bssid to the list of seen bssids
|
|
|
|
// thus add the bssid to the list of seen bssids
|
|
|
|
NMProxy* nm = NMProxy::getInstance();
|
|
|
|
|
|
|
|
if (!nm)
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TDEWiFiConnection* active_conn = dynamic_cast<TDEWiFiConnection*>(nm->getActiveConnection(d->dev));
|
|
|
|
// get the currently active connection
|
|
|
|
if (active_conn && d->dev->getState() == NM_DEVICE_STATE_ACTIVATED)
|
|
|
|
TDEGlobalNetworkManager* nm = KGlobal::networkManager();
|
|
|
|
{
|
|
|
|
TDENetworkConnectionManager* deviceConnMan = d->dev->connectionManager();
|
|
|
|
if ( d->dev->getActiveAccessPoint() != d->activeAccessPoint) {
|
|
|
|
TDENetworkConnection* active_conn = NULL;
|
|
|
|
if (!d->activeAccessPoint.isNull())
|
|
|
|
if ((!(deviceConnMan->deviceInformation().statusFlags & TDENetworkConnectionStatus::Disconnected))
|
|
|
|
disconnect( d->activeAccessPoint, TQT_SIGNAL(strengthChanged(TQ_UINT8)), this, TQT_SLOT(apStrengthChanged(TQ_UINT8)));
|
|
|
|
&& (!(deviceConnMan->deviceInformation().statusFlags & TDENetworkConnectionStatus::Invalid))) {
|
|
|
|
|
|
|
|
active_conn = nm->findConnectionByUUID(deviceConnMan->deviceInformation().activeConnectionUUID);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (active_conn && deviceConnMan->deviceInformation().statusFlags == TDENetworkConnectionStatus::Connected) {
|
|
|
|
|
|
|
|
TDENetworkWiFiAPInfo * activeap = deviceConnMan->findAccessPointByBSSID(deviceConnMan->deviceInformation().wiFiInfo.activeAccessPointBSSID);
|
|
|
|
|
|
|
|
if ( activeap != d->activeAccessPoint) {
|
|
|
|
|
|
|
|
if (!d->activeAccessPoint.isNull()) {
|
|
|
|
|
|
|
|
disconnect( deviceConnMan, TQT_SIGNAL(accessPointStatusChanged(TDEMACAddress, TDENetworkAPEventType::TDENetworkAPEventType)), this, TQT_SLOT(apPropertyChanged(TDEMACAddress, TDENetworkAPEventType::TDENetworkAPEventType)));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
d->activeAccessPoint = d->dev->getActiveAccessPoint();
|
|
|
|
d->activeAccessPoint = activeap;
|
|
|
|
if ( d->activeAccessPoint ) {
|
|
|
|
if ( d->activeAccessPoint ) {
|
|
|
|
connect( d->activeAccessPoint, TQT_SIGNAL(strengthChanged(TQ_UINT8)), this, TQT_SLOT(apStrengthChanged(TQ_UINT8)));
|
|
|
|
connect( deviceConnMan, TQT_SIGNAL(accessPointStatusChanged(TDEMACAddress, TDENetworkAPEventType::TDENetworkAPEventType)), this, TQT_SLOT(apPropertyChanged(TDEMACAddress, TDENetworkAPEventType::TDENetworkAPEventType)));
|
|
|
|
ConnectionSettings::Wireless* wireless = active_conn->getWirelessSetting();
|
|
|
|
TDEWiFiConnection* wireless = dynamic_cast<TDEWiFiConnection*>(active_conn);
|
|
|
|
wireless->addSeenBssid(d->activeAccessPoint->getHwAddress());
|
|
|
|
if (wireless) {
|
|
|
|
|
|
|
|
if (!(wireless->heardBSSIDs.contains(d->activeAccessPoint->BSSID))) {
|
|
|
|
|
|
|
|
wireless->heardBSSIDs.append(d->activeAccessPoint->BSSID);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WirelessDeviceTray::apStrengthChanged(TQ_UINT8 strength)
|
|
|
|
void WirelessDeviceTray::apPropertyChanged(TDEMACAddress BSSID, TDENetworkAPEventType::TDENetworkAPEventType event)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
kdDebug() << k_funcinfo << (uint)strength << endl;
|
|
|
|
if (event == TDENetworkAPEventType::SignalStrengthChanged) {
|
|
|
|
TDENetworkConnectionStatus::TDENetworkConnectionStatus state = device()->getState();
|
|
|
|
TDENetworkConnectionManager* deviceConnMan = d->dev->connectionManager();
|
|
|
|
if (strength > 80)
|
|
|
|
TDENetworkWiFiAPInfo * ap = deviceConnMan->findAccessPointByBSSID(BSSID);
|
|
|
|
setPixmapForState(state, "nm_signal_100");
|
|
|
|
if (ap) {
|
|
|
|
else if (strength > 55)
|
|
|
|
TQ_UINT32 strength = (ap->signalQuality*100.0);
|
|
|
|
setPixmapForState(state, "nm_signal_75");
|
|
|
|
kdDebug() << k_funcinfo << strength << endl;
|
|
|
|
else if (strength > 30)
|
|
|
|
TDENetworkConnectionStatus::TDENetworkConnectionStatus state = deviceConnMan->deviceInformation().statusFlags;
|
|
|
|
setPixmapForState(state, "nm_signal_50");
|
|
|
|
if (strength > 80) {
|
|
|
|
else if (strength > 5)
|
|
|
|
setPixmapForStates(state, "nm_signal_100");
|
|
|
|
setPixmapForState(state, "nm_signal_25");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else if (strength > 55) {
|
|
|
|
setPixmapForState(state, "nm_signal_00");
|
|
|
|
setPixmapForStates(state, "nm_signal_75");
|
|
|
|
emit uiUpdated();
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (strength > 30) {
|
|
|
|
|
|
|
|
setPixmapForStates(state, "nm_signal_50");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (strength > 5) {
|
|
|
|
|
|
|
|
setPixmapForStates(state, "nm_signal_25");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
setPixmapForStates(state, "nm_signal_00");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
emit uiUpdated();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WirelessDeviceTray::slotAccessPointAdded(TDENetworkWiFiAPInfo* ap)
|
|
|
|
void WirelessDeviceTray::slotAccessPointAdded(TDENetworkWiFiAPInfo* ap)
|
|
|
@ -353,11 +391,11 @@ WirelessDeviceTray::WirelessDeviceTray (TDENetworkDevice* dev, KSystemTray * par
|
|
|
|
d->dev = dev;
|
|
|
|
d->dev = dev;
|
|
|
|
|
|
|
|
|
|
|
|
// we want other icons for wireless devices
|
|
|
|
// we want other icons for wireless devices
|
|
|
|
setPixmapForState(NM_DEVICE_STATE_UNKNOWN, "wireless_off");
|
|
|
|
setPixmapForState(TDENetworkConnectionStatus::Invalid, "wireless_off");
|
|
|
|
setPixmapForState(NM_DEVICE_STATE_UNAVAILABLE, "wireless_off");
|
|
|
|
setPixmapForState(TDENetworkConnectionStatus::LinkUnavailable, "wireless_off");
|
|
|
|
setPixmapForState(NM_DEVICE_STATE_UNMANAGED, "wireless_off");
|
|
|
|
setPixmapForState(TDENetworkConnectionStatus::UnManaged, "wireless_off");
|
|
|
|
setPixmapForState(NM_DEVICE_STATE_DISCONNECTED, "wireless");
|
|
|
|
setPixmapForState(TDENetworkConnectionStatus::Disconnected, "wireless");
|
|
|
|
setPixmapForState(NM_DEVICE_STATE_ACTIVATED, "nm_signal_50");
|
|
|
|
setPixmapForState(TDENetworkConnectionStatus::Connected, "nm_signal_50");
|
|
|
|
|
|
|
|
|
|
|
|
// get notified when the device state changes
|
|
|
|
// get notified when the device state changes
|
|
|
|
connect(dev, TQT_SIGNAL(StateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus)), this, TQT_SLOT(slotUpdateDeviceState(TDENetworkConnectionStatus::TDENetworkConnectionStatus)));
|
|
|
|
connect(dev, TQT_SIGNAL(StateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus)), this, TQT_SLOT(slotUpdateDeviceState(TDENetworkConnectionStatus::TDENetworkConnectionStatus)));
|
|
|
|