X-Git-Url: https://git.saurik.com/cydia.git/blobdiff_plain/8d603a7de7b0e5e8f72eabe6b2307c4dfff5b663..6995cc75744a56c2e552404a8de6181fd45ac562:/UICaboodle/BrowserView.mm?ds=sidebyside diff --git a/UICaboodle/BrowserView.mm b/UICaboodle/BrowserView.mm index 5fd65c21..2abc02ec 100644 --- a/UICaboodle/BrowserView.mm +++ b/UICaboodle/BrowserView.mm @@ -451,6 +451,8 @@ static void $UIWebViewWebViewDelegate$webViewClose$(UIWebViewWebViewDelegate *se if (title_ != nil) [title_ release]; + if ([loading_ count] != 0) + [delegate_ releaseNetworkActivityIndicator]; [loading_ release]; [reloaditem_ release]; @@ -636,7 +638,7 @@ static void $UIWebViewWebViewDelegate$webViewClose$(UIWebViewWebViewDelegate *se if ([scheme isEqualToString:@"mailto"]) [self _openMailToURL:url]; - CYViewController *page([delegate_ pageForURL:url hasTag:NULL]); + CYViewController *page([delegate_ pageForURL:url]); if (page == nil) { BrowserController *browser([[[class_ alloc] init] autorelease]); @@ -651,13 +653,11 @@ static void $UIWebViewWebViewDelegate$webViewClose$(UIWebViewWebViewDelegate *se [[self navigationController] pushViewController:page animated:YES]; } else { - UCNavigationController *navigation([[[UCNavigationController alloc] init] autorelease]); + UCNavigationController *navigation([[[UCNavigationController alloc] initWithRootViewController:page] autorelease]); [navigation setHook:indirect_]; [navigation setDelegate:delegate_]; - [navigation setViewControllers:[NSArray arrayWithObject:page]]; - [[page navigationItem] setLeftBarButtonItem:[[[UIBarButtonItem alloc] initWithTitle:UCLocalize("CLOSE") style:UIBarButtonItemStylePlain @@ -835,19 +835,13 @@ static void $UIWebViewWebViewDelegate$webViewClose$(UIWebViewWebViewDelegate *se [alert dismissWithClickedButtonIndex:-1 animated:YES]; } else if ([context isEqualToString:@"submit"]) { - switch (button) { - case 1: - break; - - case 2: - if (request_ != nil) { - WebThreadLock(); - [webview_ loadRequest:request_]; - WebThreadUnlock(); - } - break; - - _nodefault + if (button == [alert cancelButtonIndex]) { + } else if (button == [alert firstOtherButtonIndex]) { + if (request_ != nil) { + WebThreadLock(); + [webview_ loadRequest:request_]; + WebThreadUnlock(); + } } [alert dismissWithClickedButtonIndex:-1 animated:YES]; @@ -902,8 +896,22 @@ static void $UIWebViewWebViewDelegate$webViewClose$(UIWebViewWebViewDelegate *se } } +- (void) didStartLoading { + // Overridden in subclasses. +} + - (void) _didStartLoading { [self applyRightButton]; + + if ([loading_ count] != 1) + return; + + [delegate_ retainNetworkActivityIndicator]; + [self didStartLoading]; +} + +- (void) didFinishLoading { + // Overridden in subclasses. } - (void) _didFinishLoading { @@ -911,10 +919,10 @@ static void $UIWebViewWebViewDelegate$webViewClose$(UIWebViewWebViewDelegate *se return; [self applyRightButton]; + [[self navigationItem] setTitle:title_]; - // XXX: wtf? - if (![self isLoading]) - [[self navigationItem] setTitle:title_]; + [delegate_ releaseNetworkActivityIndicator]; + [self didFinishLoading]; } - (bool) isLoading {