Make access point notifications more extensible

pull/16/head
Timothy Pearson 12 years ago
parent 60ee06f236
commit 0216dae757

@ -1199,7 +1199,7 @@ void TDENetworkConnectionManager_BackendNMPrivate::internalProcessDeviceStateCha
void TDENetworkConnectionManager_BackendNMPrivate::internalProcessWiFiAccessPointAdded(const TQT_DBusObjectPath& dbuspath) { void TDENetworkConnectionManager_BackendNMPrivate::internalProcessWiFiAccessPointAdded(const TQT_DBusObjectPath& dbuspath) {
TDENetworkWiFiAPInfo* apInfo = m_parent->getAccessPointDetails(dbuspath); TDENetworkWiFiAPInfo* apInfo = m_parent->getAccessPointDetails(dbuspath);
if (apInfo) { if (apInfo) {
m_parent->internalAccessPointVisibilityChanged(apInfo->BSSID, TRUE); m_parent->internalAccessPointStatusChanged(apInfo->BSSID, TDENetworkAPEventType::Discovered);
delete apInfo; delete apInfo;
} }
} }
@ -1207,11 +1207,16 @@ void TDENetworkConnectionManager_BackendNMPrivate::internalProcessWiFiAccessPoin
void TDENetworkConnectionManager_BackendNMPrivate::internalProcessWiFiAccessPointRemoved(const TQT_DBusObjectPath& dbuspath) { void TDENetworkConnectionManager_BackendNMPrivate::internalProcessWiFiAccessPointRemoved(const TQT_DBusObjectPath& dbuspath) {
TDENetworkWiFiAPInfo* apInfo = m_parent->getAccessPointDetails(dbuspath); TDENetworkWiFiAPInfo* apInfo = m_parent->getAccessPointDetails(dbuspath);
if (apInfo) { if (apInfo) {
m_parent->internalAccessPointVisibilityChanged(apInfo->BSSID, FALSE); m_parent->internalAccessPointStatusChanged(apInfo->BSSID, TDENetworkAPEventType::Lost);
delete apInfo; delete apInfo;
} }
} }
// FIXME
// If access point strength changes, this must be called:
// m_parent->internalAccessPointStatusChanged(apInfo->BSSID, TDENetworkAPEventType::Lost);
// 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() { TDENetworkDeviceType::TDENetworkDeviceType TDENetworkConnectionManager_BackendNM::deviceType() {
if (m_macAddress == "") { if (m_macAddress == "") {
return TDENetworkDeviceType::BackendOnly; return TDENetworkDeviceType::BackendOnly;

@ -716,8 +716,8 @@ void TDENetworkConnectionManager::internalNetworkDeviceStateChanged(TDENetworkCo
m_prevDeviceStatus[hwAddress] = newState; m_prevDeviceStatus[hwAddress] = newState;
} }
void TDENetworkConnectionManager::internalAccessPointVisibilityChanged(TDEMACAddress BSSID, bool detected) { void TDENetworkConnectionManager::internalAccessPointStatusChanged(TDEMACAddress BSSID, TDENetworkAPEventType::TDENetworkAPEventType event) {
emit(accessPointVisibilityChanged(BSSID, detected)); emit(accessPointStatusChanged(BSSID, event));
} }
/*================================================================================================*/ /*================================================================================================*/

@ -176,6 +176,16 @@ namespace TDENetworkSlaveDeviceType {
}; };
}; };
namespace TDENetworkAPEventType {
enum TDENetworkAPEventType {
Discovered,
Lost,
SignalStrengthChanged,
Other,
Last = Other
};
};
namespace TDENetworkGlobalManagerFlags { namespace TDENetworkGlobalManagerFlags {
enum TDENetworkGlobalManagerFlags { enum TDENetworkGlobalManagerFlags {
Unknown = 0x00000000, Unknown = 0x00000000,
@ -1045,10 +1055,10 @@ class TDECORE_EXPORT TDENetworkConnectionManager : public TQObject
void networkDeviceStateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus newState, TDENetworkConnectionStatus::TDENetworkConnectionStatus previousState, TQString hwAddress); void networkDeviceStateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus newState, TDENetworkConnectionStatus::TDENetworkConnectionStatus previousState, TQString hwAddress);
/** /**
* Emitted whenever a wireless access point is detected or lost * Emitted whenever the status of a wireless access point changes
* If a new access point was detected, @param detected will be set to TRUE, otherwise if lost it will be set to FALSE * The event type that caused the signal is available in @param event
*/ */
void accessPointVisibilityChanged(TDEMACAddress BSSID, bool detected); void accessPointStatusChanged(TDEMACAddress BSSID, TDENetworkAPEventType::TDENetworkAPEventType event);
public: public:
/** /**
@ -1095,7 +1105,7 @@ class TDECORE_EXPORT TDENetworkConnectionManager : public TQObject
void clearTDENetworkHWNeighborList(); void clearTDENetworkHWNeighborList();
void internalNetworkConnectionStateChanged(TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags newState); void internalNetworkConnectionStateChanged(TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags newState);
void internalNetworkDeviceStateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus newState, TQString hwAddress=TQString::null); void internalNetworkDeviceStateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus newState, TQString hwAddress=TQString::null);
void internalAccessPointVisibilityChanged(TDEMACAddress BSSID, bool detected); void internalAccessPointStatusChanged(TDEMACAddress BSSID, TDENetworkAPEventType::TDENetworkAPEventType event);
protected: protected:
TDENetworkConnectionList* m_connectionList; TDENetworkConnectionList* m_connectionList;
@ -1235,10 +1245,10 @@ class TDECORE_EXPORT TDEGlobalNetworkManager : public TQObject
void networkDeviceStateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus newState, TDENetworkConnectionStatus::TDENetworkConnectionStatus previousState, TQString hwAddress); void networkDeviceStateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus newState, TDENetworkConnectionStatus::TDENetworkConnectionStatus previousState, TQString hwAddress);
/** /**
* Emitted whenever a wireless access point is detected or lost * Emitted whenever the status of a wireless access point changes
* If a new access point was detected, @param detected will be set to TRUE, otherwise if lost it will be set to FALSE * The event type that caused the signal is available in @param event
*/ */
void accessPointVisibilityChanged(TDEMACAddress BSSID, bool detected); void accessPointStatusChanged(TDEMACAddress BSSID, TDENetworkAPEventType::TDENetworkAPEventType event);
public: public:
/** /**

Loading…
Cancel
Save