NanoTech

Change the auth dialog into a UIViewController.

This brings a few things, including iPad support
and a proper top toolbar.
... ... @@ -14,15 +14,18 @@ typedef enum _ASIAuthenticationType {
ASIProxyAuthenticationType = 1
} ASIAuthenticationType;
@interface ASIAuthenticationDialog : NSObject <UIActionSheetDelegate, UITableViewDelegate, UITableViewDataSource> {
@interface ASIAuthenticationDialog : UIViewController <UIActionSheetDelegate, UITableViewDelegate, UITableViewDataSource> {
ASIHTTPRequest *request;
UIActionSheet *loginDialog;
ASIAuthenticationType type;
UITableView *tableView;
UIViewController *presentingController;
CGFloat keyboardHeight;
}
+ (void)presentAuthenticationDialogForRequest:(ASIHTTPRequest *)request;
+ (void)presentProxyAuthenticationDialogForRequest:(ASIHTTPRequest *)request;
+ (void)dismiss;
@property (retain) ASIHTTPRequest *request;
@property (retain) UIActionSheet *loginDialog;
@property (assign) ASIAuthenticationType type;
@end
... ...
This diff is collapsed. Click to expand it.
... ... @@ -23,7 +23,7 @@
// Automatically set on build
NSString *ASIHTTPRequestVersion = @"v1.6.2-10 2010-05-14";
NSString *ASIHTTPRequestVersion = @"v1.6.2-13 2010-06-14";
NSString* const NetworkRequestErrorDomain = @"ASIHTTPRequestErrorDomain";
... ... @@ -1502,6 +1502,9 @@ static BOOL isiPhoneOS2;
#if DEBUG_REQUEST_STATUS || DEBUG_THROTTLING
NSLog(@"Request finished: %@",self);
#endif
if ([self shouldPresentAuthenticationDialog] || [self shouldPresentProxyAuthenticationDialog]) {
[self performSelectorOnMainThread:@selector(dismissAuthenticationDialog) withObject:nil waitUntilDone:[NSThread isMainThread]];
}
if ([self error] || [self mainRequest]) {
return;
}
... ... @@ -2181,6 +2184,11 @@ static BOOL isiPhoneOS2;
#endif
}
- (void)dismissAuthenticationDialog
{
[ASIAuthenticationDialog dismiss];
}
- (BOOL)askDelegateForCredentials
{
// If we have a delegate, we'll see if it can handle proxyAuthenticationNeededForRequest:.
... ...