summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-09-07 00:33:23 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-09-07 00:33:23 -0500
commit6b96deb4ebac9e55ff35d7f77313c5aebb103880 (patch)
tree79c35ba8c591c53fb0b2a77bf5895862c472db8f
parent96765c9dea208b345a7da67e7f8357e4be6a40bf (diff)
downloadtdelibs-6b96deb4ebac9e55ff35d7f77313c5aebb103880.tar.gz
tdelibs-6b96deb4ebac9e55ff35d7f77313c5aebb103880.zip
Add global network management event signal
-rw-r--r--tdecore/networkbackends/network-manager/network-manager.cpp1
-rw-r--r--tdecore/tdenetworkconnections.cpp9
-rw-r--r--tdecore/tdenetworkconnections.h21
3 files changed, 30 insertions, 1 deletions
diff --git a/tdecore/networkbackends/network-manager/network-manager.cpp b/tdecore/networkbackends/network-manager/network-manager.cpp
index 32a15c0ad..9bb44f5f6 100644
--- a/tdecore/networkbackends/network-manager/network-manager.cpp
+++ b/tdecore/networkbackends/network-manager/network-manager.cpp
@@ -2488,6 +2488,7 @@ void TDENetworkConnectionManager_BackendNM::loadConnectionInformation() {
// Error!
PRINT_ERROR(error.name())
}
+ m_parent->internalNetworkManagementEvent(TDENetworkGlobalEventType::ConnectionListChanged);
}
}
diff --git a/tdecore/tdenetworkconnections.cpp b/tdecore/tdenetworkconnections.cpp
index b3f0d9257..11874205f 100644
--- a/tdecore/tdenetworkconnections.cpp
+++ b/tdecore/tdenetworkconnections.cpp
@@ -796,6 +796,10 @@ void TDENetworkConnectionManager::internalAccessPointStatusChanged(TDEMACAddress
emit(accessPointStatusChanged(BSSID, event));
}
+void TDENetworkConnectionManager::internalNetworkManagementEvent(TDENetworkGlobalEventType::TDENetworkGlobalEventType event) {
+ emit(networkManagementEvent(event));
+}
+
/*================================================================================================*/
/* TDEGlobalNetworkManager */
/*================================================================================================*/
@@ -804,7 +808,10 @@ TDEGlobalNetworkManager::TDEGlobalNetworkManager() : m_internalConnectionManager
#ifdef WITH_NETWORK_MANAGER_BACKEND
m_internalConnectionManager = new TDENetworkConnectionManager_BackendNM(TQString::null);
#endif // WITH_NETWORK_MANAGER_BACKEND
- connect(m_internalConnectionManager, SIGNAL(networkConnectionStateChanged(TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags, TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags)), this, SIGNAL(networkConnectionStateChanged(TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags, TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags)));
+ if (m_internalConnectionManager) {
+ connect(m_internalConnectionManager, SIGNAL(networkConnectionStateChanged(TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags, TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags)), this, SIGNAL(networkConnectionStateChanged(TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags, TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags)));
+ connect(m_internalConnectionManager, SIGNAL(networkManagementEvent(TDENetworkGlobalEventType::TDENetworkGlobalEventType)), this, SIGNAL(networkManagementEvent(TDENetworkGlobalEventType::TDENetworkGlobalEventType)));
+ }
}
TDEGlobalNetworkManager::~TDEGlobalNetworkManager() {
diff --git a/tdecore/tdenetworkconnections.h b/tdecore/tdenetworkconnections.h
index ded2d58b4..7f8052e6b 100644
--- a/tdecore/tdenetworkconnections.h
+++ b/tdecore/tdenetworkconnections.h
@@ -176,6 +176,14 @@ namespace TDENetworkSlaveDeviceType {
};
};
+namespace TDENetworkGlobalEventType {
+ enum TDENetworkGlobalEventType {
+ ConnectionListChanged,
+ Other,
+ Last = Other
+ };
+};
+
namespace TDENetworkAPEventType {
enum TDENetworkAPEventType {
Discovered,
@@ -1089,6 +1097,12 @@ class TDECORE_EXPORT TDENetworkConnectionManager : public TQObject
*/
void accessPointStatusChanged(TDEMACAddress BSSID, TDENetworkAPEventType::TDENetworkAPEventType event);
+ /**
+ * Emitted whenever a global network management event occurs
+ * The event type that caused the signal is available in @param event
+ */
+ void networkManagementEvent(TDENetworkGlobalEventType::TDENetworkGlobalEventType event);
+
public:
/**
* @return a TDENetworkConnectionList object containing a list of all
@@ -1140,6 +1154,7 @@ class TDECORE_EXPORT TDENetworkConnectionManager : public TQObject
void internalNetworkConnectionStateChanged(TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags newState);
void internalNetworkDeviceStateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus newState, TQString hwAddress=TQString::null);
void internalAccessPointStatusChanged(TDEMACAddress BSSID, TDENetworkAPEventType::TDENetworkAPEventType event);
+ void internalNetworkManagementEvent(TDENetworkGlobalEventType::TDENetworkGlobalEventType event);
protected:
TDENetworkConnectionList* m_connectionList;
@@ -1291,6 +1306,12 @@ class TDECORE_EXPORT TDEGlobalNetworkManager : public TQObject
*/
void accessPointStatusChanged(TDEMACAddress BSSID, TDENetworkAPEventType::TDENetworkAPEventType event);
+ /**
+ * Emitted whenever a global network management event occurs
+ * The event type that caused the signal is available in @param event
+ */
+ void networkManagementEvent(TDENetworkGlobalEventType::TDENetworkGlobalEventType event);
+
public:
/**
* @return a TDENetworkConnectionList object containing a list of all