| 99 | } |
| 100 | |
| 101 | void IndexTextureController::notifyChangeScope(std::string_view _scope) |
| 102 | { |
| 103 | if (mControl == nullptr) |
| 104 | return; |
| 105 | |
| 106 | if (_scope == mScopeName) |
| 107 | { |
| 108 | if (!mActivated) |
| 109 | { |
| 110 | mControl->clearAll(); |
| 111 | |
| 112 | DataSelectorManager::getInstance() |
| 113 | .getEvent(mParentTypeName) |
| 114 | ->connect(this, &IndexTextureController::notifyChangeDataSelector); |
| 115 | mParentData = DataUtility::getSelectedDataByType(mParentTypeName); |
| 116 | notifyChangeDataSelector(mParentData, false); |
| 117 | |
| 118 | mControl->getRoot()->setUserString("CurrentScopeController", mScopeName); |
| 119 | |
| 120 | mActivated = true; |
| 121 | } |
| 122 | } |
| 123 | else |
| 124 | { |
| 125 | if (mActivated) |
| 126 | { |
| 127 | DataSelectorManager::getInstance().getEvent(mParentTypeName)->disconnect(this); |
| 128 | mParentData = nullptr; |
| 129 | |
| 130 | // мы еще владельцы контрола сбрасываем его |
| 131 | std::string_view value = mControl->getRoot()->getUserString("CurrentScopeController"); |
| 132 | if (value == mScopeName) |
| 133 | { |
| 134 | mControl->getRoot()->setUserString("CurrentScopeController", std::string_view{}); |
| 135 | notifyChangeDataSelector(mParentData, false); |
| 136 | |
| 137 | mControl->clearAll(); |
| 138 | } |
| 139 | |
| 140 | mActivated = false; |
| 141 | } |
| 142 | } |
| 143 | } |
| 144 | |
| 145 | void IndexTextureController::updateCoords(std::string_view _value) |
| 146 | { |
nothing calls this directly
no test coverage detected