| 124 | } |
| 125 | |
| 126 | void SeparatorTextureController::notifyChangeScope(std::string_view _scope) |
| 127 | { |
| 128 | if (mControl == nullptr) |
| 129 | return; |
| 130 | |
| 131 | if (_scope == mScopeName) |
| 132 | { |
| 133 | if (!mActivated) |
| 134 | { |
| 135 | mControl->eventChangeValue.connect(this, &SeparatorTextureController::notifyChangeValue); |
| 136 | mControl->clearAll(); |
| 137 | |
| 138 | DataSelectorManager::getInstance() |
| 139 | .getEvent(mParentTypeName) |
| 140 | ->connect(this, &SeparatorTextureController::notifyChangeDataSelector); |
| 141 | mParentData = DataUtility::getSelectedDataByType(mParentTypeName); |
| 142 | notifyChangeDataSelector(mParentData, false); |
| 143 | |
| 144 | mControl->getRoot()->setUserString("CurrentScopeController", mScopeName); |
| 145 | |
| 146 | mActivated = true; |
| 147 | } |
| 148 | } |
| 149 | else |
| 150 | { |
| 151 | if (mActivated) |
| 152 | { |
| 153 | mControl->eventChangeValue.disconnect(this); |
| 154 | |
| 155 | DataSelectorManager::getInstance().getEvent(mParentTypeName)->disconnect(this); |
| 156 | mParentData = nullptr; |
| 157 | |
| 158 | // мы еще владельцы контрола сбрасываем его |
| 159 | std::string_view value = mControl->getRoot()->getUserString("CurrentScopeController"); |
| 160 | if (value == mScopeName) |
| 161 | { |
| 162 | mControl->getRoot()->setUserString("CurrentScopeController", std::string_view{}); |
| 163 | notifyChangeDataSelector(mParentData, false); |
| 164 | |
| 165 | mControl->clearAll(); |
| 166 | } |
| 167 | |
| 168 | mActivated = false; |
| 169 | } |
| 170 | } |
| 171 | } |
| 172 | |
| 173 | void SeparatorTextureController::updateCoords(std::string_view _value) |
| 174 | { |
nothing calls this directly
no test coverage detected