|
|
|
@ -428,25 +428,6 @@ void WirelessDeviceTray::slotAccessPointRemoved(TDEMACAddress)
|
|
|
|
|
KNotifyClient::event( tray()->winId(), "tdenm-nm-network-gone", i18n("TDENetworkManager Wireless Network Disappeared") );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void WirelessDeviceTray::tdeHardwareEventHandler(TDEHardwareEvent::TDEHardwareEvent event, TQString)
|
|
|
|
|
{
|
|
|
|
|
if (event == TDEHardwareEvent::HardwareListModified) {
|
|
|
|
|
TDENetworkDevice* dev = dynamic_cast<TDENetworkDevice*>(hwdevices->findByUniqueID(d->dev));
|
|
|
|
|
TDENetworkConnectionManager* deviceConnMan = (dev)?dev->connectionManager():NULL;
|
|
|
|
|
|
|
|
|
|
// get notified when the device state changes
|
|
|
|
|
connect(deviceConnMan, TQT_SIGNAL(networkDeviceStateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus, TDENetworkConnectionStatus::TDENetworkConnectionStatus, TQString)), this, TQT_SLOT(slotUpdateDeviceState(TDENetworkConnectionStatus::TDENetworkConnectionStatus, TDENetworkConnectionStatus::TDENetworkConnectionStatus, TQString)));
|
|
|
|
|
|
|
|
|
|
// get notified of all AP changes
|
|
|
|
|
connect(deviceConnMan, TQT_SIGNAL(accessPointStatusChanged(TDEMACAddress, TDENetworkAPEventType::TDENetworkAPEventType)), this, TQT_SLOT(tdeAccessPointStatusChangedHandler(TDEMACAddress, TDENetworkAPEventType::TDENetworkAPEventType)));
|
|
|
|
|
|
|
|
|
|
// force status update to ensure correct icon is shown on startup
|
|
|
|
|
if ((dev) && (deviceConnMan)) {
|
|
|
|
|
slotUpdateDeviceState(deviceConnMan->deviceInformation().statusFlags, TDENetworkConnectionStatus::Invalid, dev->deviceNode());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void WirelessDeviceTray::tdeAccessPointStatusChangedHandler(TDEMACAddress BSSID, TDENetworkAPEventType::TDENetworkAPEventType event) {
|
|
|
|
|
TDENetworkDevice* dev = dynamic_cast<TDENetworkDevice*>(hwdevices->findByUniqueID(d->dev));
|
|
|
|
|
TDENetworkConnectionManager* deviceConnMan = dev->connectionManager();
|
|
|
|
@ -487,8 +468,20 @@ WirelessDeviceTray::WirelessDeviceTray (TQString dev, KSystemTray * parent, cons
|
|
|
|
|
setPixmapForState(TDENetworkConnectionStatus::Disconnected, "wireless");
|
|
|
|
|
setPixmapForState(TDENetworkConnectionStatus::Connected, "nm_signal_50");
|
|
|
|
|
|
|
|
|
|
// Trigger an initial hardware information update
|
|
|
|
|
tdeHardwareEventHandler(TDEHardwareEvent::HardwareListModified, TQString::null);
|
|
|
|
|
// initial hardware information update
|
|
|
|
|
TDENetworkDevice* netdev = dynamic_cast<TDENetworkDevice*>(hwdevices->findByUniqueID(d->dev));
|
|
|
|
|
TDENetworkConnectionManager* deviceConnMan = (netdev)?netdev->connectionManager():NULL;
|
|
|
|
|
|
|
|
|
|
// get notified when the device state changes
|
|
|
|
|
connect(deviceConnMan, TQT_SIGNAL(networkDeviceStateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus, TDENetworkConnectionStatus::TDENetworkConnectionStatus, TQString)), this, TQT_SLOT(slotUpdateDeviceState(TDENetworkConnectionStatus::TDENetworkConnectionStatus, TDENetworkConnectionStatus::TDENetworkConnectionStatus, TQString)));
|
|
|
|
|
|
|
|
|
|
// get notified of all AP changes
|
|
|
|
|
connect(deviceConnMan, TQT_SIGNAL(accessPointStatusChanged(TDEMACAddress, TDENetworkAPEventType::TDENetworkAPEventType)), this, TQT_SLOT(tdeAccessPointStatusChangedHandler(TDEMACAddress, TDENetworkAPEventType::TDENetworkAPEventType)));
|
|
|
|
|
|
|
|
|
|
// force status update to ensure correct icon is shown on startup
|
|
|
|
|
if ((netdev) && (deviceConnMan)) {
|
|
|
|
|
slotUpdateDeviceState(deviceConnMan->deviceInformation().statusFlags, TDENetworkConnectionStatus::Invalid, netdev->deviceNode());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
WirelessDeviceTray::~WirelessDeviceTray ()
|
|
|
|
|