mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
Add a preferences window
This adds a preference window with default preferences to change the sparkle options and to set a custom path to a git binary.
This commit is contained in:
committed by
Pieter de Bie
parent
85fa5a1d8f
commit
0f09401aa6
@@ -0,0 +1,46 @@
|
||||
//
|
||||
// PBNSURLPathUserDefaultsTransfomer.m
|
||||
// GitX
|
||||
//
|
||||
// Created by Christian Jacobsen on 28/09/2008.
|
||||
// Copyright 2008 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#import "PBNSURLPathUserDefaultsTransfomer.h"
|
||||
|
||||
/*
|
||||
This ValueTransformer is used to store NSURLs in the user defaults system
|
||||
as strings, without a host part. It is assumed that the path is an absolute
|
||||
path in the local filesystem.
|
||||
*/
|
||||
|
||||
@implementation PBNSURLPathUserDefaultsTransfomer
|
||||
|
||||
+ (Class)transformedValueClass {
|
||||
return [NSURL class];
|
||||
}
|
||||
|
||||
+ (BOOL)allowsReverseTransformation {
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (id)transformedValue:(id)value {
|
||||
if(value == nil)
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
return [NSURL URLWithString:value
|
||||
relativeToURL:[NSURL URLWithString:@"file://localhost/"]];
|
||||
}
|
||||
|
||||
- (id)reverseTransformedValue:(id)value {
|
||||
if(value == nil)
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
return [value path];
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user