Showing the changes to interface/src/ui/EntityScriptServerLogDialog.cpp (1 of 3 files). Show all
Unified · Split
| @@ -21,19 +21,13 @@ EntityScriptServerLogDialog::EntityScriptServerLogDialog(QWidget* parent) : Base · 20 unmodified lines | |||
| 21 | QObject::connect(nodeList.data(), &NodeList::nodeActivated, this, &EntityScriptServerLogDialog::nodeActivated); | 21 | QObject::connect(nodeList.data(), &NodeList::nodeActivated, this, &EntityScriptServerLogDialog::nodeActivated); |
| 22 | QObject::connect(nodeList.data(), &NodeList::nodeKilled, this, &EntityScriptServerLogDialog::nodeKilled); | 22 | QObject::connect(nodeList.data(), &NodeList::nodeKilled, this, &EntityScriptServerLogDialog::nodeKilled); |
| 23 | 23 | ||
| 24 | QObject::connect(nodeList.data(), &NodeList::canRezChanged, this, &EntityScriptServerLogDialog::shouldEnableLog); | 24 | QObject::connect(nodeList.data(), &NodeList::canRezChanged, this, &EntityScriptServerLogDialog::enableToEntityServerScriptLog); |
| 25 | QObject::connect(nodeList.data(), &NodeList::canRezTmpChanged, this, &EntityScriptServerLogDialog::shouldEnableLog); | 25 | enableToEntityServerScriptLog(nodeList->getThisNodeCanRez()); |
| 26 | shouldEnableLog(); | ||
| 27 | } | 26 | } |
| 28 | 27 | ||
| 29 | EntityScriptServerLogDialog::~EntityScriptServerLogDialog() { | 28 | EntityScriptServerLogDialog::~EntityScriptServerLogDialog() { |
| 30 | enableToEntityServerScriptLog(false); | 29 | enableToEntityServerScriptLog(false); |
| 31 | } | 30 | } |
| 32 | void EntityScriptServerLogDialog::shouldEnableLog() { | ||
| 33 | auto nodeList = DependencyManager::get<NodeList>(); | ||
| 34 | enableToEntityServerScriptLog(nodeList->getThisNodeCanRez() || nodeList->getThisNodeCanRezTmp()); | ||
| 35 | }; | ||
| 36 | |||
| 37 | void EntityScriptServerLogDialog::enableToEntityServerScriptLog(bool enable) { | 31 | void EntityScriptServerLogDialog::enableToEntityServerScriptLog(bool enable) { |
| 38 | auto nodeList = DependencyManager::get<NodeList>(); | 32 | auto nodeList = DependencyManager::get<NodeList>(); |
| 39 | 33 | ||
| @@ -63,7 +57,7 @@ void EntityScriptServerLogDialog::handleEntityServerScriptLogPacket(QSharedPoint · 23 unmodified lines | |||
| 63 | void EntityScriptServerLogDialog::nodeActivated(SharedNodePointer activatedNode) { | 57 | void EntityScriptServerLogDialog::nodeActivated(SharedNodePointer activatedNode) { |
| 64 | if (_subscribed && activatedNode->getType() == NodeType::EntityScriptServer) { | 58 | if (_subscribed && activatedNode->getType() == NodeType::EntityScriptServer) { |
| 65 | _subscribed = false; | 59 | _subscribed = false; |
| 66 | shouldEnableLog(); | 60 | enableToEntityServerScriptLog(DependencyManager::get<NodeList>()->getThisNodeCanRez()); |
| 67 | } | 61 | } |
| 68 | } | 62 | } |
| 69 | 63 | ||