Ben Copsey

Make the queue pass on the authorization warning to its delegate

... ... @@ -122,7 +122,7 @@
NSDate *lastActivityTime;
NSTimeInterval timeOutSeconds;
}
#pragma mark init / dealloc
... ...
... ... @@ -152,6 +152,14 @@
[ASIHTTPRequest setProgress:progress forProgressIndicator:downloadProgressDelegate];
}
- (void)authorizationNeededForRequest:(ASIHTTPRequest *)request
{
if ([delegate respondsToSelector:@selector(authorizationNeededForRequest:)]) {
[delegate performSelector:@selector(authorizationNeededForRequest:) withObject:request];
}
}
@synthesize uploadProgressDelegate;
@synthesize downloadProgressDelegate;
@synthesize requestDidFinishSelector;
... ...
... ... @@ -43,10 +43,11 @@
- (IBAction)URLFetchWithProgress:(id)sender
{
[networkQueue cancelAllOperations];
[networkQueue setDownloadProgressDelegate:progressIndicator];
[networkQueue setDelegate:self];
[networkQueue setRequestDidFinishSelector:@selector(URLFetchWithProgressComplete:)];
ASIHTTPRequest *request = [[[ASIHTTPRequest alloc] initWithURL:[NSURL URLWithString:@"http://trails-network.net/Downloads/MemexTrails_1.0b1.zip"]] autorelease];
[request setDelegate:self];
[request setDownloadProgressDelegate:progressIndicator];
[request setDidFinishSelector:@selector(URLFetchWithProgressComplete:)];
[request setDownloadDestinationPath:[[[[NSBundle mainBundle] bundlePath] stringByDeletingLastPathComponent] stringByAppendingPathComponent:@"MemexTrails_1.0b1.zip"]];
[networkQueue addOperation:request];
}
... ... @@ -108,14 +109,17 @@
- (IBAction)fetchTopSecretInformation:(id)sender
{
[networkQueue cancelAllOperations];
[networkQueue setRequestDidFinishSelector:@selector(topSecretFetchComplete:)];
[networkQueue setDelegate:self];
[progressIndicator setDoubleValue:0];
ASIHTTPRequest *request;
request = [[[ASIHTTPRequest alloc] initWithURL:[NSURL URLWithString:@"http://allseeing-i.com/top_secret/"]] autorelease];
[request setDelegate:self];
[request setDidFinishSelector:@selector(topSecretFetchComplete:)];
[request setUseKeychainPersistance:[keychainCheckbox state]];
[networkQueue addOperation:request];
}
- (IBAction)topSecretFetchComplete:(ASIHTTPRequest *)request
... ...
... ... @@ -47,12 +47,12 @@
if (img) {
if ([imageView1 image]) {
if ([imageView2 image]) {
[imageView3 setImage:img];
[imageView3 performSelectorOnMainThread:@selector(setImage:) withObject:img waitUntilDone:NO];
} else {
[imageView2 setImage:img];
[imageView2 performSelectorOnMainThread:@selector(setImage:) withObject:img waitUntilDone:NO];
}
} else {
[imageView1 setImage:img];
[imageView1 performSelectorOnMainThread:@selector(setImage:) withObject:img waitUntilDone:NO];
}
}
}
... ...
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.