]> granicus.if.org Git - handbrake/commitdiff
MacGui: Preset refinements
authordynaflash <dynaflashtech@gmail.com>
Wed, 28 Mar 2007 14:20:13 +0000 (14:20 +0000)
committerdynaflash <dynaflashtech@gmail.com>
Wed, 28 Mar 2007 14:20:13 +0000 (14:20 +0000)
- Added current settings field in main window, uses the preset name if one is chosen and "Custom" if any settings are outside of the selected preset
- Deselects the preset if settings are changed from currently selected preset
- Uses a new method - (IBAction) CustomSettingUsed: (id) sender to make determination via the sender value.
presets use  a NULL value to make determination

- Currently, changing Picture Settings DOES NOT trigger the display change. Still sorting through those conditionals.

git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@460 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 ea35ac2955f32d80ad6c0c8c0ee336969defe751..9d6969466c956f7ca172f00d4f6b6d0c05bfb3fa 100644 (file)
 - (IBAction) OpenForums:   (id) sender;
 
 // Preset Methods Here
-
+- (IBAction) CustomSettingUsed: (id) sender;
 - (IBAction) ShowAddPresetPanel: (id) sender;
 - (IBAction) CloseAddPresetPanel: (id) sender;
 - (NSDictionary *)CreatePreset;
