diff options
author | dynaflash <[email protected]> | 2007-08-22 19:10:11 +0000 |
---|---|---|
committer | dynaflash <[email protected]> | 2007-08-22 19:10:11 +0000 |
commit | e25ada5ce7684610215a68f4356ff132a4408205 (patch) | |
tree | d7bb6107e8e33f45a74cebf8a2d998084ce91887 | |
parent | 5b79c836c803fe8b7706bf06485656f889478f7f (diff) |
MacGui: internal change to Controller.mm
- move preset loading code from awakeFromNib to a new method called loadPresets
- remove references to unused x264Opts.plist file we never used.
This fat boy is going on a diet !
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@851 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | macosx/Controller.h | 9 | ||||
-rw-r--r-- | macosx/Controller.mm | 77 |
2 files changed, 36 insertions, 50 deletions
diff --git a/macosx/Controller.h b/macosx/Controller.h index d990118a1..744fe111e 100644 --- a/macosx/Controller.h +++ b/macosx/Controller.h @@ -219,9 +219,7 @@ NSString * AppSupportDirectory; NSString * UserPresetsFile; - NSString * x264ProfilesFile; NSMutableArray * UserPresets; - NSMutableArray * x264Profiles; NSMutableArray * UserPresetssortedArray; NSMutableDictionary * chosenPreset; int curUserPresetChosenNum; @@ -232,8 +230,8 @@ IBOutlet NSTableView * tableView; IBOutlet NSButton * fPresetsAdd; IBOutlet NSButton * fPresetsDelete; - IBOutlet MVMenuButton * fPresetsActionButton; - IBOutlet NSMenu * fPresetsActionMenu; + IBOutlet MVMenuButton * fPresetsActionButton; + IBOutlet NSMenu * fPresetsActionMenu; hb_handle_t * fHandle; hb_title_t * fTitle; @@ -243,7 +241,7 @@ int currentScanCount; int currentSuccessfulScanCount; NSString * currentSource; - HBOutputPanelController *outputPanel; + HBOutputPanelController *outputPanel; BOOL startButtonEnabled; BOOL pauseButtonEnabled; @@ -317,6 +315,7 @@ - (IBAction) X264AdvancedOptionsChanged: (id) sender; // Preset Methods Here +- (void) loadPresets; - (IBAction) CustomSettingUsed: (id) sender; - (IBAction) ShowAddPresetPanel: (id) sender; - (IBAction) CloseAddPresetPanel: (id) sender; diff --git a/macosx/Controller.mm b/macosx/Controller.mm index 0381e1c70..3587f6c81 100644 --- a/macosx/Controller.mm +++ b/macosx/Controller.mm @@ -141,52 +141,9 @@ static NSString* ChooseSourceIdentifier = @"Choose Source Item Identifie evaluate successive scans */ currentScanCount = 0; - /* Init User Presets .plist */ - /* We declare the default NSFileManager into fileManager */ - NSFileManager * fileManager = [NSFileManager defaultManager]; - //presetPrefs = [[NSUserDefaults standardUserDefaults] retain]; - /* we set the files and support paths here */ - AppSupportDirectory = @"~/Library/Application Support/HandBrake"; - AppSupportDirectory = [AppSupportDirectory stringByExpandingTildeInPath]; - - UserPresetsFile = @"~/Library/Application Support/HandBrake/UserPresets.plist"; - UserPresetsFile = [UserPresetsFile stringByExpandingTildeInPath]; - - x264ProfilesFile = @"~/Library/Application Support/HandBrake/x264Profiles.plist"; - x264ProfilesFile = [x264ProfilesFile stringByExpandingTildeInPath]; - /* We check for the app support directory for media fork */ - if ([fileManager fileExistsAtPath:AppSupportDirectory] == 0) - { - // If it doesnt exist yet, we create it here - [fileManager createDirectoryAtPath:AppSupportDirectory attributes:nil]; - } - // We check for the presets.plist here - - if ([fileManager fileExistsAtPath:UserPresetsFile] == 0) - { - - [fileManager createFileAtPath:UserPresetsFile contents:nil attributes:nil]; + /* Init UserPresets .plist */ + [self loadPresets]; - } - // We check for the x264profiles.plist here - - if ([fileManager fileExistsAtPath:x264ProfilesFile] == 0) - { - - [fileManager createFileAtPath:x264ProfilesFile contents:nil attributes:nil]; - } - - - UserPresetsFile = @"~/Library/Application Support/HandBrake/UserPresets.plist"; - UserPresetsFile = [[UserPresetsFile stringByExpandingTildeInPath]retain]; - - UserPresets = [[NSMutableArray alloc] initWithContentsOfFile:UserPresetsFile]; - if (nil == UserPresets) - { - UserPresets = [[NSMutableArray alloc] init]; - [self AddFactoryPresets:NULL]; - } - /* Show/Dont Show Presets drawer upon launch based @@ -329,6 +286,36 @@ static NSString* ChooseSourceIdentifier = @"Choose Source Item Identifie } +- (void) loadPresets { + /* We declare the default NSFileManager into fileManager */ + NSFileManager * fileManager = [NSFileManager defaultManager]; + /* we set the files and support paths here */ + AppSupportDirectory = @"~/Library/Application Support/HandBrake"; + AppSupportDirectory = [AppSupportDirectory stringByExpandingTildeInPath]; + //UserPresetsFile = @"~/Library/Application Support/HandBrake/UserPresets.plist"; + //UserPresetsFile = [UserPresetsFile stringByExpandingTildeInPath]; + /* We check for the app support directory for handbrake */ + if ([fileManager fileExistsAtPath:AppSupportDirectory] == 0) + { + // If it doesnt exist yet, we create it here + [fileManager createDirectoryAtPath:AppSupportDirectory attributes:nil]; + } + /* We check for the presets.plist here */ + if ([fileManager fileExistsAtPath:UserPresetsFile] == 0) + { + [fileManager createFileAtPath:UserPresetsFile contents:nil attributes:nil]; + } + UserPresetsFile = @"~/Library/Application Support/HandBrake/UserPresets.plist"; + UserPresetsFile = [[UserPresetsFile stringByExpandingTildeInPath]retain]; + + UserPresets = [[NSMutableArray alloc] initWithContentsOfFile:UserPresetsFile]; + if (nil == UserPresets) + { + UserPresets = [[NSMutableArray alloc] init]; + [self AddFactoryPresets:NULL]; + } + +} // ============================================================ // NSToolbar Related Methods |