Add UI setting to disable mass action buttons for top-level vehicle lists

This commit is contained in:
Jonathan G Rennison
2018-03-29 20:39:25 +01:00
parent 53dd010f3b
commit 6ec78ff4b0
8 changed files with 31 additions and 10 deletions

View File

@@ -548,7 +548,7 @@ public:
/* Disable all lists management button when the list is empty */
this->SetWidgetDisabledState(WID_GL_MANAGE_VEHICLES_DROPDOWN, !this->ShouldShowActionDropdownList() || _local_company != this->vli.company);
this->SetWidgetsDisabledState(this->vehicles.Length() == 0 || _local_company != this->vli.company,
this->SetWidgetsDisabledState(this->vehicles.Length() == 0 || _local_company != this->vli.company || (IsTopLevelGroupID(this->vli.index) && _settings_client.gui.disable_top_veh_list_mass_actions),
WID_GL_STOP_ALL,
WID_GL_START_ALL,
WIDGET_LIST_END);
@@ -817,7 +817,8 @@ public:
break;
case WID_GL_MANAGE_VEHICLES_DROPDOWN: {
DropDownList *list = this->BuildActionDropdownList(true, Group::IsValidID(this->vli.index), this->vli.vtype == VEH_TRAIN);
DropDownList *list = this->BuildActionDropdownList(true, Group::IsValidID(this->vli.index), this->vli.vtype == VEH_TRAIN,
0, false, IsTopLevelGroupID(this->vli.index));
ShowDropDownList(this, list, -1, WID_GL_MANAGE_VEHICLES_DROPDOWN);
break;
}