Change the auth dialog into a UIViewController.
This brings a few things, including iPad support and a proper top toolbar.
Showing
3 changed files
with
15 additions
and
4 deletions
| @@ -14,15 +14,18 @@ typedef enum _ASIAuthenticationType { | @@ -14,15 +14,18 @@ typedef enum _ASIAuthenticationType { | ||
| 14 | ASIProxyAuthenticationType = 1 | 14 | ASIProxyAuthenticationType = 1 |
| 15 | } ASIAuthenticationType; | 15 | } ASIAuthenticationType; |
| 16 | 16 | ||
| 17 | -@interface ASIAuthenticationDialog : NSObject <UIActionSheetDelegate, UITableViewDelegate, UITableViewDataSource> { | 17 | +@interface ASIAuthenticationDialog : UIViewController <UIActionSheetDelegate, UITableViewDelegate, UITableViewDataSource> { |
| 18 | ASIHTTPRequest *request; | 18 | ASIHTTPRequest *request; |
| 19 | - UIActionSheet *loginDialog; | ||
| 20 | ASIAuthenticationType type; | 19 | ASIAuthenticationType type; |
| 20 | + UITableView *tableView; | ||
| 21 | + UIViewController *presentingController; | ||
| 22 | + CGFloat keyboardHeight; | ||
| 21 | } | 23 | } |
| 22 | + (void)presentAuthenticationDialogForRequest:(ASIHTTPRequest *)request; | 24 | + (void)presentAuthenticationDialogForRequest:(ASIHTTPRequest *)request; |
| 23 | + (void)presentProxyAuthenticationDialogForRequest:(ASIHTTPRequest *)request; | 25 | + (void)presentProxyAuthenticationDialogForRequest:(ASIHTTPRequest *)request; |
| 24 | 26 | ||
| 27 | ++ (void)dismiss; | ||
| 28 | + | ||
| 25 | @property (retain) ASIHTTPRequest *request; | 29 | @property (retain) ASIHTTPRequest *request; |
| 26 | -@property (retain) UIActionSheet *loginDialog; | ||
| 27 | @property (assign) ASIAuthenticationType type; | 30 | @property (assign) ASIAuthenticationType type; |
| 28 | @end | 31 | @end |
This diff is collapsed. Click to expand it.
| @@ -23,7 +23,7 @@ | @@ -23,7 +23,7 @@ | ||
| 23 | 23 | ||
| 24 | 24 | ||
| 25 | // Automatically set on build | 25 | // Automatically set on build |
| 26 | -NSString *ASIHTTPRequestVersion = @"v1.6.2-10 2010-05-14"; | 26 | +NSString *ASIHTTPRequestVersion = @"v1.6.2-13 2010-06-14"; |
| 27 | 27 | ||
| 28 | NSString* const NetworkRequestErrorDomain = @"ASIHTTPRequestErrorDomain"; | 28 | NSString* const NetworkRequestErrorDomain = @"ASIHTTPRequestErrorDomain"; |
| 29 | 29 | ||
| @@ -1502,6 +1502,9 @@ static BOOL isiPhoneOS2; | @@ -1502,6 +1502,9 @@ static BOOL isiPhoneOS2; | ||
| 1502 | #if DEBUG_REQUEST_STATUS || DEBUG_THROTTLING | 1502 | #if DEBUG_REQUEST_STATUS || DEBUG_THROTTLING |
| 1503 | NSLog(@"Request finished: %@",self); | 1503 | NSLog(@"Request finished: %@",self); |
| 1504 | #endif | 1504 | #endif |
| 1505 | + if ([self shouldPresentAuthenticationDialog] || [self shouldPresentProxyAuthenticationDialog]) { | ||
| 1506 | + [self performSelectorOnMainThread:@selector(dismissAuthenticationDialog) withObject:nil waitUntilDone:[NSThread isMainThread]]; | ||
| 1507 | + } | ||
| 1505 | if ([self error] || [self mainRequest]) { | 1508 | if ([self error] || [self mainRequest]) { |
| 1506 | return; | 1509 | return; |
| 1507 | } | 1510 | } |
| @@ -2181,6 +2184,11 @@ static BOOL isiPhoneOS2; | @@ -2181,6 +2184,11 @@ static BOOL isiPhoneOS2; | ||
| 2181 | #endif | 2184 | #endif |
| 2182 | } | 2185 | } |
| 2183 | 2186 | ||
| 2187 | +- (void)dismissAuthenticationDialog | ||
| 2188 | +{ | ||
| 2189 | + [ASIAuthenticationDialog dismiss]; | ||
| 2190 | +} | ||
| 2191 | + | ||
| 2184 | - (BOOL)askDelegateForCredentials | 2192 | - (BOOL)askDelegateForCredentials |
| 2185 | { | 2193 | { |
| 2186 | // If we have a delegate, we'll see if it can handle proxyAuthenticationNeededForRequest:. | 2194 | // If we have a delegate, we'll see if it can handle proxyAuthenticationNeededForRequest:. |
-
Please register or login to post a comment