Merge branch 'pu/pb/index_quick_fix' into stable
[GitX.git] / PBPrefsWindowController.m
blob254adc4ec83454df535abad44273ced05fa9ab01
1 //
2 //  PBPrefsWindowController.m
3 //  GitX
4 //
5 //  Created by Christian Jacobsen on 02/10/2008.
6 //  Copyright 2008 __MyCompanyName__. All rights reserved.
7 //
9 #import "PBPrefsWindowController.h"
10 #import "PBGitRepository.h"
12 @implementation PBPrefsWindowController
14 # pragma mark DBPrefsWindowController overrides
16 - (void)setupToolbar
18         // GENERAL
19         [self addView:generalPrefsView label:@"General" image:[NSImage imageNamed:@"gitx"]];
20         // INTERGRATION
21         [self addView:integrationPrefsView label:@"Integration" image:[NSImage imageNamed:NSImageNameNetwork]];
22         // UPDATES
23         [self addView:updatesPrefsView label:@"Updates"];
26 #pragma mark -
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;
52 #pragma mark -
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"];
62 @end