summaryrefslogtreecommitdiff
path: root/Cydia.mm
diff options
context:
space:
mode:
authorGrant Paul <chpwn@chpwn.com>2010-08-10 17:37:39 +0000
committerJay Freeman (saurik) <saurik@saurik.com>2010-09-30 08:21:31 +0000
commit3272e699fcca7ada9261265970323a0249f28e9a (patch)
treed2b36b239625af8b0d5ef32127a3a81e3fd601b6 /Cydia.mm
parent969eaf2fc7d6cc51eca971d69872f0b5dc46decd (diff)
Commit (chpwn): essential-alerts.patch
Diffstat (limited to 'Cydia.mm')
-rw-r--r--Cydia.mm57
1 files changed, 23 insertions, 34 deletions
diff --git a/Cydia.mm b/Cydia.mm
index a6860c9..077c63a 100644
--- a/Cydia.mm
+++ b/Cydia.mm
@@ -3968,7 +3968,7 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) {
@interface ConfirmationView : CydiaBrowserView {
_transient Database *database_;
- UIActionSheet *essential_;
+ UIAlertView *essential_;
NSArray *changes_;
NSArray *issues_;
NSArray *sizes_;
@@ -3996,28 +3996,25 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) {
[book_ popFromSuperviewAnimated:YES];
}
-- (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:@"remove"]) {
- switch (button) {
- case 1:
+ if (button == [alert cancelButtonIndex]) {
[self cancel];
- break;
- case 2:
+ } else if (button == [alert firstOtherButtonIndex]) {
if (substrate_)
Finish_ = 2;
[delegate_ confirm];
- break;
- _nodefault
}
- [sheet dismiss];
+ [alert dismissWithClickedButtonIndex:-1 animated:YES];
} else if ([context isEqualToString:@"unable"]) {
[self cancel];
- [sheet dismiss];
- } else
- [super alertSheet:sheet buttonClicked:button];
+ [alert dismissWithClickedButtonIndex:-1 animated:YES];
+ } else {
+ [super alertView:alert clickedButtonAtIndex:button];
+ }
}
- (void) webView:(WebView *)sender didClearWindowObject:(WebScriptObject *)window forFrame:(WebFrame *)frame {
@@ -4072,33 +4069,25 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) {
else if (Advanced_) {
NSString *parenthetical(UCLocalize("PARENTHETICAL"));
- essential_ = [[UIActionSheet alloc]
+ essential_ = [[UIAlertView alloc]
initWithTitle:UCLocalize("REMOVING_ESSENTIALS")
- buttons:[NSArray arrayWithObjects:
- [NSString stringWithFormat:parenthetical, UCLocalize("CANCEL_OPERATION"), UCLocalize("SAFE")],
- [NSString stringWithFormat:parenthetical, UCLocalize("FORCE_REMOVAL"), UCLocalize("UNSAFE")],
- nil]
- defaultButtonIndex:0
- delegate:self
- context:@"remove"
- ];
-
- [essential_ setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)];
+ message:UCLocalize("REMOVING_ESSENTIALS_EX")
+ delegate:self
+ cancelButtonTitle:[NSString stringWithFormat:parenthetical, UCLocalize("CANCEL_OPERATION"), UCLocalize("SAFE")]
+ otherButtonTitles:[NSString stringWithFormat:parenthetical, UCLocalize("FORCE_REMOVAL"), UCLocalize("UNSAFE")], nil
+ ];
- [essential_ setDestructiveButtonIndex:1];
- [essential_ setBodyText:UCLocalize("REMOVING_ESSENTIALS_EX")];
+ [essential_ setContext:@"remove"];
} else {
- essential_ = [[UIActionSheet alloc]
+ essential_ = [[UIAlertView alloc]
initWithTitle:UCLocalize("UNABLE_TO_COMPLY")
- buttons:[NSArray arrayWithObjects:UCLocalize("OKAY"), nil]
- defaultButtonIndex:0
- delegate:self
- context:@"unable"
+ message:UCLocalize("UNABLE_TO_COMPLY_EX")
+ delegate:self
+ cancelButtonTitle:UCLocalize("OKAY")
+ otherButtonTitles:nil
];
- [essential_ setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)];
-
- [essential_ setBodyText:UCLocalize("UNABLE_TO_COMPLY_EX")];
+ [essential_ setContext:@"unable"];
}
changes_ = [[NSArray alloc] initWithObjects: