diff options
author | prigaux <[email protected]> | 2007-02-11 20:00:15 +0000 |
---|---|---|
committer | prigaux <[email protected]> | 2007-02-11 20:00:15 +0000 |
commit | a74fd5a1ec37e53fe7008f022639af6ede0e82c9 (patch) | |
tree | 0a6a32640a840b72653149aa11efa264674df976 /macosx/PrefsController.m | |
parent | f45dfeb2afb1b0bf46054959e8ea9494f3b7d14f (diff) |
Merge the 0.8.0_mpeg4ip branch into the trunk
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@285 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx/PrefsController.m')
-rw-r--r-- | macosx/PrefsController.m | 113 |
1 files changed, 108 insertions, 5 deletions
diff --git a/macosx/PrefsController.m b/macosx/PrefsController.m index a4622ae51..6f98400e5 100644 --- a/macosx/PrefsController.m +++ b/macosx/PrefsController.m @@ -8,17 +8,32 @@ NSDictionary * appDefaults; /* Unless the user specified otherwise, default is to check - for update */ + for update fDefPicSizeAutoSetipod*/ defaults = [NSUserDefaults standardUserDefaults]; appDefaults = [NSDictionary dictionaryWithObject:@"YES" forKey:@"CheckForUpdates"]; appDefaults = [NSDictionary dictionaryWithObject:@"English" forKey:@"DefaultLanguage"]; + appDefaults = [NSDictionary dictionaryWithObject:@"NO" + forKey:@"DefaultMpegName"]; + appDefaults = [NSDictionary dictionaryWithObject:@"NO" + forKey:@"DefaultCrf"]; + appDefaults = [NSDictionary dictionaryWithObject:@"NO" + forKey:@"DefaultDeinterlaceOn"]; + appDefaults = [NSDictionary dictionaryWithObject:@"YES" + forKey:@"DefaultPicSizeAutoiPod"]; + appDefaults = [NSDictionary dictionaryWithObject:@"NO" + forKey:@"PixelRatio"]; + + [defaults registerDefaults: appDefaults]; - /* Check or uncheck according to the preferences */ + /* fUpdateCheck Check or uncheck according to the preferences */ [fUpdateCheck setState: [defaults boolForKey:@"CheckForUpdates"] ? NSOnState : NSOffState]; + + + // Fill the languages combobox [fdefaultlanguage removeAllItems]; [fdefaultlanguage addItemWithObjectValue: @"Afar"]; @@ -185,10 +200,37 @@ [fdefaultlanguage addItemWithObjectValue: @"Yoruba"]; [fdefaultlanguage addItemWithObjectValue: @"Zhuang"]; [fdefaultlanguage addItemWithObjectValue: @"Zulu"]; + [fdefaultlanguage setStringValue:@"English"]; + + /* If a Default Language is selected then write it otherwise let English as default */ - [fdefaultlanguage setStringValue:[defaults stringForKey:@"DefaultLanguage"]]; - [fdefaultlanguage selectItemWithObjectValue:[defaults stringForKey:@"DefaultLanguage"]]; + if ([defaults stringForKey:@"DefaultLanguage"]!=NULL) + { + [fdefaultlanguage setStringValue:[defaults stringForKey:@"DefaultLanguage"]]; + } + [fdefaultlanguage selectItemWithObjectValue:[defaults stringForKey:@"DefaultLanguage"]]; + + + + + /* fFileExtItunes Check or uncheck according to the preferences */ + [fFileExtItunes setState: [defaults boolForKey:@"DefaultMpegName"] ? + NSOnState : NSOffState]; + + /* fDefCrf Check or uncheck according to the preferences*/ + [fDefCrf setState: [defaults boolForKey:@"DefaultCrf"] ? + NSOnState : NSOffState]; + + /* fDefDeinterlace Check or uncheck according to the preferences*/ + [fDefDeinterlace setState: [defaults boolForKey:@"DefaultDeinterlaceOn"] ? + NSOnState : NSOffState]; +/* fDefPicSizeAutoSetipod Check or uncheck according to the preferences*/ + [fDefPicSizeAutoSetipod setState: [defaults boolForKey:@"DefaultPicSizeAutoiPod"] ? + NSOnState : NSOffState]; + /* fDefPixelRatio */ + [fDefPixelRatio setState: [defaults boolForKey:@"PixelRatio"] ? + NSOnState : NSOffState]; } @@ -207,7 +249,8 @@ { NSUserDefaults * defaults = [NSUserDefaults standardUserDefaults]; - if( [fUpdateCheck state] == NSOnState ) + /* Check Update CheckForUpdates Set */ + if( [fUpdateCheck state] == NSOnState ) { [defaults setObject:@"YES" forKey:@"CheckForUpdates"]; } @@ -216,8 +259,68 @@ [defaults setObject:@"NO" forKey:@"CheckForUpdates"]; } + /* Preferred Language Combobox Set */ + [defaults setObject:[fdefaultlanguage objectValueOfSelectedItem] forKey:@"DefaultLanguage"]; + + /* File Extension Itunes Set */ + + if( [fFileExtItunes state] == NSOnState ) + { + [defaults setObject:@"YES" forKey:@"DefaultMpegName"]; + } + else + { + [defaults setObject:@"NO" forKey:@"DefaultMpegName"]; + } + + /* Use CRF for constant mode */ + + if( [fDefCrf state] == NSOnState ) + { + [defaults setObject:@"YES" forKey:@"DefaultCrf"]; + } + else + { + [defaults setObject:@"NO" forKey:@"DefaultCrf"]; + } + + /* Use Deinterlace on as a default*/ + + if( [fDefDeinterlace state] == NSOnState ) + { + [defaults setObject:@"YES" forKey:@"DefaultDeinterlaceOn"]; + } + else + { + [defaults setObject:@"NO" forKey:@"DefaultDeinterlaceOn"]; + } + + /* Use Picture size set to 640 upon x264 (iPod) Selection as a default*/ + + if( [fDefPicSizeAutoSetipod state] == NSOnState ) + { + [defaults setObject:@"YES" forKey:@"DefaultPicSizeAutoiPod"]; + } + else + { + [defaults setObject:@"NO" forKey:@"DefaultPicSizeAutoiPod"]; + } + + /* Use Pixel Ratio*/ + + if( [fDefPixelRatio state] == NSOnState ) + { + [defaults setObject:@"YES" forKey:@"PixelRatio"]; + } + else + { + [defaults setObject:@"NO" forKey:@"PixelRatio"]; + } + + + } @end |