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