From 540437033286aa962b940cefac84686abf6d9ffa Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Thu, 2 Dec 2010 03:33:09 -0800 Subject: Use UIApplication::networkActivityIndicator to indicate network activity. --- UICaboodle/BrowserView.h | 2 ++ UICaboodle/BrowserView.mm | 7 +++++++ 2 files changed, 9 insertions(+) (limited to 'UICaboodle') diff --git a/UICaboodle/BrowserView.h b/UICaboodle/BrowserView.h index f5d5029..f224326 100644 --- a/UICaboodle/BrowserView.h +++ b/UICaboodle/BrowserView.h @@ -50,6 +50,8 @@ @end @protocol BrowserControllerDelegate +- (void) retainNetworkActivityIndicator; +- (void) releaseNetworkActivityIndicator; - (CYViewController *) pageForURL:(NSURL *)url hasTag:(int *)tag; @end diff --git a/UICaboodle/BrowserView.mm b/UICaboodle/BrowserView.mm index 5fd65c2..f1053f8 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]; @@ -904,11 +906,16 @@ static void $UIWebViewWebViewDelegate$webViewClose$(UIWebViewWebViewDelegate *se - (void) _didStartLoading { [self applyRightButton]; + + if ([loading_ count] != 1) + return; + [delegate_ retainNetworkActivityIndicator]; } - (void) _didFinishLoading { if ([loading_ count] != 0) return; + [delegate_ releaseNetworkActivityIndicator]; [self applyRightButton]; -- cgit v1.2.3