]> granicus.if.org Git - handbrake/commitdiff
MacGui: Fix Presets mangling the x264 option strings for the umpteenth time.
authordynaflash <dynaflashtech@gmail.com>
Mon, 16 Apr 2007 20:59:16 +0000 (20:59 +0000)
committerdynaflash <dynaflashtech@gmail.com>
Mon, 16 Apr 2007 20:59:16 +0000 (20:59 +0000)
- Replace the Optional x264 string NSTextView with an NSTextField
- Change when the field is emptied after creation.
- Reset the value of the ChickenSandwich.

git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@516 b64f7644-9d1e-0410-96f1-a4d463321fa5

macosx/Controller.h
macosx/Controller.mm
macosx/English.lproj/MainMenu.nib/classes.nib
macosx/English.lproj/MainMenu.nib/info.nib
macosx/English.lproj/MainMenu.nib/keyedobjects.nib

index dd366dd981b2d7bfecdf2fd4e8b9e1faea776f72..6666e3c3560d1ccc29602ece91e53e42293bfb6e 100644 (file)
        
        IBOutlet NSDrawer            * fPresetDrawer;
        IBOutlet NSTextField         * fPresetNewName;
-       IBOutlet NSTextView          * fPresetNewX264Opt;
+       IBOutlet NSTextField         * fPresetNewX264Opt;
        IBOutlet NSTextField         * fPresetNewX264OptLabel;
        IBOutlet NSButton            * fPresetNewPicSettingsApply;
        IBOutlet NSTextField         * fPresetSelectedDisplay;
index 0849cd0fd18813a7a505470ede1d900c5b47dd56..c80ae3ed934f3fbffbd47d3a2f65af1d8a52a13b 100644 (file)
@@ -587,7 +587,7 @@ static int FormatSettings[3][4] =
                fPicLabelAr,fPicLabelDeinter,fPicLabelSrcX,fPicLabelOutputX,
                fPicLabelPAROutp,fPicLabelPAROutputX,fPicSettingPARWidth,fPicSettingPARHeight,
                fPicSettingPARDsply,fPicLabelAnamorphic,tableView,fPresetsAdd,fPresetsDelete,
-               fCreateChapterMarkers,fPresetNewX264OptLabel};
+               fCreateChapterMarkers,fPresetNewX264OptLabel,fDisplayX264Options};
 
     for( unsigned i = 0;
          i < sizeof( controls ) / sizeof( NSControl * ); i++ )
@@ -1729,42 +1729,6 @@ the user is using "Custom" settings by determining the sender*/
 }
 
 
-- (IBAction) ShowAddPresetPanel: (id) sender
-{
-    /* Deselect the currently selected Preset if there is one*/
-               [tableView deselectRow:[tableView selectedRow]];
-    /* If we have MP4, AVC H.264 and Main then we enable the x264 Options field for the
-        Add Preset window we are about to open. We do this before we actually open the panel,
-        as doing it after causes it to stick from the last selection for some reason. */
-       if ([fDstFormatPopUp indexOfSelectedItem] == 0 && [fDstCodecsPopUp indexOfSelectedItem] == 1)
-       {
-               [fPresetNewX264Opt setEditable: YES];
-               [fPresetNewX264OptLabel setEnabled: YES];
-       }
-       else
-       {
-               [fPresetNewX264Opt setEditable: NO];
-               [fPresetNewX264OptLabel setEnabled: NO];
-       }
-               /* Erase info from the input fields */
-       [fPresetNewName setStringValue: @""];
-       [fPresetNewX264Opt setString:@""];
-       /* Show the panel */
-       [NSApp beginSheet: fAddPresetPanel modalForWindow: fWindow
-        modalDelegate: NULL didEndSelector: NULL contextInfo: NULL];
-    [NSApp runModalForWindow: fAddPresetPanel];
-    [NSApp endSheet: fAddPresetPanel];
-    [fAddPresetPanel orderOut: self];
-       
-       
-}
-- (IBAction) CloseAddPresetPanel: (id) sender
-{
-       /* Erase info from the input fields */
-       [fPresetNewName setStringValue: @""];
-       [fPresetNewX264Opt setString:@""];
-    [NSApp stopModal];
-}
    /* We use this method to recreate new, updated factory
    presets */
 - (IBAction)AddFactoryPresets:(id)sender
