signal from ignoreNodesInRadius

This commit is contained in:
howard-stearns 2016-11-23 11:23:06 -08:00
parent 00b94860cf
commit b37feb20de
2 changed files with 5 additions and 7 deletions

View file

@ -751,6 +751,7 @@ bool NodeList::sockAddrBelongsToDomainOrNode(const HifiSockAddr& sockAddr) {
}
void NodeList::ignoreNodesInRadius(float radiusToIgnore, bool enabled) {
bool isEnabledChange = _ignoreRadiusEnabled.get() != enabled;
_ignoreRadiusEnabled.set(enabled);
_ignoreRadius.set(radiusToIgnore);
@ -759,6 +760,9 @@ void NodeList::ignoreNodesInRadius(float radiusToIgnore, bool enabled) {
}, [this](const SharedNodePointer& destinationNode) {
sendIgnoreRadiusStateToNode(destinationNode);
});
if (isEnabledChange) {
emit ignoreRadiusEnabledChanged(enabled);
}
}
void NodeList::sendIgnoreRadiusStateToNode(const SharedNodePointer& destinationNode) {
@ -886,9 +890,3 @@ void NodeList::muteNodeBySessionID(const QUuid& nodeID) {
}
}
void NodeList::toggleIgnoreRadius() {
bool isIgnored = !getIgnoreRadiusEnabled();
ignoreNodesInRadius(getIgnoreRadius(), isIgnored);
emit ignoreRadiusEnabledChanged(isIgnored);
}

View file

@ -74,7 +74,7 @@ public:
void ignoreNodesInRadius(float radiusToIgnore, bool enabled = true);
float getIgnoreRadius() const { return _ignoreRadius.get(); }
bool getIgnoreRadiusEnabled() const { return _ignoreRadiusEnabled.get(); }
void toggleIgnoreRadius();
void toggleIgnoreRadius() { ignoreNodesInRadius(getIgnoreRadius(), !getIgnoreRadiusEnabled()); }
void enableIgnoreRadius() { ignoreNodesInRadius(getIgnoreRadius(), true); }
void disableIgnoreRadius() { ignoreNodesInRadius(getIgnoreRadius(), false); }
void ignoreNodeBySessionID(const QUuid& nodeID);