* Set cargo filter for the vehicle group list. * @param cargo_type The cargo to be set. */
| 415 | * @param cargo_type The cargo to be set. |
| 416 | */ |
| 417 | void BaseVehicleListWindow::SetCargoFilter(CargoType cargo_type) |
| 418 | { |
| 419 | if (this->cargo_filter_criteria != cargo_type) { |
| 420 | this->cargo_filter_criteria = cargo_type; |
| 421 | /* Deactivate filter if criteria is 'Show All', activate it otherwise. */ |
| 422 | this->vehgroups.SetFilterState(this->cargo_filter_criteria != CargoFilterCriteria::CF_ANY); |
| 423 | this->vehgroups.SetFilterType(0); |
| 424 | this->vehgroups.ForceRebuild(); |
| 425 | } |
| 426 | } |
| 427 | |
| 428 | /** |
| 429 | *Populate the filter list and set the cargo filter criteria. |
no test coverage detected