HistoryView: don't load in commit information in a separate thread anymore
[GitX.git] / PBGitDefaults.m
blobdc9cfd1af6319dd03bd6266b294fb0b79953bfc4
1 //
2 //  PBGitDefaults.m
3 //  GitX
4 //
5 //  Created by Jeff Mesnil on 19/10/08.
6 //  Copyright 2008 Jeff Mesnil (http://jmesnil.net/). All rights reserved.
7 //
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
23 + (void)initialize
25         NSMutableDictionary *defaultValues = [NSMutableDictionary dictionary];
26         [defaultValues setObject:[NSNumber numberWithInt:kDefaultVerticalLineLength]
27                       forKey:kCommitMessageViewVerticalLineLength];
28         [defaultValues setObject:[NSNumber numberWithBool:YES]
29                           forKey:kEnableGist];
30         [defaultValues setObject:[NSNumber numberWithBool:YES]
31                           forKey:kEnableGravatar];
32         [defaultValues setObject:[NSNumber numberWithBool:YES]
33                           forKey:kConfirmPublicGists];
34         [defaultValues setObject:[NSNumber numberWithBool:NO]
35                           forKey:kPublicGist];
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];
65 + (BOOL) isGistPublic
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];
85 @end