summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorritsuka <[email protected]>2014-08-24 05:59:00 +0000
committerritsuka <[email protected]>2014-08-24 05:59:00 +0000
commit29a27007840b51bcf789c04fa05c7fcbc40cd665 (patch)
tree116087622f830e563c4455562c3e57a1672e6703
parent3857ffc03e9afa793b2820a0f1d1656d26f45225 (diff)
MacGui: removed a couple of unused preferences keys (CheckForUpdates, DisableDvdAutoDetect, DefAdvancedx264Flags) and the empty TOOLBAR_PICTURE tab. Added a new checkbox to hide the Advanced tab.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6353 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--macosx/English.lproj/Preferences.xib63
-rw-r--r--macosx/HBPreferencesController.h10
-rw-r--r--macosx/HBPreferencesController.m105
3 files changed, 76 insertions, 102 deletions
diff --git a/macosx/English.lproj/Preferences.xib b/macosx/English.lproj/Preferences.xib
index 2e1dfef5e..3122bf98a 100644
--- a/macosx/English.lproj/Preferences.xib
+++ b/macosx/English.lproj/Preferences.xib
@@ -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"/>
@@ -320,21 +319,6 @@
</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"/>
@@ -386,11 +370,11 @@
</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"/>
@@ -399,7 +383,7 @@
</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"/>
@@ -417,7 +401,7 @@
</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"/>
@@ -440,7 +424,7 @@
</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"/>
@@ -482,7 +466,7 @@
</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"/>
@@ -493,7 +477,7 @@
</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"/>
@@ -504,7 +488,7 @@
</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"/>
@@ -515,7 +499,7 @@
</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"/>
@@ -524,7 +508,7 @@
</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"/>
@@ -533,7 +517,7 @@
</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"/>
@@ -542,7 +526,7 @@
</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"/>
@@ -551,7 +535,7 @@
</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"/>
@@ -560,7 +544,7 @@
</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"/>
@@ -569,7 +553,7 @@
</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"/>
@@ -578,7 +562,7 @@
</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"/>
@@ -589,6 +573,17 @@
<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"/>
diff --git a/macosx/HBPreferencesController.h b/macosx/HBPreferencesController.h
index 3db3d528b..6003aa8bd 100644
--- a/macosx/HBPreferencesController.h
+++ b/macosx/HBPreferencesController.h
@@ -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
diff --git a/macosx/HBPreferencesController.m b/macosx/HBPreferencesController.m
index d3d016f58..d1740f9b4 100644
--- a/macosx/HBPreferencesController.m
+++ b/macosx/HBPreferencesController.m
@@ -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"
@@ -23,6 +22,13 @@
*/
@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
@@ -31,10 +37,10 @@
@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
@@ -50,32 +56,28 @@
{
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}"]
+ }];
}
/**
@@ -138,12 +140,6 @@
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
@@ -172,8 +168,7 @@
- (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 */
@@ -196,28 +191,22 @@
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
@@ -289,9 +278,7 @@
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;