74 // file not present, means that also other files are absent |
74 // file not present, means that also other files are absent |
75 NSLog(@"First time run, creating settings files"); |
75 NSLog(@"First time run, creating settings files"); |
76 |
76 |
77 // show a popup with an indicator to make the user wait |
77 // show a popup with an indicator to make the user wait |
78 UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"One-time Preferences Configuration",@"") |
78 UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"One-time Preferences Configuration",@"") |
79 message:nil |
79 message:nil |
80 delegate:nil |
80 delegate:nil |
81 cancelButtonTitle:nil |
81 cancelButtonTitle:nil |
82 otherButtonTitles:nil]; |
82 otherButtonTitles:nil]; |
83 [alert show]; |
83 [alert show]; |
84 |
84 |
85 UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc] |
85 UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc] |
86 initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge]; |
86 initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge]; |
87 indicator.center = CGPointMake(alert.bounds.size.width / 2, alert.bounds.size.height - 50); |
87 indicator.center = CGPointMake(alert.bounds.size.width / 2, alert.bounds.size.height - 50); |
121 -(void) disappear { |
122 -(void) disappear { |
122 [UIView beginAnimations:@"removing main controller" context:NULL]; |
123 [UIView beginAnimations:@"removing main controller" context:NULL]; |
123 [UIView setAnimationDuration:1]; |
124 [UIView setAnimationDuration:1]; |
124 self.view.alpha = 0; |
125 self.view.alpha = 0; |
125 [UIView commitAnimations]; |
126 [UIView commitAnimations]; |
|
127 [self.view removeFromSuperview]; |
126 } |
128 } |
127 |
129 |
128 #pragma mark - |
130 #pragma mark - |
129 #pragma mark Action buttons |
131 #pragma mark Action buttons |
130 -(IBAction) startPlaying { |
132 -(IBAction) startPlaying { |
131 [[SDLUIKitDelegate sharedAppDelegate] startSDLgame]; |
133 [[SDLUIKitDelegate sharedAppDelegate] startSDLgame]; |
132 } |
134 } |
133 |
135 |
134 -(IBAction) notYetImplemented { |
136 -(IBAction) notYetImplemented { |
135 UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Not Yet Implemented" |
137 UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Not Yet Implemented" |
136 message:@"Sorry, this feature is not yet implemented" |
138 message:@"Sorry, this feature is not yet implemented" |
137 delegate:nil |
139 delegate:nil |
138 cancelButtonTitle:@"Well, don't worry" |
140 cancelButtonTitle:@"Well, don't worry" |
139 otherButtonTitles:nil]; |
141 otherButtonTitles:nil]; |
140 [alert show]; |
142 [alert show]; |
141 [alert release]; |
143 [alert release]; |
142 } |
144 } |
143 |
145 |
|
146 /* |
144 -(IBAction) switchViews:(id)sender { |
147 -(IBAction) switchViews:(id)sender { |
145 |
|
146 // view not displayed or not created |
148 // view not displayed or not created |
147 if (nil == self.settingsViewController.view.superview) { |
149 if (nil == self.settingsViewController.view.superview) { |
148 // view not created |
150 // view not created |
149 if (nil == self.settingsViewController) { |
151 if (nil == self.settingsViewController) { |
150 SettingsViewController *controller = [[SettingsViewController alloc] initWithNibName:@"SettingsViewController" |
152 SettingsViewController *controller = [[SettingsViewController alloc] initWithNibName:@"SettingsViewController" |