From 53d51e1e9ca1e766bcaa92360cc77e48f0b6d46a Mon Sep 17 00:00:00 2001 From: dynaflash Date: Fri, 12 Dec 2008 02:40:21 +0000 Subject: [PATCH] MacGui: Add a preference so we can specify what we do at launch, choices are: - Do Nothing - Open Source - Open Source (Title Specific) - Pref defaults to Open Source git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2020 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- macosx/Controller.mm | 24 ++- macosx/English.lproj/Preferences.xib | 229 ++++++++++++++++++++++++--- macosx/HBPreferencesController.m | 1 + 3 files changed, 228 insertions(+), 26 deletions(-) diff --git a/macosx/Controller.mm b/macosx/Controller.mm index 0a8428221..dc2dacd65 100644 --- a/macosx/Controller.mm +++ b/macosx/Controller.mm @@ -158,10 +158,16 @@ static NSString * ChooseSourceIdentifier = @"Choose Source It } else { + /* We show whichever open source window specified in LaunchSourceBehavior preference key */ + if ([[[NSUserDefaults standardUserDefaults] stringForKey:@"LaunchSourceBehavior"] isEqualToString: @"Open Source"]) + { + [self browseSources:nil]; + } - /* Show Browse Sources Window ASAP */ - [self performSelectorOnMainThread:@selector(browseSources:) - withObject:nil waitUntilDone:NO]; + if ([[[NSUserDefaults standardUserDefaults] stringForKey:@"LaunchSourceBehavior"] isEqualToString: @"Open Source (Title Specific)"]) + { + [self browseSources:(id)fOpenSourceTitleMMenu]; + } } } @@ -170,8 +176,16 @@ static NSString * ChooseSourceIdentifier = @"Choose Source It if (returnCode == NSAlertOtherReturn) { [self clearQueueAllItems]; - [self performSelectorOnMainThread:@selector(browseSources:) - withObject:nil waitUntilDone:NO]; + /* We show whichever open source window specified in LaunchSourceBehavior preference key */ + if ([[[NSUserDefaults standardUserDefaults] stringForKey:@"LaunchSourceBehavior"] isEqualToString: @"Open Source"]) + { + [self browseSources:nil]; + } + + if ([[[NSUserDefaults standardUserDefaults] stringForKey:@"LaunchSourceBehavior"] isEqualToString: @"Open Source (Title Specific)"]) + { + [self browseSources:(id)fOpenSourceTitleMMenu]; + } } else { diff --git a/macosx/English.lproj/Preferences.xib b/macosx/English.lproj/Preferences.xib index d4dadaf65..38ebafbf2 100644 --- a/macosx/English.lproj/Preferences.xib +++ b/macosx/English.lproj/Preferences.xib @@ -8,8 +8,7 @@ 352.00 YES - - + YES @@ -50,19 +49,19 @@ YES - LoggingLevel + LaunchSourceBehavior YES - + 256 YES 256 - {{110, 18}, {364, 18}} + {{110, 29}, {364, 18}} YES @@ -89,7 +88,7 @@ 256 - {{110, 131}, {251, 18}} + {{110, 173}, {251, 18}} YES @@ -110,7 +109,7 @@ 256 - {{110, 38}, {354, 18}} + {{110, 49}, {354, 18}} YES @@ -131,7 +130,7 @@ 256 - {{26, 95}, {80, 17}} + {{26, 106}, {80, 17}} YES @@ -163,7 +162,7 @@ 256 - {{110, 151}, {138, 18}} + {{110, 193}, {138, 18}} YES @@ -184,7 +183,7 @@ 256 - {{110, 70}, {228, 18}} + {{110, 81}, {228, 18}} YES @@ -209,7 +208,7 @@ 256 - {{38, 152}, {68, 17}} + {{38, 194}, {68, 17}} YES @@ -222,10 +221,26 @@ + + + 256 + {{84, 144}, {136, 20}} + + YES + + 67239424 + 71303168 + Source selection: + + + + + + 256 - {{24, 39}, {83, 17}} + {{24, 50}, {83, 17}} YES @@ -241,7 +256,7 @@ 256 - {{109, 89}, {218, 26}} + {{109, 100}, {218, 26}} YES @@ -251,7 +266,7 @@ 109199615 1 - + LucidaGrande 1.300000e+01 16 @@ -352,13 +367,85 @@ 1 + + + 256 + {{222, 140}, {218, 26}} + + YES + + 71433792 + 2048 + + + 109199615 + 1 + + + + + + 400 + 75 + + + Open Source + + 1048576 + 2147483647 + 1 + + + _popUpItemAction: + + + YES + + + OtherViews + + + YES + + + Do Nothing + + 1048576 + 2147483647 + + + _popUpItemAction: + + + + + + Open Source (Title Specific) + + 1048576 + 2147483647 + + + _popUpItemAction: + + + + + 1 + 3 + YES + YES + 1 + + - {492, 189} + {492, 231} + NSView NSControl - + 256 YES @@ -380,7 +467,6 @@ {496, 82} - NSView NSResponder @@ -703,7 +789,7 @@ NSResponder - + 256 YES @@ -970,7 +1056,6 @@ {482, 156} - NSView @@ -1220,6 +1305,22 @@ 373 + + + selectedValue: values.LaunchSourceBehavior + + + + + + selectedValue: values.LaunchSourceBehavior + selectedValue + values.LaunchSourceBehavior + 2 + + + 386 + @@ -1279,6 +1380,8 @@ + + General @@ -1742,6 +1845,64 @@ + + 374 + + + YES + + + + + + 375 + + + YES + + + + + + 376 + + + YES + + + + + + + + 377 + + + + + 378 + + + + + 379 + + + + + 383 + + + YES + + + + + + 384 + + + @@ -1834,6 +1995,19 @@ 370.IBPluginDependency 371.IBPluginDependency 371.ImportedFromIB2 + 374.IBPluginDependency + 374.ImportedFromIB2 + 376.IBEditorWindowLastContentRect + 376.IBPluginDependency + 376.ImportedFromIB2 + 377.IBPluginDependency + 377.ImportedFromIB2 + 378.IBPluginDependency + 378.ImportedFromIB2 + 379.IBPluginDependency + 379.ImportedFromIB2 + 383.IBPluginDependency + 383.ImportedFromIB2 5.IBPluginDependency 5.ImportedFromIB2 5.windowTemplate.hasMaxSize @@ -1849,7 +2023,7 @@ YES com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{220, 300}, {492, 189}} + {{324, 545}, {492, 231}} com.apple.InterfaceBuilder.CocoaPlugin {{0, 636}, {500, 209}} @@ -1935,6 +2109,19 @@ com.apple.InterfaceBuilder.CocoaPlugin + {{535, 648}, {255, 63}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + {3.40282e+38, 3.40282e+38} @@ -1965,7 +2152,7 @@ - 373 + 386 diff --git a/macosx/HBPreferencesController.m b/macosx/HBPreferencesController.m index b51dacf8d..8f6997079 100644 --- a/macosx/HBPreferencesController.m +++ b/macosx/HBPreferencesController.m @@ -43,6 +43,7 @@ [[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary dictionaryWithObjectsAndKeys: @"YES", @"CheckForUpdates", + @"Open Source", @"LaunchSourceBehavior", @"English", @"DefaultLanguage", @"NO", @"DefaultMpegName", @"YES", @"DefaultCrf", -- 2.40.0