MacGui: removed a couple of unused preferences keys (CheckForUpdates, DisableDvdAutoD...
authorritsuka <damiog@gmail.com>
Sun, 24 Aug 2014 05:59:00 +0000 (05:59 +0000)
committerritsuka <damiog@gmail.com>
Sun, 24 Aug 2014 05:59:00 +0000 (05:59 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6353 b64f7644-9d1e-0410-96f1-a4d463321fa5

macosx/English.lproj/Preferences.xib
macosx/HBPreferencesController.h
macosx/HBPreferencesController.m

index 2e1dfef5eed135f562723b4c3f28b97926e06837..3122bf98a22a6a405268efed84789eabe1e37358 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="5056" systemVersion="13F14" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="5056" systemVersion="14A329r" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
     <dependencies>
-        <deployment version="1060" identifier="macosx"/>
+        <deployment version="1060" defaultVersion="1060" identifier="macosx"/>
         <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="5056"/>
     </dependencies>
     <objects>
@@ -11,7 +11,6 @@
                 <outlet property="fAdvancedView" destination="236" id="246"/>
                 <outlet property="fAudioView" destination="235" id="247"/>
                 <outlet property="fGeneralView" destination="233" id="245"/>
-                <outlet property="fPictureView" destination="234" id="248"/>
                 <outlet property="fSendEncodeToAppField" destination="448" id="456"/>
                 <outlet property="formatTokenField" destination="6aa-GX-TuM" id="DyQ-f3-zBJ"/>
                 <outlet property="window" destination="5" id="187"/>
                 </textField>
             </subviews>
         </customView>
-        <customView id="234" userLabel="Picture">
-            <rect key="frame" x="0.0" y="0.0" width="496" height="82"/>
-            <autoresizingMask key="autoresizingMask"/>
-            <subviews>
-                <textField verticalHuggingPriority="750" id="326">
-                    <rect key="frame" x="34" y="42" width="432" height="17"/>
-                    <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
-                    <textFieldCell key="cell" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" title="Nothing here right now, but I am sure we will think of something" id="327">
-                        <font key="font" metaFont="system"/>
-                        <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
-                        <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
-                    </textFieldCell>
-                </textField>
-            </subviews>
-        </customView>
         <customView id="235" userLabel="Audio">
             <rect key="frame" x="0.0" y="0.0" width="500" height="88"/>
             <autoresizingMask key="autoresizingMask"/>
             </subviews>
         </customView>
         <customView id="236" userLabel="Advanced">
-            <rect key="frame" x="0.0" y="0.0" width="500" height="242"/>
+            <rect key="frame" x="0.0" y="0.0" width="500" height="266"/>
             <autoresizingMask key="autoresizingMask"/>
             <subviews>
                 <textField verticalHuggingPriority="750" id="444">
-                    <rect key="frame" x="18" y="20" width="117" height="14"/>
+                    <rect key="frame" x="18" y="44" width="117" height="14"/>
                     <autoresizingMask key="autoresizingMask"/>
                     <textFieldCell key="cell" controlSize="small" sendsActionOnEndEditing="YES" alignment="right" title="Presets:" id="445">
                         <font key="font" metaFont="smallSystem"/>
                     </textFieldCell>
                 </textField>
                 <popUpButton verticalHuggingPriority="750" id="363">
-                    <rect key="frame" x="295" y="49" width="66" height="22"/>
+                    <rect key="frame" x="295" y="73" width="66" height="22"/>
                     <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
                     <popUpButtonCell key="cell" type="push" title="1" bezelStyle="rounded" alignment="left" controlSize="small" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="369" id="364">
                         <behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
                     </connections>
                 </popUpButton>
                 <popUpButton verticalHuggingPriority="750" id="387">
-                    <rect key="frame" x="300" y="201" width="76" height="22"/>
+                    <rect key="frame" x="300" y="225" width="76" height="22"/>
                     <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
                     <popUpButtonCell key="cell" type="push" title="0.25" bezelStyle="rounded" alignment="left" controlSize="small" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="391" id="388">
                         <behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
                     </connections>
                 </popUpButton>
                 <popUpButton verticalHuggingPriority="750" id="352">
-                    <rect key="frame" x="300" y="139" width="73" height="22"/>
+                    <rect key="frame" x="300" y="163" width="73" height="22"/>
                     <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
                     <popUpButtonCell key="cell" type="push" bezelStyle="rounded" alignment="left" controlSize="small" lineBreakMode="truncatingTail" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" id="353">
                         <behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
                     </connections>
                 </popUpButton>
                 <button id="401">
-                    <rect key="frame" x="138" y="18" width="339" height="18"/>
+                    <rect key="frame" x="138" y="42" width="339" height="18"/>
                     <autoresizingMask key="autoresizingMask"/>
                     <buttonCell key="cell" type="check" title="Alert when updating built-in presets" bezelStyle="regularSquare" imagePosition="left" alignment="left" controlSize="small" inset="2" id="402">
                         <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
                     </connections>
                 </button>
                 <button id="398">
-                    <rect key="frame" x="138" y="107" width="339" height="18"/>
+                    <rect key="frame" x="138" y="131" width="339" height="18"/>
                     <autoresizingMask key="autoresizingMask"/>
                     <buttonCell key="cell" type="check" title="Use libdvdnav (instead of libdvdread)" bezelStyle="regularSquare" imagePosition="left" alignment="left" controlSize="small" inset="2" id="399">
                         <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
                     </connections>
                 </button>
                 <button id="347">
-                    <rect key="frame" x="138" y="73" width="340" height="18"/>
+                    <rect key="frame" x="138" y="97" width="340" height="18"/>
                     <autoresizingMask key="autoresizingMask"/>
                     <buttonCell key="cell" type="check" title="Put individual encode logs in same location as movie" bezelStyle="regularSquare" imagePosition="left" alignment="left" controlSize="small" inset="2" id="348">
                         <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
                     </connections>
                 </button>
                 <textField verticalHuggingPriority="750" id="442">
-                    <rect key="frame" x="18" y="109" width="117" height="14"/>
+                    <rect key="frame" x="18" y="133" width="117" height="14"/>
                     <autoresizingMask key="autoresizingMask"/>
                     <textFieldCell key="cell" controlSize="small" sendsActionOnEndEditing="YES" alignment="right" title="DVD-Video:" id="443">
                         <font key="font" metaFont="smallSystem"/>
                     </textFieldCell>
                 </textField>
                 <textField verticalHuggingPriority="750" id="350">
-                    <rect key="frame" x="17" y="75" width="118" height="14"/>
+                    <rect key="frame" x="17" y="99" width="118" height="14"/>
                     <autoresizingMask key="autoresizingMask"/>
                     <textFieldCell key="cell" controlSize="small" sendsActionOnEndEditing="YES" alignment="right" title="Log:" id="351">
                         <font key="font" metaFont="smallSystem"/>
                     </textFieldCell>
                 </textField>
                 <textField verticalHuggingPriority="750" id="371">
-                    <rect key="frame" x="112" y="54" width="180" height="14"/>
+                    <rect key="frame" x="112" y="78" width="180" height="14"/>
                     <autoresizingMask key="autoresizingMask"/>
                     <textFieldCell key="cell" controlSize="small" sendsActionOnEndEditing="YES" alignment="right" title="Activity Log Verbosity Level:" id="372">
                         <font key="font" metaFont="smallSystem"/>
                     </textFieldCell>
                 </textField>
                 <textField verticalHuggingPriority="750" id="359">
-                    <rect key="frame" x="18" y="144" width="279" height="14"/>
+                    <rect key="frame" x="18" y="168" width="279" height="14"/>
                     <autoresizingMask key="autoresizingMask"/>
                     <textFieldCell key="cell" controlSize="small" sendsActionOnEndEditing="YES" alignment="right" title="Number of picture previews to scan:" id="360">
                         <font key="font" metaFont="smallSystem"/>
                     </textFieldCell>
                 </textField>
                 <textField verticalHuggingPriority="750" id="463">
-                    <rect key="frame" x="18" y="174" width="279" height="14"/>
+                    <rect key="frame" x="18" y="198" width="279" height="14"/>
                     <autoresizingMask key="autoresizingMask"/>
                     <textFieldCell key="cell" controlSize="small" sendsActionOnEndEditing="YES" alignment="right" title="Minimum length of title to scan:" id="464">
                         <font key="font" metaFont="smallSystem"/>
                     </textFieldCell>
                 </textField>
                 <textField verticalHuggingPriority="750" id="UXr-op-aKN">
-                    <rect key="frame" x="356" y="173" width="121" height="14"/>
+                    <rect key="frame" x="356" y="197" width="121" height="14"/>
                     <autoresizingMask key="autoresizingMask"/>
                     <textFieldCell key="cell" controlSize="small" sendsActionOnEndEditing="YES" alignment="left" title="seconds" id="klQ-DW-Kc6">
                         <font key="font" metaFont="smallSystem"/>
                     </textFieldCell>
                 </textField>
                 <textField verticalHuggingPriority="750" id="395">
-                    <rect key="frame" x="18" y="206" width="279" height="14"/>
+                    <rect key="frame" x="18" y="230" width="279" height="14"/>
                     <autoresizingMask key="autoresizingMask"/>
                     <textFieldCell key="cell" controlSize="small" sendsActionOnEndEditing="YES" alignment="right" title="x264 Constant Quality fractional granularity:" id="396">
                         <font key="font" metaFont="smallSystem"/>
                     </textFieldCell>
                 </textField>
                 <textField verticalHuggingPriority="750" id="480">
-                    <rect key="frame" x="303" y="171" width="48" height="19"/>
+                    <rect key="frame" x="303" y="195" width="48" height="19"/>
                     <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
                     <textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="481">
                         <font key="font" metaFont="smallSystem"/>
                         <binding destination="61" name="value" keyPath="values.MinTitleScanSeconds" id="483"/>
                     </connections>
                 </textField>
+                <button appearanceType="aqua" id="ybi-46-yhY">
+                    <rect key="frame" x="137" y="17" width="223" height="20"/>
+                    <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+                    <buttonCell key="cell" type="check" title="Show Advanced Encoder Options Tab" bezelStyle="regularSquare" imagePosition="left" controlSize="small" state="on" inset="2" id="Du1-9x-nHn">
+                        <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
+                        <font key="font" metaFont="smallSystem"/>
+                    </buttonCell>
+                    <connections>
+                        <binding destination="61" name="value" keyPath="values.HBShowAdvancedTab" id="PgA-TV-kBr"/>
+                    </connections>
+                </button>
             </subviews>
         </customView>
         <customObject id="410" userLabel="Updater" customClass="SUUpdater"/>
index 3db3d528b0432e10e7c13a10089ad2ba3f1b0576..6003aa8bd03316cde0cd15833d4bcd4cbab990cf 100644 (file)
@@ -6,15 +6,7 @@
 #import <Cocoa/Cocoa.h>
 
 @interface HBPreferencesController : NSWindowController <NSToolbarDelegate>
-{
-    IBOutlet NSView         * fGeneralView, * fPictureView, * fAudioView, * fAdvancedView;
-    IBOutlet NSTextField    * fSendEncodeToAppField;
-}
 
 + (void)registerUserDefaults;
-- (id)init;
-/* Manage the send encode to xxx.app windows and field */
-- (IBAction) browseSendToApp: (id) sender;
-- (void) browseSendToAppDone: (NSOpenPanel *) sheet
-                  returnCode: (int) returnCode contextInfo: (void *) contextInfo;
+
 @end
index d3d016f5856f41ab97791e44173010e5a98c98a1..d1740f9b46c84e4fe635515836b7a8def8ce97b6 100644 (file)
@@ -7,7 +7,6 @@
 #import "HBLanguagesSelection.h"
 
 #define TOOLBAR_GENERAL     @"TOOLBAR_GENERAL"
-#define TOOLBAR_PICTURE     @"TOOLBAR_PICTURE"
 #define TOOLBAR_AUDIO       @"TOOLBAR_AUDIO"
 #define TOOLBAR_ADVANCED    @"TOOLBAR_ADVANCED"
 
  */
 
 @interface HBPreferencesController () <NSTokenFieldDelegate>
+{
+    IBOutlet NSView         * fGeneralView, * fAudioView, * fAdvancedView;
+    IBOutlet NSTextField    * fSendEncodeToAppField;
+}
+
+/* Manage the send encode to xxx.app windows and field */
+- (IBAction) browseSendToApp: (id) sender;
 
 - (void) setPrefView: (id) sender;
 - (NSToolbarItem *)toolbarItemWithIdentifier: (NSString *)identifier
 
 @property (assign) IBOutlet NSTokenField *formatTokenField;
 @property (assign) IBOutlet NSTokenField *builtInTokenField;
-@property (readonly, nonatomic) NSArray *buildInFormatTokens;
-@property (retain, nonatomic) NSArray *matches;
+@property (nonatomic, readonly) NSArray *buildInFormatTokens;
+@property (nonatomic, retain) NSArray *matches;
 
-@property (retain, nonatomic) HBLanguagesSelection *languages;
+@property (nonatomic, retain) HBLanguagesSelection *languages;
 
 @end
 
 {
     NSString *desktopDirectory =  [@"~/Desktop" stringByExpandingTildeInPath];
 
-    [[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary dictionaryWithObjectsAndKeys:
-        @"YES",             @"CheckForUpdates",
-        @"Open Source",     @"LaunchSourceBehavior",
-        @"English",         @"DefaultLanguage",
-        @"Auto",            @"DefaultMpegExtension",
-        @"YES",             @"UseDvdNav",
-        @"",                @"DefAdvancedx264Flags",
-        @"YES",             @"DefaultPresetsDrawerShow",
-        desktopDirectory,   @"LastDestinationDirectory",
-        desktopDirectory,   @"LastSourceDirectory",
-        @"NO",              @"DefaultAutoNaming",
-        @"NO",              @"DisableDvdAutoDetect",
-        @"Alert Window",    @"AlertWhenDone",
-        @"YES",             @"AlertWhenDoneSound",
-        @"1",               @"LoggingLevel",
-        @"NO",              @"EncodeLogLocation",
-        @"10",              @"MinTitleScanSeconds",
-        @"10",              @"PreviewsNumber",
-        @"",                @"Drawer Size",
-        @"0.25",            @"x264CqSliderFractional",
-        @"YES",             @"AlertBuiltInPresetUpdate",
-        @"MetaX",           @"SendCompletedEncodeToApp",
-        @"NO",              @"ShowAdvancedOptsForAutoPassthru",
-
-        @[@"{Source}", @" ", @"{Title}"],       @"HBAutoNamingFormat",
-        nil]];
+    [[NSUserDefaults standardUserDefaults] registerDefaults:@{
+        @"LaunchSourceBehavior":            @"Open Source",
+        @"DefaultLanguage":                 @"English",
+        @"DefaultMpegExtension":            @"Auto",
+        @"UseDvdNav":                       @"YES",
+        @"DefaultPresetsDrawerShow":        @YES,
+        @"LastDestinationDirectory":        desktopDirectory,
+        @"LastSourceDirectory":             desktopDirectory,
+        @"DefaultAutoNaming":               @NO,
+        @"AlertWhenDone":                   @"Alert Window",
+        @"AlertWhenDoneSound":              @"YES",
+        @"LoggingLevel":                    @"1",
+        @"EncodeLogLocation":               @"NO",
+        @"MinTitleScanSeconds":             @"10",
+        @"PreviewsNumber":                  @"10",
+        @"Drawer Size":                     @"",
+        @"x264CqSliderFractional":          @"0.25",
+        @"AlertBuiltInPresetUpdate":        @"YES",
+        @"SendCompletedEncodeToApp":        @"MetaX",
+        @"HBShowAdvancedTab":               @NO,
+        @"HBAutoNamingFormat":              @[@"{Source}", @" ", @"{Title}"]
+        }];
 }
 
 /**
                                          label:NSLocalizedString(@"General", @"Preferences General Toolbar Item")
                                          image:[NSImage imageNamed:@"settings"]];
     }
-    else if ( [ident isEqualToString:TOOLBAR_PICTURE] )
-    {
-        return [self toolbarItemWithIdentifier:ident
-                                         label:NSLocalizedString(@"Picture", @"Preferences Picture Toolbar Item")
-                                         image:[NSImage imageNamed:@"picturesettings"]];
-    }
     else if ( [ident isEqualToString:TOOLBAR_AUDIO] )
     {
         return [self toolbarItemWithIdentifier:ident
 
 - (NSArray *) toolbarAllowedItemIdentifiers: (NSToolbar *) toolbar
 {
-    return [NSArray arrayWithObjects: TOOLBAR_GENERAL, /*TOOLBAR_PICTURE, */
-                                        TOOLBAR_AUDIO, TOOLBAR_ADVANCED, nil];
+    return @[TOOLBAR_GENERAL, TOOLBAR_AUDIO, TOOLBAR_ADVANCED];
 }
 
 /* Manage the send encode to xxx.app windows and field */
                sendToAppDirectory = @"/Applications";
        }
     [panel setDirectoryURL:[NSURL fileURLWithPath:sendToAppDirectory]];
