From 306b3e7c13a8a1c19437a67c1a200a179c04663e Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Fri, 25 Dec 2009 21:18:59 +0000 Subject: [PATCH] Open the configuration dialog on first startup so that the user can configure IWADs. Subversion-branch: /launcher Subversion-revision: 1759 --- IWADController.m | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/IWADController.m b/IWADController.m index 03647d8..415b421 100644 --- a/IWADController.m +++ b/IWADController.m @@ -55,11 +55,12 @@ static NSString *IWADLabels[NUM_IWAD_TYPES] = } // Set the dropdown list to include an entry for each IWAD that has -// been configured. +// been configured. Returns true if at least one IWAD is configured. -- (void) setDropdownList +- (BOOL) setDropdownList { IWADLocation *iwadList[NUM_IWAD_TYPES]; + BOOL have_wads; id location; unsigned int i; unsigned int enabled_wads; @@ -80,7 +81,10 @@ static NSString *IWADLabels[NUM_IWAD_TYPES] = } } - [self->iwadSelector setEnabled: (enabled_wads > 0)]; + have_wads = enabled_wads > 0; + [self->iwadSelector setEnabled: have_wads]; + + return have_wads; } - (IWAD) getSelectedIWAD @@ -138,5 +142,16 @@ static NSString *IWADLabels[NUM_IWAD_TYPES] = [self setDropdownList]; } +- (void) awakeFromNib +{ + // Populate the dropdown IWAD list, and open the configuration + // dialog if not yet configured. + + if (![self setDropdownList]) + { + [self openConfigWindow: nil]; + } +} + @end