2 // PBPrefsWindowController.m
5 // Created by Christian Jacobsen on 02/10/2008.
6 // Copyright 2008 __MyCompanyName__. All rights reserved.
9 #import "PBPrefsWindowController.h"
10 #import "PBGitRepository.h"
12 @implementation PBPrefsWindowController
14 # pragma mark DBPrefsWindowController overrides
19 [self addView:generalPrefsView label:@"General" image:[NSImage imageNamed:@"gitx"]];
21 [self addView:integrationPrefsView label:@"Integration" image:[NSImage imageNamed:NSImageNameNetwork]];
23 [self addView:updatesPrefsView label:@"Updates"];
27 #pragma mark Delegate methods
29 - (IBAction) checkGitValidity: sender
31 // FIXME: This does not work reliably, probably due to: http://www.cocoabuilder.com/archive/message/cocoa/2008/9/10/217850
32 //[badGitPathIcon setHidden:[PBGitRepository validateGit:[[NSValueTransformer valueTransformerForName:@"PBNSURLPathUserDefaultsTransfomer"] reverseTransformedValue:[gitPathController URL]]]];
35 - (IBAction) resetGitPath: sender
37 [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"gitExecutable"];
40 - (void)pathCell:(NSPathCell *)pathCell willDisplayOpenPanel:(NSOpenPanel *)openPanel
42 [openPanel setCanChooseDirectories:NO];
43 [openPanel setCanChooseFiles:YES];
44 [openPanel setAllowsMultipleSelection:NO];
45 [openPanel setTreatsFilePackagesAsDirectories:YES];
46 [openPanel setAccessoryView:gitPathOpenAccessory];
47 //[[openPanel _navView] setShowsHiddenFiles:YES];
49 gitPathOpenPanel = openPanel;
53 #pragma mark Git Path open panel actions
55 - (IBAction) showHideAllFiles: sender
57 /* FIXME: This uses undocumented OpenPanel features to show hidden files! */
58 NSNumber *showHidden = [NSNumber numberWithBool:[sender state] == NSOnState];
59 [[gitPathOpenPanel valueForKey:@"_navView"] setValue:showHidden forKey:@"showsHiddenFiles"];