+
     [panel beginSheetModalForWindow:[self window] completionHandler:^(NSInteger result) {
-        [self browseSendToAppDone:panel returnCode:(int)result contextInfo:sender];
+        if (result == NSOKButton)
+        {
+            NSURL *sendToAppURL = [panel URL];
+            NSURL *sendToAppDirectory = [sendToAppURL URLByDeletingLastPathComponent];
+            [[NSUserDefaults standardUserDefaults] setObject:[sendToAppDirectory path] forKey:@"LastSendToAppDirectory"];
+
+            NSString *sendToAppName = [[sendToAppURL lastPathComponent] stringByDeletingPathExtension];
+            /* we set the name of the app to send to in the display field */
+            [fSendEncodeToAppField setStringValue:sendToAppName];
+            [[NSUserDefaults standardUserDefaults] setObject:[fSendEncodeToAppField stringValue] forKey:@"SendCompletedEncodeToApp"];
+        }
     }];
 }
 
-- (void) browseSendToAppDone: (NSOpenPanel *) sheet
-                  returnCode: (int) returnCode contextInfo: (void *) contextInfo
-{
-    if( returnCode == NSOKButton )
-    {
-        NSURL *sendToAppURL = [[sheet URLs] objectAtIndex: 0];
-        NSURL *sendToAppDirectory = [sendToAppURL URLByDeletingLastPathComponent];
-        [[NSUserDefaults standardUserDefaults] setObject:[sendToAppDirectory path] forKey:@"LastSendToAppDirectory"];
-        [sheet orderOut: self];
-        NSString *sendToAppName;
-        sendToAppName = [[sendToAppURL lastPathComponent] stringByDeletingPathExtension];
-        /* we set the name of the app to send to in the display field */
-        [fSendEncodeToAppField setStringValue:sendToAppName];
-        [[NSUserDefaults standardUserDefaults] setObject:[fSendEncodeToAppField stringValue] forKey:@"SendCompletedEncodeToApp"];
-    }
-}
-
 #pragma mark - Format Token Field Delegate
 
 - (NSString *)tokenField:(NSTokenField *)tokenField displayStringForRepresentedObject:(id)representedObject
     if( sender )
     {
         NSString * identifier = [sender itemIdentifier];
-        if( [identifier isEqualToString: TOOLBAR_PICTURE] )
-            view = fPictureView;
-        else if( [identifier isEqualToString: TOOLBAR_AUDIO] )
+        if( [identifier isEqualToString: TOOLBAR_AUDIO] )
             view = fAudioView;
         else if( [identifier isEqualToString: TOOLBAR_ADVANCED] )
             view = fAdvancedView;