Add additional network event signals

pull/16/head
Timothy Pearson 12 years ago
parent 6a2462e308
commit a1f084dd42

@ -1164,6 +1164,7 @@ TDENetworkConnectionManager_BackendNM::TDENetworkConnectionManager_BackendNM(TQS
if (d->m_wiFiDeviceProxy) {
connect(d->m_wiFiDeviceProxy, SIGNAL(AccessPointAdded(const TQT_DBusObjectPath&)), d, SLOT(internalProcessWiFiAccessPointAdded(const TQT_DBusObjectPath&)));
connect(d->m_wiFiDeviceProxy, SIGNAL(AccessPointRemoved(const TQT_DBusObjectPath&)), d, SLOT(internalProcessWiFiAccessPointRemoved(const TQT_DBusObjectPath&)));
connect(d->m_wiFiDeviceProxy, SIGNAL(PropertiesChanged(const TQMap<TQString, TQT_DBusVariant>&)), d, SLOT(internalProcessWiFiPropertiesChanged(const TQMap<TQString, TQT_DBusVariant>&)));
}
// Create public lists
@ -1212,9 +1213,24 @@ void TDENetworkConnectionManager_BackendNMPrivate::internalProcessWiFiAccessPoin
}
}
void TDENetworkConnectionManager_BackendNMPrivate::internalProcessWiFiPropertiesChanged(const TQMap<TQString, TQT_DBusVariant>& props) {
if (m_wiFiDeviceProxy) {
if (props.contains("ActiveAccessPoint")) {
TQT_DBusError error;
TDENetworkWiFiAPInfo* apInfo = m_parent->getAccessPointDetails(m_wiFiDeviceProxy->getActiveAccessPoint(error));
if (apInfo) {
m_parent->internalAccessPointStatusChanged(apInfo->BSSID, TDENetworkAPEventType::AccessPointChanged);
}
}
else if (props.contains("Bitrate")) {
m_parent->internalNetworkDeviceEvent(TDENetworkDeviceEventType::BitRateChanged);
}
}
}
// FIXME
// If access point strength changes, this must be called:
// m_parent->internalAccessPointStatusChanged(apInfo->BSSID, TDENetworkAPEventType::Lost);
// m_parent->internalAccessPointStatusChanged(apInfo->BSSID, TDENetworkAPEventType::SignalStrengthChanged);
// How do I get NetworkManager to notify me when an access point changes strength? Do I have to poll it for this information?
TDENetworkDeviceType::TDENetworkDeviceType TDENetworkConnectionManager_BackendNM::deviceType() {

@ -90,6 +90,7 @@ class TDENetworkConnectionManager_BackendNMPrivate : public TQObject
void internalProcessDeviceStateChanged(TQ_UINT32 newState, TQ_UINT32 oldState, TQ_UINT32 reason);
void internalProcessWiFiAccessPointAdded(const TQT_DBusObjectPath&);
void internalProcessWiFiAccessPointRemoved(const TQT_DBusObjectPath&);
void internalProcessWiFiPropertiesChanged(const TQMap<TQString, TQT_DBusVariant>&);
private:
TDENetworkConnectionManager_BackendNM* m_parent;

@ -796,6 +796,10 @@ void TDENetworkConnectionManager::internalAccessPointStatusChanged(TDEMACAddress
emit(accessPointStatusChanged(BSSID, event));
}
void TDENetworkConnectionManager::internalNetworkDeviceEvent(TDENetworkDeviceEventType::TDENetworkDeviceEventType event) {
emit(networkDeviceEvent(event));
}
void TDENetworkConnectionManager::internalNetworkManagementEvent(TDENetworkGlobalEventType::TDENetworkGlobalEventType event) {
emit(networkManagementEvent(event));
}

@ -184,11 +184,20 @@ namespace TDENetworkGlobalEventType {
};
};
namespace TDENetworkDeviceEventType {
enum TDENetworkDeviceEventType {
BitRateChanged,
Other,
Last = Other
};
};
namespace TDENetworkAPEventType {
enum TDENetworkAPEventType {
Discovered,
Lost,
SignalStrengthChanged,
AccessPointChanged,
Other,
Last = Other
};
@ -1098,6 +1107,12 @@ class TDECORE_EXPORT TDENetworkConnectionManager : public TQObject
*/
void accessPointStatusChanged(TDEMACAddress BSSID, TDENetworkAPEventType::TDENetworkAPEventType event);
/**
* Emitted whenever a network device event occurs
* The event type that caused the signal is available in @param event
*/
void networkDeviceEvent(TDENetworkDeviceEventType::TDENetworkDeviceEventType event);
/**
* Emitted whenever a global network management event occurs
* The event type that caused the signal is available in @param event
@ -1150,11 +1165,44 @@ class TDECORE_EXPORT TDENetworkConnectionManager : public TQObject
static TQString friendlyConnectionTypeName(TDENetworkConnectionType::TDENetworkConnectionType type);
protected:
/**
* @internal Safely clears out the master connection list and deletes all member objects
*/
void clearTDENetworkConnectionList();
/**
* @internal Safely clears out the neighboring devices list and deletes all member objects
*/
void clearTDENetworkHWNeighborList();
/**
* @internal This method must be called by the network backend whenever a connection changes state
* It emits the appropriate signals to notify client applications of the state change
*/
void internalNetworkConnectionStateChanged(TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags newState);
/**
* @internal This method must be called by the network backend whenever a device changes state
* It emits the appropriate signals to notify client applications of the state change
*/
void internalNetworkDeviceStateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus newState, TQString hwAddress=TQString::null);
/**
* @internal This method must be called by the network backend whenever a wireless access point changes state
* It emits the appropriate signals to notify client applications of the state change
*/
void internalAccessPointStatusChanged(TDEMACAddress BSSID, TDENetworkAPEventType::TDENetworkAPEventType event);
/**
* @internal This method must be called by the network backend whenever a device event occurs
* It emits the appropriate signals to notify client applications of the network device event
*/
void internalNetworkDeviceEvent(TDENetworkDeviceEventType::TDENetworkDeviceEventType event);
/**
* @internal This method must be called by the network backend whenever it changes state
* It emits the appropriate signals to notify client applications of the state change
*/
void internalNetworkManagementEvent(TDENetworkGlobalEventType::TDENetworkGlobalEventType event);
protected:

Loading…
Cancel
Save