NanoTech

Add rotation support to the auth dialog (iPad only for now).

... ... @@ -13,8 +13,11 @@ typedef enum _ASIAuthenticationType {
ASIStandardAuthenticationType = 0,
ASIProxyAuthenticationType = 1
} ASIAuthenticationType;
@interface ASIAuthenticationDialog : UIViewController <UIActionSheetDelegate, UITableViewDelegate, UITableViewDataSource, UITextFieldDelegate> {
@interface ASIAutorotatingViewController : UIViewController
@end
@interface ASIAuthenticationDialog : ASIAutorotatingViewController <UIActionSheetDelegate, UITableViewDelegate, UITableViewDataSource, UITextFieldDelegate> {
ASIHTTPRequest *request;
ASIAuthenticationType type;
UITableView *tableView;
... ...
... ... @@ -20,6 +20,22 @@ static const NSUInteger kPasswordSection = 0;
static const NSUInteger kDomainRow = 0;
static const NSUInteger kDomainSection = 1;
@implementation ASIAutorotatingViewController
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
#if __IPHONE_3_2 && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_3_2
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
return YES;
}
#endif
return (toInterfaceOrientation == UIInterfaceOrientationPortrait);
}
@end
@interface ASIAuthenticationDialog ()
- (void)show;
@property (retain) UITableView *tableView;
... ... @@ -108,7 +124,7 @@ static const NSUInteger kDomainSection = 1;
- (UIViewController *)presentingController
{
if (!presentingController) {
presentingController = [[UIViewController alloc] initWithNibName:nil bundle:nil];
presentingController = [[ASIAutorotatingViewController alloc] initWithNibName:nil bundle:nil];
// Attach to the window, but don't interfere.
UIWindow *window = [[[UIApplication sharedApplication] windows] objectAtIndex:0];
... ...