| 155 | } |
| 156 | |
| 157 | void OnRemoveClicked(wxCommandEvent& evt) |
| 158 | { |
| 159 | const auto index = IndexForId(evt.GetId()); |
| 160 | const auto baseId = BaseRowIdForIndex(index); |
| 161 | //When item is removed from the sizer the tail gets shifted, |
| 162 | //but items in mPathCtrls are not. We need to map index from |
| 163 | //mPathCtrls to index in mRows |
| 164 | mRows->Remove( |
| 165 | std::count_if( |
| 166 | mPathCtrls.begin(), |
| 167 | mPathCtrls.begin() + index, |
| 168 | [](const auto ptr) { return ptr != nullptr; } |
| 169 | ) |
| 170 | ); |
| 171 | |
| 172 | FindWindowById(baseId, this)->Destroy(); |
| 173 | FindWindowById(baseId + 1, this)->Destroy(); |
| 174 | FindWindowById(baseId + 2, this)->Destroy(); |
| 175 | mPathCtrls[index] = nullptr; |
| 176 | mPaths[index] = wxString{};//Don't save path on commit |
| 177 | |
| 178 | wxPostEvent(this, wxCommandEvent(EVT_PLUGIN_LOCATIONS_CHANGED)); |
| 179 | } |
| 180 | |
| 181 | void OnBrowseClicked(wxCommandEvent& evt) |
| 182 | { |
nothing calls this directly
no test coverage detected