cocoaTouch/GeneralSettingsViewController.m
changeset 3335 2520ee7a5484
parent 3332 3c90a923f156
child 3361 cfc6cd502f85
--- a/cocoaTouch/GeneralSettingsViewController.m	Sun Apr 11 01:04:54 2010 +0000
+++ b/cocoaTouch/GeneralSettingsViewController.m	Sun Apr 11 03:43:13 2010 +0000
@@ -7,16 +7,17 @@
 //
 
 #import "GeneralSettingsViewController.h"
-#import "SDL_uikitappdelegate.h"
+#import "CommodityFunctions.h"
 
 @implementation GeneralSettingsViewController
 @synthesize settingsDictionary, textFieldBeingEdited, musicSwitch, soundSwitch, altDamageSwitch;
 
 
-- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
-    return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
+-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
+	return rotationManager(interfaceOrientation);
 }
 
+
 #pragma mark -
 #pragma mark textfield methods
 // return to previous table
@@ -88,15 +89,12 @@
 	[self.soundSwitch addTarget:self action:@selector(alsoTurnOffMusic:) forControlEvents:UIControlEventValueChanged];
 	[self.musicSwitch addTarget:self action:@selector(dontTurnOnMusic:) forControlEvents:UIControlEventValueChanged];
 	[self.altDamageSwitch addTarget:self action:@selector(justUpdateDictionary:) forControlEvents:UIControlEventValueChanged];
-
-    NSString *filePath = [[SDLUIKitDelegate sharedAppDelegate] dataFilePath:@"settings.plist"];
-    NSMutableDictionary *dictionary = [[NSMutableDictionary alloc] initWithContentsOfFile:filePath];
+    
+    NSMutableDictionary *dictionary = [[NSMutableDictionary alloc] initWithContentsOfFile:SETTINGS_FILE()];
     self.settingsDictionary = dictionary;
     [dictionary release];
 }
 
-
-
 -(void) viewWillAppear:(BOOL)animated {
     [self.tableView setContentOffset:CGPointMake(0,0) animated:NO];
     isWriteNeeded = NO;
@@ -113,7 +111,7 @@
     
     if (isWriteNeeded) {
        	NSLog(@"writing preferences to file");
-        [self.settingsDictionary writeToFile:[[SDLUIKitDelegate sharedAppDelegate] dataFilePath:@"settings.plist"] atomically:YES];
+        [self.settingsDictionary writeToFile:SETTINGS_FILE() atomically:YES];
         isWriteNeeded = NO;
     }
 }