OSDN Git Service

MacGui: internal change to Controller.mm
authordynaflash <dynaflash@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Wed, 22 Aug 2007 19:10:11 +0000 (19:10 +0000)
committerdynaflash <dynaflash@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Wed, 22 Aug 2007 19:10:11 +0000 (19:10 +0000)
- 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://localhost/HandBrake/trunk@851 b64f7644-9d1e-0410-96f1-a4d463321fa5

macosx/Controller.h
macosx/Controller.mm

index d990118..744fe11 100644 (file)
        
        NSString                     * AppSupportDirectory;
        NSString                     * UserPresetsFile;
-       NSString                     * x264ProfilesFile;
        NSMutableArray               * UserPresets;
-       NSMutableArray               * x264Profiles;
        NSMutableArray               * UserPresetssortedArray;
        NSMutableDictionary          * chosenPreset;
     int                            curUserPresetChosenNum;
        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;
        int                            currentScanCount;
        int                            currentSuccessfulScanCount;
        NSString                      * currentSource;
-       HBOutputPanelController *outputPanel;
+       HBOutputPanelController       *outputPanel;
        
        BOOL                         startButtonEnabled;
     BOOL                         pauseButtonEnabled;
 - (IBAction) X264AdvancedOptionsChanged: (id) sender;
 
 // Preset Methods Here
+- (void) loadPresets;
 - (IBAction) CustomSettingUsed: (id) sender;
 - (IBAction) ShowAddPresetPanel: (id) sender;
 - (IBAction) CloseAddPresetPanel: (id) sender;
index 0381e1c..3587f6c 100644 (file)
@@ -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