8 |
8 |
9 #import "DetailViewController.h" |
9 #import "DetailViewController.h" |
10 #import "SDL_uikitappdelegate.h" |
10 #import "SDL_uikitappdelegate.h" |
11 #import "TeamSettingsViewController.h" |
11 #import "TeamSettingsViewController.h" |
12 #import "GeneralSettingsViewController.h" |
12 #import "GeneralSettingsViewController.h" |
|
13 #import "CommodityFunctions.h" |
13 |
14 |
14 @implementation DetailViewController |
15 @implementation DetailViewController |
15 @synthesize popoverController, controllers; |
16 @synthesize popoverController, controllers; |
16 |
17 |
|
18 |
|
19 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation { |
|
20 return rotationManager(interfaceOrientation); |
|
21 } |
17 |
22 |
18 - (void)viewDidLoad { |
23 - (void)viewDidLoad { |
19 self.title = NSLocalizedString(@"Settings",@""); |
24 self.title = NSLocalizedString(@"Settings",@""); |
20 |
25 |
21 // allocate controllers and store them into the array |
26 // allocate controllers and store them into the array |
123 */ |
128 */ |
124 |
129 |
125 #pragma mark - |
130 #pragma mark - |
126 #pragma mark Split view support |
131 #pragma mark Split view support |
127 #ifdef __IPHONE_3_2 |
132 #ifdef __IPHONE_3_2 |
128 -(void) splitViewController:(UISplitViewController*)svc willHideViewController:(UIViewController *)aViewController withBarButtonItem:(UIBarButtonItem*)barButtonItem forPopoverController: (UIPopoverController*)pc { |
133 -(void) splitViewController:(UISplitViewController *)svc willHideViewController:(UIViewController *)aViewController withBarButtonItem:(UIBarButtonItem *)barButtonItem forPopoverController:(UIPopoverController *)pc { |
129 barButtonItem.title = @"Master List"; |
134 barButtonItem.title = @"Master List"; |
130 // [navigationBar.topItem setLeftBarButtonItem:barButtonItem animated:YES]; |
135 [self.navigationController.navigationBar.topItem setLeftBarButtonItem:barButtonItem animated:YES]; |
131 self.popoverController = pc; |
136 self.popoverController = pc; |
132 } |
137 } |
133 |
138 |
134 // Called when the view is shown again in the split view, invalidating the button and popover controller. |
139 // Called when the view is shown again in the split view, invalidating the button and popover controller. |
135 -(void) splitViewController: (UISplitViewController*)svc willShowViewController:(UIViewController *)aViewController invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem { |
140 -(void) splitViewController: (UISplitViewController*)svc willShowViewController:(UIViewController *)aViewController invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem { |
136 // [navigationBar.topItem setLeftBarButtonItem:nil animated:YES]; |
141 [self.navigationController.navigationBar.topItem setLeftBarButtonItem:nil animated:YES]; |
137 self.popoverController = nil; |
142 self.popoverController = nil; |
138 } |
143 } |
139 #endif |
144 #endif |
140 |
|
141 #pragma mark - |
|
142 #pragma mark Rotation support |
|
143 // Ensure that the view controller supports rotation and that the split view can therefore show in both portrait and landscape. |
|
144 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { |
|
145 return (interfaceOrientation == UIInterfaceOrientationLandscapeRight); |
|
146 } |
|
147 |
145 |
148 -(IBAction) dismissSplitView { |
146 -(IBAction) dismissSplitView { |
149 [[NSNotificationCenter defaultCenter] postNotificationName:@"dismissModalView" object:nil]; |
147 [[NSNotificationCenter defaultCenter] postNotificationName:@"dismissModalView" object:nil]; |
150 } |
148 } |
151 |
149 |