From d3bd3c8f6214dc290a00c05575aa2ab02cde2e20 Mon Sep 17 00:00:00 2001 From: dynaflash Date: Wed, 19 Jan 2011 22:35:46 +0000 Subject: [PATCH] MacGui: In Preferences, Instead of the old "Use iTunes / iPod friendly file extension for mp4" checkbox we allow three choices: - Auto (Default): will use .mp4 unless any of the conditions are met for Apple devices to use .m4v such as AC3 audio or chapters, etc. - .m4v: will set the extension to .m4v regardless of settings. - .mp4: will set the extension to .mp4 regardless of settings. Basically anything other than Auto forces either the .m4v or .mp4 file extension. Again "Auto" is default. Note: This deprecates the old preferences plist key "DefaultMpegName" which was just a bool and adds "DefaultMpegExtension" which is a string. As a result users that had the old "Use iPod/iTunes friendly (.m4v) file extension for MP4" checkbox checked will need to select ".m4v" in the new preferences dialogue. git-svn-id: svn://localhost/HandBrake/trunk@3758 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- macosx/Controller.m | 25 +- macosx/English.lproj/Preferences.xib | 503 +++++++++++------------------------ macosx/HBPreferencesController.m | 2 +- 3 files changed, 158 insertions(+), 372 deletions(-) diff --git a/macosx/Controller.m b/macosx/Controller.m index aa0299b6..a744ad21 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -4484,15 +4484,7 @@ bool one_burned = FALSE; switch( format ) { case 0: - /*Get Default MP4 File Extension*/ - if ([[NSUserDefaults standardUserDefaults] boolForKey:@"DefaultMpegName"] > 0) - { - ext = "m4v"; - } - else - { - ext = "mp4"; - } + [self autoSetM4vExtension: nil]; /* Add additional video encoders here */ menuItem = [[fVidEncoderPopUp menu] addItemWithTitle:@"H.264 (x264)" action: NULL keyEquivalent: @""]; [menuItem setTag: HB_VCODEC_X264]; @@ -4570,22 +4562,23 @@ bool one_burned = FALSE; { if ( [fDstFormatPopUp indexOfSelectedItem] ) return; - + NSString * extension = @"mp4"; - + BOOL anyCodecAC3 = [fAudioDelegate anyCodecMatches: HB_ACODEC_AC3] || [fAudioDelegate anyCodecMatches: HB_ACODEC_AC3_PASS]; - if (YES == anyCodecAC3 || - [fCreateChapterMarkers state] == NSOnState || - [[NSUserDefaults standardUserDefaults] boolForKey:@"DefaultMpegName"] > 0 ) + + if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"DefaultMpegExtension"] isEqualToString: @".m4v"] || + ((YES == anyCodecAC3 || [fCreateChapterMarkers state] == NSOnState) && + [[[NSUserDefaults standardUserDefaults] objectForKey:@"DefaultMpegExtension"] isEqualToString: @"Auto"] )) { extension = @"m4v"; } - + if( [extension isEqualTo: [[fDstFile2Field stringValue] pathExtension]] ) return; else [fDstFile2Field setStringValue: [NSString stringWithFormat:@"%@.%@", - [[fDstFile2Field stringValue] stringByDeletingPathExtension], extension]]; + [[fDstFile2Field stringValue] stringByDeletingPathExtension], extension]]; } /* Method to determine if we should change the UI diff --git a/macosx/English.lproj/Preferences.xib b/macosx/English.lproj/Preferences.xib index 2f877b55..40652162 100644 --- a/macosx/English.lproj/Preferences.xib +++ b/macosx/English.lproj/Preferences.xib @@ -2,17 +2,17 @@ 1050 - 10F569 - 788 - 1038.29 - 461.00 + 10J567 + 732 + 1038.35 + 462.00 com.apple.InterfaceBuilder.CocoaPlugin - 788 + 732 YES - + YES @@ -62,7 +62,7 @@ YES - MinTitleScanSeconds + DefaultMpegExtension YES @@ -76,7 +76,6 @@ 256 {{123, 90}, {313, 18}} - YES -2080244224 @@ -108,13 +107,12 @@ 268 {{345, 71}, {96, 16}} - YES 67239424 134479872 Browse ... - + LucidaGrande 9 3614 @@ -133,7 +131,6 @@ 268 {{209, 73}, {125, 14}} - YES 68288064 @@ -161,34 +158,11 @@ - - - 256 - {{125, 18}, {311, 18}} - - - YES - - 67239424 - 131072 - Use iPod/iTunes friendly (.m4v) file extension for MP4 - - - 1211912703 - 2 - - - - 200 - 25 - - 256 {{123, 220}, {133, 18}} - YES 67239424 @@ -210,7 +184,6 @@ 256 {{125, 38}, {303, 18}} - YES 67239424 @@ -232,7 +205,6 @@ 256 {{52, 117}, {69, 14}} - YES 67239424 @@ -249,7 +221,6 @@ 256 {{123, 175}, {194, 18}} - YES 67239424 @@ -271,7 +242,6 @@ 256 {{123, 71}, {86, 18}} - YES 67239424 @@ -294,7 +264,6 @@ 256 {{62, 222}, {59, 14}} - YES 67239424 @@ -306,12 +275,27 @@ + + + 256 + {{125, 20}, {134, 14}} + + YES + + 67239424 + 71434240 + Default MP4 Extension: + + + + + + 256 {{141, 199}, {95, 14}} - YES 67239424 @@ -328,7 +312,6 @@ 256 {{52, 40}, {71, 14}} - YES 67239424 @@ -343,20 +326,19 @@ 256 - {{123, 110}, {189, 22}} + {{263, 19}, {66, 15}} - YES 71433792 - 133120 - + 264192 + 109199615 1 - + LucidaGrande - 11 + 9 16 @@ -365,18 +347,18 @@ 400 75 - + - Alert Window + Auto 1048576 2147483647 1 - + NSImage NSMenuCheckmark - + NSImage NSMenuMixedState @@ -390,65 +372,31 @@ YES - - - Do Nothing - - 1048576 - 2147483647 - - - _popUpItemAction: - - - - + + - Growl Notification + .m4v 1048576 2147483647 - - + + _popUpItemAction: - + - Alert Window And Growl + .mp4 1048576 2147483647 - - - _popUpItemAction: - - - - - Put Computer To Sleep - - 1048576 - 2147483647 - - - _popUpItemAction: - - - - - Shut Down Computer - - 1048576 - 2147483647 - - + + _popUpItemAction: - 1 3 YES YES @@ -460,7 +408,6 @@ 256 {{141, 148}, {102, 22}} - YES 71433792 @@ -469,7 +416,11 @@ 109199615 1 - + + LucidaGrande + 11 + 16 + @@ -483,8 +434,8 @@ 1048576 2147483647 1 - - + + _popUpItemAction: 604800 @@ -502,8 +453,8 @@ 1048576 2147483647 - - + + _popUpItemAction: 86400 @@ -515,8 +466,8 @@ 1048576 2147483647 - - + + _popUpItemAction: 2629800 @@ -535,7 +486,6 @@ 256 {{238, 194}, {205, 22}} - YES 71433792 @@ -558,8 +508,8 @@ 1048576 2147483647 1 - - + + _popUpItemAction: @@ -576,8 +526,8 @@ 1048576 2147483647 - - + + _popUpItemAction: @@ -588,8 +538,8 @@ 1048576 2147483647 - - + + _popUpItemAction: @@ -605,12 +555,11 @@ {460, 256} - NSView NSControl - + 256 YES @@ -619,7 +568,6 @@ 268 {{34, 42}, {432, 17}} - YES 67239488 @@ -637,13 +585,11 @@ {496, 82} - - NSView NSResponder - + 256 YES @@ -652,7 +598,6 @@ 256 {{30, 56}, {96, 14}} - YES 67239424 @@ -669,7 +614,6 @@ 256 {{95, 22}, {31, 14}} - YES 67239424 @@ -686,7 +630,6 @@ 256 {{131, 50}, {247, 22}} - YES 343014976 @@ -957,7 +900,6 @@ -2147483392 {{18, -4}, {472, 18}} - YES 604110336 @@ -979,7 +921,6 @@ 268 {{128, 20}, {333, 18}} - YES -2080244224 @@ -999,15 +940,13 @@ {492, 91} - - NSView NSResponder - + 256 YES @@ -1216,8 +1155,8 @@ 1048576 2147483647 1 - - + + _popUpItemAction: @@ -1233,8 +1172,8 @@ 1048576 2147483647 - - + + _popUpItemAction: @@ -1244,8 +1183,8 @@ 1048576 2147483647 - - + + _popUpItemAction: @@ -1254,8 +1193,8 @@ 25 2147483647 - - + + _popUpItemAction: @@ -1264,8 +1203,8 @@ 30 2147483647 - - + + _popUpItemAction: @@ -1300,8 +1239,8 @@ 2147483647 1 - - + + _popUpItemAction: @@ -1316,8 +1255,8 @@ 1048576 2147483647 - - + + _popUpItemAction: @@ -1327,8 +1266,8 @@ 1048576 2147483647 - - + + _popUpItemAction: @@ -1338,8 +1277,8 @@ 0.20 2147483647 - - + + _popUpItemAction: @@ -1376,8 +1315,8 @@ 1048576 2147483647 1 - - + + _popUpItemAction: @@ -1392,8 +1331,8 @@ 1048576 2147483647 - - + + _popUpItemAction: @@ -1404,8 +1343,8 @@ 1048576 2147483647 - - + + _popUpItemAction: @@ -1436,7 +1375,6 @@ {495, 241} - NSView @@ -1531,22 +1469,6 @@ - value: values.DefaultMpegName - - - - - - value: values.DefaultMpegName - value - values.DefaultMpegName - 2 - - - 264 - - - value: values.sendToMetaX @@ -1595,22 +1517,6 @@ - selectedValue: values.AlertWhenDone - - - - - - selectedValue: values.AlertWhenDone - selectedValue - values.AlertWhenDone - 2 - - - 298 - - - value: values.EncodeLogLocation @@ -1865,6 +1771,22 @@ 483 + + + selectedValue: values.DefaultMpegExtension + + + + + + selectedValue: values.DefaultMpegExtension + selectedValue + values.DefaultMpegExtension + 2 + + + 490 + @@ -1919,7 +1841,6 @@ - @@ -1927,21 +1848,13 @@ - + + General - 237 - - - YES - - - - - 238 @@ -2088,11 +2001,6 @@ Advanced - 300 - - - - 301 @@ -2156,46 +2064,18 @@ YES - - - - - + + - 296 - - - - - 295 - - - - - 294 - - - - - 293 - - - - 292 - 291 - - - - -3 @@ -2697,6 +2577,30 @@ + + 484 + + + + + 485 + + + + + 486 + + + YES + + + + + + 487 + + + @@ -2720,8 +2624,6 @@ 236.IBPluginDependency 236.ImportedFromIB2 236.editorWindowContentRectSynchronizationRect - 237.IBPluginDependency - 237.ImportedFromIB2 238.IBPluginDependency 238.ImportedFromIB2 239.IBPluginDependency @@ -2747,19 +2649,8 @@ 290.IBEditorWindowLastContentRect 290.IBPluginDependency 290.ImportedFromIB2 - 291.IBPluginDependency - 291.ImportedFromIB2 292.IBPluginDependency 292.ImportedFromIB2 - 293.IBPluginDependency - 293.ImportedFromIB2 - 294.IBPluginDependency - 294.ImportedFromIB2 - 295.IBPluginDependency - 295.ImportedFromIB2 - 296.IBPluginDependency - 296.ImportedFromIB2 - 300.IBPluginDependency 301.IBPluginDependency 302.IBPluginDependency 304.IBPluginDependency @@ -2868,6 +2759,13 @@ 464.IBPluginDependency 480.IBPluginDependency 481.IBPluginDependency + 484.IBPluginDependency + 484.ImportedFromIB2 + 485.IBPluginDependency + 485.ImportedFromIB2 + 486.IBPluginDependency + 486.ImportedFromIB2 + 487.IBPluginDependency 5.IBEditorWindowLastContentRect 5.IBPluginDependency 5.IBWindowTemplateEditedContentRect @@ -2884,7 +2782,7 @@ YES com.apple.InterfaceBuilder.CocoaPlugin - {{275, 562}, {460, 256}} + {{96, 562}, {460, 256}} com.apple.InterfaceBuilder.CocoaPlugin @@ -2896,7 +2794,7 @@ {{73, 765}, {492, 91}} com.apple.InterfaceBuilder.CocoaPlugin - {{229, 565}, {495, 241}} + {{134, 507}, {495, 241}} com.apple.InterfaceBuilder.CocoaPlugin {{0, 650}, {500, 184}} @@ -2922,25 +2820,12 @@ com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - {{314, 193}, {234, 123}} + {{348, 548}, {79, 48}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3048,6 +2933,13 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin {{69, 656}, {500, 200}} com.apple.InterfaceBuilder.CocoaPlugin {{69, 656}, {500, 200}} @@ -3078,7 +2970,7 @@ - 483 + 490 @@ -3090,13 +2982,6 @@ browseSendToApp: id - - browseSendToApp: - - browseSendToApp: - id - - YES @@ -3116,40 +3001,6 @@ NSTextField - - YES - - YES - fAdvancedView - fAudioView - fGeneralView - fPictureView - fSendEncodeToAppField - - - YES - - fAdvancedView - NSView - - - fAudioView - NSView - - - fGeneralView - NSView - - - fPictureView - NSView - - - fSendEncodeToAppField - NSTextField - - - IBProjectSource HBPreferencesController.h @@ -3162,13 +3013,6 @@ runModal: id - - runModal: - - runModal: - id - - IBUserSource @@ -3198,24 +3042,10 @@ checkForUpdates: id - - checkForUpdates: - - checkForUpdates: - id - - delegate id - - delegate - - delegate - id - - @@ -3852,13 +3682,6 @@ showWindow: id - - showWindow: - - showWindow: - id - - IBFrameworkSource AppKit.framework/Headers/NSWindowController.h @@ -3871,30 +3694,15 @@ checkForUpdates: id - - checkForUpdates: - - checkForUpdates: - id - - delegate id - - delegate - - delegate - id - - 0 - IBCocoaFramework com.apple.InterfaceBuilder.CocoaPlugin.macosx @@ -3906,20 +3714,5 @@ YES ../HandBrake.xcodeproj 3 - - YES - - YES - NSMenuCheckmark - NSMenuMixedState - NSSwitch - - - YES - {9, 8} - {7, 2} - {15, 15} - - diff --git a/macosx/HBPreferencesController.m b/macosx/HBPreferencesController.m index f8291838..e8be9227 100644 --- a/macosx/HBPreferencesController.m +++ b/macosx/HBPreferencesController.m @@ -46,7 +46,7 @@ @"Open Source", @"LaunchSourceBehavior", @"English", @"DefaultLanguage", @"YES", @"UseCoreAudio", - @"YES", @"DefaultMpegName", + @"Auto", @"DefaultMpegExtension", @"YES", @"UseDvdNav", @"", @"DefAdvancedx264Flags", @"YES", @"DefaultPresetsDrawerShow", -- 2.11.0