summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2011-02-26 01:56:33 -0800
committerJay Freeman (saurik) <saurik@saurik.com>2011-03-07 02:41:23 -0800
commit8d497e2a4c6478859f08e5e0bb912256c0ca64b1 (patch)
treef67e563cdcb513aff216bce307c7baee1fbb62f1
parent64d46af3a8176919d9d8601b3e8f1673ce8bb235 (diff)
Add cydia.popViewController(animated).
-rw-r--r--MobileCydia.mm8
-rw-r--r--UICaboodle/BrowserView.mm6
2 files changed, 14 insertions, 0 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm
index 49218cb..ad48ee5 100644
--- a/MobileCydia.mm
+++ b/MobileCydia.mm
@@ -4234,6 +4234,8 @@ static NSMutableSet *Diversions_;
return @"installPackages";
else if (selector == @selector(localizedStringForKey:value:table:))
return @"localize";
+ else if (selector == @selector(popViewController:))
+ return @"popViewController";
else if (selector == @selector(refreshSources))
return @"refreshSources";
else if (selector == @selector(removeButton))
@@ -4320,6 +4322,12 @@ static NSMutableSet *Diversions_;
[delegate_ performSelectorOnMainThread:@selector(addCydiaHost:) withObject:host waitUntilDone:NO];
}
+- (void) popViewController:(NSNumber *)value {
+ if (value == (id) [WebUndefined undefined])
+ value = [NSNumber numberWithBool:YES];
+ [indirect_ performSelectorOnMainThread:@selector(popViewControllerWithNumber:) withObject:value waitUntilDone:NO];
+}
+
- (void) addTrivialSource:(NSString *)href {
[delegate_ performSelectorOnMainThread:@selector(addTrivialSource:) withObject:href waitUntilDone:NO];
}
diff --git a/UICaboodle/BrowserView.mm b/UICaboodle/BrowserView.mm
index 9858598..9a067f7 100644
--- a/UICaboodle/BrowserView.mm
+++ b/UICaboodle/BrowserView.mm
@@ -649,6 +649,12 @@ static void $UIWebViewWebViewDelegate$webViewClose$(UIWebViewWebViewDelegate *se
[self setAllowsNavigationAction:[value boolValue]];
}
+- (void) popViewControllerWithNumber:(NSNumber *)value {
+ UINavigationController *navigation([self navigationController]);
+ if ([navigation topViewController] == self)
+ [navigation popViewControllerAnimated:[value boolValue]];
+}
+
- (void) _didFailWithError:(NSError *)error forFrame:(WebFrame *)frame {
[loading_ removeObject:[NSValue valueWithNonretainedObject:frame]];
[self _didFinishLoading];