Disable the IWAD selector dropdown if no IWADs have been configured at

all.

Subversion-branch: /launcher
Subversion-revision: 1755
This commit is contained in:
Simon Howard 2009-12-25 20:02:22 +00:00
parent 59587038c7
commit 6833b3e308

View file

@ -42,10 +42,13 @@ static NSString *IWADLabels[NUM_IWAD_TYPES] =
IWADLocation *iwadList[NUM_IWAD_TYPES];
id location;
unsigned int i;
unsigned int enabled_wads;
[self getIWADList: iwadList];
[self->iwadSelector removeAllItems];
enabled_wads = 0;
for (i=0; i<NUM_IWAD_TYPES; ++i)
{
location = [iwadList[i] getLocation];
@ -53,8 +56,11 @@ static NSString *IWADLabels[NUM_IWAD_TYPES] =
if (location != nil && [location length] > 0)
{
[self->iwadSelector addItemWithTitle: IWADLabels[i]];
++enabled_wads;
}
}
[self->iwadSelector setEnabled: (enabled_wads > 0)];
}
- (IWAD) getSelectedIWAD