forked from pieter/gitx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PBGitDefaults.m
85 lines (72 loc) · 2.49 KB
/
PBGitDefaults.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
//
// PBGitDefaults.m
// GitX
//
// Created by Jeff Mesnil on 19/10/08.
// Copyright 2008 Jeff Mesnil (http://jmesnil.net/). All rights reserved.
//
#import "PBGitDefaults.h"
#define kDefaultVerticalLineLength 50
#define kCommitMessageViewVerticalLineLength @"PBCommitMessageViewVerticalLineLength"
#define kEnableGist @"PBEnableGist"
#define kEnableGravatar @"PBEnableGravatar"
#define kConfirmPublicGists @"PBConfirmPublicGists"
#define kPublicGist @"PBGistPublic"
#define kShowWhitespaceDifferences @"PBShowWhitespaceDifferences"
#define kOpenCurDirOnLaunch @"PBOpenCurDirOnLaunch"
#define kShowOpenPanelOnLaunch @"PBShowOpenPanelOnLaunch"
@implementation PBGitDefaults
+ (void)initialize
{
NSMutableDictionary *defaultValues = [NSMutableDictionary dictionary];
[defaultValues setObject:[NSNumber numberWithInt:kDefaultVerticalLineLength]
forKey:kCommitMessageViewVerticalLineLength];
[defaultValues setObject:[NSNumber numberWithBool:YES]
forKey:kEnableGist];
[defaultValues setObject:[NSNumber numberWithBool:YES]
forKey:kEnableGravatar];
[defaultValues setObject:[NSNumber numberWithBool:YES]
forKey:kConfirmPublicGists];
[defaultValues setObject:[NSNumber numberWithBool:NO]
forKey:kPublicGist];
[defaultValues setObject:[NSNumber numberWithBool:YES]
forKey:kShowWhitespaceDifferences];
[defaultValues setObject:[NSNumber numberWithBool:YES]
forKey:kOpenCurDirOnLaunch];
[defaultValues setObject:[NSNumber numberWithBool:YES]
forKey:kShowOpenPanelOnLaunch];
[[NSUserDefaults standardUserDefaults] registerDefaults:defaultValues];
}
+ (int) commitMessageViewVerticalLineLength
{
return [[NSUserDefaults standardUserDefaults] integerForKey:kCommitMessageViewVerticalLineLength];
}
+ (BOOL) isGistEnabled
{
return [[NSUserDefaults standardUserDefaults] boolForKey:kEnableGist];
}
+ (BOOL) isGravatarEnabled
{
return [[NSUserDefaults standardUserDefaults] boolForKey:kEnableGravatar];
}
+ (BOOL) confirmPublicGists
{
return [[NSUserDefaults standardUserDefaults] boolForKey:kConfirmPublicGists];
}
+ (BOOL) isGistPublic
{
return [[NSUserDefaults standardUserDefaults] boolForKey:kPublicGist];
}
+ (BOOL)showWhitespaceDifferences
{
return [[NSUserDefaults standardUserDefaults] boolForKey:kShowWhitespaceDifferences];
}
+ (BOOL)openCurDirOnLaunch
{
return [[NSUserDefaults standardUserDefaults] boolForKey:kOpenCurDirOnLaunch];
}
+ (BOOL)showOpenPanelOnLaunch
{
return [[NSUserDefaults standardUserDefaults] boolForKey:kShowOpenPanelOnLaunch];
}
@end