5 // Created by Jeff Mesnil on 19/10/08.
6 // Copyright 2008 Jeff Mesnil (http://jmesnil.net/). All rights reserved.
9 #import "PBGitDefaults.h"
11 #define kDefaultVerticalLineLength 50
12 #define kCommitMessageViewVerticalLineLength @"PBCommitMessageViewVerticalLineLength"
13 #define kEnableGist @"PBEnableGist"
14 #define kEnableGravatar @"PBEnableGravatar"
15 #define kConfirmPublicGists @"PBConfirmPublicGists"
16 #define kPublicGist @"PBGistPublic"
18 @implementation PBGitDefaults
22 NSMutableDictionary *defaultValues = [NSMutableDictionary dictionary];
23 [defaultValues setObject:[NSNumber numberWithInt:kDefaultVerticalLineLength]
24 forKey:kCommitMessageViewVerticalLineLength];
25 [defaultValues setObject:[NSNumber numberWithBool:YES]
27 [defaultValues setObject:[NSNumber numberWithBool:YES]
28 forKey:kEnableGravatar];
29 [defaultValues setObject:[NSNumber numberWithBool:YES]
30 forKey:kConfirmPublicGists];
31 [defaultValues setObject:[NSNumber numberWithBool:NO]
33 [[NSUserDefaults standardUserDefaults] registerDefaults:defaultValues];
36 + (int) commitMessageViewVerticalLineLength
38 return [[NSUserDefaults standardUserDefaults] integerForKey:kCommitMessageViewVerticalLineLength];
41 + (BOOL) isGistEnabled
43 return [[NSUserDefaults standardUserDefaults] boolForKey:kEnableGist];
46 + (BOOL) isGravatarEnabled
48 return [[NSUserDefaults standardUserDefaults] boolForKey:kEnableGravatar];
51 + (BOOL) confirmPublicGists
53 return [[NSUserDefaults standardUserDefaults] boolForKey:kConfirmPublicGists];
58 return [[NSUserDefaults standardUserDefaults] boolForKey:kPublicGist];