]> git.saurik.com Git - cydia.git/commitdiff
Merged uialertview-for-cyactionsheet.patch from chpwn.
authorGrant Paul <chpwn@chpwn.com>
Mon, 9 Aug 2010 22:34:46 +0000 (22:34 +0000)
committerJay Freeman (saurik) <saurik@saurik.com>
Thu, 30 Sep 2010 08:21:04 +0000 (08:21 +0000)
Cydia.mm

index 8d933813cf1f8011f9a46643607ff37fa28f8e16..29c7982cfe75b8aa223fc02f45cb0cee9b940ebf 100644 (file)
--- a/Cydia.mm
+++ b/Cydia.mm
@@ -281,7 +281,7 @@ static _finline NSString *CydiaURL(NSString *path) {
 @end
 /* }}} */
 
-@interface CYActionSheet : UIActionSheet {
+@interface CYActionSheet : UIAlertView {
     unsigned button_;
 }
 
@@ -291,12 +291,15 @@ static _finline NSString *CydiaURL(NSString *path) {
 @implementation CYActionSheet
 
 - (id) initWithTitle:(NSString *)title buttons:(NSArray *)buttons defaultButtonIndex:(int)index {
-    if ((self = [super initWithTitle:title buttons:buttons defaultButtonIndex:index delegate:self context:nil]) != nil) {
+    if ((self = [super init])) {
+               [self setDelegate:self];
+               for (NSString *button in buttons) [self addButtonWithTitle:button];
+               [self setCancelButtonIndex:index];
     } return self;
 }
 
-- (void) alertSheet:(UIActionSheet *)sheet buttonClicked:(int)button {
-    button_ = button;
+- (void) alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
+    button_ = buttonIndex + 1;
 }
 
 - (int) yieldToPopupAlertAnimated:(BOOL)animated {