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"
17 #define kShowWhitespaceDifferences @"PBShowWhitespaceDifferences"
18 #define kOpenCurDirOnLaunch @"PBOpenCurDirOnLaunch"
19 #define kShowOpenPanelOnLaunch @"PBShowOpenPanelOnLaunch"
21 @implementation PBGitDefaults
25 NSMutableDictionary *defaultValues = [NSMutableDictionary dictionary];
26 [defaultValues setObject:[NSNumber numberWithInt:kDefaultVerticalLineLength]
27 forKey:kCommitMessageViewVerticalLineLength];
28 [defaultValues setObject:[NSNumber numberWithBool:YES]
30 [defaultValues setObject:[NSNumber numberWithBool:YES]
31 forKey:kEnableGravatar];
32 [defaultValues setObject:[NSNumber numberWithBool:YES]
33 forKey:kConfirmPublicGists];
34 [defaultValues setObject:[NSNumber numberWithBool:NO]
36 [defaultValues setObject:[NSNumber numberWithBool:YES]
37 forKey:kShowWhitespaceDifferences];
38 [defaultValues setObject:[NSNumber numberWithBool:YES]
39 forKey:kOpenCurDirOnLaunch];
40 [defaultValues setObject:[NSNumber numberWithBool:YES]
41 forKey:kShowOpenPanelOnLaunch];
42 [[NSUserDefaults standardUserDefaults] registerDefaults:defaultValues];
45 + (int) commitMessageViewVerticalLineLength
47 return [[NSUserDefaults standardUserDefaults] integerForKey:kCommitMessageViewVerticalLineLength];
50 + (BOOL) isGistEnabled
52 return [[NSUserDefaults standardUserDefaults] boolForKey:kEnableGist];
55 + (BOOL) isGravatarEnabled
57 return [[NSUserDefaults standardUserDefaults] boolForKey:kEnableGravatar];
60 + (BOOL) confirmPublicGists
62 return [[NSUserDefaults standardUserDefaults] boolForKey:kConfirmPublicGists];
67 return [[NSUserDefaults standardUserDefaults] boolForKey:kPublicGist];
70 + (BOOL)showWhitespaceDifferences
72 return [[NSUserDefaults standardUserDefaults] boolForKey:kShowWhitespaceDifferences];
75 + (BOOL)openCurDirOnLaunch
77 return [[NSUserDefaults standardUserDefaults] boolForKey:kOpenCurDirOnLaunch];
80 + (BOOL)showOpenPanelOnLaunch
82 return [[NSUserDefaults standardUserDefaults] boolForKey:kShowOpenPanelOnLaunch];