@@ -1805,11 +1769,49 @@ the user is using "Custom" settings by determining the sender*/
 
 }
 
+- (IBAction) ShowAddPresetPanel: (id) sender
+{
+    /* Deselect the currently selected Preset if there is one*/
+               [tableView deselectRow:[tableView selectedRow]];
+    /* If we have MP4, AVC H.264 and Main then we enable the x264 Options field for the
+        Add Preset window we are about to open. We do this before we actually open the panel,
+        as doing it after causes it to stick from the last selection for some reason. */
+       if ([fDstFormatPopUp indexOfSelectedItem] == 0 && [fDstCodecsPopUp indexOfSelectedItem] == 1)
+       {
+               [fPresetNewX264Opt setEditable: YES];
+               [fPresetNewX264OptLabel setEnabled: YES];
+       }
+       else
+       {
+               [fPresetNewX264Opt setEditable: NO];
+               [fPresetNewX264OptLabel setEnabled: NO];
+       }
+               /* Erase info from the input fields */
+       [fPresetNewName setStringValue: @""];
+       [fPresetNewX264Opt setStringValue:@""];
+       /* Show the panel */
+       [NSApp beginSheet: fAddPresetPanel modalForWindow: fWindow
+        modalDelegate: NULL didEndSelector: NULL contextInfo: NULL];
+    [NSApp runModalForWindow: fAddPresetPanel];
+    [NSApp endSheet: fAddPresetPanel];
+    [fAddPresetPanel orderOut: self];
+       
+       
+}
+- (IBAction) CloseAddPresetPanel: (id) sender
+{
+       [NSApp stopModal];
+}
+
+
 - (IBAction)AddUserPreset:(id)sender
 {
+
     /* Here we create a custom user preset */
        [UserPresets addObject:[self CreatePreset]];
-
+       /* Erase info from the input fields */
+       [fPresetNewName setStringValue: @""];
+       [fPresetNewX264Opt setStringValue:@""];
        /* We stop the modal window for the new preset */
        [NSApp stopModal];
     [self AddPreset];
@@ -1865,7 +1867,7 @@ the user is using "Custom" settings by determining the sender*/
        /* Video encoder */
        [preset setObject:[fVidEncoderPopUp titleOfSelectedItem] forKey:@"VideoEncoder"];
        /* x264 Option String */
-       [preset setObject:[fPresetNewX264Opt string] forKey:@"x264Option"];
+       [preset setObject:[fPresetNewX264Opt stringValue] forKey:@"x264Option"];
        //[fDisplayX264Options setStringValue: [NSString stringWithFormat: @"Using Option: %@",CurUserPresetx264Opt]];
        /* Video quality */
        [preset setObject:[NSNumber numberWithInt:[fVidQualityMatrix selectedRow]] forKey:@"VideoQualityType"];
index 74266e5dea1c24a21498bdb7282ceaa8ce219852..bc5e6856cfd8d2d3290ce92be61816e2bb0d10cf 100644 (file)
@@ -88,7 +88,7 @@
                 fPresetDrawer = NSDrawer; 
                 fPresetNewName = NSTextField; 
                 fPresetNewPicSettingsApply = NSButton; 
-                fPresetNewX264Opt = NSTextView
+                fPresetNewX264Opt = NSTextField
                 fPresetNewX264OptLabel = NSTextField; 
                 fPresetSaveButton = NSButton; 
                 fPresetSelectedDisplay = NSTextField; 
index 0ec631a81466de37e06e5492ea2b77f3dc694c4c..91b113aeb2ed3f8acf93a279640268f87e16aba5 100644 (file)
@@ -19,8 +19,8 @@
        </array>
        <key>IBOpenObjects</key>
        <array>
-               <integer>21</integer>
                <integer>29</integer>
+               <integer>1867</integer>
        </array>
        <key>IBSystem Version</key>
        <string>8P2137</string>
index 14cc389e08d677929ba19b96a6857b4371fec093..ef298fa5d74d2b3e5983fd29406a67213fde672b 100644 (file)
Binary files a/macosx/English.lproj/MainMenu.nib/keyedobjects.nib and b/macosx/English.lproj/MainMenu.nib/keyedobjects.nib differ