From: Jay Freeman (saurik) Date: Fri, 21 Oct 2011 00:12:10 +0000 (+0000) Subject: Replace UIAlertSheet with UIAlertView. X-Git-Tag: v0.9.3902~8 X-Git-Url: https://git.saurik.com/winterboard.git/commitdiff_plain/54a4cf27b947b46de9854d91fb141076771ac217?hp=024f98ea589529f42b26fa62fcb5913a6aee6a57 Replace UIAlertSheet with UIAlertView. --- diff --git a/Settings.mm b/Settings.mm index 89231a0..442e97c 100644 --- a/Settings.mm +++ b/Settings.mm @@ -371,18 +371,17 @@ static NSString *_plist; } - (void) optimizeThemes { - UIActionSheet *sheet([[[UIActionSheet alloc] + UIAlertView *alert([[[UIAlertView alloc] initWithTitle:@"Optimize Themes" - buttons:[NSArray arrayWithObjects:@"Optimize", @"Cancel", nil] - defaultButtonIndex:1 + message:@"Please note that this setting /replaces/ the PNG files that came with the theme. PNG files that have been iPhone-optimized cannot be viewed on a normal computer unless they are first deoptimized. You can use Cydia to reinstall themes that have been optimized in order to revert to the original PNG files." delegate:self - context:@"optimize" + cancelButtonTitle:@"Cancel" + otherButtonTitles:@"Optimize", nil ] autorelease]); - [sheet setBodyText:@"Please note that this setting /replaces/ the PNG files that came with the theme. PNG files that have been iPhone-optimized cannot be viewed on a normal computer unless they are first deoptimized. You can use Cydia to reinstall themes that have been optimized in order to revert to the original PNG files."]; - [sheet setNumberOfRows:1]; - [sheet setDestructiveButtonIndex:0]; - [sheet popupAlertAnimated:YES]; + [alert setContext:@"optimize"]; + [alert setNumberOfRows:1]; + [alert show]; } - (void) _optimizeThemes { @@ -404,20 +403,18 @@ static NSString *_plist; [self settingsChanged]; } -- (void) alertSheet:(UIActionSheet *)sheet buttonClicked:(int)button { - NSString *context([sheet context]); +- (void) alertView:(UIAlertView *)alert clickedButtonAtIndex:(NSInteger)button { + NSString *context([alert context]); if ([context isEqualToString:@"optimize"]) { - switch (button) { - case 1: - [self performSelector:@selector(_optimizeThemes) withObject:nil afterDelay:0]; - break; + if (button == [alert firstOtherButtonIndex]) { + [self performSelector:@selector(_optimizeThemes) withObject:nil afterDelay:0]; } - [sheet dismiss]; - } else - [super alertSheet:sheet buttonClicked:button]; - + [alert dismissWithClickedButtonIndex:-1 animated:YES]; + } + /*else if ([super respondsToSelector:@selector(alertView:clickedButtonAtIndex:)]) + [super alertView:alert clickedButtonAtIndex:button];*/ } @end