index 717303ebffdc9220cf6d55e073a272746a254709..71d06546262ebcbb04ada92966cf7a6c368b976f 100644 (file)
@@ -433,8 +433,9 @@ if ([[NSUserDefaults standardUserDefaults] boolForKey:@"DefaultPresetsDrawerShow
             }
             // Select the longuest title
                        [fSrcTitlePopUp selectItemAtIndex: indxpri];
-
-                       
+            /* We set the Settings Display to "Default" here
+                       until we get default presets implemented */
+                       [fPresetSelectedDisplay setStringValue: @"Default"];
                        
             [self TitlePopUpChanged: NULL];
             [self EnableUI: YES];
@@ -656,6 +657,7 @@ if ([[NSUserDefaults standardUserDefaults] boolForKey:@"DefaultPresetsDrawerShow
 
     [self QualitySliderChanged: sender];
     [self CalculateBitrate:     sender];
+       [self CustomSettingUsed: sender];
 }
 
 - (IBAction) QualitySliderChanged: (id) sender
@@ -663,6 +665,7 @@ if ([[NSUserDefaults standardUserDefaults] boolForKey:@"DefaultPresetsDrawerShow
     [fVidConstantCell setTitle: [NSString stringWithFormat:
         _( @"Constant quality: %.0f %%" ), 100.0 *
         [fVidQualitySlider floatValue]]];
+               [self CustomSettingUsed: sender];
 }
 
 - (IBAction) BrowseFile: (id) sender
@@ -1231,7 +1234,9 @@ if ([[NSUserDefaults standardUserDefaults] boolForKey:@"DefaultPresetsDrawerShow
        /* changing the codecs on offer may mean that we are/aren't now offering AAC, so */
        /* check if this change means we should / should't offer 6-channel AAC extraction */
        [self Check6ChannelAACExtraction: sender];
-
+       /* We call method method to change UI to reflect whether a preset is used or not*/
+       [self CustomSettingUsed: sender];       
+       
 }
 
 - (IBAction) CodecsPopUpChanged: (id) sender
@@ -1274,7 +1279,8 @@ if ([[NSUserDefaults standardUserDefaults] boolForKey:@"DefaultPresetsDrawerShow
        [self Check6ChannelAACExtraction: sender];
 
     [self CalculateBitrate: sender];
-
+    /* We call method method to change UI to reflect whether a preset is used or not*/
+       [self CustomSettingUsed: sender];
 }
 
 - (IBAction) EncoderPopUpChanged: (id) sender
@@ -1303,8 +1309,9 @@ if ([[NSUserDefaults standardUserDefaults] boolForKey:@"DefaultPresetsDrawerShow
 
        }
     
-       [self CalculatePictureSizing: sender];    
-  
+       [self CalculatePictureSizing: sender];
+       /* We call method method to change UI to reflect whether a preset is used or not*/    
+    [self CustomSettingUsed: sender];
 }
 
 - (IBAction) Check6ChannelAACExtraction: (id) sender
@@ -1473,8 +1480,25 @@ if ([[NSUserDefaults standardUserDefaults] boolForKey:@"DefaultPresetsDrawerShow
 
     [fVidBitrateField setIntValue: hb_calc_bitrate( job,
             [fVidTargetSizeField intValue] )];
+                       
+                       
+}
+
+/* Method to determine if we should change the UI
+To reflect whether or not a Preset is being used or if
+the user is using "Custom" settings by determining the sender*/
+- (IBAction) CustomSettingUsed: (id) sender
+{
+       if ([sender stringValue] != NULL)
+       {
+               /* Deselect the currently selected Preset if there is one*/
+               [tableView deselectRow:[tableView selectedRow]];
+               /* Change UI to show "Custom" settings are being used */
+               [fPresetSelectedDisplay setStringValue: @"Custom"];
+       }
 }
 
+
 - (IBAction) ShowAddPresetPanel: (id) sender
 {
     /* Show the panel */
@@ -1773,7 +1797,7 @@ if ([[NSUserDefaults standardUserDefaults] boolForKey:@"DefaultPresetsDrawerShow
                /* we get the chosen preset from the UserPresets array */
                chosenPreset = [UserPresets objectAtIndex:[sender selectedRow]];
                /* we set the preset display field in main window here */
-               //[fPresetSelectedDisplay setStringValue: [NSString stringWithFormat: @"%@", [chosenPreset valueForKey:@"PresetName"]]];
+               [fPresetSelectedDisplay setStringValue: [NSString stringWithFormat: @"%@", [chosenPreset valueForKey:@"PresetName"]]];
                /* File Format */
                [fDstFormatPopUp selectItemWithTitle: [NSString stringWithFormat:[chosenPreset valueForKey:@"FileFormat"]]];
                [self FormatPopUpChanged: NULL];
@@ -1785,9 +1809,9 @@ if ([[NSUserDefaults standardUserDefaults] boolForKey:@"DefaultPresetsDrawerShow
                /* Video encoder */
                [fVidEncoderPopUp selectItemWithTitle: [NSString stringWithFormat:[chosenPreset valueForKey:@"VideoEncoder"]]];
                /* Lets run through the following functions to get variables set there */
-               [self EncoderPopUpChanged: sender];
-               [self Check6ChannelAACExtraction: sender];
-               [self CalculateBitrate: sender];
+               [self EncoderPopUpChanged: NULL];
+               [self Check6ChannelAACExtraction: NULL];
+               [self CalculateBitrate: NULL];
                
                /* Video quality */
                [fVidQualityMatrix selectCellAtRow:[[chosenPreset objectForKey:@"VideoQualityType"] intValue] column:0];
@@ -1796,7 +1820,7 @@ if ([[NSUserDefaults standardUserDefaults] boolForKey:@"DefaultPresetsDrawerShow
                [fVidBitrateField setStringValue: [NSString stringWithFormat:[chosenPreset valueForKey:@"VideoAvgBitrate"]]];
                
                [fVidQualitySlider setFloatValue: [[chosenPreset valueForKey:@"VideoQualitySlider"] floatValue]];
-               [self VideoMatrixChanged: sender];
+               [self VideoMatrixChanged: NULL];
                
                /* Video framerate */
                [fVidRatePopUp selectItemWithTitle: [NSString stringWithFormat:[chosenPreset valueForKey:@"VideoFramerate"]]];
@@ -1813,7 +1837,7 @@ if ([[NSUserDefaults standardUserDefaults] boolForKey:@"DefaultPresetsDrawerShow
                [fAudLang1PopUp selectItemWithTitle: [NSString stringWithFormat:[chosenPreset valueForKey:@"AudioLang1"]]];
                /* Audio Language One Surround Sound Checkbox*/
                [fAudLang1SurroundCheck setState:[[chosenPreset objectForKey:@"AudioLang1Surround"] intValue]];
-               [self Check6ChannelAACExtraction: sender];
+               [self Check6ChannelAACExtraction: NULL];
                /* Audio Sample Rate*/
                [fAudRatePopUp selectItemWithTitle: [NSString stringWithFormat:[chosenPreset valueForKey:@"AudioSampleRate"]]];
                /* Audio Bitrate Rate*/
@@ -1838,11 +1862,9 @@ if ([[NSUserDefaults standardUserDefaults] boolForKey:@"DefaultPresetsDrawerShow
                        job->crop[1] = [[chosenPreset objectForKey:@"PictureBottomCrop"]  intValue];
                        job->crop[2] = [[chosenPreset objectForKey:@"PictureLeftCrop"]  intValue];
                        job->crop[3] = [[chosenPreset objectForKey:@"PictureRightCrop"]  intValue];
-                       [self CalculatePictureSizing: sender]; 
+                       [self CalculatePictureSizing: NULL]; 
                }
-               
-               // Deselect the currently selected table //
-               //[tableView deselectRow:[tableView selectedRow]];
+
 }
 }
 
index fb50aa48fcd089301162a7ff95d6a510213c7f3e..28e806f96cf5e99448b3bee34358fcdeac291b43 100644 (file)
@@ -12,6 +12,7 @@
                 ChapterPopUpChanged = id; 
                 CloseAddPresetPanel = id; 
                 CodecsPopUpChanged = id; 
+                CustomSettingUsed = id; 
                 DeletePreset = id; 
                 EnableQueue = id; 
                 EncoderPopUpChanged = id; 
@@ -29,7 +30,6 @@
                 ShowScanPanel = id; 
                 TitlePopUpChanged = id; 
                 VideoMatrixChanged = id; 
-                myAction = id; 
                 tableViewSelected = id; 
             }; 
             CLASS = HBController; 
index f4bcaea335a6b1b7b3d827c2394727d17a55c3f5..079775a97723b9592db6243103630ebef8141637 100644 (file)
@@ -3,11 +3,11 @@
 <plist version="1.0">
 <dict>
        <key>IBDocumentLocation</key>
-       <string>-6 259 630 601 0 0 1440 878 </string>
+       <string>-2 228 630 601 0 0 1440 878 </string>
        <key>IBEditorPositions</key>
        <dict>
                <key>1843</key>
-               <string>610 276 220 592 0 0 1440 878 </string>
+               <string>1970 386 220 592 1440 0 1280 1024 </string>
                <key>29</key>
                <string>102 834 300 44 0 0 1440 878 </string>
        </dict>
@@ -19,8 +19,8 @@
        </array>
        <key>IBOpenObjects</key>
        <array>
-               <integer>1438</integer>
-               <integer>1843</integer>
+               <integer>21</integer>
+               <integer>29</integer>
        </array>
        <key>IBSystem Version</key>
        <string>8P2137</string>
index f5251873d497290f5936d1cc578d52297e2b28dc..0b02921b377e8a047b6de507b06b17ebf7c44268 100644 (file)
Binary files a/macosx/English.lproj/MainMenu.nib/keyedobjects.nib and b/macosx/English.lproj/MainMenu.nib/keyedobjects.nib differ