summaryrefslogtreecommitdiff
path: root/MobileCydia.mm
diff options
context:
space:
mode:
Diffstat (limited to 'MobileCydia.mm')
-rw-r--r--MobileCydia.mm24
1 files changed, 22 insertions, 2 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm
index 8eeb857..a85c12e 100644
--- a/MobileCydia.mm
+++ b/MobileCydia.mm
@@ -7690,9 +7690,29 @@ static void HomeControllerReachabilityCallback(SCNetworkReachabilityRef reachabi
return path;
}
+- (void) alertView:(UIAlertView *)alert clickedButtonAtIndex:(NSInteger)button {
+ NSString *context([alert context]);
+
+ if ([context isEqualToString:@"norefresh"])
+ [alert dismissWithClickedButtonIndex:-1 animated:YES];
+}
+
- (void) refreshButtonClicked {
- [delegate_ beginUpdate];
- [[self navigationItem] setLeftBarButtonItem:nil animated:YES];
+ if (IsReachable("cydia.saurik.com")) {
+ [delegate_ beginUpdate];
+ [[self navigationItem] setLeftBarButtonItem:nil animated:YES];
+ } else {
+ UIAlertView *alert = [[[UIAlertView alloc]
+ initWithTitle:[NSString stringWithFormat:Colon_, Error_, UCLocalize("REFRESH")]
+ message:@"Host Unreachable" // XXX: Localize
+ delegate:self
+ cancelButtonTitle:UCLocalize("OK")
+ otherButtonTitles:nil
+ ] autorelease];
+
+ [alert setContext:@"norefresh"];
+ [alert show];
+ }
}
- (void) upgradeButtonClicked {