diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-09-05 10:38:49 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-09-05 10:38:49 -0500 |
commit | d4745d88937867b0d65f73bc85edf6ae7b8b8cc3 (patch) | |
tree | b0c1abc49476d52a5174f1676580e7d5ff1c2d68 /tdecore/networkbackends/network-manager | |
parent | d3cfdd24fa0bd2f0c9fce7de57d29333e1e071e2 (diff) | |
download | tdelibs-d4745d88937867b0d65f73bc85edf6ae7b8b8cc3.tar.gz tdelibs-d4745d88937867b0d65f73bc85edf6ae7b8b8cc3.zip |
Add wireless AP detect signals
Diffstat (limited to 'tdecore/networkbackends/network-manager')
3 files changed, 39 insertions, 10 deletions
diff --git a/tdecore/networkbackends/network-manager/network-manager.cpp b/tdecore/networkbackends/network-manager/network-manager.cpp index 9d9d9e740..5cf5f7534 100644 --- a/tdecore/networkbackends/network-manager/network-manager.cpp +++ b/tdecore/networkbackends/network-manager/network-manager.cpp @@ -1136,7 +1136,7 @@ TQString TDENetworkConnectionManager_BackendNM::deviceInterfaceString(TQString m } TDENetworkConnectionManager_BackendNM::TDENetworkConnectionManager_BackendNM(TQString macAddress) : TDENetworkConnectionManager(macAddress) { - d = new TDENetworkConnectionManager_BackendNMPrivate(); + d = new TDENetworkConnectionManager_BackendNMPrivate(this); // Set up proxy interfaces d->m_networkManagerProxy = new DBus::NetworkManagerProxy(NM_DBUS_SERVICE, NM_DBUS_PATH); @@ -1155,11 +1155,15 @@ TDENetworkConnectionManager_BackendNM::TDENetworkConnectionManager_BackendNM(TQS } // Connect global signals - connect(d->m_networkManagerProxy, SIGNAL(StateChanged(TQ_UINT32)), this, SLOT(internalProcessGlobalStateChanged(TQ_UINT32))); + connect(d->m_networkManagerProxy, SIGNAL(StateChanged(TQ_UINT32)), d, SLOT(internalProcessGlobalStateChanged(TQ_UINT32))); // Connect local signals if (d->m_networkDeviceProxy) { - connect(d->m_networkDeviceProxy, SIGNAL(StateChanged(TQ_UINT32, TQ_UINT32, TQ_UINT32)), this, SLOT(internalProcessDeviceStateChanged(TQ_UINT32, TQ_UINT32, TQ_UINT32))); + connect(d->m_networkDeviceProxy, SIGNAL(StateChanged(TQ_UINT32, TQ_UINT32, TQ_UINT32)), d, SLOT(internalProcessDeviceStateChanged(TQ_UINT32, TQ_UINT32, TQ_UINT32))); + } + 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&))); } // Create public lists @@ -1182,14 +1186,30 @@ TDENetworkConnectionManager_BackendNM::~TDENetworkConnectionManager_BackendNM() delete d; } -void TDENetworkConnectionManager_BackendNM::internalProcessGlobalStateChanged(TQ_UINT32 state) { - internalNetworkConnectionStateChanged(nmGlobalStateToTDEGlobalState(state)); +void TDENetworkConnectionManager_BackendNMPrivate::internalProcessGlobalStateChanged(TQ_UINT32 state) { + m_parent->internalNetworkConnectionStateChanged(nmGlobalStateToTDEGlobalState(state)); } -void TDENetworkConnectionManager_BackendNM::internalProcessDeviceStateChanged(TQ_UINT32 newState, TQ_UINT32 oldState, TQ_UINT32 reason) { +void TDENetworkConnectionManager_BackendNMPrivate::internalProcessDeviceStateChanged(TQ_UINT32 newState, TQ_UINT32 oldState, TQ_UINT32 reason) { Q_UNUSED(oldState) Q_UNUSED(reason) - internalNetworkDeviceStateChanged(nmDeviceStateToTDEDeviceState(newState), m_macAddress); + m_parent->internalNetworkDeviceStateChanged(nmDeviceStateToTDEDeviceState(newState), m_parent->m_macAddress); +} + +void TDENetworkConnectionManager_BackendNMPrivate::internalProcessWiFiAccessPointAdded(const TQT_DBusObjectPath& dbuspath) { + TDENetworkWiFiAPInfo* apInfo = m_parent->getAccessPointDetails(dbuspath); + if (apInfo) { + m_parent->internalAccessPointVisibilityChanged(apInfo->BSSID, TRUE); + delete apInfo; + } +} + +void TDENetworkConnectionManager_BackendNMPrivate::internalProcessWiFiAccessPointRemoved(const TQT_DBusObjectPath& dbuspath) { + TDENetworkWiFiAPInfo* apInfo = m_parent->getAccessPointDetails(dbuspath); + if (apInfo) { + m_parent->internalAccessPointVisibilityChanged(apInfo->BSSID, FALSE); + delete apInfo; + } } TDENetworkDeviceType::TDENetworkDeviceType TDENetworkConnectionManager_BackendNM::deviceType() { diff --git a/tdecore/networkbackends/network-manager/network-manager.h b/tdecore/networkbackends/network-manager/network-manager.h index 8fa876728..709cd42cf 100644 --- a/tdecore/networkbackends/network-manager/network-manager.h +++ b/tdecore/networkbackends/network-manager/network-manager.h @@ -161,8 +161,6 @@ class TDECORE_EXPORT TDENetworkConnectionManager_BackendNM : public TDENetworkCo virtual bool wiFiEnabled(); private: - void internalProcessGlobalStateChanged(TQ_UINT32 state); - void internalProcessDeviceStateChanged(TQ_UINT32 newState, TQ_UINT32 oldState, TQ_UINT32 reason); TDENetworkDeviceType::TDENetworkDeviceType nmDeviceTypeToTDEDeviceType(TQ_UINT32 nmType); TQString deviceInterfaceString(TQString macAddress); bool loadConnectionSecretsForGroup(TQString uuid, TQString group); @@ -171,6 +169,7 @@ class TDECORE_EXPORT TDENetworkConnectionManager_BackendNM : public TDENetworkCo private: TDENetworkConnectionManager_BackendNMPrivate* d; + friend class TDENetworkConnectionManager_BackendNMPrivate; }; #endif // _TDENETWORKBACKEND_NETWORKMANAGER_H
\ No newline at end of file diff --git a/tdecore/networkbackends/network-manager/network-manager_p.h b/tdecore/networkbackends/network-manager/network-manager_p.h index 88c63a59f..0ead39e3f 100644 --- a/tdecore/networkbackends/network-manager/network-manager_p.h +++ b/tdecore/networkbackends/network-manager/network-manager_p.h @@ -63,12 +63,14 @@ typedef TQMap<uint, TQT_DBusObjectPath> NMAddConnectionAsyncResponseMap; typedef TQValueList<TQT_DBusObjectPath> TQT_DBusObjectPathList; +class TDENetworkConnectionManager_BackendNM; + class TDENetworkConnectionManager_BackendNMPrivate : public TQObject { Q_OBJECT public: - TDENetworkConnectionManager_BackendNMPrivate() : m_networkManagerProxy(NULL), m_networkManagerSettings(NULL), m_networkDeviceProxy(NULL), m_wiFiDeviceProxy(NULL) {} + TDENetworkConnectionManager_BackendNMPrivate(TDENetworkConnectionManager_BackendNM* parent) : m_networkManagerProxy(NULL), m_networkManagerSettings(NULL), m_networkDeviceProxy(NULL), m_wiFiDeviceProxy(NULL), m_parent(parent) {} public: DBus::NetworkManagerProxy* m_networkManagerProxy; @@ -83,6 +85,14 @@ class TDENetworkConnectionManager_BackendNMPrivate : public TQObject void processConnectionSettingsAsyncReply(int, const TQT_DBusDataMap<TQString>&); void processConnectionSettingsUpdateAsyncReply(int); void processAddConnectionAsyncReply(int, const TQT_DBusObjectPath&); + + void internalProcessGlobalStateChanged(TQ_UINT32 state); + void internalProcessDeviceStateChanged(TQ_UINT32 newState, TQ_UINT32 oldState, TQ_UINT32 reason); + void internalProcessWiFiAccessPointAdded(const TQT_DBusObjectPath&); + void internalProcessWiFiAccessPointRemoved(const TQT_DBusObjectPath&); + + private: + TDENetworkConnectionManager_BackendNM* m_parent; }; #endif // _TDENETWORKBACKEND_NETWORKMANAGER_P_H
\ No newline at end of file |