From c8cfe7acaa2c72d729ab3196b0e7ed1c307f1ba9 Mon Sep 17 00:00:00 2001 From: Pieter de Bie Date: Tue, 8 Sep 2009 13:09:40 +0200 Subject: [PATCH 01/90] Add start of a sourceview list This shows in a separate window for now, so we don't mess up the xibs. Once I'm satisfied with the result, I can put it into the main view with a single change :) --- GitX.xcodeproj/project.pbxproj | 24 ++ PBGitSidebarController.h | 20 ++ PBGitSidebarController.m | 29 +++ PBGitSidebarView.xib | 459 +++++++++++++++++++++++++++++++++ PBGitWindowController.h | 5 +- PBGitWindowController.m | 26 +- PBSourceViewItem.h | 20 ++ PBSourceViewItem.m | 29 +++ 8 files changed, 600 insertions(+), 12 deletions(-) create mode 100644 PBGitSidebarController.h create mode 100644 PBGitSidebarController.m create mode 100644 PBGitSidebarView.xib create mode 100644 PBSourceViewItem.h create mode 100644 PBSourceViewItem.m diff --git a/GitX.xcodeproj/project.pbxproj b/GitX.xcodeproj/project.pbxproj index be97512..a07e078 100644 --- a/GitX.xcodeproj/project.pbxproj +++ b/GitX.xcodeproj/project.pbxproj @@ -93,6 +93,9 @@ F5886A330ED5D5580066E74C /* PBGitRevSpecifier.m in Sources */ = {isa = PBXBuildFile; fileRef = F53FF2040E7ABB5300389171 /* PBGitRevSpecifier.m */; }; F5886A340ED5D55D0066E74C /* PBGitBinary.m in Sources */ = {isa = PBXBuildFile; fileRef = F53C4DF60E97FC630022AD59 /* PBGitBinary.m */; }; F5886A360ED5D56E0066E74C /* PBGitTree.m in Sources */ = {isa = PBXBuildFile; fileRef = F56174560E058893001DCD79 /* PBGitTree.m */; }; + F58DB55910566D3500CFDF4A /* PBGitSidebarController.m in Sources */ = {isa = PBXBuildFile; fileRef = F58DB55810566D3500CFDF4A /* PBGitSidebarController.m */; }; + F58DB56010566E3900CFDF4A /* PBGitSidebarView.xib in Resources */ = {isa = PBXBuildFile; fileRef = F58DB55F10566E3900CFDF4A /* PBGitSidebarView.xib */; }; + F58DB5E8105671B600CFDF4A /* PBSourceViewItem.m in Sources */ = {isa = PBXBuildFile; fileRef = F58DB5E7105671B600CFDF4A /* PBSourceViewItem.m */; }; F59116E60E843BB50072CCB1 /* PBGitCommitView.xib in Resources */ = {isa = PBXBuildFile; fileRef = F59116E50E843BB50072CCB1 /* PBGitCommitView.xib */; }; F59116E90E843BCB0072CCB1 /* PBGitCommitController.m in Sources */ = {isa = PBXBuildFile; fileRef = F59116E80E843BCB0072CCB1 /* PBGitCommitController.m */; }; F593DF780E9E636C003A8559 /* PBFileChangesTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = F593DF770E9E636C003A8559 /* PBFileChangesTableView.m */; }; @@ -243,6 +246,11 @@ F5886A0A0ED5D27A0066E74C /* speedtest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = speedtest.m; sourceTree = ""; }; F5886A100ED5D33D0066E74C /* SpeedTest.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SpeedTest.app; sourceTree = BUILT_PRODUCTS_DIR; }; F5886A120ED5D33D0066E74C /* SpeedTest-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SpeedTest-Info.plist"; sourceTree = ""; }; + F58DB55710566D3500CFDF4A /* PBGitSidebarController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitSidebarController.h; sourceTree = ""; }; + F58DB55810566D3500CFDF4A /* PBGitSidebarController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitSidebarController.m; sourceTree = ""; }; + F58DB55F10566E3900CFDF4A /* PBGitSidebarView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PBGitSidebarView.xib; sourceTree = ""; }; + F58DB5E6105671B600CFDF4A /* PBSourceViewItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBSourceViewItem.h; sourceTree = ""; }; + F58DB5E7105671B600CFDF4A /* PBSourceViewItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBSourceViewItem.m; sourceTree = ""; }; F59116E50E843BB50072CCB1 /* PBGitCommitView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PBGitCommitView.xib; sourceTree = ""; }; F59116E70E843BCB0072CCB1 /* PBGitCommitController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitCommitController.h; sourceTree = ""; }; F59116E80E843BCB0072CCB1 /* PBGitCommitController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitCommitController.m; sourceTree = ""; }; @@ -415,6 +423,7 @@ F59116E50E843BB50072CCB1 /* PBGitCommitView.xib */, 47DBDB680E94EF6500671A1E /* Preferences.xib */, F569AE920F2CBD7C00C2FFA7 /* Credits.html */, + F58DB55F10566E3900CFDF4A /* PBGitSidebarView.xib */, ); name = Resources; sourceTree = ""; @@ -482,6 +491,7 @@ F57CC3850E05DDC1000472E2 /* Controllers */ = { isa = PBXGroup; children = ( + F58DB55610566D1F00CFDF4A /* Sidebar */, F5B161BB0EAB6E0C005A1DE1 /* Diff */, F5EF8C880E9D498F0050906B /* History */, F5E927F90E883EF600056E75 /* Commit */, @@ -549,6 +559,17 @@ name = SpeedTest; sourceTree = ""; }; + F58DB55610566D1F00CFDF4A /* Sidebar */ = { + isa = PBXGroup; + children = ( + F58DB55710566D3500CFDF4A /* PBGitSidebarController.h */, + F58DB55810566D3500CFDF4A /* PBGitSidebarController.m */, + F58DB5E6105671B600CFDF4A /* PBSourceViewItem.h */, + F58DB5E7105671B600CFDF4A /* PBSourceViewItem.m */, + ); + name = Sidebar; + sourceTree = ""; + }; F5B161BB0EAB6E0C005A1DE1 /* Diff */ = { isa = PBXGroup; children = ( @@ -743,6 +764,7 @@ 47DBDB6A0E94EF6500671A1E /* Preferences.xib in Resources */, 47DBDBB10E94F6CA00671A1E /* Updates.png in Resources */, F569AE930F2CBD7C00C2FFA7 /* Credits.html in Resources */, + F58DB56010566E3900CFDF4A /* PBGitSidebarView.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -854,6 +876,8 @@ 47DBDBCA0E95016F00671A1E /* PBNSURLPathUserDefaultsTransfomer.m in Sources */, F562C8870FE1766C000EC528 /* NSString_RegEx.m in Sources */, EB2A734A0FEE3F09006601CF /* PBCollapsibleSplitView.m in Sources */, + F58DB55910566D3500CFDF4A /* PBGitSidebarController.m in Sources */, + F58DB5E8105671B600CFDF4A /* PBSourceViewItem.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/PBGitSidebarController.h b/PBGitSidebarController.h new file mode 100644 index 0000000..a2e180c --- /dev/null +++ b/PBGitSidebarController.h @@ -0,0 +1,20 @@ +// +// PBGitSidebar.h +// GitX +// +// Created by Pieter de Bie on 9/8/09. +// Copyright 2009 __MyCompanyName__. All rights reserved. +// + +#import +#import "PBViewController.h" + +@interface PBGitSidebarController : PBViewController { + IBOutlet NSWindow *window; + IBOutlet NSOutlineView *sourceView; + + NSMutableArray *items; +} + +@property(readonly) NSMutableArray *items; +@end diff --git a/PBGitSidebarController.m b/PBGitSidebarController.m new file mode 100644 index 0000000..8f325ac --- /dev/null +++ b/PBGitSidebarController.m @@ -0,0 +1,29 @@ +// +// PBGitSidebar.m +// GitX +// +// Created by Pieter de Bie on 9/8/09. +// Copyright 2009 __MyCompanyName__. All rights reserved. +// + +#import "PBGitSidebarController.h" +#import "PBSourceViewItem.h" + +@implementation PBGitSidebarController +@synthesize items; + +- (id)initWithRepository:(PBGitRepository *)theRepository superController:(PBGitWindowController *)controller +{ + self = [super initWithRepository:theRepository superController:controller]; + [sourceView setDelegate:self]; + items = [NSMutableArray array]; + return self; +} + +- (void)awakeFromNib +{ + window.contentView = self.view; + [super awakeFromNib]; +} + +@end diff --git a/PBGitSidebarView.xib b/PBGitSidebarView.xib new file mode 100644 index 0000000..c264858 --- /dev/null +++ b/PBGitSidebarView.xib @@ -0,0 +1,459 @@ + + + + 1050 + 9L31a + 677 + 949.54 + 353.00 + + YES + + + + + YES + com.apple.InterfaceBuilderKit + com.apple.InterfaceBuilder.CocoaPlugin + + + YES + + YES + + + YES + + + + YES + + PBGitSidebarController + + + FirstResponder + + + NSApplication + + + 15 + 2 + {{196, 106}, {186, 404}} + 603979776 + Window + NSWindow + + {3.40282e+38, 3.40282e+38} + + + 274 + {186, 404} + + + {{0, 0}, {1280, 1002}} + {3.40282e+38, 3.40282e+38} + + + + 4370 + + YES + + + 2304 + + YES + + + 4352 + {151, 352} + + YES + + + 256 + {{197, 0}, {16, 17}} + + + YES + + 1.500000e+02 + 1.600000e+01 + 1.000000e+03 + + 75628032 + 0 + + + LucidaGrande + 1.100000e+01 + 3100 + + + 3 + MC4zMzMzMzI5OQA + + + 6 + System + headerTextColor + + 3 + MAA + + + + + 337772096 + 2048 + Text Cell + + LucidaGrande + 1.300000e+01 + 1044 + + + + 6 + System + controlBackgroundColor + + 3 + MC42NjY2NjY2OQA + + + + 6 + System + controlTextColor + + + + 3 + YES + YES + + + + 3.000000e+00 + + 6 + System + _sourceListBackgroundColor + + 1 + MC44MzkyMTU3IDAuODY2NjY2NjcgMC44OTgwMzkyMgA + + + + 6 + System + gridColor + + 3 + MC41AA + + + 2.000000e+01 + -767557632 + 4 + 15 + 0 + YES + 1 + 1.400000e+01 + + + {153, 354} + + + + + 4 + + + + -2147483392 + {{137, 1}, {15, 338}} + + + _doScroller: + 9.969879e-01 + + + + 256 + {{-100, -100}, {196, 15}} + + 1 + + _doScroller: + 5.714286e-01 + + + {153, 354} + + + 528 + + + + QSAAAEEgAABBoAAAQaAAAA + + + YES + + + + + YES + + + window + + + + 5 + + + + view + + + + 25 + + + + sourceView + + + + 26 + + + + dataSource + + + + 34 + + + + delegate + + + + 35 + + + + + YES + + 0 + + YES + + + + + + -2 + + + RmlsZSdzIE93bmVyA + + + -1 + + + First Responder + + + -3 + + + Application + + + 2 + + + YES + + + + + + 3 + + + + + 8 + + + YES + + + + + + + + 9 + + + + + 10 + + + + + 11 + + + YES + + + + + + 13 + + + YES + + + + + + 16 + + + + + 21 + + + + + + + YES + + YES + -1.IBPluginDependency + -2.IBPluginDependency + -3.IBPluginDependency + 10.IBPluginDependency + 11.IBPluginDependency + 13.IBPluginDependency + 16.CustomClassName + 16.IBPluginDependency + 2.IBEditorWindowLastContentRect + 2.IBPluginDependency + 2.IBWindowTemplateEditedContentRect + 2.NSWindowTemplate.visibleAtLaunch + 3.IBPluginDependency + 8.IBEditorWindowLastContentRect + 8.IBPluginDependency + 9.IBPluginDependency + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilderKit + com.apple.InterfaceBuilderKit + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + PBIconAndTextCell + com.apple.InterfaceBuilder.CocoaPlugin + {{297, 477}, {186, 404}} + com.apple.InterfaceBuilder.CocoaPlugin + {{297, 477}, {186, 404}} + + com.apple.InterfaceBuilder.CocoaPlugin + {{105, 545}, {153, 354}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + YES + + YES + + + YES + + + + + YES + + YES + + + YES + + + + 35 + + + + YES + + PBGitSidebarController + PBViewController + + YES + + YES + sourceView + window + + + YES + NSOutlineView + NSWindow + + + + IBProjectSource + PBGitSidebarController.h + + + + PBIconAndTextCell + NSTextFieldCell + + IBProjectSource + PBIconAndTextCell.h + + + + PBViewController + NSViewController + + viewToolbar + NSToolbar + + + IBProjectSource + PBViewController.h + + + + + 0 + GitX.xcodeproj + 3 + + diff --git a/PBGitWindowController.h b/PBGitWindowController.h index ae2298b..5dcf5e0 100644 --- a/PBGitWindowController.h +++ b/PBGitWindowController.h @@ -9,7 +9,8 @@ #import #import "PBGitRepository.h" -@class PBViewController; +@class PBViewController, PBGitSidebarController; + @interface PBGitWindowController : NSWindowController { __weak PBGitRepository* repository; int selectedViewIndex; @@ -19,6 +20,8 @@ PBViewController *commitViewController; PBViewController* viewController; + + PBGitSidebarController *sidebarController; } @property (assign) __weak PBGitRepository *repository; diff --git a/PBGitWindowController.m b/PBGitWindowController.m index aba1987..087e3ad 100644 --- a/PBGitWindowController.m +++ b/PBGitWindowController.m @@ -9,6 +9,7 @@ #import "PBGitWindowController.h" #import "PBGitHistoryController.h" #import "PBGitCommitController.h" +#import "PBGitSidebarController.h" @implementation PBGitWindowController @@ -17,18 +18,21 @@ - (id)initWithRepository:(PBGitRepository*)theRepository displayDefault:(BOOL)displayDefault { - if(self = [self initWithWindowNibName:@"RepositoryWindow"]) - { - self.repository = theRepository; - [self showWindow:nil]; - } - - if (displayDefault) { - self.selectedViewIndex = [[NSUserDefaults standardUserDefaults] integerForKey:@"selectedViewIndex"]; - } else { - self.selectedViewIndex = -1; - } + if (!(self = [self initWithWindowNibName:@"RepositoryWindow"])) + return nil; + self.repository = theRepository; + [self showWindow:nil]; + + if (displayDefault) + self.selectedViewIndex = [[NSUserDefaults standardUserDefaults] integerForKey:@"selectedViewIndex"]; + else + self.selectedViewIndex = -1; + + // Sidebar + sidebarController = [[PBGitSidebarController alloc] initWithRepository:repository superController:self]; + // Hack for now + [sidebarController view]; return self; } diff --git a/PBSourceViewItem.h b/PBSourceViewItem.h new file mode 100644 index 0000000..3b722c7 --- /dev/null +++ b/PBSourceViewItem.h @@ -0,0 +1,20 @@ +// +// PBSourceViewItem.h +// GitX +// +// Created by Pieter de Bie on 9/8/09. +// Copyright 2009 __MyCompanyName__. All rights reserved. +// + +#import + + +@interface PBSourceViewItem : NSObject { + NSString *name; +} + +- (id)initWithName:(NSString *)name; + +@property(retain) NSString *name; +@property(readonly) NSArray *children; +@end diff --git a/PBSourceViewItem.m b/PBSourceViewItem.m new file mode 100644 index 0000000..8629a50 --- /dev/null +++ b/PBSourceViewItem.m @@ -0,0 +1,29 @@ +// +// PBSourceViewItem.m +// GitX +// +// Created by Pieter de Bie on 9/8/09. +// Copyright 2009 __MyCompanyName__. All rights reserved. +// + +#import "PBSourceViewItem.h" + + +@implementation PBSourceViewItem +@synthesize name; +@dynamic children; + +- (id)initWithName:(NSString *)aName +{ + if (!(self = [super init])) + return nil; + + name = aName; + return self; +} + +- (NSArray *)children +{ + return [NSArray array]; +} +@end From 462e90dfc835519065f3866487b472c707663a14 Mon Sep 17 00:00:00 2001 From: Pieter de Bie Date: Tue, 8 Sep 2009 14:06:31 +0200 Subject: [PATCH 02/90] Sidebar: populate with branches This is far from perfect, but should indicate which direction this is going in --- PBGitSidebarController.m | 109 ++++++++++++++++++++++++++++++++++++++- PBSourceViewItem.h | 20 +++++-- PBSourceViewItem.m | 38 +++++++++++--- 3 files changed, 155 insertions(+), 12 deletions(-) diff --git a/PBGitSidebarController.m b/PBGitSidebarController.m index 8f325ac..e8ca450 100644 --- a/PBGitSidebarController.m +++ b/PBGitSidebarController.m @@ -9,6 +9,12 @@ #import "PBGitSidebarController.h" #import "PBSourceViewItem.h" +@interface PBGitSidebarController () + +- (void)populateList; + +@end + @implementation PBGitSidebarController @synthesize items; @@ -17,13 +23,114 @@ self = [super initWithRepository:theRepository superController:controller]; [sourceView setDelegate:self]; items = [NSMutableArray array]; + return self; } - (void)awakeFromNib { - window.contentView = self.view; [super awakeFromNib]; + window.contentView = self.view; + [self populateList]; +} + +#pragma mark NSOutlineView delegate methods +- (BOOL)outlineView:(NSOutlineView *)outlineView isGroupItem:(id)item +{ + return [item isGroupItem]; +} + +- (void)outlineView:(NSOutlineView *)outlineView willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item +{ + if ([item isGroupItem]) + [cell setImage:nil]; + else + [cell setImage:[NSImage imageNamed:@"new_file"]]; +} + +- (BOOL)outlineView:(NSOutlineView *)outlineView shouldSelectItem:(id)item +{ + return ![item isGroupItem]; +} + +// +// The next two methods are necessary to hide the triangle for uncollapsible items +// That is, items which should always be displayed, such as the action items. +// +- (BOOL)outlineView:(NSOutlineView *)outlineView shouldCollapseItem:(id)item +{ + return !([item isUncollapsible]); +} + +- (void)outlineView:(NSOutlineView *)outlineView willDisplayOutlineCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item +{ + [cell setTransparent:[item isUncollapsible]]; +} + +- (void)populateList +{ + PBSourceViewItem *actions = [PBSourceViewItem groupItemWithTitle:@"Actions"]; + + PBSourceViewItem *branches = [PBSourceViewItem groupItemWithTitle:@"Branches"]; + PBSourceViewItem *remotes = [PBSourceViewItem groupItemWithTitle:@"Remotes"]; + PBSourceViewItem *tags = [PBSourceViewItem groupItemWithTitle:@"Tags"]; + PBSourceViewItem *custom = [PBSourceViewItem groupItemWithTitle:@"Custom"]; + + for (PBGitRevSpecifier *rev in repository.branches) + { + if (![rev isSimpleRef]) + [custom addChild:[PBSourceViewItem itemWithRevSpec:rev]]; + else if ([[rev simpleRef] hasPrefix:@"refs/heads/"]) + [branches addChild:[PBSourceViewItem itemWithRevSpec:rev]]; + else if ([[rev simpleRef] hasPrefix:@"refs/tags/"]) + [tags addChild:[PBSourceViewItem itemWithRevSpec:rev]]; + else if ([[rev simpleRef] hasPrefix:@"refs/remotes/"]) + [remotes addChild:[PBSourceViewItem itemWithRevSpec:rev]]; + + } + + [items addObject:actions]; + + [items addObject:branches]; + [items addObject:remotes]; + [items addObject:tags]; + [items addObject:custom]; + + [sourceView reloadData]; + [sourceView expandItem:branches expandChildren:YES]; + [sourceView expandItem:actions]; + + NSAssert(actions == [sourceView itemAtRow:0], @"First item is not the Action"); + [sourceView reloadItem:nil reloadChildren:YES]; + +} + +#pragma mark NSOutlineView Datasource methods + +- (id)outlineView:(NSOutlineView *)outlineView child:(NSInteger)index ofItem:(id)item +{ + if (!item) + return [items objectAtIndex:index]; + + return [[(PBSourceViewItem *)item children] objectAtIndex:index]; +} + +- (BOOL)outlineView:(NSOutlineView *)outlineView isItemExpandable:(id)item +{ + return [[(PBSourceViewItem *)item children] count]; +} + +- (NSInteger)outlineView:(NSOutlineView *)outlineView numberOfChildrenOfItem:(id)item +{ + if (!item) + return [items count]; + + return [[(PBSourceViewItem *)item children] count]; +} + +- (id)outlineView:(NSOutlineView *)outlineView objectValueForTableColumn:(NSTableColumn *)tableColumn byItem:(id)item +{ + return [(PBSourceViewItem *)item title]; } @end diff --git a/PBSourceViewItem.h b/PBSourceViewItem.h index 3b722c7..5825bc8 100644 --- a/PBSourceViewItem.h +++ b/PBSourceViewItem.h @@ -8,13 +8,25 @@ #import +@class PBGitRevSpecifier; @interface PBSourceViewItem : NSObject { - NSString *name; + NSMutableArray *children; + + NSString *title; + PBGitRevSpecifier *revSpecifier; + + BOOL isGroupItem; } -- (id)initWithName:(NSString *)name; ++ (PBSourceViewItem *)groupItemWithTitle:(NSString *)title; ++ (PBSourceViewItem *)itemWithRevSpec:(PBGitRevSpecifier *)revSpecifier; + +- (void)addChild:(PBSourceViewItem *)child; + +@property(retain) NSString *title; +@property(readonly) NSMutableArray *children; +@property(assign) BOOL isGroupItem; +@property(retain) PBGitRevSpecifier *revSpecifier; -@property(retain) NSString *name; -@property(readonly) NSArray *children; @end diff --git a/PBSourceViewItem.m b/PBSourceViewItem.m index 8629a50..dfbd7de 100644 --- a/PBSourceViewItem.m +++ b/PBSourceViewItem.m @@ -7,23 +7,47 @@ // #import "PBSourceViewItem.h" - +#import "PBGitRevSpecifier.h" @implementation PBSourceViewItem -@synthesize name; -@dynamic children; +@synthesize title, isGroupItem, children, revSpecifier; -- (id)initWithName:(NSString *)aName +- (id)init { if (!(self = [super init])) return nil; - name = aName; + children = [NSMutableArray array]; return self; } -- (NSArray *)children ++ (PBSourceViewItem *)groupItemWithTitle:(NSString *)title { - return [NSArray array]; + PBSourceViewItem *item = [[PBSourceViewItem alloc] init]; + item.title = title; + item.isGroupItem = YES; + return item; } + ++ (PBSourceViewItem *)itemWithRevSpec:(PBGitRevSpecifier *)revSpecifier +{ + PBSourceViewItem *item = [[PBSourceViewItem alloc] init]; + item.revSpecifier = revSpecifier; + + return item; +} + +- (void)addChild:(PBSourceViewItem *)child +{ + [self.children addObject:child]; +} + +- (NSString *)title +{ + if (title) + return title; + + return [revSpecifier description]; +} + @end From bff93631d53af130d32ec2ec993e044c64981c61 Mon Sep 17 00:00:00 2001 From: Pieter de Bie Date: Tue, 8 Sep 2009 14:23:14 +0200 Subject: [PATCH 03/90] SideBar: Add branches as children This makes a nice tree, which should be more readable than the existing list. The local branches are expanded by default. --- PBGitSidebarController.m | 13 ++++++++----- PBSourceViewItem.h | 6 ++++++ PBSourceViewItem.m | 31 ++++++++++++++++++++++++++++++- 3 files changed, 44 insertions(+), 6 deletions(-) diff --git a/PBGitSidebarController.m b/PBGitSidebarController.m index e8ca450..5bb4854 100644 --- a/PBGitSidebarController.m +++ b/PBGitSidebarController.m @@ -78,14 +78,17 @@ for (PBGitRevSpecifier *rev in repository.branches) { - if (![rev isSimpleRef]) + if (![rev isSimpleRef]) { [custom addChild:[PBSourceViewItem itemWithRevSpec:rev]]; - else if ([[rev simpleRef] hasPrefix:@"refs/heads/"]) - [branches addChild:[PBSourceViewItem itemWithRevSpec:rev]]; + continue; + } + NSArray *pathComponents = [[rev simpleRef] componentsSeparatedByString:@"/"]; + if ([[pathComponents objectAtIndex:1] isEqualToString:@"heads"]) + [branches addRev:rev toPath:[pathComponents subarrayWithRange:NSMakeRange(2, [pathComponents count] - 2)]]; else if ([[rev simpleRef] hasPrefix:@"refs/tags/"]) - [tags addChild:[PBSourceViewItem itemWithRevSpec:rev]]; + [tags addRev:rev toPath:[pathComponents subarrayWithRange:NSMakeRange(2, [pathComponents count] - 2)]]; else if ([[rev simpleRef] hasPrefix:@"refs/remotes/"]) - [remotes addChild:[PBSourceViewItem itemWithRevSpec:rev]]; + [remotes addRev:rev toPath:[pathComponents subarrayWithRange:NSMakeRange(2, [pathComponents count] - 2)]]; } diff --git a/PBSourceViewItem.h b/PBSourceViewItem.h index 5825bc8..c6d5f4e 100644 --- a/PBSourceViewItem.h +++ b/PBSourceViewItem.h @@ -21,9 +21,15 @@ + (PBSourceViewItem *)groupItemWithTitle:(NSString *)title; + (PBSourceViewItem *)itemWithRevSpec:(PBGitRevSpecifier *)revSpecifier; ++ (PBSourceViewItem *)itemWithTitle:(NSString *)title; - (void)addChild:(PBSourceViewItem *)child; +// This adds the ref to the path, which should match the item's title, +// so "refs/heads/pu/pb/sidebar" would have the path [@"pu", @"pb", @"sidebare"] +// to the 'local' branch thing +- (void)addRev:(PBGitRevSpecifier *)revSpecifier toPath:(NSArray *)path; + @property(retain) NSString *title; @property(readonly) NSMutableArray *children; @property(assign) BOOL isGroupItem; diff --git a/PBSourceViewItem.m b/PBSourceViewItem.m index dfbd7de..cd11084 100644 --- a/PBSourceViewItem.m +++ b/PBSourceViewItem.m @@ -37,17 +37,46 @@ return item; } ++ (PBSourceViewItem *)itemWithTitle:(NSString *)title; +{ + PBSourceViewItem *item = [[PBSourceViewItem alloc] init]; + item.title = title; + return item; +} + - (void)addChild:(PBSourceViewItem *)child { [self.children addObject:child]; } +- (void)addRev:(PBGitRevSpecifier *)theRevSpecifier toPath:(NSArray *)path +{ + if ([path count] == 1) { + PBSourceViewItem *item = [PBSourceViewItem itemWithRevSpec:theRevSpecifier]; + [self addChild:item]; + return; + } + + NSString *firstTitle = [path objectAtIndex:0]; + PBSourceViewItem *node = nil; + for (PBSourceViewItem *child in [self children]) + if ([child.title isEqualToString:firstTitle]) + node = child; + + if (!node) { + node = [PBSourceViewItem itemWithTitle:firstTitle]; + [self addChild:node]; + } + + [node addRev:theRevSpecifier toPath:[path subarrayWithRange:NSMakeRange(1, [path count] - 1)]]; +} + - (NSString *)title { if (title) return title; - return [revSpecifier description]; + return [[revSpecifier description] lastPathComponent]; } @end From ca479c79e95cdbaaef00b08dd3ec5b205a3e0145 Mon Sep 17 00:00:00 2001 From: Pieter de Bie Date: Tue, 8 Sep 2009 14:50:20 +0200 Subject: [PATCH 04/90] Sidebar: display a custom icon These are based on a contribution by Vincent Esche, but we'll probably have to change them a bit. --- GitX.xcodeproj/project.pbxproj | 16 ++++++++++++++++ Images/branch.tiff | Bin 0 -> 4418 bytes Images/folder.tiff | Bin 0 -> 4418 bytes Images/remote.tiff | Bin 0 -> 4418 bytes Images/tag.tiff | Bin 0 -> 4418 bytes PBGitSidebarController.m | 5 +---- PBSourceViewItem.h | 5 ++++- PBSourceViewItem.m | 20 +++++++++++++++++++- 8 files changed, 40 insertions(+), 6 deletions(-) create mode 100644 Images/branch.tiff create mode 100644 Images/folder.tiff create mode 100644 Images/remote.tiff create mode 100644 Images/tag.tiff diff --git a/GitX.xcodeproj/project.pbxproj b/GitX.xcodeproj/project.pbxproj index a07e078..11fb6a7 100644 --- a/GitX.xcodeproj/project.pbxproj +++ b/GitX.xcodeproj/project.pbxproj @@ -96,6 +96,10 @@ F58DB55910566D3500CFDF4A /* PBGitSidebarController.m in Sources */ = {isa = PBXBuildFile; fileRef = F58DB55810566D3500CFDF4A /* PBGitSidebarController.m */; }; F58DB56010566E3900CFDF4A /* PBGitSidebarView.xib in Resources */ = {isa = PBXBuildFile; fileRef = F58DB55F10566E3900CFDF4A /* PBGitSidebarView.xib */; }; F58DB5E8105671B600CFDF4A /* PBSourceViewItem.m in Sources */ = {isa = PBXBuildFile; fileRef = F58DB5E7105671B600CFDF4A /* PBSourceViewItem.m */; }; + F58DB7711056860900CFDF4A /* branch.tiff in Resources */ = {isa = PBXBuildFile; fileRef = F58DB76D1056860900CFDF4A /* branch.tiff */; }; + F58DB7721056860900CFDF4A /* remote.tiff in Resources */ = {isa = PBXBuildFile; fileRef = F58DB76E1056860900CFDF4A /* remote.tiff */; }; + F58DB7731056860900CFDF4A /* folder.tiff in Resources */ = {isa = PBXBuildFile; fileRef = F58DB76F1056860900CFDF4A /* folder.tiff */; }; + F58DB7741056860900CFDF4A /* tag.tiff in Resources */ = {isa = PBXBuildFile; fileRef = F58DB7701056860900CFDF4A /* tag.tiff */; }; F59116E60E843BB50072CCB1 /* PBGitCommitView.xib in Resources */ = {isa = PBXBuildFile; fileRef = F59116E50E843BB50072CCB1 /* PBGitCommitView.xib */; }; F59116E90E843BCB0072CCB1 /* PBGitCommitController.m in Sources */ = {isa = PBXBuildFile; fileRef = F59116E80E843BCB0072CCB1 /* PBGitCommitController.m */; }; F593DF780E9E636C003A8559 /* PBFileChangesTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = F593DF770E9E636C003A8559 /* PBFileChangesTableView.m */; }; @@ -251,6 +255,10 @@ F58DB55F10566E3900CFDF4A /* PBGitSidebarView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PBGitSidebarView.xib; sourceTree = ""; }; F58DB5E6105671B600CFDF4A /* PBSourceViewItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBSourceViewItem.h; sourceTree = ""; }; F58DB5E7105671B600CFDF4A /* PBSourceViewItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBSourceViewItem.m; sourceTree = ""; }; + F58DB76D1056860900CFDF4A /* branch.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = branch.tiff; path = Images/branch.tiff; sourceTree = ""; }; + F58DB76E1056860900CFDF4A /* remote.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = remote.tiff; path = Images/remote.tiff; sourceTree = ""; }; + F58DB76F1056860900CFDF4A /* folder.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = folder.tiff; path = Images/folder.tiff; sourceTree = ""; }; + F58DB7701056860900CFDF4A /* tag.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = tag.tiff; path = Images/tag.tiff; sourceTree = ""; }; F59116E50E843BB50072CCB1 /* PBGitCommitView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PBGitCommitView.xib; sourceTree = ""; }; F59116E70E843BCB0072CCB1 /* PBGitCommitController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitCommitController.h; sourceTree = ""; }; F59116E80E843BCB0072CCB1 /* PBGitCommitController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitCommitController.m; sourceTree = ""; }; @@ -394,6 +402,10 @@ 29B97315FDCFA39411CA2CEA /* Other Sources */ = { isa = PBXGroup; children = ( + F58DB76D1056860900CFDF4A /* branch.tiff */, + F58DB76E1056860900CFDF4A /* remote.tiff */, + F58DB76F1056860900CFDF4A /* folder.tiff */, + F58DB7701056860900CFDF4A /* tag.tiff */, 3BC07F4A0ED5A5C5009A7768 /* HistoryViewTemplate.png */, 3BC07F4B0ED5A5C5009A7768 /* CommitViewTemplate.png */, F56ADDD70ED19F9E002AC78F /* AddBranchTemplate.png */, @@ -765,6 +777,10 @@ 47DBDBB10E94F6CA00671A1E /* Updates.png in Resources */, F569AE930F2CBD7C00C2FFA7 /* Credits.html in Resources */, F58DB56010566E3900CFDF4A /* PBGitSidebarView.xib in Resources */, + F58DB7711056860900CFDF4A /* branch.tiff in Resources */, + F58DB7721056860900CFDF4A /* remote.tiff in Resources */, + F58DB7731056860900CFDF4A /* folder.tiff in Resources */, + F58DB7741056860900CFDF4A /* tag.tiff in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Images/branch.tiff b/Images/branch.tiff new file mode 100644 index 0000000000000000000000000000000000000000..dc35b5b8ded3e2bbfb65f98445b79ffe4a030184 GIT binary patch literal 4418 zcmdUxcU)6h7RT><=_Hhp&|BzDdJ9cM@6xNFKoUYI0YU;IN)u5)1pyJk1~Mq>fMo<^ ztcYS^P_WlUT?ETGI1V<{>V-?`_U`+Miy_dW>-07d|y@kK>N z;Q#pt{$x0~SXo>eJ=CB2*$+%;$^ zBY5!BI#JW1lEMIAADOzcyn~IaQ$)=T`ICj~G6g0UMnsY%amJsY&H;2AE1;+#KNoN1 zWaxDKwLo;}_Nsf$HDyOvCk2RV$}`5#Ol*EJ^r7Lyv7z00+Pa!E3vb@I2Jq83plw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>^Ubm98^0X?n>alulZEVf9-eG;)hGG+7 zv(~21=CiGxE#J1o_L-fIUA)~kyIXWBJ&3-Ze!(7N?`mIYf873qgRO(W;jqJRjwX(& zj{6)Zob;X8POVN)oVA=2oSU6T7t$8SFWj|obdlzwghefj9y7EVEJhn++{Mr(#pQs@ zD_3(@zUxufcWw@DtK3ezqujmRE8K@XWIe(?8a*C*YI$-z_j^uy*?8r9o%Y6f`+0Bj zzU8Cl!}MwQne?^uUFF;FNAe5xYxH~UZ{*MS?+t(hd;@9&?l0C|%v;mq!wVY?k zi<0Y;Uvk~JjojBM-YGj%-lYbn?nxD;MW%J82HUnk$P}K3e6ns<{9vNG#|p)GjP794qoF+FLA9oLc-#iFrv)$semDSNE2x zl@^sgS>v^4f02GFWY>v-nxG07KtswEu#(o z4Lw_RwpMTb)R^3Oqsg_YbDQe6@@?<7v$l`yVC?AFskXCn=f_>#UALRPn!8%`TIzRW zcjxSW+8WV1@B{sa_BQ3V%C^sYczZ_ohV1Qcw`*_Tr@F6dKfGVK|Ji}q16O}^|FNgT zq@%f0zO(WmI4C^${80R%n}_`l_Z^`h>G(-NN*v^%fw=G>jWS9Bk9zv6++gZhW6 z4_p3X_?OO6+tCw`+#d}-4t;#@3G>N|zh?jS(^%8sqH~mJ`RHc|N=Pe97~% z7nv`nUzYt!{&m|cgI7QO#`tY;GHP<{HUG8f_w{d--t76q`j5V;ps9y%)89_Nt9Y;U he(wkRhk=igAIGP2KjA(#d^Y^t`^E3eeNnnd^fxCmF4O=3 literal 0 HcmV?d00001 diff --git a/Images/folder.tiff b/Images/folder.tiff new file mode 100644 index 0000000000000000000000000000000000000000..c6a7b144c9425d22b7a15dea5c8687cc4bc3b859 GIT binary patch literal 4418 zcmc(hcT^O~_Q$Jx5<`X=avE|*LCGQ@K@eCF6@*0vXGR#pfJ0UUL_`D>L_wlTSQSxF zlptb46ax~5WENyuvx~Zz*M8Lm<-K#>d%yGk`Bk6W^_g4uTXpMJcc1a_0D1rr1yWN} z!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W2L!#u-| zgkj;n;q?&$5rGkBxsu#4ZbzhYWI|+Llzvo3)W}AwjRhMgcy7GI(Ma@~=$05d{4>=R zs}s9Db~J8rTxr~=c%S&w2@(n1gsw!r#GQ#xH#u+mZ8LE*b8~x=YSPxE(Jl5{Dw2`p z^~voi>M7|d5E6+rD&rZH8zDFJpLz^^Sv? z#7s_R_s#`7i+6s{VrAXTo}XQq{Vj)?b90yRuA*Jo?hU)UbIo!O}(&tbKnKtSh)txUlfxe!=~*`$vl0i&}~`it~!Um4uWGmM$r+FH
JEM7~tdZ83)r2%9Hcd2#G>^3Swe+1`cDB9My0!6~(YYgSs%@p`rOxMG5WJ9n z0lT>A;^d{MORp{mUmj~;*M9%X>MH{s%R9QSx?R0~&H37uPW#S_*KMx1-LSfG_NK+n z=38dBnz~H88gHB4ZtOPeZt5}bY3a4>ZS7mscY$xqzufQGe{H~Z;MU+TgMCA*hVBdp z43FGl-FbF5{O;R(areI7Pklgoko8dfVc{diN0pCtAJ>nVjhr8K9PN6t;>rCn=Ge>M zqksQ4p8ki(AB9gX-kkZyzB4qn|B4cYg8x^7L!`H_Er7zjgm^{qFYt J0TzK_{{R7CC!zoV literal 0 HcmV?d00001 diff --git a/Images/remote.tiff b/Images/remote.tiff new file mode 100644 index 0000000000000000000000000000000000000000..24f81d4c16d34d8b421ced13ed1f38dcec172848 GIT binary patch literal 4418 zcmbuB2|QF?AIHzVvoqE~c4OZ{ls)?%vPMLiW(E_621%(Tsc4mCDW# z1R`i?>!zHpz0SPbJ#@Bv^lK+}J-OR8bhfg#k;xw;5Qzf$&vgX>J7*7__Wrjmk47PE zeE9|b{^BFNf?Z90Ut#AMgpUW`w%9v+=nC|Ly!p?TwoZz7`rbdg^x`W#dVc~I-<^OZ zZ4>Z7+ax^NF$ufhe1XmVUt#;JiEe9qXJx)e;3r}^ooehXuYL|;8Rn~gG6nawyn`7H z<8XcbINaPg4)bokgZpp2hgbU`{O#t`a=u64w|Di@YV7?yRn#&G&p(=k4bMNo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x+&l|UHy579r?9hDmmd&lpEmkd;Zd=^Gc*pEcO{-~Z^UkbkJey#iF`K=qqLHIYhUH(!4 literal 0 HcmV?d00001 diff --git a/Images/tag.tiff b/Images/tag.tiff new file mode 100644 index 0000000000000000000000000000000000000000..0532a45d36fff7722b88d229d025c93bdfcacb09 GIT binary patch literal 4418 zcmbuB2|SeB8^_Q4&Wf?lShI|EEZM^#WnV(pD5)?rm@qW9v{F)0DM>;^Qqtw#x+qtY zwMCQ)l|rtI>XsI1fB)|g&AtEI{r^Arp81^fe&6RjzjL1RoO5Qz-5qEHfF&j;Cxd@m z!QT`we|Pm4$fKnGr=6DC^J#zZoSpX%M!pw&XB+(o6U~qMCTft!?^@p;DoXdlVzF}` zf2ZeZ@4svu=zehqxjtHkbc~%qe*N4!m2)h^3x~r^kMTXdy|cA`??l}|$Ft)|+ejhO zK2n6%LX-=Tp-+ud2l97%5QqfuS9+fI_V3jLZDYAeK^Txt~LFsNcr6uq_D>yIo`$TQ&Lf& z@auWnYhxz|st1yhs=iIgPxrSXm3Y+ydl zXk7YgbG-?&rQQtL{EI2Fy_t?2x)S(bT7LcZqVTL^H#y@9O7aRm;a1VR+H8@eS|em@ zgDH~Lw(>8v{CZBBe|&Kt`^$l2DM8sk$DK&3Ge$OFG)4Bed|%72SJ9NGrIaskE9*&| z%)1f#Ci9BljB7@lVIx?%4_n6Gx!8Nz>M7-ez5yN;+85FrUZAIYzb_CiuKOyoIA z&-!BlBnNoc5Y=KIL-XeN2_(-qj^!uM~y|D zc>J}XF~9AZ9vs}(b@rrEXFLASr#K^q8;3^ciTWEeS+NY1Q&EmgjEmvfCs3w@MDQ5q z<(I-m14LPd$6+%(f7)k;t$ECh;xJJkUd%DfC?=0vP~Mdg&q5jFhH_d0o0W+29hB7~ z71om=O`oWm4^;qhf+NNdU~OnWq90yxdaJB%2zVo0{qx z>7nVLD}UQL=k@o%+uIqB*Iv_m21#{%vwhQkvqhHxK%Yc&v;UhdgzYl!#>G9^9%N^C86&f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-Lfi2gz+IGs$!fvx&qdmsn$v)k_(?P;vnM0n#BS#g-FvkkV z2`3Y$jZTfuIA>Sq1J1oJ3N8$na+irEW=l3NX>ldF`ncw~K6cY~{~^G`t76Z`QP4kA9r2p+JK~2D7A52-yi4>; zJhxtaJ!gGKl6KPWq|ptI8%}J*Ze(n1+N8WGWz*1Ro6W^rpe-R=nzpKLP2D<@?38>e zMKC2I<;FIHZCTsiZ1>+@m#UDOoI1S2X-7qxNE$b-cc|LF^jdvf}{Ux25 zel5cwBPZk29>$()dky#I?nU;6?(57n%`DuH-_P0Kb71j-Q(59!8?uHEx*x2`re>#S zzd5w#(AAs;IYoyB562%K%yr8>e?;xb{v)6A!t?It+vZml$QSG`m^#Wl+FfW}SXrb{ zlu`8I82eaXu~TtPiAG7zas2UwqmA0RtpC~VrE6XVRe3El=@RawdmU6T5^3(FC zGb`YV_=@o}foE?1VE@DUO5MuhDygcBAHk3DKR)>>=%=2uu4kLh(a%->tp0OBHMu&y z2C7M_nWzn~9X!9{{H+U1E;Q9y)>Z$a_shw8<@)@Kk{2@@1RGKtkV_jbO*Y0fKD!)t zdAMm!(}U*a&39V7S~^=@Td%Y^wl%lgv|qYnb*28Q#nlVf=+|nmn_jQ!FzKkiVRECo z)3mdu%dG4CP4k;|w-(-N=w94?`L_M-wmU9&uHRjH_g2rcp1$6|-oZX*-`Ks#doS-N z-2eC>xgXb`{!r{;&LjCpB?DRmRfDF37l-VJIv)ExelW}!e)?FRoJxNu`|i|x`up||{vSp^CVnD(%KfbMx$cYWmwqG)LH+|*7<}dc literal 0 HcmV?d00001 diff --git a/PBGitSidebarController.m b/PBGitSidebarController.m index 5bb4854..097aade 100644 --- a/PBGitSidebarController.m +++ b/PBGitSidebarController.m @@ -42,10 +42,7 @@ - (void)outlineView:(NSOutlineView *)outlineView willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item { - if ([item isGroupItem]) - [cell setImage:nil]; - else - [cell setImage:[NSImage imageNamed:@"new_file"]]; + [cell setImage:[item icon]]; } - (BOOL)outlineView:(NSOutlineView *)outlineView shouldSelectItem:(id)item diff --git a/PBSourceViewItem.h b/PBSourceViewItem.h index c6d5f4e..8b1c160 100644 --- a/PBSourceViewItem.h +++ b/PBSourceViewItem.h @@ -15,6 +15,7 @@ NSString *title; PBGitRevSpecifier *revSpecifier; + PBSourceViewItem *parent; BOOL isGroupItem; } @@ -30,9 +31,11 @@ // to the 'local' branch thing - (void)addRev:(PBGitRevSpecifier *)revSpecifier toPath:(NSArray *)path; +- (NSImage *)icon; + @property(retain) NSString *title; @property(readonly) NSMutableArray *children; @property(assign) BOOL isGroupItem; @property(retain) PBGitRevSpecifier *revSpecifier; - +@property(retain) PBSourceViewItem *parent; @end diff --git a/PBSourceViewItem.m b/PBSourceViewItem.m index cd11084..2f3b416 100644 --- a/PBSourceViewItem.m +++ b/PBSourceViewItem.m @@ -10,7 +10,7 @@ #import "PBGitRevSpecifier.h" @implementation PBSourceViewItem -@synthesize title, isGroupItem, children, revSpecifier; +@synthesize parent, title, isGroupItem, children, revSpecifier; - (id)init { @@ -47,6 +47,7 @@ - (void)addChild:(PBSourceViewItem *)child { [self.children addObject:child]; + child.parent = self; } - (void)addRev:(PBGitRevSpecifier *)theRevSpecifier toPath:(NSArray *)path @@ -79,4 +80,21 @@ return [[revSpecifier description] lastPathComponent]; } +- (NSImage *)icon +{ + if ([self isGroupItem]) + return nil; + + if (self.parent && !self.parent.parent && [self.parent.title isEqualToString:@"Remotes"]) + return [NSImage imageNamed:@"remote"]; + + if (self.parent && !self.parent.parent && [self.parent.title isEqualToString:@"Tags"]) + return [NSImage imageNamed:@"tag"]; + + if ([[self children] count]) + return [NSImage imageNamed:@"folder"]; + + return [NSImage imageNamed:@"branch"]; +} + @end From 23d5c01a3da9d63919a84f32ebf59fb2002823c6 Mon Sep 17 00:00:00 2001 From: Pieter de Bie Date: Thu, 10 Sep 2009 01:18:12 +0200 Subject: [PATCH 05/90] Sidebar: hook up branch switching This is far from perfect, but at least you can use it to navigate the stuff a bit now :) --- GitX.xcodeproj/project.pbxproj | 6 ++++++ NSOutlineViewExt.h | 15 ++++++++++++++ NSOutlineViewExt.m | 25 +++++++++++++++++++++++ PBGitSidebarController.m | 36 ++++++++++++++++++++++++++++++++++ PBSourceViewItem.h | 1 + PBSourceViewItem.m | 13 ++++++++++++ 6 files changed, 96 insertions(+) create mode 100644 NSOutlineViewExt.h create mode 100644 NSOutlineViewExt.m diff --git a/GitX.xcodeproj/project.pbxproj b/GitX.xcodeproj/project.pbxproj index 11fb6a7..235b8ae 100644 --- a/GitX.xcodeproj/project.pbxproj +++ b/GitX.xcodeproj/project.pbxproj @@ -65,6 +65,7 @@ F56524F00E02D45200F03B52 /* PBGitCommit.m in Sources */ = {isa = PBXBuildFile; fileRef = F56524EF0E02D45200F03B52 /* PBGitCommit.m */; }; F56526240E03D85900F03B52 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F56526230E03D85900F03B52 /* WebKit.framework */; }; F565262B0E03D89B00F03B52 /* PBWebHistoryController.m in Sources */ = {isa = PBXBuildFile; fileRef = F565262A0E03D89B00F03B52 /* PBWebHistoryController.m */; }; + F567B88D1057FA9F000DB976 /* NSOutlineViewExt.m in Sources */ = {isa = PBXBuildFile; fileRef = F567B88C1057FA9F000DB976 /* NSOutlineViewExt.m */; }; F569AE930F2CBD7C00C2FFA7 /* Credits.html in Resources */ = {isa = PBXBuildFile; fileRef = F569AE920F2CBD7C00C2FFA7 /* Credits.html */; }; F56ADDD90ED19F9E002AC78F /* AddBranchTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = F56ADDD70ED19F9E002AC78F /* AddBranchTemplate.png */; }; F56ADDDA0ED19F9E002AC78F /* AddLabelTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = F56ADDD80ED19F9E002AC78F /* AddLabelTemplate.png */; }; @@ -233,6 +234,8 @@ F56526230E03D85900F03B52 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = /System/Library/Frameworks/WebKit.framework; sourceTree = ""; }; F56526290E03D89B00F03B52 /* PBWebHistoryController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBWebHistoryController.h; sourceTree = ""; }; F565262A0E03D89B00F03B52 /* PBWebHistoryController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBWebHistoryController.m; sourceTree = ""; }; + F567B88B1057FA9F000DB976 /* NSOutlineViewExt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSOutlineViewExt.h; sourceTree = ""; }; + F567B88C1057FA9F000DB976 /* NSOutlineViewExt.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSOutlineViewExt.m; sourceTree = ""; }; F569AE920F2CBD7C00C2FFA7 /* Credits.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = Credits.html; sourceTree = ""; }; F56ADDD70ED19F9E002AC78F /* AddBranchTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = AddBranchTemplate.png; path = Images/AddBranchTemplate.png; sourceTree = ""; }; F56ADDD80ED19F9E002AC78F /* AddLabelTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = AddLabelTemplate.png; path = Images/AddLabelTemplate.png; sourceTree = ""; }; @@ -559,6 +562,8 @@ EB2A73490FEE3F09006601CF /* PBCollapsibleSplitView.m */, F5FC41F20EBCBD4300191D80 /* PBGitXProtocol.h */, F5FC41F30EBCBD4300191D80 /* PBGitXProtocol.m */, + F567B88B1057FA9F000DB976 /* NSOutlineViewExt.h */, + F567B88C1057FA9F000DB976 /* NSOutlineViewExt.m */, ); name = Aux; sourceTree = ""; @@ -894,6 +899,7 @@ EB2A734A0FEE3F09006601CF /* PBCollapsibleSplitView.m in Sources */, F58DB55910566D3500CFDF4A /* PBGitSidebarController.m in Sources */, F58DB5E8105671B600CFDF4A /* PBSourceViewItem.m in Sources */, + F567B88D1057FA9F000DB976 /* NSOutlineViewExt.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/NSOutlineViewExt.h b/NSOutlineViewExt.h new file mode 100644 index 0000000..64c0186 --- /dev/null +++ b/NSOutlineViewExt.h @@ -0,0 +1,15 @@ +// +// NSOutlineViewExit.h +// GitX +// +// Created by Pieter de Bie on 9/9/09. +// Copyright 2009 __MyCompanyName__. All rights reserved. +// + +#import + + +@interface NSOutlineView (PBExpandParents) + +- (void)PBExpandItem:(id)item expandParents:(BOOL)expand; +@end diff --git a/NSOutlineViewExt.m b/NSOutlineViewExt.m new file mode 100644 index 0000000..57531f8 --- /dev/null +++ b/NSOutlineViewExt.m @@ -0,0 +1,25 @@ +// +// NSOutlineViewExit.m +// GitX +// +// Created by Pieter de Bie on 9/9/09. +// Copyright 2009 __MyCompanyName__. All rights reserved. +// + +#import "NSOutlineViewExt.h" + + +@implementation NSOutlineView (PBExpandParents) + +- (void)PBExpandItem:(id)item expandParents:(BOOL)expand +{ + NSMutableArray *parents = [NSMutableArray array]; + while (item) { + [parents insertObject:item atIndex:0]; + item = [item parent]; + } + + for (id p in parents) + [self expandItem:p]; +} +@end diff --git a/PBGitSidebarController.m b/PBGitSidebarController.m index 097aade..6e5bd43 100644 --- a/PBGitSidebarController.m +++ b/PBGitSidebarController.m @@ -8,10 +8,12 @@ #import "PBGitSidebarController.h" #import "PBSourceViewItem.h" +#import "NSOutlineViewExt.h" @interface PBGitSidebarController () - (void)populateList; +- (void)updateSelection; @end @@ -32,8 +34,42 @@ [super awakeFromNib]; window.contentView = self.view; [self populateList]; + + [repository addObserver:self forKeyPath:@"currentBranch" options:0 context:@"currentBranchChange"]; + [self updateSelection]; } +- (void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context +{ + if ([@"currentBranchChange" isEqualTo:context]) + [self updateSelection]; +} + +- (void)updateSelection +{ + PBGitRevSpecifier *rev = repository.currentBranch; + if (!rev) + return; + + PBSourceViewItem *item = nil; + for (PBSourceViewItem *it in items) + if (item = [it findRev:rev]) + break; + + // TODO: We should add the current branch, or something :) + + if (!item) { + [sourceView deselectAll:self]; + return; + } + + [sourceView PBExpandItem:item expandParents:YES]; + NSInteger index = [sourceView rowForItem:item]; + + [sourceView selectRow:index byExtendingSelection:NO]; +} + + #pragma mark NSOutlineView delegate methods - (BOOL)outlineView:(NSOutlineView *)outlineView isGroupItem:(id)item { diff --git a/PBSourceViewItem.h b/PBSourceViewItem.h index 8b1c160..13e0e08 100644 --- a/PBSourceViewItem.h +++ b/PBSourceViewItem.h @@ -30,6 +30,7 @@ // so "refs/heads/pu/pb/sidebar" would have the path [@"pu", @"pb", @"sidebare"] // to the 'local' branch thing - (void)addRev:(PBGitRevSpecifier *)revSpecifier toPath:(NSArray *)path; +- (PBSourceViewItem *)findRev:(PBGitRevSpecifier *)rev; - (NSImage *)icon; diff --git a/PBSourceViewItem.m b/PBSourceViewItem.m index 2f3b416..b5a28df 100644 --- a/PBSourceViewItem.m +++ b/PBSourceViewItem.m @@ -72,6 +72,19 @@ [node addRev:theRevSpecifier toPath:[path subarrayWithRange:NSMakeRange(1, [path count] - 1)]]; } +- (PBSourceViewItem *)findRev:(PBGitRevSpecifier *)rev +{ + if (rev == revSpecifier) + return self; + + PBSourceViewItem *item = nil; + for (PBSourceViewItem *child in children) + if (item = [child findRev:rev]) + return item; + + return nil; +} + - (NSString *)title { if (title) From c59d68bb3ec415880b3186e77990ba08428602e6 Mon Sep 17 00:00:00 2001 From: Pieter de Bie Date: Thu, 10 Sep 2009 01:42:13 +0200 Subject: [PATCH 06/90] Sidebar: Handle selection changes --- PBGitSidebarController.m | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/PBGitSidebarController.m b/PBGitSidebarController.m index 6e5bd43..6fbf58c 100644 --- a/PBGitSidebarController.m +++ b/PBGitSidebarController.m @@ -69,6 +69,21 @@ [sourceView selectRow:index byExtendingSelection:NO]; } +#pragma mark NSOutlineView delegate methods + +- (void)outlineViewSelectionDidChange:(NSNotification *)notification +{ + NSInteger index = [sourceView selectedRow]; + PBSourceViewItem *item = [sourceView itemAtRow:index]; + + if ([item revSpecifier]) { + [[repository windowController] showHistoryView:self]; + repository.currentBranch = [item revSpecifier]; + return; + } + + /* Handle Remotes etc */ +} #pragma mark NSOutlineView delegate methods - (BOOL)outlineView:(NSOutlineView *)outlineView isGroupItem:(id)item From fb3a1705e35f7948d6dd65d429f754b032a4d47b Mon Sep 17 00:00:00 2001 From: Pieter de Bie Date: Tue, 8 Sep 2009 17:11:20 +0200 Subject: [PATCH 07/90] SideBar: Add ViewAction and ViewRemote objects These two new classes can represent items in our SourceList that refer to specific actions (such as comitting), or specific Remotes. --- GitX.xcodeproj/project.pbxproj | 12 ++++++++++++ PBSourceViewAction.h | 17 +++++++++++++++++ PBSourceViewAction.m | 15 +++++++++++++++ PBSourceViewItem.h | 6 +++--- PBSourceViewItem.m | 12 ++++++------ PBSourceViewRemote.h | 16 ++++++++++++++++ PBSourceViewRemote.m | 18 ++++++++++++++++++ 7 files changed, 87 insertions(+), 9 deletions(-) create mode 100644 PBSourceViewAction.h create mode 100644 PBSourceViewAction.m create mode 100644 PBSourceViewRemote.h create mode 100644 PBSourceViewRemote.m diff --git a/GitX.xcodeproj/project.pbxproj b/GitX.xcodeproj/project.pbxproj index 235b8ae..b90117e 100644 --- a/GitX.xcodeproj/project.pbxproj +++ b/GitX.xcodeproj/project.pbxproj @@ -52,6 +52,8 @@ F513085B0E0740F2000C8BCD /* PBQLOutlineView.m in Sources */ = {isa = PBXBuildFile; fileRef = F513085A0E0740F2000C8BCD /* PBQLOutlineView.m */; }; F5140DC90E8A8EB20091E9F3 /* RoundedRectangle.m in Sources */ = {isa = PBXBuildFile; fileRef = F5140DC80E8A8EB20091E9F3 /* RoundedRectangle.m */; }; F523CEB60ED3399200DDD714 /* PBGitIndexController.m in Sources */ = {isa = PBXBuildFile; fileRef = F523CEB50ED3399200DDD714 /* PBGitIndexController.m */; }; + F528210A1056A7C1001D1511 /* PBSourceViewRemote.m in Sources */ = {isa = PBXBuildFile; fileRef = F52821091056A7C1001D1511 /* PBSourceViewRemote.m */; }; + F528210D1056A7EB001D1511 /* PBSourceViewAction.m in Sources */ = {isa = PBXBuildFile; fileRef = F528210C1056A7EB001D1511 /* PBSourceViewAction.m */; }; F52BCE030E84208300AA3741 /* PBGitHistoryView.xib in Resources */ = {isa = PBXBuildFile; fileRef = F52BCE020E84208300AA3741 /* PBGitHistoryView.xib */; }; F52BCE070E84211300AA3741 /* PBGitHistoryController.m in Sources */ = {isa = PBXBuildFile; fileRef = F52BCE060E84211300AA3741 /* PBGitHistoryController.m */; }; F53C4DF70E97FC630022AD59 /* PBGitBinary.m in Sources */ = {isa = PBXBuildFile; fileRef = F53C4DF60E97FC630022AD59 /* PBGitBinary.m */; }; @@ -213,6 +215,10 @@ F5140DC80E8A8EB20091E9F3 /* RoundedRectangle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RoundedRectangle.m; sourceTree = ""; }; F523CEB40ED3399100DDD714 /* PBGitIndexController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitIndexController.h; sourceTree = ""; }; F523CEB50ED3399200DDD714 /* PBGitIndexController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitIndexController.m; sourceTree = ""; }; + F52821081056A7C1001D1511 /* PBSourceViewRemote.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBSourceViewRemote.h; sourceTree = ""; }; + F52821091056A7C1001D1511 /* PBSourceViewRemote.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBSourceViewRemote.m; sourceTree = ""; }; + F528210B1056A7EB001D1511 /* PBSourceViewAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBSourceViewAction.h; sourceTree = ""; }; + F528210C1056A7EB001D1511 /* PBSourceViewAction.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBSourceViewAction.m; sourceTree = ""; }; F52BCE020E84208300AA3741 /* PBGitHistoryView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PBGitHistoryView.xib; sourceTree = ""; }; F52BCE050E84211300AA3741 /* PBGitHistoryController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitHistoryController.h; sourceTree = ""; }; F52BCE060E84211300AA3741 /* PBGitHistoryController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitHistoryController.m; sourceTree = ""; }; @@ -583,6 +589,10 @@ F58DB55810566D3500CFDF4A /* PBGitSidebarController.m */, F58DB5E6105671B600CFDF4A /* PBSourceViewItem.h */, F58DB5E7105671B600CFDF4A /* PBSourceViewItem.m */, + F52821081056A7C1001D1511 /* PBSourceViewRemote.h */, + F52821091056A7C1001D1511 /* PBSourceViewRemote.m */, + F528210B1056A7EB001D1511 /* PBSourceViewAction.h */, + F528210C1056A7EB001D1511 /* PBSourceViewAction.m */, ); name = Sidebar; sourceTree = ""; @@ -900,6 +910,8 @@ F58DB55910566D3500CFDF4A /* PBGitSidebarController.m in Sources */, F58DB5E8105671B600CFDF4A /* PBSourceViewItem.m in Sources */, F567B88D1057FA9F000DB976 /* NSOutlineViewExt.m in Sources */, + F528210A1056A7C1001D1511 /* PBSourceViewRemote.m in Sources */, + F528210D1056A7EB001D1511 /* PBSourceViewAction.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/PBSourceViewAction.h b/PBSourceViewAction.h new file mode 100644 index 0000000..763d254 --- /dev/null +++ b/PBSourceViewAction.h @@ -0,0 +1,17 @@ +// +// PBSourceViewAction.h +// GitX +// +// Created by Pieter de Bie on 9/8/09. +// Copyright 2009 __MyCompanyName__. All rights reserved. +// + +#import +#import "PBSourceViewItem.h" + +@interface PBSourceViewAction : PBSourceViewItem { + NSImage *icon; +} + +@property(retain) NSImage *icon; +@end diff --git a/PBSourceViewAction.m b/PBSourceViewAction.m new file mode 100644 index 0000000..344b967 --- /dev/null +++ b/PBSourceViewAction.m @@ -0,0 +1,15 @@ +// +// PBSourceViewAction.m +// GitX +// +// Created by Pieter de Bie on 9/8/09. +// Copyright 2009 __MyCompanyName__. All rights reserved. +// + +#import "PBSourceViewAction.h" + + +@implementation PBSourceViewAction +@synthesize icon; + +@end diff --git a/PBSourceViewItem.h b/PBSourceViewItem.h index 13e0e08..17b6670 100644 --- a/PBSourceViewItem.h +++ b/PBSourceViewItem.h @@ -20,9 +20,9 @@ BOOL isGroupItem; } -+ (PBSourceViewItem *)groupItemWithTitle:(NSString *)title; -+ (PBSourceViewItem *)itemWithRevSpec:(PBGitRevSpecifier *)revSpecifier; -+ (PBSourceViewItem *)itemWithTitle:(NSString *)title; ++ (id)groupItemWithTitle:(NSString *)title; ++ (id)itemWithRevSpec:(PBGitRevSpecifier *)revSpecifier; ++ (id)itemWithTitle:(NSString *)title; - (void)addChild:(PBSourceViewItem *)child; diff --git a/PBSourceViewItem.m b/PBSourceViewItem.m index b5a28df..bac9099 100644 --- a/PBSourceViewItem.m +++ b/PBSourceViewItem.m @@ -21,25 +21,25 @@ return self; } -+ (PBSourceViewItem *)groupItemWithTitle:(NSString *)title ++ (id)groupItemWithTitle:(NSString *)title { - PBSourceViewItem *item = [[PBSourceViewItem alloc] init]; + PBSourceViewItem *item = [[[self class] alloc] init]; item.title = title; item.isGroupItem = YES; return item; } -+ (PBSourceViewItem *)itemWithRevSpec:(PBGitRevSpecifier *)revSpecifier ++ (id)itemWithRevSpec:(PBGitRevSpecifier *)revSpecifier { - PBSourceViewItem *item = [[PBSourceViewItem alloc] init]; + PBSourceViewItem *item = [[[self class] alloc] init]; item.revSpecifier = revSpecifier; return item; } -+ (PBSourceViewItem *)itemWithTitle:(NSString *)title; ++ (id)itemWithTitle:(NSString *)title; { - PBSourceViewItem *item = [[PBSourceViewItem alloc] init]; + PBSourceViewItem *item = [[[self class] alloc] init]; item.title = title; return item; } diff --git a/PBSourceViewRemote.h b/PBSourceViewRemote.h new file mode 100644 index 0000000..edb5d98 --- /dev/null +++ b/PBSourceViewRemote.h @@ -0,0 +1,16 @@ +// +// PBSourceViewRemote.h +// GitX +// +// Created by Pieter de Bie on 9/8/09. +// Copyright 2009 __MyCompanyName__. All rights reserved. +// + +#import +#import "PBSourceViewItem.h" + +@interface PBSourceViewRemote : PBSourceViewItem { + +} + +@end diff --git a/PBSourceViewRemote.m b/PBSourceViewRemote.m new file mode 100644 index 0000000..b8ccd84 --- /dev/null +++ b/PBSourceViewRemote.m @@ -0,0 +1,18 @@ +// +// PBSourceViewRemote.m +// GitX +// +// Created by Pieter de Bie on 9/8/09. +// Copyright 2009 __MyCompanyName__. All rights reserved. +// + +#import "PBSourceViewRemote.h" + + +@implementation PBSourceViewRemote + +- (NSImage *)icon +{ + return [NSImage imageNamed:@"remote"]; +} +@end From 692a79c3ad0bea07e394713bfc75f60e1aaa94c1 Mon Sep 17 00:00:00 2001 From: Pieter de Bie Date: Thu, 10 Sep 2009 01:18:26 +0200 Subject: [PATCH 08/90] Sidebar: Add "Commit" action When this tree leaf is selected, the view switches to the commit view. --- PBGitSidebarController.h | 5 +++++ PBGitSidebarController.m | 15 ++++++++++++++- PBSourceViewItem.h | 3 ++- PBSourceViewItem.m | 2 +- 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/PBGitSidebarController.h b/PBGitSidebarController.h index a2e180c..9f568ac 100644 --- a/PBGitSidebarController.h +++ b/PBGitSidebarController.h @@ -9,11 +9,16 @@ #import #import "PBViewController.h" +@class PBSourceViewAction; + @interface PBGitSidebarController : PBViewController { IBOutlet NSWindow *window; IBOutlet NSOutlineView *sourceView; NSMutableArray *items; + + /* Specific things */ + PBSourceViewAction *commitAction; } @property(readonly) NSMutableArray *items; diff --git a/PBGitSidebarController.m b/PBGitSidebarController.m index 6fbf58c..803a19e 100644 --- a/PBGitSidebarController.m +++ b/PBGitSidebarController.m @@ -9,6 +9,7 @@ #import "PBGitSidebarController.h" #import "PBSourceViewItem.h" #import "NSOutlineViewExt.h" +#import "PBSourceViewAction.h" @interface PBGitSidebarController () @@ -82,7 +83,13 @@ return; } - /* Handle Remotes etc */ + if (item == commitAction) + [[repository windowController] showCommitView:self]; + + /* ... */ + + + /* Handle Remotes */ } #pragma mark NSOutlineView delegate methods @@ -119,6 +126,12 @@ { PBSourceViewItem *actions = [PBSourceViewItem groupItemWithTitle:@"Actions"]; + actions.isUncollapsible = YES; + + commitAction = [PBSourceViewAction itemWithTitle:@"Index / Commit"]; + commitAction.icon = [NSImage imageNamed:@"CommitViewTemplate"]; + [actions addChild:commitAction]; + PBSourceViewItem *branches = [PBSourceViewItem groupItemWithTitle:@"Branches"]; PBSourceViewItem *remotes = [PBSourceViewItem groupItemWithTitle:@"Remotes"]; PBSourceViewItem *tags = [PBSourceViewItem groupItemWithTitle:@"Tags"]; diff --git a/PBSourceViewItem.h b/PBSourceViewItem.h index 17b6670..1748f5a 100644 --- a/PBSourceViewItem.h +++ b/PBSourceViewItem.h @@ -18,6 +18,7 @@ PBSourceViewItem *parent; BOOL isGroupItem; + BOOL isUncollapsible; } + (id)groupItemWithTitle:(NSString *)title; @@ -36,7 +37,7 @@ @property(retain) NSString *title; @property(readonly) NSMutableArray *children; -@property(assign) BOOL isGroupItem; +@property(assign) BOOL isGroupItem, isUncollapsible; @property(retain) PBGitRevSpecifier *revSpecifier; @property(retain) PBSourceViewItem *parent; @end diff --git a/PBSourceViewItem.m b/PBSourceViewItem.m index bac9099..b7f4045 100644 --- a/PBSourceViewItem.m +++ b/PBSourceViewItem.m @@ -10,7 +10,7 @@ #import "PBGitRevSpecifier.h" @implementation PBSourceViewItem -@synthesize parent, title, isGroupItem, children, revSpecifier; +@synthesize parent, title, isGroupItem, children, revSpecifier, isUncollapsible; - (id)init { From ff1d30571b81862951c52b3efc858a693a7f46fb Mon Sep 17 00:00:00 2001 From: Pieter de Bie Date: Sun, 13 Sep 2009 22:44:26 +0200 Subject: [PATCH 09/90] WIP: Move the sidebar to the history view instead I'm not sure what we should do with the commit stuff, but this seems more reasonable --- PBGitHistoryController.h | 3 +++ PBGitHistoryController.m | 14 ++++++++++++++ PBGitWindowController.h | 2 -- PBGitWindowController.m | 4 ---- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/PBGitHistoryController.h b/PBGitHistoryController.h index fadb6cd..586180b 100644 --- a/PBGitHistoryController.h +++ b/PBGitHistoryController.h @@ -12,7 +12,10 @@ #import "PBViewController.h" #import "PBCollapsibleSplitView.h" +@class PBGitSidebarController; + @interface PBGitHistoryController : PBViewController { + PBGitSidebarController *sidebarController; IBOutlet NSSearchField *searchField; IBOutlet NSArrayController* commitController; IBOutlet NSTreeController* treeController; diff --git a/PBGitHistoryController.m b/PBGitHistoryController.m index f8ad04a..10d5098 100644 --- a/PBGitHistoryController.m +++ b/PBGitHistoryController.m @@ -11,6 +11,7 @@ #import "PBGitGrapher.h" #import "PBGitRevisionCell.h" #import "PBCommitList.h" +#import "PBGitSidebarController.h" #define QLPreviewPanel NSClassFromString(@"QLPreviewPanel") @@ -29,6 +30,19 @@ [fileBrowser setTarget:self]; [fileBrowser setDoubleAction:@selector(openSelectedFile:)]; + [historySplitView removeFromSuperview]; + NSSplitView *newView = [[NSSplitView alloc] initWithFrame:[historySplitView frame]]; + + sidebarController = [[PBGitSidebarController alloc] initWithRepository:repository superController:superController]; + [newView setDividerStyle:NSSplitViewDividerStyleThin]; + [newView addSubview:[sidebarController view]]; + [newView addSubview:historySplitView]; + [newView setVertical:YES]; + [newView adjustSubviews]; + [newView setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; + + [[self view] addSubview:newView]; + if (!repository.currentBranch) { [repository reloadRefs]; [repository readCurrentBranch]; diff --git a/PBGitWindowController.h b/PBGitWindowController.h index 5dcf5e0..0fc969c 100644 --- a/PBGitWindowController.h +++ b/PBGitWindowController.h @@ -20,8 +20,6 @@ PBViewController *commitViewController; PBViewController* viewController; - - PBGitSidebarController *sidebarController; } @property (assign) __weak PBGitRepository *repository; diff --git a/PBGitWindowController.m b/PBGitWindowController.m index 087e3ad..91b95af 100644 --- a/PBGitWindowController.m +++ b/PBGitWindowController.m @@ -29,10 +29,6 @@ else self.selectedViewIndex = -1; - // Sidebar - sidebarController = [[PBGitSidebarController alloc] initWithRepository:repository superController:self]; - // Hack for now - [sidebarController view]; return self; } From 1c3ee96e7c1b27655f6a5cac5c993bd641aa21b7 Mon Sep 17 00:00:00 2001 From: Pieter de Bie Date: Sun, 13 Sep 2009 22:46:22 +0200 Subject: [PATCH 10/90] Don't show the Actions menu for now --- PBGitSidebarController.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PBGitSidebarController.m b/PBGitSidebarController.m index 803a19e..4e779a7 100644 --- a/PBGitSidebarController.m +++ b/PBGitSidebarController.m @@ -153,7 +153,7 @@ } - [items addObject:actions]; + //[items addObject:actions]; [items addObject:branches]; [items addObject:remotes]; @@ -164,7 +164,7 @@ [sourceView expandItem:branches expandChildren:YES]; [sourceView expandItem:actions]; - NSAssert(actions == [sourceView itemAtRow:0], @"First item is not the Action"); + NSAssert(branches == [sourceView itemAtRow:0], @"First item is not the Branches"); [sourceView reloadItem:nil reloadChildren:YES]; } From d05deb95484665d5d465bdc9651ab1b79f13126f Mon Sep 17 00:00:00 2001 From: Pieter de Bie Date: Sun, 13 Sep 2009 23:04:48 +0200 Subject: [PATCH 11/90] PBGitRevSpecifier: tweak "isSimpleRef" a bit For example, HEAD is a simple ref, but "stable..HEAD" isn't. --- PBGitRevSpecifier.m | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/PBGitRevSpecifier.m b/PBGitRevSpecifier.m index ded8575..2865fd7 100644 --- a/PBGitRevSpecifier.m +++ b/PBGitRevSpecifier.m @@ -47,9 +47,19 @@ [revspec setDescription:@"Local branches"]; return revspec; } + - (BOOL) isSimpleRef { - return ([parameters count] == 1 && ![[parameters objectAtIndex:0] hasPrefix:@"-"]); + if ([parameters count] > 1) + return NO; + + NSString *param = [parameters objectAtIndex:0]; + if ([param hasPrefix:@"-"] || + [param rangeOfCharacterFromSet:[NSCharacterSet characterSetWithCharactersInString:@"^@{}~:"]].location != NSNotFound || + [param rangeOfString:@".."].location != NSNotFound) + return NO; + + return YES; } - (NSString*) simpleRef From cd381a459c298333f019104aa15f89f11d98f109 Mon Sep 17 00:00:00 2001 From: Pieter de Bie Date: Sun, 13 Sep 2009 23:05:07 +0200 Subject: [PATCH 12/90] Sidebar: Check if we have enough path components --- PBGitSidebarController.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PBGitSidebarController.m b/PBGitSidebarController.m index 4e779a7..c9b5656 100644 --- a/PBGitSidebarController.m +++ b/PBGitSidebarController.m @@ -144,7 +144,9 @@ continue; } NSArray *pathComponents = [[rev simpleRef] componentsSeparatedByString:@"/"]; - if ([[pathComponents objectAtIndex:1] isEqualToString:@"heads"]) + if ([pathComponents count] < 2) + [branches addChild:[PBSourceViewItem itemWithRevSpec:rev]]; + else if ([[pathComponents objectAtIndex:1] isEqualToString:@"heads"]) [branches addRev:rev toPath:[pathComponents subarrayWithRange:NSMakeRange(2, [pathComponents count] - 2)]]; else if ([[rev simpleRef] hasPrefix:@"refs/tags/"]) [tags addRev:rev toPath:[pathComponents subarrayWithRange:NSMakeRange(2, [pathComponents count] - 2)]]; From 468e6bbb4025427c6f18a8c1b64623c19b7b56cf Mon Sep 17 00:00:00 2001 From: Pieter de Bie Date: Sun, 13 Sep 2009 23:10:31 +0200 Subject: [PATCH 13/90] Sidebar: add a new ref if it can't be found --- PBGitSidebarController.h | 4 ++- PBGitSidebarController.m | 55 ++++++++++++++++++++++------------------ 2 files changed, 33 insertions(+), 26 deletions(-) diff --git a/PBGitSidebarController.h b/PBGitSidebarController.h index 9f568ac..9bc7581 100644 --- a/PBGitSidebarController.h +++ b/PBGitSidebarController.h @@ -9,7 +9,7 @@ #import #import "PBViewController.h" -@class PBSourceViewAction; +@class PBSourceViewAction, PBSourceViewItem; @interface PBGitSidebarController : PBViewController { IBOutlet NSWindow *window; @@ -19,6 +19,8 @@ /* Specific things */ PBSourceViewAction *commitAction; + + PBSourceViewItem *branches, *remotes, *tags, *custom; } @property(readonly) NSMutableArray *items; diff --git a/PBGitSidebarController.m b/PBGitSidebarController.m index c9b5656..b19eaaa 100644 --- a/PBGitSidebarController.m +++ b/PBGitSidebarController.m @@ -15,7 +15,7 @@ - (void)populateList; - (void)updateSelection; - +- (void)addRevSpec:(PBGitRevSpecifier *)revSpec; @end @implementation PBGitSidebarController @@ -57,11 +57,13 @@ if (item = [it findRev:rev]) break; - // TODO: We should add the current branch, or something :) - if (!item) { - [sourceView deselectAll:self]; - return; + [self addRevSpec:rev]; + // Try to find the just added item again. + // TODO: refactor with above. + for (PBSourceViewItem *it in items) + if (item = [it findRev:rev]) + break; } [sourceView PBExpandItem:item expandParents:YES]; @@ -70,6 +72,24 @@ [sourceView selectRow:index byExtendingSelection:NO]; } +- (void)addRevSpec:(PBGitRevSpecifier *)rev +{ + if (![rev isSimpleRef]) { + [custom addChild:[PBSourceViewItem itemWithRevSpec:rev]]; + return; + } + + NSArray *pathComponents = [[rev simpleRef] componentsSeparatedByString:@"/"]; + if ([pathComponents count] < 2) + [branches addChild:[PBSourceViewItem itemWithRevSpec:rev]]; + else if ([[pathComponents objectAtIndex:1] isEqualToString:@"heads"]) + [branches addRev:rev toPath:[pathComponents subarrayWithRange:NSMakeRange(2, [pathComponents count] - 2)]]; + else if ([[rev simpleRef] hasPrefix:@"refs/tags/"]) + [tags addRev:rev toPath:[pathComponents subarrayWithRange:NSMakeRange(2, [pathComponents count] - 2)]]; + else if ([[rev simpleRef] hasPrefix:@"refs/remotes/"]) + [remotes addRev:rev toPath:[pathComponents subarrayWithRange:NSMakeRange(2, [pathComponents count] - 2)]]; +} + #pragma mark NSOutlineView delegate methods - (void)outlineViewSelectionDidChange:(NSNotification *)notification @@ -132,28 +152,13 @@ commitAction.icon = [NSImage imageNamed:@"CommitViewTemplate"]; [actions addChild:commitAction]; - PBSourceViewItem *branches = [PBSourceViewItem groupItemWithTitle:@"Branches"]; - PBSourceViewItem *remotes = [PBSourceViewItem groupItemWithTitle:@"Remotes"]; - PBSourceViewItem *tags = [PBSourceViewItem groupItemWithTitle:@"Tags"]; - PBSourceViewItem *custom = [PBSourceViewItem groupItemWithTitle:@"Custom"]; + branches = [PBSourceViewItem groupItemWithTitle:@"Branches"]; + remotes = [PBSourceViewItem groupItemWithTitle:@"Remotes"]; + tags = [PBSourceViewItem groupItemWithTitle:@"Tags"]; + custom = [PBSourceViewItem groupItemWithTitle:@"Custom"]; for (PBGitRevSpecifier *rev in repository.branches) - { - if (![rev isSimpleRef]) { - [custom addChild:[PBSourceViewItem itemWithRevSpec:rev]]; - continue; - } - NSArray *pathComponents = [[rev simpleRef] componentsSeparatedByString:@"/"]; - if ([pathComponents count] < 2) - [branches addChild:[PBSourceViewItem itemWithRevSpec:rev]]; - else if ([[pathComponents objectAtIndex:1] isEqualToString:@"heads"]) - [branches addRev:rev toPath:[pathComponents subarrayWithRange:NSMakeRange(2, [pathComponents count] - 2)]]; - else if ([[rev simpleRef] hasPrefix:@"refs/tags/"]) - [tags addRev:rev toPath:[pathComponents subarrayWithRange:NSMakeRange(2, [pathComponents count] - 2)]]; - else if ([[rev simpleRef] hasPrefix:@"refs/remotes/"]) - [remotes addRev:rev toPath:[pathComponents subarrayWithRange:NSMakeRange(2, [pathComponents count] - 2)]]; - - } + [self addRevSpec:rev]; //[items addObject:actions]; From fbc1902764f3526120540f55a69d4391fad9bb0a Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Fri, 19 Feb 2010 22:26:14 -0700 Subject: [PATCH 14/90] Switch Delete Remote panel to a window modal sheet --- PBRefController.m | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/PBRefController.m b/PBRefController.m index 31c5590..7c1ac62 100644 --- a/PBRefController.m +++ b/PBRefController.m @@ -34,27 +34,29 @@ } } - -- (void) removeRef:(PBRefMenuItem *) sender +- (void) removeRefSheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo { - NSString *ref_desc = [NSString stringWithFormat:@"%@ %@", [[sender ref] type], [[sender ref] shortName]]; - NSString *question = [NSString stringWithFormat:@"Are you sure you want to remove the %@?", ref_desc]; - int choice = NSRunAlertPanel([NSString stringWithFormat:@"Delete %@?", ref_desc], question, @"Delete", @"Cancel", nil); - // TODO: Use a non-modal alert here, so we don't block all the GitX windows - - if(choice) { + if (returnCode == NSAlertDefaultReturn) { int ret = 1; - [historyController.repository outputForArguments:[NSArray arrayWithObjects:@"update-ref", @"-d", [[sender ref] ref], nil] retValue: &ret]; + PBRefMenuItem *refMenuItem = contextInfo; + [historyController.repository outputForArguments:[NSArray arrayWithObjects:@"update-ref", @"-d", [[refMenuItem ref] ref], nil] retValue: &ret]; if (ret) { NSLog(@"Removing ref failed!"); return; } - [historyController.repository removeBranch:[[PBGitRevSpecifier alloc] initWithRef:[sender ref]]]; - [[sender commit] removeRef:[sender ref]]; + [historyController.repository removeBranch:[[PBGitRevSpecifier alloc] initWithRef:[refMenuItem ref]]]; + [[refMenuItem commit] removeRef:[refMenuItem ref]]; [commitController rearrangeObjects]; } } +- (void) removeRef:(PBRefMenuItem *)sender +{ + NSString *ref_desc = [NSString stringWithFormat:@"%@ %@", [[sender ref] type], [[sender ref] shortName]]; + NSString *question = [NSString stringWithFormat:@"Are you sure you want to remove the %@?", ref_desc]; + NSBeginAlertSheet([NSString stringWithFormat:@"Delete %@?", ref_desc], @"Delete", @"Cancel", nil, [[historyController view] window], self, @selector(removeRefSheetDidEnd:returnCode:contextInfo:), NULL, sender, question); +} + - (void) checkoutRef:(PBRefMenuItem *)sender { int ret = 1; From c0744f19ecf682d36a97332e3911f5e94ab9aa15 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Fri, 19 Feb 2010 22:28:00 -0700 Subject: [PATCH 15/90] Switch "Discard Hunk" panel to a window modal sheet --- PBWebChangesController.m | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/PBWebChangesController.m b/PBWebChangesController.m index 933fecc..3216725 100644 --- a/PBWebChangesController.m +++ b/PBWebChangesController.m @@ -85,21 +85,35 @@ [self refresh]; } +- (void) discardHunk:(NSString *)hunk +{ + [controller.index applyPatch:hunk stage:NO reverse:YES]; + [self refresh]; +} + +- (void) discardHunkAlertDidEnd:(NSAlert *)alert returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo +{ + [[alert window] orderOut:nil]; + + if (returnCode == NSAlertDefaultReturn) + [self discardHunk:contextInfo]; +} + - (void)discardHunk:(NSString *)hunk altKey:(BOOL)altKey { - int ret = NSAlertDefaultReturn; if (!altKey) { - ret = [[NSAlert alertWithMessageText:@"Discard hunk" - defaultButton:nil - alternateButton:@"Cancel" - otherButton:nil - informativeTextWithFormat:@"Are you sure you wish to discard the changes in this hunk?\n\nYou cannot undo this operation."] runModal]; - } - - if (ret == NSAlertDefaultReturn) { - [controller.index applyPatch:hunk stage:NO reverse:YES]; - [self refresh]; - } + NSAlert *alert = [NSAlert alertWithMessageText:@"Discard hunk" + defaultButton:nil + alternateButton:@"Cancel" + otherButton:nil + informativeTextWithFormat:@"Are you sure you wish to discard the changes in this hunk?\n\nYou cannot undo this operation."]; + [alert beginSheetModalForWindow:[[controller view] window] + modalDelegate:self + didEndSelector:@selector(discardHunkAlertDidEnd:returnCode:contextInfo:) + contextInfo:hunk]; + } else { + [self discardHunk:hunk]; + } } - (void) setStateMessage:(NSString *)state From cfcbec788a7bc879fffa88370934a0f39ff69e18 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Fri, 19 Feb 2010 22:53:38 -0700 Subject: [PATCH 16/90] Switch "Discard changes" panel to a window modal sheet --- PBGitIndexController.m | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/PBGitIndexController.m b/PBGitIndexController.m index 5d2a949..d72e8bc 100644 --- a/PBGitIndexController.m +++ b/PBGitIndexController.m @@ -196,19 +196,30 @@ [ws selectFile: path inFileViewerRootedAtPath:nil]; } -- (void)discardChangesForFiles:(NSArray *)files force:(BOOL)force +- (void) discardChangesForFilesAlertDidEnd:(NSAlert *)alert returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo +{ + [[alert window] orderOut:nil]; + + if (returnCode == NSAlertDefaultReturn) { + [commitController.index discardChangesForFiles:contextInfo]; + } +} + +- (void) discardChangesForFiles:(NSArray *)files force:(BOOL)force { if (!force) { - int ret = [[NSAlert alertWithMessageText:@"Discard changes" - defaultButton:nil - alternateButton:@"Cancel" - otherButton:nil - informativeTextWithFormat:@"Are you sure you wish to discard the changes to this file?\n\nYou cannot undo this operation."] runModal]; - if (ret != NSAlertDefaultReturn) - return; - } - - [commitController.index discardChangesForFiles:files]; + NSAlert *alert = [NSAlert alertWithMessageText:@"Discard changes" + defaultButton:nil + alternateButton:@"Cancel" + otherButton:nil + informativeTextWithFormat:@"Are you sure you wish to discard the changes to this file?\n\nYou cannot undo this operation."]; + [alert beginSheetModalForWindow:[[commitController view] window] + modalDelegate:self + didEndSelector:@selector(discardChangesForFilesAlertDidEnd:returnCode:contextInfo:) + contextInfo:files]; + } else { + [commitController.index discardChangesForFiles:files]; + } } # pragma mark TableView icon delegate From 87f76fd5a17f8c6b6d2e2f281602a0cc5939faee Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Fri, 19 Feb 2010 22:54:25 -0700 Subject: [PATCH 17/90] Bugfix: fix the contextual menu and drag-n-drop of refs When the Subject column is not the first column in the git history table the contextual menu for refs and dragging and dropping refs don't work. Offset the mouse click's x value by the x origin of the Subject column. In PBRefController look up the column index of the subject column and check that it's the clicked column (don't assume it's the first one). --- PBCommitList.m | 3 ++- PBGitRevisionCell.m | 2 +- PBRefController.m | 6 ++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/PBCommitList.m b/PBCommitList.m index 9f76422..264b5e2 100644 --- a/PBCommitList.m +++ b/PBCommitList.m @@ -61,8 +61,9 @@ int row = [self rowAtPoint:location]; int column = [self columnAtPoint:location]; PBGitRevisionCell *cell = (PBGitRevisionCell *)[self preparedCellAtColumn:column row:row]; + NSRect cellFrame = [self frameOfCellAtColumn:column row:row]; - int index = [cell indexAtX:location.x]; + int index = [cell indexAtX:(location.x - cellFrame.origin.x)]; if (index == -1) return [super dragImageForRowsWithIndexes:dragRows tableColumns:tableColumns event:dragEvent offset:dragImageOffset]; diff --git a/PBGitRevisionCell.m b/PBGitRevisionCell.m index 98f978b..579168b 100644 --- a/PBGitRevisionCell.m +++ b/PBGitRevisionCell.m @@ -283,7 +283,7 @@ if (!contextMenuDelegate) return [self menu]; - int i = [self indexAtX:[view convertPointFromBase:[event locationInWindow]].x]; + int i = [self indexAtX:[view convertPointFromBase:[event locationInWindow]].x - rect.origin.x]; if (i < 0) return [self menu]; diff --git a/PBRefController.m b/PBRefController.m index 7c1ac62..f89f434 100644 --- a/PBRefController.m +++ b/PBRefController.m @@ -94,12 +94,14 @@ NSPoint location = [tv convertPointFromBase:[(PBCommitList *)tv mouseDownPoint]]; int row = [tv rowAtPoint:location]; int column = [tv columnAtPoint:location]; - if (column != 0) + int subjectColumn = [tv columnWithIdentifier:@"SubjectColumn"]; + if (column != subjectColumn) return NO; PBGitRevisionCell *cell = (PBGitRevisionCell *)[tv preparedCellAtColumn:column row:row]; + NSRect cellFrame = [tv frameOfCellAtColumn:column row:row]; - int index = [cell indexAtX:location.x]; + int index = [cell indexAtX:(location.x - cellFrame.origin.x)]; if (index == -1) return NO; From 76cd64c92b2ed957cccce5ea7412eeadbef38ef1 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Fri, 19 Feb 2010 22:30:02 -0700 Subject: [PATCH 18/90] Fix for "Remote host closed connection" exception EINTR errors are recoverable, just need to read() again. Randomly while looking at files in the file browser the contents view will be empty or files will not be shown when clicking a discloser triangle. Seems to happen more when running in XCode than when running by itself. --- NSFileHandleExt.m | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/NSFileHandleExt.m b/NSFileHandleExt.m index 2772855..6d30cc9 100644 --- a/NSFileHandleExt.m +++ b/NSFileHandleExt.m @@ -33,8 +33,14 @@ while (n > 0) { n = read(fd, buffer + bytesReceived++, 1); - if (n < 0) - [[NSException exceptionWithName:@"Socket error" reason:@"Remote host closed connection" userInfo:nil] raise]; + if (n < 0) { + if (errno == EINTR) { + n = 1; + bytesReceived--; + } else { + [[NSException exceptionWithName:@"Socket error" reason:@"Remote host closed connection" userInfo:nil] raise]; + } + } if (bytesReceived >= bufferSize) { // Make buffer bigger From 370c1322c4cf426ea35c63196b4f3ff6e82ff304 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Tue, 1 Dec 2009 22:14:13 -0700 Subject: [PATCH 19/90] Add a space before the file name. --- html/views/commit/commit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/views/commit/commit.js b/html/views/commit/commit.js index cdec998..dfa9d34 100644 --- a/html/views/commit/commit.js +++ b/html/views/commit/commit.js @@ -57,7 +57,7 @@ var showFileChanges = function(file, cached) { if (file.status == 0) // New file? return showNewFile(file); - setTitle((cached ? "Staged": "Unstaged") + " changes for" + file.path); + setTitle((cached ? "Staged": "Unstaged") + " changes for " + file.path); displayContext(); var changes = Index.diffForFile_staged_contextLines_(file, cached, contextLines); From 1c4601dd5229516ddcba9c6e8b0486efd9f21324 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sat, 5 Dec 2009 10:27:52 -0700 Subject: [PATCH 20/90] PBGitConfig: Change name of -initWithRepository: Better indicates the information needed and stops a compiler warning about wrong type (there are other initWithRepository: methods that take a different type). --- PBGitConfig.h | 2 +- PBGitConfig.m | 2 +- PBGitRepository.m | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/PBGitConfig.h b/PBGitConfig.h index 9875a3c..1645819 100644 --- a/PBGitConfig.h +++ b/PBGitConfig.h @@ -15,5 +15,5 @@ } - init; -- initWithRepository:(NSString *)path; +- initWithRepositoryPath:(NSString *)path; @end diff --git a/PBGitConfig.m b/PBGitConfig.m index 9166cc4..caf883c 100644 --- a/PBGitConfig.m +++ b/PBGitConfig.m @@ -17,7 +17,7 @@ return self; } -- initWithRepository:(NSString *)path +- initWithRepositoryPath:(NSString *)path { repositoryPath = path; return self; diff --git a/PBGitRepository.m b/PBGitRepository.m index 821cd2a..2e74040 100644 --- a/PBGitRepository.m +++ b/PBGitRepository.m @@ -118,7 +118,7 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; - (void) setup { - config = [[PBGitConfig alloc] initWithRepository:self.fileURL.path]; + config = [[PBGitConfig alloc] initWithRepositoryPath:[[self fileURL] path]]; self.branches = [NSMutableArray array]; [self reloadRefs]; revisionList = [[PBGitRevList alloc] initWithRepository:self]; From 03dc7819b4b380afc4a32ff51d89912f843680f0 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sat, 5 Dec 2009 10:33:00 -0700 Subject: [PATCH 21/90] Disable Commit button when there are no staged files. --- PBGitCommitController.h | 1 + PBGitCommitController.m | 6 ++++++ PBGitCommitView.xib | 12 +++++++++++- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/PBGitCommitController.h b/PBGitCommitController.h index f29f884..8cda41e 100644 --- a/PBGitCommitController.h +++ b/PBGitCommitController.h @@ -19,6 +19,7 @@ IBOutlet NSTextView *commitMessageView; IBOutlet NSArrayController *unstagedFilesController; IBOutlet NSArrayController *cachedFilesController; + IBOutlet NSButton *commitButton; IBOutlet PBGitIndexController *indexController; IBOutlet PBWebChangesController *webController; diff --git a/PBGitCommitController.m b/PBGitCommitController.m index 6a77348..c8b5f55 100644 --- a/PBGitCommitController.m +++ b/PBGitCommitController.m @@ -177,6 +177,12 @@ { [cachedFilesController rearrangeObjects]; [unstagedFilesController rearrangeObjects]; + if ([[cachedFilesController arrangedObjects] count]) { + [commitButton setEnabled:YES]; + } else { + [commitButton setEnabled:NO]; + } + } - (void)indexOperationFailed:(NSNotification *)notification diff --git a/PBGitCommitView.xib b/PBGitCommitView.xib index 5b8021f..7d0e8a7 100644 --- a/PBGitCommitView.xib +++ b/PBGitCommitView.xib @@ -1202,6 +1202,14 @@ 283 + + + commitButton + + + + 307 + @@ -1663,7 +1671,7 @@ - 283 + 307 @@ -1707,6 +1715,7 @@ YES cachedFilesController + commitButton commitMessageView indexController unstagedFilesController @@ -1715,6 +1724,7 @@ YES NSArrayController + NSButton NSTextView PBGitIndexController NSArrayController From 771daa7a2c89f101913b36c7d17289620652df31 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sun, 20 Dec 2009 13:44:11 -0700 Subject: [PATCH 22/90] PBGitRef: add support methods that will be needed in future commits. These add functionality and will improve readability. --- PBGitRef.h | 19 +++++++++++++ PBGitRef.m | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 95 insertions(+), 3 deletions(-) diff --git a/PBGitRef.h b/PBGitRef.h index 578b56e..fbd01e0 100644 --- a/PBGitRef.h +++ b/PBGitRef.h @@ -9,12 +9,31 @@ #import +extern NSString * const kGitXTagRefPrefix; +extern NSString * const kGitXBranchRefPrefix; +extern NSString * const kGitXRemoteRefPrefix; + + @interface PBGitRef : NSObject { NSString* ref; } - (NSString*) shortName; +- (NSString *) tagName; +- (NSString *) branchName; +- (NSString *) remoteName; +- (NSString *) remoteBranchName; + - (NSString*) type; +- (BOOL) isBranch; +- (BOOL) isTag; +- (BOOL) isRemote; +- (BOOL) isRemoteBranch; + +- (PBGitRef *) remoteRef; + +- (BOOL) isEqualToRef:(PBGitRef *)otherRef; + + (PBGitRef*) refFromString: (NSString*) s; - (PBGitRef*) initWithString: (NSString*) s; @property(readonly) NSString* ref; diff --git a/PBGitRef.m b/PBGitRef.m index f345a0a..4bf03b8 100644 --- a/PBGitRef.m +++ b/PBGitRef.m @@ -9,6 +9,11 @@ #import "PBGitRef.h" +NSString * const kGitXTagRefPrefix = @"refs/tags/"; +NSString * const kGitXBranchRefPrefix = @"refs/heads/"; +NSString * const kGitXRemoteRefPrefix = @"refs/remotes/"; + + @implementation PBGitRef @synthesize ref; @@ -19,17 +24,85 @@ return ref; } +- (NSString *) tagName +{ + if (![self isTag]) + return nil; + + return [self shortName]; +} + +- (NSString *) branchName +{ + if (![self isBranch]) + return nil; + + return [self shortName]; +} + +- (NSString *) remoteName +{ + if (![self isRemote]) + return nil; + + return (NSString *)[[ref componentsSeparatedByString:@"/"] objectAtIndex:2]; +} + +- (NSString *) remoteBranchName +{ + if (![self isRemoteBranch]) + return nil; + + return [[self shortName] substringFromIndex:[[self remoteName] length] + 1];; +} + - (NSString*) type { - if ([ref hasPrefix:@"refs/heads"]) + if ([self isBranch]) return @"head"; - if ([ref hasPrefix:@"refs/tags"]) + if ([self isTag]) return @"tag"; - if ([ref hasPrefix:@"refs/remotes"]) + if ([self isRemote]) return @"remote"; return nil; } +- (BOOL) isBranch +{ + return [ref hasPrefix:kGitXBranchRefPrefix]; +} + +- (BOOL) isTag +{ + return [ref hasPrefix:kGitXTagRefPrefix]; +} + +- (BOOL) isRemote +{ + return [ref hasPrefix:kGitXRemoteRefPrefix]; +} + +- (BOOL) isRemoteBranch +{ + if (![self isRemote]) + return NO; + + return ([[ref componentsSeparatedByString:@"/"] count] > 3); +} + +- (BOOL) isEqualToRef:(PBGitRef *)otherRef +{ + return [ref isEqualToString:[otherRef ref]]; +} + +- (PBGitRef *) remoteRef +{ + if (![self isRemote]) + return nil; + + return [PBGitRef refFromString:[@"refs/remotes/" stringByAppendingString:[self remoteName]]]; +} + + (PBGitRef*) refFromString: (NSString*) s { return [[PBGitRef alloc] initWithString:s]; From 39def32a1b1c3b09bd5334d7e9cd8a10b7428680 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Mon, 1 Feb 2010 19:34:28 -0700 Subject: [PATCH 23/90] Add protocol. This will simplify methods that execute git commands that can take a ref or an SHA. Add some string constants so there is only one place for the type strings. --- GitX.xcodeproj/project.pbxproj | 2 ++ PBGitCommit.h | 12 +++++++++- PBGitCommit.m | 23 ++++++++++++++++++ PBGitRef.h | 16 ++++++++++--- PBGitRef.m | 43 +++++++++++++++++++++++++++------- PBGitRefish.h | 27 +++++++++++++++++++++ 6 files changed, 111 insertions(+), 12 deletions(-) create mode 100644 PBGitRefish.h diff --git a/GitX.xcodeproj/project.pbxproj b/GitX.xcodeproj/project.pbxproj index 8f8f62c..d8bba5a 100644 --- a/GitX.xcodeproj/project.pbxproj +++ b/GitX.xcodeproj/project.pbxproj @@ -208,6 +208,7 @@ 93F7857E0EA3ABF100C1F443 /* PBCommitMessageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCommitMessageView.m; sourceTree = ""; }; 93FCCBA80EA8AF450061B02B /* PBGitConfig.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitConfig.m; sourceTree = ""; }; D26DC6440E782C9000C777B2 /* gitx.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = gitx.icns; sourceTree = ""; }; + D85B94B710E576B4007F3C28 /* PBGitRefish.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitRefish.h; sourceTree = ""; }; EB2A73480FEE3F09006601CF /* PBCollapsibleSplitView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCollapsibleSplitView.h; sourceTree = ""; }; EB2A73490FEE3F09006601CF /* PBCollapsibleSplitView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCollapsibleSplitView.m; sourceTree = ""; }; F50A411D0EBB874C00208746 /* mainSplitterBar.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = mainSplitterBar.tiff; path = Images/mainSplitterBar.tiff; sourceTree = ""; }; @@ -625,6 +626,7 @@ F5AD56770E79B78100EDAAFE /* PBCommitList.h */, F5AD56780E79B78100EDAAFE /* PBCommitList.m */, F5C6F6750E65FE2B00478D97 /* Graphing */, + D85B94B710E576B4007F3C28 /* PBGitRefish.h */, F56524EE0E02D45200F03B52 /* PBGitCommit.h */, F56524EF0E02D45200F03B52 /* PBGitCommit.m */, F5C007730E731B48007B84B2 /* PBGitRef.h */, diff --git a/PBGitCommit.h b/PBGitCommit.h index 9a7832e..6f55b77 100644 --- a/PBGitCommit.h +++ b/PBGitCommit.h @@ -9,9 +9,14 @@ #import #import "PBGitRepository.h" #import "PBGitTree.h" +#import "PBGitRefish.h" #include "git/oid.h" -@interface PBGitCommit : NSObject { + +extern NSString * const kGitXCommitType; + + +@interface PBGitCommit : NSObject { git_oid sha; git_oid *parentShas; int nParents; @@ -35,6 +40,11 @@ - (NSString *)realSha; +// +- (NSString *) refishName; +- (NSString *) shortName; +- (NSString *) refishType; + @property (readonly) git_oid *sha; @property (copy) NSString* subject; @property (copy) NSString* author; diff --git a/PBGitCommit.m b/PBGitCommit.m index 9ebe3b5..a8c56ad 100644 --- a/PBGitCommit.m +++ b/PBGitCommit.m @@ -9,6 +9,10 @@ #import "PBGitCommit.h" #import "PBGitDefaults.h" + +NSString * const kGitXCommitType = @"commit"; + + @implementation PBGitCommit @synthesize repository, subject, timestamp, author, parentShas, nParents, sign, lineInfo; @@ -128,4 +132,23 @@ + (BOOL)isKeyExcludedFromWebScript:(const char *)name { return NO; } + + +#pragma mark + +- (NSString *) refishName +{ + return [self realSha]; +} + +- (NSString *) shortName +{ + return [[self realSha] substringToIndex:10]; +} + +- (NSString *) refishType +{ + return kGitXCommitType; +} + @end diff --git a/PBGitRef.h b/PBGitRef.h index fbd01e0..80bae6e 100644 --- a/PBGitRef.h +++ b/PBGitRef.h @@ -7,24 +7,34 @@ // #import +#import "PBGitRefish.h" +extern NSString * const kGitXTagType; +extern NSString * const kGitXBranchType; +extern NSString * const kGitXRemoteType; +extern NSString * const kGitXRemoteBranchType; + extern NSString * const kGitXTagRefPrefix; extern NSString * const kGitXBranchRefPrefix; extern NSString * const kGitXRemoteRefPrefix; -@interface PBGitRef : NSObject { +@interface PBGitRef : NSObject { NSString* ref; } -- (NSString*) shortName; +// +- (NSString *) refishName; +- (NSString *) shortName; +- (NSString *) refishType; + - (NSString *) tagName; - (NSString *) branchName; - (NSString *) remoteName; - (NSString *) remoteBranchName; -- (NSString*) type; +- (NSString *) type; - (BOOL) isBranch; - (BOOL) isTag; - (BOOL) isRemote; diff --git a/PBGitRef.m b/PBGitRef.m index 4bf03b8..c9ab938 100644 --- a/PBGitRef.m +++ b/PBGitRef.m @@ -9,6 +9,11 @@ #import "PBGitRef.h" +NSString * const kGitXTagType = @"tag"; +NSString * const kGitXBranchType = @"branch"; +NSString * const kGitXRemoteType = @"remote"; +NSString * const kGitXRemoteBranchType = @"remote branch"; + NSString * const kGitXTagRefPrefix = @"refs/tags/"; NSString * const kGitXBranchRefPrefix = @"refs/heads/"; NSString * const kGitXRemoteRefPrefix = @"refs/remotes/"; @@ -17,12 +22,6 @@ NSString * const kGitXRemoteRefPrefix = @"refs/remotes/"; @implementation PBGitRef @synthesize ref; -- (NSString*) shortName -{ - if ([self type]) - return [ref substringFromIndex:[[self type] length] + 7]; - return ref; -} - (NSString *) tagName { @@ -56,7 +55,7 @@ NSString * const kGitXRemoteRefPrefix = @"refs/remotes/"; return [[self shortName] substringFromIndex:[[self remoteName] length] + 1];; } -- (NSString*) type +- (NSString *) type { if ([self isBranch]) return @"head"; @@ -100,7 +99,7 @@ NSString * const kGitXRemoteRefPrefix = @"refs/remotes/"; if (![self isRemote]) return nil; - return [PBGitRef refFromString:[@"refs/remotes/" stringByAppendingString:[self remoteName]]]; + return [PBGitRef refFromString:[kGitXRemoteRefPrefix stringByAppendingString:[self remoteName]]]; } + (PBGitRef*) refFromString: (NSString*) s @@ -123,4 +122,32 @@ NSString * const kGitXRemoteRefPrefix = @"refs/remotes/"; return NO; } + +#pragma mark + +- (NSString *) refishName +{ + return ref; +} + +- (NSString *) shortName +{ + if ([self type]) + return [ref substringFromIndex:[[self type] length] + 7]; + return ref; +} + +- (NSString *) refishType +{ + if ([self isBranch]) + return kGitXBranchType; + if ([self isTag]) + return kGitXTagType; + if ([self isRemoteBranch]) + return kGitXRemoteBranchType; + if ([self isRemote]) + return kGitXRemoteType; + return nil; +} + @end diff --git a/PBGitRefish.h b/PBGitRefish.h new file mode 100644 index 0000000..ac0f9d8 --- /dev/null +++ b/PBGitRefish.h @@ -0,0 +1,27 @@ +// +// PBGitRefish.h +// GitX +// +// Created by Nathan Kinsinger on 12/25/09. +// Copyright 2009 Nathan Kinsinger. All rights reserved. +// + +#import + + +// Several git commands can take a ref "refs/heads/master" or an SHA. +// Use to accept a PBGitRef or a PBGitCommit without having to write +// two separate methods. +// +// refishName the full name of the ref "refs/heads/master" or the full SHA +// used in git commands +// shortName a more user friendly version of the refName, "master" or a short SHA +// refishType a short name for the type + +@protocol PBGitRefish + +- (NSString *) refishName; +- (NSString *) shortName; +- (NSString *) refishType; + +@end From b61028a06a8a003f0f9be0b60740adc53d996689 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sun, 20 Dec 2009 13:46:50 -0700 Subject: [PATCH 24/90] Add support methods needed for future commits. PBGitCommit PBGitRevSpecifier PBGitRepository --- PBGitCommit.h | 5 +++ PBGitCommit.m | 57 ++++++++++++++++++++++++-- PBGitRepository.h | 10 +++++ PBGitRepository.m | 99 +++++++++++++++++++++++++++++++++++++++++++++ PBGitRevSpecifier.h | 3 ++ PBGitRevSpecifier.m | 18 +++++++++ 6 files changed, 188 insertions(+), 4 deletions(-) diff --git a/PBGitCommit.h b/PBGitCommit.h index 6f55b77..3e361e9 100644 --- a/PBGitCommit.h +++ b/PBGitCommit.h @@ -26,6 +26,7 @@ extern NSString * const kGitXCommitType; NSString* details; NSString *_patch; NSArray* parents; + NSString *realSHA; int timestamp; char sign; @@ -33,12 +34,16 @@ extern NSString * const kGitXCommitType; PBGitRepository* repository; } ++ commitWithRepository:(PBGitRepository*)repo andSha:(git_oid)newSha; - initWithRepository:(PBGitRepository *)repo andSha:(git_oid)sha; - (void)addRef:(PBGitRef *)ref; - (void)removeRef:(id)ref; +- (BOOL) hasRef:(PBGitRef *)ref; - (NSString *)realSha; +- (BOOL) isOnSameBranchAs:(PBGitCommit *)other; +- (BOOL) isOnHeadBranch; // - (NSString *) refishName; diff --git a/PBGitCommit.m b/PBGitCommit.m index a8c56ad..28abcda 100644 --- a/PBGitCommit.m +++ b/PBGitCommit.m @@ -54,6 +54,11 @@ NSString * const kGitXCommitType = @"commit"; return &sha; } ++ commitWithRepository:(PBGitRepository*)repo andSha:(git_oid)newSha +{ + return [[[self alloc] initWithRepository:repo andSha:newSha] autorelease]; +} + - initWithRepository:(PBGitRepository*) repo andSha:(git_oid)newSha { details = nil; @@ -64,10 +69,42 @@ NSString * const kGitXCommitType = @"commit"; - (NSString *)realSha { - char *hex = git_oid_mkhex(&sha); - NSString *str = [NSString stringWithUTF8String:hex]; - free(hex); - return str; + if (!realSHA) { + char *hex = git_oid_mkhex(&sha); + realSHA = [NSString stringWithUTF8String:hex]; + free(hex); + } + + return realSHA; +} + +- (BOOL) isOnSameBranchAs:(PBGitCommit *)other +{ + if (!other) + return NO; + + NSString *mySHA = [self realSha]; + NSString *otherSHA = [other realSha]; + + if ([otherSHA isEqualToString:mySHA]) + return YES; + + NSString *commitRange = [NSString stringWithFormat:@"%@..%@", mySHA, otherSHA]; + NSString *parentsOutput = [repository outputForArguments:[NSArray arrayWithObjects:@"rev-list", @"--parents", @"-1", commitRange, nil]]; + if ([parentsOutput isEqualToString:@""]) { + return NO; + } + + NSString *mergeSHA = [repository outputForArguments:[NSArray arrayWithObjects:@"merge-base", mySHA, otherSHA, nil]]; + if ([mergeSHA isEqualToString:mySHA] || [mergeSHA isEqualToString:otherSHA]) + return YES; + + return NO; +} + +- (BOOL) isOnHeadBranch +{ + return [self isOnSameBranchAs:[repository headCommit]]; } // FIXME: Remove this method once it's unused. @@ -108,6 +145,18 @@ NSString * const kGitXCommitType = @"commit"; [self.refs removeObject:ref]; } +- (BOOL) hasRef:(PBGitRef *)ref +{ + if (!self.refs) + return NO; + + for (PBGitRef *existingRef in self.refs) + if ([existingRef isEqualToRef:ref]) + return YES; + + return NO; +} + - (NSMutableArray *)refs { return [[repository refs] objectForKey:[self realSha]]; diff --git a/PBGitRepository.h b/PBGitRepository.h index 93c38c9..c8bd680 100644 --- a/PBGitRepository.h +++ b/PBGitRepository.h @@ -14,6 +14,7 @@ extern NSString* PBGitRepositoryErrorDomain; @class PBGitWindowController; +@class PBGitCommit; @interface PBGitRepository : NSDocument { PBGitRevList* revisionList; @@ -51,6 +52,15 @@ extern NSString* PBGitRepositoryErrorDomain; - (void) addRef:(PBGitRef *)ref fromParameters:(NSArray *)params; - (void) lazyReload; - (PBGitRevSpecifier*) headRef; +- (NSString *) headSHA; +- (PBGitCommit *) headCommit; +- (NSString *) shaForRef:(PBGitRef *)ref; +- (PBGitCommit *) commitForRef:(PBGitRef *)ref; +- (PBGitCommit *) commitForSHA:(NSString *)sha; +- (BOOL) isSHAOnHeadBranch:(NSString *)testSHA; +- (BOOL) isRefOnHeadBranch:(PBGitRef *)testRef; +- (BOOL) checkRefFormat:(NSString *)refName; +- (BOOL) refExists:(PBGitRef *)ref; - (void) readCurrentBranch; - (PBGitRevSpecifier*) addBranch: (PBGitRevSpecifier*) rev; diff --git a/PBGitRepository.m b/PBGitRepository.m index 2e74040..477d15b 100644 --- a/PBGitRepository.m +++ b/PBGitRepository.m @@ -281,6 +281,105 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; return _headRef; } + +- (NSString *) headSHA +{ + return [self shaForRef:[[self headRef] ref]]; +} + +- (PBGitCommit *) headCommit +{ + return [self commitForSHA:[self headSHA]]; +} + +- (NSString *) shaForRef:(PBGitRef *)ref +{ + if (!ref) + return nil; + + for (NSString *sha in refs) + for (PBGitRef *existingRef in [refs objectForKey:sha]) + if ([existingRef isEqualToRef:ref]) + return sha; + + int retValue = 1; + NSArray *args = [NSArray arrayWithObjects:@"rev-list", @"-1", [ref ref], nil]; + NSString *shaForRef = [self outputInWorkdirForArguments:args retValue:&retValue]; + if (retValue || [shaForRef isEqualToString:@""]) + return nil; + + return shaForRef; +} + +- (PBGitCommit *) commitForRef:(PBGitRef *)ref +{ + if (!ref) + return nil; + + return [self commitForSHA:[self shaForRef:ref]]; +} + +- (PBGitCommit *) commitForSHA:(NSString *)sha +{ + if (!sha) + return nil; + NSArray *revList = [self.revisionList.commits copy]; + + for (PBGitCommit *commit in revList) + if ([[commit realSha] isEqualToString:sha]) + return commit; + + return nil; +} + +- (BOOL) isSHAOnHeadBranch:(NSString *)testSHA +{ + if (!testSHA) + return NO; + + NSString *headSHA = [self headSHA]; + + if ([testSHA isEqualToString:headSHA]) + return YES; + + NSString *commitRange = [NSString stringWithFormat:@"%@..%@", testSHA, headSHA]; + NSString *parentsOutput = [self outputForArguments:[NSArray arrayWithObjects:@"rev-list", @"--parents", @"-1", commitRange, nil]]; + if ([parentsOutput isEqualToString:@""]) { + return NO; + } + + NSString *mergeSHA = [self outputForArguments:[NSArray arrayWithObjects:@"merge-base", testSHA, headSHA, nil]]; + if ([mergeSHA isEqualToString:testSHA] || [mergeSHA isEqualToString:headSHA]) + return YES; + + return NO; +} + +- (BOOL) isRefOnHeadBranch:(PBGitRef *)testRef +{ + if (!testRef) + return NO; + + return [self isSHAOnHeadBranch:[self shaForRef:testRef]]; +} + +- (BOOL) checkRefFormat:(NSString *)refName +{ + int retValue = 1; + [self outputInWorkdirForArguments:[NSArray arrayWithObjects:@"check-ref-format", refName, nil] retValue:&retValue]; + if (retValue) + return NO; + return YES; +} + +- (BOOL) refExists:(PBGitRef *)ref +{ + int retValue = 1; + NSString *output = [self outputInWorkdirForArguments:[NSArray arrayWithObjects:@"for-each-ref", [ref ref], nil] retValue:&retValue]; + if (retValue || [output isEqualToString:@""]) + return NO; + return YES; +} // Returns either this object, or an existing, equal object - (PBGitRevSpecifier*) addBranch: (PBGitRevSpecifier*) rev diff --git a/PBGitRevSpecifier.h b/PBGitRevSpecifier.h index 0461908..bc2724c 100644 --- a/PBGitRevSpecifier.h +++ b/PBGitRevSpecifier.h @@ -20,10 +20,13 @@ - (BOOL) isSimpleRef; - (NSString*) simpleRef; +- (PBGitRef *) ref; - (BOOL) hasPathLimiter; - (BOOL) hasLeftRight; - (BOOL) isEqualTo: (PBGitRevSpecifier*) other; +- (BOOL) isAllBranchesRev; +- (BOOL) isLocalBranchesRev; + (PBGitRevSpecifier *)allBranchesRevSpec; + (PBGitRevSpecifier *)localBranchesRevSpec; diff --git a/PBGitRevSpecifier.m b/PBGitRevSpecifier.m index 0fe9093..529275d 100644 --- a/PBGitRevSpecifier.m +++ b/PBGitRevSpecifier.m @@ -59,6 +59,14 @@ return [parameters objectAtIndex:0]; } +- (PBGitRef *) ref +{ + if (![self isSimpleRef]) + return nil; + + return [PBGitRef refFromString:[self simpleRef]]; +} + - (NSString*) description { if (description) @@ -95,6 +103,16 @@ (!description || [description isEqualToString:other.description])); } +- (BOOL) isAllBranchesRev +{ + return [self isEqualTo:[PBGitRevSpecifier allBranchesRevSpec]]; +} + +- (BOOL) isLocalBranchesRev +{ + return [self isEqualTo:[PBGitRevSpecifier localBranchesRevSpec]]; +} + - (void) encodeWithCoder:(NSCoder *)coder { [coder encodeObject:description forKey:@"Description"]; From ff5f3f7979d470acdd55bb9869114802278d2314 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Tue, 2 Feb 2010 19:29:38 -0700 Subject: [PATCH 25/90] Add methods dealing with menus needed for future features. Switch from storing both the ref and the commit to storing just one or the other as a refish. Change action methods that receive PBRefMenuItem to support the change in functionality. In particular the removeRefSheetDidEnd:returnCode:contextInfo: method in PBRefController now looks up the commit for the ref (this was the only place that needed both the ref and the commit). --- PBGitRevisionCell.m | 2 +- PBRefContextDelegate.h | 3 +- PBRefController.h | 5 ++- PBRefController.m | 27 ++++++++----- PBRefMenuItem.h | 12 +++--- PBRefMenuItem.m | 87 ++++++++++++++++++++++++++++------------ PBWebHistoryController.m | 2 +- 7 files changed, 93 insertions(+), 45 deletions(-) diff --git a/PBGitRevisionCell.m b/PBGitRevisionCell.m index 579168b..a79667a 100644 --- a/PBGitRevisionCell.m +++ b/PBGitRevisionCell.m @@ -291,7 +291,7 @@ if (!ref) return [self menu]; - NSArray *items = [contextMenuDelegate menuItemsForRef:ref commit:[self objectValue]]; + NSArray *items = [contextMenuDelegate menuItemsForRef:ref]; NSMenu *menu = [[NSMenu alloc] init]; for (NSMenuItem *item in items) [menu addItem:item]; diff --git a/PBRefContextDelegate.h b/PBRefContextDelegate.h index 81019ce..1b7a973 100644 --- a/PBRefContextDelegate.h +++ b/PBRefContextDelegate.h @@ -9,5 +9,6 @@ @protocol PBRefContextDelegate -- (NSArray *) menuItemsForRef:(PBGitRef *)ref commit:(PBGitCommit *)commit; +- (NSArray *) menuItemsForRef:(PBGitRef *)ref; +- (NSArray *) menuItemsForCommit:(PBGitCommit *)commit; @end diff --git a/PBRefController.h b/PBRefController.h index 0706fc5..163c996 100644 --- a/PBRefController.h +++ b/PBRefController.h @@ -13,6 +13,8 @@ #import "PBGitCommit.h" #import "PBRefContextDelegate.h" +@class PBRefMenuItem; + @interface PBRefController : NSObject { IBOutlet __weak PBGitHistoryController *historyController; IBOutlet NSArrayController *commitController; @@ -29,7 +31,8 @@ - (IBAction)closeSheet:(id) sender; - (IBAction)saveSheet:(id) sender; -- (NSArray *) menuItemsForRef:(PBGitRef *)ref commit:(PBGitCommit *)commit; +- (NSArray *) menuItemsForRef:(PBGitRef *)ref; +- (NSArray *) menuItemsForCommit:(PBGitCommit *)commit; - (void) changeBranch:(NSMenuItem *)sender; - (void) selectCurrentBranch; diff --git a/PBRefController.m b/PBRefController.m index f89f434..63483be 100644 --- a/PBRefController.m +++ b/PBRefController.m @@ -39,20 +39,21 @@ if (returnCode == NSAlertDefaultReturn) { int ret = 1; PBRefMenuItem *refMenuItem = contextInfo; - [historyController.repository outputForArguments:[NSArray arrayWithObjects:@"update-ref", @"-d", [[refMenuItem ref] ref], nil] retValue: &ret]; + [historyController.repository outputForArguments:[NSArray arrayWithObjects:@"update-ref", @"-d", [[refMenuItem refish] refishName], nil] retValue: &ret]; if (ret) { NSLog(@"Removing ref failed!"); return; } - [historyController.repository removeBranch:[[PBGitRevSpecifier alloc] initWithRef:[refMenuItem ref]]]; - [[refMenuItem commit] removeRef:[refMenuItem ref]]; + [historyController.repository removeBranch:[[PBGitRevSpecifier alloc] initWithRef:[refMenuItem refish]]]; + PBGitCommit *commitForRef = [historyController.repository commitForRef:[refMenuItem refish]]; + [commitForRef removeRef:[refMenuItem refish]]; [commitController rearrangeObjects]; } } - (void) removeRef:(PBRefMenuItem *)sender { - NSString *ref_desc = [NSString stringWithFormat:@"%@ %@", [[sender ref] type], [[sender ref] shortName]]; + NSString *ref_desc = [NSString stringWithFormat:@"%@ %@", [(PBGitRef *)[sender refish] type], [[sender refish] shortName]]; NSString *question = [NSString stringWithFormat:@"Are you sure you want to remove the %@?", ref_desc]; NSBeginAlertSheet([NSString stringWithFormat:@"Delete %@?", ref_desc], @"Delete", @"Cancel", nil, [[historyController view] window], self, @selector(removeRefSheetDidEnd:returnCode:contextInfo:), NULL, sender, question); } @@ -60,7 +61,7 @@ - (void) checkoutRef:(PBRefMenuItem *)sender { int ret = 1; - [historyController.repository outputInWorkdirForArguments:[NSArray arrayWithObjects:@"checkout", [[sender ref] shortName], nil] retValue: &ret]; + [historyController.repository outputInWorkdirForArguments:[NSArray arrayWithObjects:@"checkout", [[sender refish] shortName], nil] retValue: &ret]; if (ret) { [[historyController.repository windowController] showMessageSheet:@"Checking out branch failed" infoText:@"There was an error checking out the branch. Perhaps your working directory is not clean?"]; return; @@ -71,10 +72,10 @@ - (void) tagInfo:(PBRefMenuItem *)sender { - NSString *message = [NSString stringWithFormat:@"Info for tag: %@", [[sender ref] shortName]]; + NSString *message = [NSString stringWithFormat:@"Info for tag: %@", [[sender refish] shortName]]; int ret = 1; - NSString *info = [historyController.repository outputInWorkdirForArguments:[NSArray arrayWithObjects:@"tag", @"-n50", @"-l", [[sender ref] shortName], nil] retValue: &ret]; + NSString *info = [historyController.repository outputInWorkdirForArguments:[NSArray arrayWithObjects:@"tag", @"-n50", @"-l", [[sender refish] shortName], nil] retValue: &ret]; if (!ret) { [[historyController.repository windowController] showMessageSheet:message infoText:info]; @@ -82,11 +83,19 @@ return; } -- (NSArray *) menuItemsForRef:(PBGitRef *)ref commit:(PBGitCommit *)commit +#pragma mark Contextual menus + +- (NSArray *) menuItemsForRef:(PBGitRef *)ref { - return [PBRefMenuItem defaultMenuItemsForRef:ref commit:commit target:self]; + return [PBRefMenuItem defaultMenuItemsForRef:ref inRepository:historyController.repository target:self]; } +- (NSArray *) menuItemsForCommit:(PBGitCommit *)commit +{ + return [PBRefMenuItem defaultMenuItemsForCommit:commit target:self]; +} + + # pragma mark Tableview delegate methods - (BOOL)tableView:(NSTableView *)tv writeRowsWithIndexes:(NSIndexSet *)rowIndexes toPasteboard:(NSPasteboard*)pboard diff --git a/PBRefMenuItem.h b/PBRefMenuItem.h index 0e3f455..9ad334d 100644 --- a/PBRefMenuItem.h +++ b/PBRefMenuItem.h @@ -11,13 +11,13 @@ #import "PBGitCommit.h" @interface PBRefMenuItem : NSMenuItem { - PBGitRef *ref; - PBGitCommit *commit; + id refish; } - -@property (retain) PBGitCommit *commit; -@property (retain) PBGitRef *ref; -+ (NSArray *)defaultMenuItemsForRef:(PBGitRef *)ref commit:(PBGitCommit *)commit target:(id)target; +@property (retain) id refish; + ++ (PBRefMenuItem *) separatorItem; ++ (NSArray *) defaultMenuItemsForRef:(PBGitRef *)ref inRepository:(PBGitRepository *)repo target:(id)target; ++ (NSArray *) defaultMenuItemsForCommit:(PBGitCommit *)commit target:(id)target; @end diff --git a/PBRefMenuItem.m b/PBRefMenuItem.m index 22aaae5..6740b52 100644 --- a/PBRefMenuItem.m +++ b/PBRefMenuItem.m @@ -10,37 +10,72 @@ @implementation PBRefMenuItem -@synthesize ref, commit; +@synthesize refish; -+ (NSArray *)defaultMenuItemsForRef:(PBGitRef *)ref commit:(PBGitCommit *)commit target:(id)target ++ (PBRefMenuItem *) itemWithTitle:(NSString *)title action:(SEL)selector enabled:(BOOL)isEnabled { - NSMutableArray *array = [NSMutableArray array]; - NSString *type = [ref type]; - if ([type isEqualToString:@"remote"]) - type = @"remote branch"; - else if ([type isEqualToString:@"head"]) - type = @"branch"; + if (!isEnabled) + selector = nil; - [array addObject:[[PBRefMenuItem alloc] initWithTitle:[@"Delete " stringByAppendingString:type] - action:@selector(removeRef:) - keyEquivalent: @""]]; - if ([type isEqualToString:@"branch"]) - [array addObject:[[PBRefMenuItem alloc] initWithTitle:@"Checkout branch" - action:@selector(checkoutRef:) - keyEquivalent: @""]]; + PBRefMenuItem *item = [[PBRefMenuItem alloc] initWithTitle:title action:selector keyEquivalent:@""]; + [item setEnabled:isEnabled]; + return item; +} - if ([type isEqualToString:@"tag"]) - [array addObject:[[PBRefMenuItem alloc] initWithTitle:@"View tag info" - action:@selector(tagInfo:) - keyEquivalent: @""]]; - - for (PBRefMenuItem *item in array) - { - [item setTarget: target]; - [item setRef: ref]; - [item setCommit:commit]; + ++ (PBRefMenuItem *) separatorItem +{ + PBRefMenuItem *item = (PBRefMenuItem *)[super separatorItem]; + return item; +} + + ++ (NSArray *) defaultMenuItemsForRef:(PBGitRef *)ref inRepository:(PBGitRepository *)repo target:(id)target +{ + if (!ref || !repo || !target) { + return nil; } - return array; + NSMutableArray *items = [NSMutableArray array]; + + NSString *targetRefName = [ref shortName]; + + PBGitRef *headRef = [[repo headRef] ref]; + BOOL isHead = [ref isEqualToRef:headRef]; + + // checkout ref + NSString *checkoutTitle = [@"Checkout " stringByAppendingString:targetRefName]; + [items addObject:[PBRefMenuItem itemWithTitle:checkoutTitle action:@selector(checkoutRef:) enabled:!isHead]]; + + // view tag info + if ([ref isTag]) + [items addObject:[PBRefMenuItem itemWithTitle:@"View tag info" action:@selector(tagInfo:) enabled:YES]]; + + // delete ref + [items addObject:[PBRefMenuItem separatorItem]]; + NSString *deleteTitle = [NSString stringWithFormat:@"Delete %@…", targetRefName]; + [items addObject:[PBRefMenuItem itemWithTitle:deleteTitle action:@selector(removeRef:) enabled:YES]]; + + for (PBRefMenuItem *item in items) { + [item setTarget:target]; + [item setRefish:ref]; + } + + return items; } + + ++ (NSArray *) defaultMenuItemsForCommit:(PBGitCommit *)commit target:(id)target +{ + NSMutableArray *items = [NSMutableArray array]; + + for (PBRefMenuItem *item in items) { + [item setTarget:target]; + [item setRefish:commit]; + } + + return items; +} + + @end diff --git a/PBWebHistoryController.m b/PBWebHistoryController.m index 1934b73..13d1cfe 100644 --- a/PBWebHistoryController.m +++ b/PBWebHistoryController.m @@ -115,7 +115,7 @@ contextMenuItemsForElement:(NSDictionary *)element for (PBGitRef *ref in historyController.webCommit.refs) { if ([[ref shortName] isEqualToString:selectedRefString]) - return [contextMenuDelegate menuItemsForRef:ref commit:historyController.webCommit]; + return [contextMenuDelegate menuItemsForRef:ref]; } NSLog(@"Could not find selected ref!"); return defaultMenuItems; From 9b39d34af40c9e103b24e862bf821183369be09b Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sat, 26 Dec 2009 21:03:55 -0700 Subject: [PATCH 26/90] The revision cell returns a menu for the commit if it doesn't for a ref. --- PBGitRevisionCell.m | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/PBGitRevisionCell.m b/PBGitRevisionCell.m index a79667a..6b0dfd2 100644 --- a/PBGitRevisionCell.m +++ b/PBGitRevisionCell.m @@ -284,19 +284,21 @@ return [self menu]; int i = [self indexAtX:[view convertPointFromBase:[event locationInWindow]].x - rect.origin.x]; - if (i < 0) - return [self menu]; - id ref = [[[self objectValue] refs] objectAtIndex:i]; - if (!ref) - return [self menu]; + id ref = nil; + if (i >= 0) + ref = [[[self objectValue] refs] objectAtIndex:i]; + + NSArray *items = nil; + if (ref) + items = [contextMenuDelegate menuItemsForRef:ref]; + else + items = [contextMenuDelegate menuItemsForCommit:[self objectValue]]; - NSArray *items = [contextMenuDelegate menuItemsForRef:ref]; NSMenu *menu = [[NSMenu alloc] init]; + [menu setAutoenablesItems:NO]; for (NSMenuItem *item in items) [menu addItem:item]; return menu; - - return [self menu]; } @end From 69c9c573978b69f46cb6ec75dee8a732bcdb3e4c Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sat, 26 Dec 2009 21:06:18 -0700 Subject: [PATCH 27/90] Add convenience method for showing an error sheet. --- PBGitWindowController.h | 1 + PBGitWindowController.m | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/PBGitWindowController.h b/PBGitWindowController.h index ae2298b..b262fed 100644 --- a/PBGitWindowController.h +++ b/PBGitWindowController.h @@ -31,6 +31,7 @@ - (void)useToolbar:(NSToolbar *)toolbar; - (void)showMessageSheet:(NSString *)messageText infoText:(NSString *)infoText; - (void)showErrorSheet:(NSError *)error; +- (void)showErrorSheetTitle:(NSString *)title message:(NSString *)message arguments:(NSArray *)arguments output:(NSString *)output; - (IBAction) showCommitView:(id)sender; - (IBAction) showHistoryView:(id)sender; diff --git a/PBGitWindowController.m b/PBGitWindowController.m index aba1987..7e277e1 100644 --- a/PBGitWindowController.m +++ b/PBGitWindowController.m @@ -137,6 +137,18 @@ [[NSAlert alertWithError:error] beginSheetModalForWindow: [self window] modalDelegate:self didEndSelector:nil contextInfo:nil]; } +- (void)showErrorSheetTitle:(NSString *)title message:(NSString *)message arguments:(NSArray *)arguments output:(NSString *)output +{ + NSString *command = [arguments componentsJoinedByString:@" "]; + NSString *reason = [NSString stringWithFormat:@"%@\n\ncommand: git %@\n%@", message, command, output]; + NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys: + title, NSLocalizedDescriptionKey, + reason, NSLocalizedRecoverySuggestionErrorKey, + nil]; + NSError *error = [NSError errorWithDomain:PBGitRepositoryErrorDomain code:0 userInfo:userInfo]; + [self showErrorSheet:error]; +} + #pragma mark - #pragma mark Toolbar Delegates From 9f048f6363cbba24f055d4f46ef5cd192ddf7f01 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Tue, 2 Feb 2010 19:41:24 -0700 Subject: [PATCH 28/90] Update Create Branch Update the methods for creating a branch. - create new class and xib PBCreateBranchSheet - remove old addRef: methods and iVars from PBRefController - remove old sheet from PBHistoryView.xib - put the implementation method in PBGitRepository - add a contextual menu item for commits - shows an error sheet - ask the commitController to rearrangeObjects to make sure the new branch is shown - switch from using "update-ref" to "branch" so that branches starting at a remote branch will track automatically (or not depending on the repo's settings) --- English.lproj/PBCreateBranchSheet.xib | 1052 ++++++++++++++++++ GitX.xcodeproj/project.pbxproj | 30 +- PBCreateBranchSheet.h | 37 + PBCreateBranchSheet.m | 88 ++ PBGitHistoryController.h | 3 + PBGitHistoryController.m | 14 + PBGitHistoryView.xib | 1458 ++++++++++++++++--------- PBGitRepository.h | 3 + PBGitRepository.m | 24 +- PBRefController.h | 8 +- PBRefController.m | 59 +- PBRefMenuItem.m | 6 + 12 files changed, 2222 insertions(+), 560 deletions(-) create mode 100644 English.lproj/PBCreateBranchSheet.xib create mode 100644 PBCreateBranchSheet.h create mode 100644 PBCreateBranchSheet.m diff --git a/English.lproj/PBCreateBranchSheet.xib b/English.lproj/PBCreateBranchSheet.xib new file mode 100644 index 0000000..f02b020 --- /dev/null +++ b/English.lproj/PBCreateBranchSheet.xib @@ -0,0 +1,1052 @@ + + + + 1050 + 10C540 + 732 + 1038.25 + 458.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 732 + + + YES + + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + YES + + YES + + + YES + + + + YES + + PBCreateBranchSheet + + + FirstResponder + + + NSApplication + + + 1 + 2 + {{196, 343}, {480, 167}} + 544736256 + Window + NSWindow + + {1.79769e+308, 1.79769e+308} + {480, 201} + + + 274 + + YES + + + 268 + {{17, 130}, {98, 17}} + + YES + + 68288064 + 272630784 + Create Branch + + LucidaGrande-Bold + 13 + 16 + + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + + + + 268 + {{29, 90}, {90, 17}} + + YES + + 68288064 + 71304192 + Branch name: + + LucidaGrande + 13 + 1044 + + + + + + + + + 266 + {{124, 88}, {327, 22}} + + YES + + -1804468671 + 272630784 + topic + + + YES + + 6 + System + textBackgroundColor + + 3 + MQA + + + + 6 + System + textColor + + + + + + + 289 + {{370, 12}, {96, 32}} + + YES + + 67239424 + 134217728 + Create + + + -2038284033 + 129 + + DQ + 200 + 25 + + + + + 289 + {{274, 12}, {96, 32}} + + YES + + 67239424 + 134217728 + Cancel + + + -2038284033 + 129 + + Gw + 200 + 25 + + + + + -2147483380 + {{29, 22}, {226, 17}} + + YES + + 68288064 + 272630784 + Label + + + + + 1 + MSAwIDAAA + + + + + {480, 167} + + + {{0, 0}, {1680, 1028}} + {480, 223} + {1.79769e+308, 1.79769e+308} + + + + + YES + + + window + + + + 31 + + + + delegate + + + + 32 + + + + createBranch: + + + + 33 + + + + closeCreateBranchSheet: + + + + 34 + + + + branchNameField + + + + 45 + + + + errorMessageField + + + + 47 + + + + + YES + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 1 + + + YES + + + + + + 2 + + + YES + + + + + + + + + + + 3 + + + YES + + + + + + 4 + + + + + 5 + + + YES + + + + + + 6 + + + + + 7 + + + YES + + + + + + 8 + + + + + 20 + + + YES + + + + + + 21 + + + + + 22 + + + YES + + + + + + 23 + + + + + 27 + + + YES + + + + + + 28 + + + + + + + YES + + YES + 1.IBEditorWindowLastContentRect + 1.IBPluginDependency + 1.IBWindowTemplateEditedContentRect + 1.NSWindowTemplate.visibleAtLaunch + 1.WindowOrigin + 1.editorWindowContentRectSynchronizationRect + 1.windowTemplate.hasMinSize + 1.windowTemplate.minSize + 2.IBPluginDependency + 20.IBPluginDependency + 21.IBPluginDependency + 22.IBPluginDependency + 23.IBPluginDependency + 27.IBPluginDependency + 28.IBPluginDependency + 3.IBPluginDependency + 4.IBPluginDependency + 5.IBPluginDependency + 6.IBPluginDependency + 7.IBPluginDependency + 8.IBPluginDependency + + + YES + {{667, 732}, {480, 167}} + com.apple.InterfaceBuilder.CocoaPlugin + {{667, 732}, {480, 167}} + + {196, 240} + {{202, 428}, {480, 270}} + + {480, 201} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + YES + + + YES + + + + + YES + + + YES + + + + 55 + + + + YES + + PBCreateBranchSheet + NSWindowController + + YES + + YES + closeCreateBranchSheet: + createBranch: + + + YES + id + id + + + + YES + + YES + branchNameField + errorMessageField + startingAtMenu + startingAtPopup + + + YES + NSTextField + NSTextField + NSMenu + NSPopUpButton + + + + IBProjectSource + PBCreateBranchSheet.h + + + + + YES + + NSActionCell + NSCell + + IBFrameworkSource + AppKit.framework/Headers/NSActionCell.h + + + + NSApplication + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSApplication.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSApplicationScripting.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSColorPanel.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSHelpManager.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSPageLayout.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSUserInterfaceItemSearching.h + + + + NSButton + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSButton.h + + + + NSButtonCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSButtonCell.h + + + + NSCell + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSCell.h + + + + NSControl + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSControl.h + + + + NSFormatter + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFormatter.h + + + + NSMenu + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenu.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSAccessibility.h + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDictionaryController.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDragging.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontManager.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontPanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSKeyValueBinding.h + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSNibLoading.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSOutlineView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSPasteboard.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSSavePanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSToolbarItem.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSView.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSError.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFileManager.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueObserving.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyedArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObject.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObjectScripting.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSPortCoder.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSRunLoop.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptObjectSpecifiers.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptWhoseTests.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSThread.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURL.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLConnection.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLDownload.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUAppcast.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUUpdater.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebDownload.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebEditingDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebFrameLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebJavaPlugIn.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPlugin.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPluginContainer.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPolicyDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebResourceLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebScriptObject.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebUIDelegate.h + + + + NSPopUpButton + NSButton + + IBFrameworkSource + AppKit.framework/Headers/NSPopUpButton.h + + + + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSInterfaceStyle.h + + + + NSResponder + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSResponder.h + + + + NSTextField + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSTextField.h + + + + NSTextFieldCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSTextFieldCell.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSClipView.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItem.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSRulerView.h + + + + NSView + NSResponder + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSDrawer.h + + + + NSWindow + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSWindow.h + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSWindowScripting.h + + + + NSWindowController + NSResponder + + showWindow: + id + + + IBFrameworkSource + AppKit.framework/Headers/NSWindowController.h + + + + + 0 + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + ../GitX.xcodeproj + 3 + + diff --git a/GitX.xcodeproj/project.pbxproj b/GitX.xcodeproj/project.pbxproj index d8bba5a..01cb711 100644 --- a/GitX.xcodeproj/project.pbxproj +++ b/GitX.xcodeproj/project.pbxproj @@ -44,6 +44,8 @@ 93CB42C20EAB7B2200530609 /* PBGitDefaults.m in Sources */ = {isa = PBXBuildFile; fileRef = 93CB42C10EAB7B2200530609 /* PBGitDefaults.m */; }; 93F7857F0EA3ABF100C1F443 /* PBCommitMessageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 93F7857E0EA3ABF100C1F443 /* PBCommitMessageView.m */; }; D26DC6450E782C9000C777B2 /* gitx.icns in Resources */ = {isa = PBXBuildFile; fileRef = D26DC6440E782C9000C777B2 /* gitx.icns */; }; + D854948610D5C01B0083B917 /* PBCreateBranchSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = D854948510D5C01B0083B917 /* PBCreateBranchSheet.m */; }; + D85B939310E3D8B4007F3C28 /* PBCreateBranchSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = D85B939210E3D8B4007F3C28 /* PBCreateBranchSheet.xib */; }; EB2A734A0FEE3F09006601CF /* PBCollapsibleSplitView.m in Sources */ = {isa = PBXBuildFile; fileRef = EB2A73490FEE3F09006601CF /* PBCollapsibleSplitView.m */; }; F50A411F0EBB874C00208746 /* mainSplitterBar.tiff in Resources */ = {isa = PBXBuildFile; fileRef = F50A411D0EBB874C00208746 /* mainSplitterBar.tiff */; }; F50A41200EBB874C00208746 /* mainSplitterDimple.tiff in Resources */ = {isa = PBXBuildFile; fileRef = F50A411E0EBB874C00208746 /* mainSplitterDimple.tiff */; }; @@ -208,7 +210,10 @@ 93F7857E0EA3ABF100C1F443 /* PBCommitMessageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCommitMessageView.m; sourceTree = ""; }; 93FCCBA80EA8AF450061B02B /* PBGitConfig.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitConfig.m; sourceTree = ""; }; D26DC6440E782C9000C777B2 /* gitx.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = gitx.icns; sourceTree = ""; }; - D85B94B710E576B4007F3C28 /* PBGitRefish.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitRefish.h; sourceTree = ""; }; + D854948410D5C01B0083B917 /* PBCreateBranchSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCreateBranchSheet.h; sourceTree = ""; }; + D854948510D5C01B0083B917 /* PBCreateBranchSheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCreateBranchSheet.m; sourceTree = ""; }; + D854949310D5C3E20083B917 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/PBCreateBranchSheet.xib; sourceTree = ""; }; + D85B93F610E51279007F3C28 /* PBGitRefish.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitRefish.h; sourceTree = ""; }; EB2A73480FEE3F09006601CF /* PBCollapsibleSplitView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCollapsibleSplitView.h; sourceTree = ""; }; EB2A73490FEE3F09006601CF /* PBCollapsibleSplitView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCollapsibleSplitView.m; sourceTree = ""; }; F50A411D0EBB874C00208746 /* mainSplitterBar.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = mainSplitterBar.tiff; path = Images/mainSplitterBar.tiff; sourceTree = ""; }; @@ -445,6 +450,7 @@ F5E424100EA3E4D60046E362 /* PBDiffWindow.xib */, F52BCE020E84208300AA3741 /* PBGitHistoryView.xib */, F59116E50E843BB50072CCB1 /* PBGitCommitView.xib */, + D85B939210E3D8B4007F3C28 /* PBCreateBranchSheet.xib */, 47DBDB680E94EF6500671A1E /* Preferences.xib */, F569AE920F2CBD7C00C2FFA7 /* Credits.html */, ); @@ -487,6 +493,15 @@ name = cli; sourceTree = ""; }; + D82F435F111B9C6D00A25A39 /* Sheets */ = { + isa = PBXGroup; + children = ( + D854948410D5C01B0083B917 /* PBCreateBranchSheet.h */, + D854948510D5C01B0083B917 /* PBCreateBranchSheet.m */, + ); + name = Sheets; + sourceTree = ""; + }; F50A41130EBB872D00208746 /* Widgets */ = { isa = PBXGroup; children = ( @@ -518,6 +533,7 @@ F5B161BB0EAB6E0C005A1DE1 /* Diff */, F5EF8C880E9D498F0050906B /* History */, F5E927F90E883EF600056E75 /* Commit */, + D82F435F111B9C6D00A25A39 /* Sheets */, 77C8280B06725ACE000B614F /* ApplicationController.h */, 77C8280C06725ACE000B614F /* ApplicationController.m */, 93CB42C00EAB7B2200530609 /* PBGitDefaults.h */, @@ -626,7 +642,7 @@ F5AD56770E79B78100EDAAFE /* PBCommitList.h */, F5AD56780E79B78100EDAAFE /* PBCommitList.m */, F5C6F6750E65FE2B00478D97 /* Graphing */, - D85B94B710E576B4007F3C28 /* PBGitRefish.h */, + D85B93F610E51279007F3C28 /* PBGitRefish.h */, F56524EE0E02D45200F03B52 /* PBGitCommit.h */, F56524EF0E02D45200F03B52 /* PBGitCommit.m */, F5C007730E731B48007B84B2 /* PBGitRef.h */, @@ -821,6 +837,7 @@ 47DBDB6A0E94EF6500671A1E /* Preferences.xib in Resources */, 47DBDBB10E94F6CA00671A1E /* Updates.png in Resources */, F569AE930F2CBD7C00C2FFA7 /* Credits.html in Resources */, + D85B939310E3D8B4007F3C28 /* PBCreateBranchSheet.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -940,6 +957,7 @@ F562C8870FE1766C000EC528 /* NSString_RegEx.m in Sources */, EB2A734A0FEE3F09006601CF /* PBCollapsibleSplitView.m in Sources */, F59F1DD5105C4FF300115F88 /* PBGitIndex.m in Sources */, + D854948610D5C01B0083B917 /* PBCreateBranchSheet.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1032,6 +1050,14 @@ name = RepositoryWindow.xib; sourceTree = ""; }; + D85B939210E3D8B4007F3C28 /* PBCreateBranchSheet.xib */ = { + isa = PBXVariantGroup; + children = ( + D854949310D5C3E20083B917 /* English */, + ); + name = PBCreateBranchSheet.xib; + sourceTree = ""; + }; F5B721C20E05CF7E00AF29DC /* MainMenu.xib */ = { isa = PBXVariantGroup; children = ( diff --git a/PBCreateBranchSheet.h b/PBCreateBranchSheet.h new file mode 100644 index 0000000..afded4f --- /dev/null +++ b/PBCreateBranchSheet.h @@ -0,0 +1,37 @@ +// +// PBCreateBranchSheet.h +// GitX +// +// Created by Nathan Kinsinger on 12/13/09. +// Copyright 2009 Nathan Kinsinger. All rights reserved. +// + +#import +#import "PBGitRefish.h" + + +@class PBGitRepository; + + +@interface PBCreateBranchSheet : NSWindowController { + PBGitRepository *repository; + id startRefish; + + NSTextField *branchNameField; + NSTextField *errorMessageField; +} + ++ (void) beginCreateBranchSheetAtRefish:(id )ref inRepository:(PBGitRepository *)repo; + + +- (IBAction) createBranch:(id)sender; +- (IBAction) closeCreateBranchSheet:(id)sender; + + +@property (retain) PBGitRepository *repository; +@property (retain) id startRefish; + +@property (assign) IBOutlet NSTextField *branchNameField; +@property (assign) IBOutlet NSTextField *errorMessageField; + +@end diff --git a/PBCreateBranchSheet.m b/PBCreateBranchSheet.m new file mode 100644 index 0000000..d7cb8cf --- /dev/null +++ b/PBCreateBranchSheet.m @@ -0,0 +1,88 @@ +// +// PBCreateBranchSheet.m +// GitX +// +// Created by Nathan Kinsinger on 12/13/09. +// Copyright 2009 Nathan Kinsinger. All rights reserved. +// + +#import "PBCreateBranchSheet.h" +#import "PBGitRepository.h" +#import "PBGitCommit.h" +#import "PBGitRef.h" + +@interface PBCreateBranchSheet () + +- (void) beginCreateBranchSheetAtRefish:(id )ref inRepository:(PBGitRepository *)repo; + +@end + + +@implementation PBCreateBranchSheet + + +@synthesize repository; +@synthesize startRefish; + +@synthesize branchNameField; +@synthesize errorMessageField; + + + +#pragma mark - +#pragma mark PBCreateBranchSheet + ++ (void) beginCreateBranchSheetAtRefish:(id )ref inRepository:(PBGitRepository *)repo +{ + PBCreateBranchSheet *sheet = [[self alloc] initWithWindowNibName:@"PBCreateBranchSheet"]; + [sheet beginCreateBranchSheetAtRefish:ref inRepository:repo]; +} + + +- (void) beginCreateBranchSheetAtRefish:(id )ref inRepository:(PBGitRepository *)repo +{ + self.repository = repo; + self.startRefish = ref; + + [self window]; // loads the window (if it wasn't already) + [self.errorMessageField setStringValue:@""]; + + [NSApp beginSheet:[self window] modalForWindow:[self.repository.windowController window] modalDelegate:self didEndSelector:nil contextInfo:NULL]; +} + + + +#pragma mark IBActions + +- (IBAction) createBranch:(id)sender +{ + NSString *name = [self.branchNameField stringValue]; + PBGitRef *ref = [PBGitRef refFromString:[@"refs/heads/" stringByAppendingString:name]]; + + if (![self.repository checkRefFormat:[ref ref]]) { + [self.errorMessageField setStringValue:@"Invalid name"]; + [self.errorMessageField setHidden:NO]; + return; + } + + if ([self.repository refExists:ref]) { + [self.errorMessageField setStringValue:@"Branch already exists"]; + [self.errorMessageField setHidden:NO]; + return; + } + + [self closeCreateBranchSheet:self]; + + [self.repository createBranch:name atRefish:self.startRefish]; +} + + +- (IBAction) closeCreateBranchSheet:(id)sender +{ + [NSApp endSheet:[self window]]; + [[self window] orderOut:self]; +} + + + +@end diff --git a/PBGitHistoryController.h b/PBGitHistoryController.h index fadb6cd..f45402b 100644 --- a/PBGitHistoryController.h +++ b/PBGitHistoryController.h @@ -51,6 +51,9 @@ - (void)showInFinderAction:(id)sender; - (void)openFilesAction:(id)sender; +// Repository Methods +- (IBAction) createBranch:(id)sender; + - (void) copyCommitInfo; - (BOOL) hasNonlinearPath; diff --git a/PBGitHistoryController.m b/PBGitHistoryController.m index a9fde36..abb7147 100644 --- a/PBGitHistoryController.m +++ b/PBGitHistoryController.m @@ -11,6 +11,7 @@ #import "PBGitGrapher.h" #import "PBGitRevisionCell.h" #import "PBCommitList.h" +#import "PBCreateBranchSheet.h" #define QLPreviewPanel NSClassFromString(@"QLPreviewPanel") @@ -321,4 +322,17 @@ return [sender frame].size.height; } + +#pragma mark Repository Methods + +- (IBAction) createBranch:(id)sender +{ + PBGitRef *currentRef = [repository.currentBranch ref]; + + if (!realCommit || [realCommit hasRef:currentRef]) + [PBCreateBranchSheet beginCreateBranchSheetAtRefish:currentRef inRepository:self.repository]; + else + [PBCreateBranchSheet beginCreateBranchSheetAtRefish:realCommit inRepository:self.repository]; +} + @end diff --git a/PBGitHistoryView.xib b/PBGitHistoryView.xib index 68b7789..1bdcd50 100644 --- a/PBGitHistoryView.xib +++ b/PBGitHistoryView.xib @@ -1,25 +1,35 @@ - + 1050 - 9L31a - 677 - 949.54 - 353.00 + 10C540 + 732 + 1038.25 + 458.00 + + YES + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.WebKitIBPlugin + + + YES + 732 + 732 + + YES - - YES - com.apple.WebKitIBPlugin - com.apple.InterfaceBuilderKit com.apple.InterfaceBuilder.CocoaPlugin + com.apple.WebKitIBPlugin YES - + YES @@ -91,7 +101,7 @@ PBWebHistoryController - + 274 YES @@ -106,14 +116,14 @@ 0 LucidaGrande - 1.300000e+01 + 13 1044 YES - 3.200000e+01 + 32 NSImage DetailViewTemplate @@ -175,16 +185,16 @@ YES SubjectColumn - 5.090000e+02 - 4.000000e+01 - 1.000000e+03 + 509 + 40 + 1000 - 75628032 - 0 + 75628096 + 2048 Subject LucidaGrande - 1.100000e+01 + 11 3100 @@ -213,7 +223,7 @@ controlBackgroundColor 3 - MC42NjY2NjY2OQA + MC42NjY2NjY2NjY3AA @@ -229,12 +239,12 @@ AuthorColumn - 1.900000e+02 - 4.000000e+01 - 1.000000e+03 + 190 + 40 + 1000 - 75628032 - 0 + 75628096 + 2048 Author @@ -255,12 +265,12 @@ DateColumn - 1.440000e+02 - 1.000000e+01 - 3.402823e+38 + 144 + 10 + 3.4028229999999999e+38 - 75628032 - 0 + 75628096 + 2048 Date @@ -289,12 +299,12 @@ SHAColumn - 6.400000e+01 - 1.000000e+01 - 3.402823e+38 + 64 + 10 + 3.4028229999999999e+38 - 75628032 - 0 + 75628096 + 2048 SHA @@ -315,8 +325,8 @@ YES - 3.000000e+00 - 2.000000e+00 + 3 + 2 6 @@ -327,13 +337,16 @@ MC41AA - 1.700000e+01 + 17 -683671552 + + CommitView 5 15 0 YES + 0 {{0, 17}, {852, 194}} @@ -350,8 +363,8 @@ _doScroller: - 3.700000e+01 - 1.947368e-01 + 37 + 0.19473679999999999 @@ -361,7 +374,7 @@ 1 _doScroller: - 2.193211e-01 + 0.21932109999999999 @@ -409,7 +422,7 @@ 274 YES - + YES Apple HTML pasteboard type Apple PDF pasteboard type @@ -437,7 +450,7 @@ YES - + YES WebKitDefaultFixedFontSize WebKitDefaultFontSize @@ -445,9 +458,9 @@ YES - - - + + + @@ -503,12 +516,12 @@ YES - 1.880000e+02 - 1.600000e+01 - 1.000000e+03 + 188 + 16 + 1000 - 75628032 - 0 + 75628096 + 2048 @@ -531,16 +544,19 @@ - 3.000000e+00 - 2.000000e+00 + 3 + 2 - 1.700000e+01 + 17 -624951296 + + 4 15 0 YES + 0 {{1, 1}, {191, 186}} @@ -557,18 +573,18 @@ _doScroller: - 9.948186e-01 + 0.9948186 - 256 + -2147483392 {{-100, -100}, {502, 15}} 1 _doScroller: - 4.504505e-03 - 9.980119e-01 + 0.0045045049999999998 + 0.99801189999999995 {208, 188} @@ -593,7 +609,7 @@ 2322 - {543, 112} + {543, 0} @@ -603,7 +619,7 @@ YES - + YES NSFont NSParagraphStyle @@ -612,7 +628,7 @@ YES Monaco - 1.000000e+01 + 10 16 @@ -620,100 +636,100 @@ YES - 0.000000e+00 + 0.0 - 5.600000e+01 + 56 - 1.120000e+02 + 112 - 1.680000e+02 + 168 - 2.240000e+02 + 224 - 2.800000e+02 + 280 - 3.360000e+02 + 336 - 3.920000e+02 + 392 - 4.480000e+02 + 448 - 5.040000e+02 + 504 - 5.600000e+02 + 560 - 6.160000e+02 + 616 - 6.720000e+02 + 672 - 7.280000e+02 + 728 - 7.840000e+02 + 784 - 8.400000e+02 + 840 - 8.960000e+02 + 896 - 9.520000e+02 + 952 - 1.008000e+03 + 1008 - 1.064000e+03 + 1064 - 1.120000e+03 + 1120 - 1.176000e+03 + 1176 - 1.232000e+03 + 1232 - 1.288000e+03 + 1288 - 1.344000e+03 + 1344 - 1.400000e+03 + 1400 - 1.456000e+03 + 1456 - 1.512000e+03 + 1512 - 1.568000e+03 + 1568 - 1.624000e+03 + 1624 - 1.680000e+03 + 1680 - 1.736000e+03 + 1736 @@ -729,16 +745,17 @@ - 5.430000e+02 + 543 1 11233 + 0 + - YES - + YES NSBackgroundColor NSColor @@ -759,10 +776,10 @@ - + YES - + YES NSColor NSUnderline @@ -773,7 +790,7 @@ 1 MCAwIDEAA - + @@ -802,18 +819,18 @@ _doScroller: - 3.003168e-02 + 0.030031680000000002 - 256 + -2147483392 {{-100, -100}, {87, 18}} 1 _doScroller: - 1.000000e+00 - 9.456522e-01 + 1 + 0.94565220000000005 {{209, 0}, {643, 188}} @@ -896,138 +913,11 @@ {852, 432} - NSView PBRefController - - 15 - 2 - {{196, 408}, {346, 102}} - 603979776 - New Branch Sheet - NSWindow - - {1000, 102} - {346, 102} - - - 256 - - YES - - - 266 - {{177, 60}, {149, 22}} - - YES - - -1804468671 - 272630784 - - - topic - - YES - - 6 - System - textBackgroundColor - - - - 6 - System - textColor - - - - - - - 268 - {{17, 62}, {155, 17}} - - YES - - 68288064 - 272630784 - Create a branch named: - - - - - - - - - 289 - {{236, 12}, {96, 32}} - - YES - - 67239424 - 134217728 - Create - - - -2038284033 - 129 - - DQ - 200 - 25 - - - - - 289 - {{140, 12}, {96, 32}} - - YES - - 67239424 - 134217728 - Cancel - - - -2038284033 - 129 - - Gw - 200 - 25 - - - - - 292 - {{17, 22}, {85, 17}} - - YES - - 68288064 - 272630784 - Invalid name - - - - - 1 - MSAwIDAAA - - - - - {346, 102} - - - {{0, 0}, {1680, 1028}} - {346, 124} - {1000, 124} - FFA3AADE-2DC8-4306-B161-4916009C1071 @@ -1041,7 +931,7 @@ 1 YES - + YES 1E431E79-1591-49E7-9E17-49497CA4622A 7FFB691C-2D2F-49A9-997F-AE1AE8BFF3F1 @@ -1073,7 +963,7 @@ YES - 4.000000e+01 + 40 NSImage HistoryViewTemplate @@ -1083,7 +973,7 @@ 0 - 4.000000e+01 + 40 NSImage CommitViewTemplate @@ -1131,15 +1021,20 @@ YES 1 - + + 6 + System + textBackgroundColor + + 130560 0 search + _searchFieldSearch: - 138690815 0 @@ -1154,7 +1049,7 @@ YES YES - + YES AXDescription NSAccessibilityEncodedAttributesValueType @@ -1162,13 +1057,13 @@ YES cancel - + + _searchFieldCancel: - 138690815 0 @@ -1312,7 +1207,7 @@ {134, 25} - {134, 25} + {134, 26} YES YES 0 @@ -1462,7 +1357,7 @@ arrangedObjects.author NSConditionallySetsEditable - + 2 @@ -1498,7 +1393,7 @@ arrangedObjects NSConditionallySetsEditable - + 2 @@ -1614,7 +1509,7 @@ arrangedObjects.path NSConditionallySetsEditable - + 2 @@ -1650,7 +1545,7 @@ arrangedObjects.dateString NSConditionallySetsEditable - + 2 @@ -1746,7 +1641,7 @@ filterPredicate YES - + YES NSDisplayName NSPredicateFormat @@ -1775,7 +1670,7 @@ filterPredicate YES - + YES NSDisplayName NSPredicateFormat @@ -1832,46 +1727,6 @@ 235 - - - performClick: - - - - 248 - - - - newBranchSheet - - - - 249 - - - - newBranchName - - - - 250 - - - - closeSheet: - - - - 252 - - - - saveSheet: - - - - 253 - contextMenuDelegate @@ -1888,14 +1743,6 @@ 260 - - - addRef: - - - - 264 - branchPopUp @@ -1917,7 +1764,7 @@ filterPredicate YES - + YES NSDisplayName NSPredicateFormat @@ -1934,14 +1781,6 @@ 271 - - - errorMessage - - - - 274 - historySplitView @@ -1979,15 +1818,15 @@ selection.textContents YES - + YES NSAllowsEditingMultipleValuesSelection NSConditionallySetsEditable YES - - + + 2 @@ -1995,51 +1834,57 @@ 291 + + + createBranch: + + + + 295 + YES 0 - - YES - + -2 - - RmlsZSdzIE93bmVyA + + File's Owner -1 - + First Responder -3 - + Application 38 - + 39 - + CommitsController 40 - + 46 @@ -2051,7 +1896,7 @@ - + 2 @@ -2242,85 +2087,7 @@ 231 - - - - 236 - - - YES - - - - - - 237 - - - YES - - - - - - - - - - 238 - - - YES - - - - - - 239 - - - YES - - - - - - 240 - - - YES - - - - - - 242 - - - YES - - - - - - 243 - - - - - 245 - - - - - 246 - - - - - 247 - - + 3 @@ -2416,7 +2183,7 @@ - + History Toolbar @@ -2551,20 +2318,6 @@ - - 272 - - - YES - - - - - - 273 - - - 287 @@ -2583,10 +2336,8 @@ YES - + YES - -1.IBPluginDependency - -2.IBPluginDependency -3.IBPluginDependency 10.IBPluginDependency 11.IBPluginDependency @@ -2624,23 +2375,6 @@ 223.IBPluginDependency 224.IBPluginDependency 225.IBPluginDependency - 231.IBPluginDependency - 236.IBEditorWindowLastContentRect - 236.IBWindowTemplateEditedContentRect - 236.NSWindowTemplate.visibleAtLaunch - 236.windowTemplate.hasMaxSize - 236.windowTemplate.hasMinSize - 236.windowTemplate.maxSize - 236.windowTemplate.minSize - 237.IBPluginDependency - 238.IBPluginDependency - 239.IBPluginDependency - 240.IBPluginDependency - 242.IBPluginDependency - 243.IBPluginDependency - 245.IBPluginDependency - 246.IBPluginDependency - 247.IBPluginDependency 261.IBAttributePlaceholdersKey 261.IBPluginDependency 262.IBPluginDependency @@ -2652,8 +2386,6 @@ 27.IBViewIntegration.shadowOffsetHeight 27.IBViewIntegration.shadowOffsetWidth 27.ImportedFromIB2 - 272.IBPluginDependency - 273.IBPluginDependency 28.IBPluginDependency 28.IBShouldRemoveOnLegacySave 287.IBPluginDependency @@ -2681,7 +2413,6 @@ 39.ImportedFromIB2 4.IBAttributePlaceholdersKey 4.IBPluginDependency - 40.IBPluginDependency 46.IBEditorWindowLastContentRect 46.IBPluginDependency 47.IBPluginDependency @@ -2698,8 +2429,6 @@ YES com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilderKit - com.apple.InterfaceBuilderKit com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin {{312, 366}, {616, 227}} @@ -2729,13 +2458,11 @@ PBCollapsibleSplitView {{312, 577}, {852, 384}} com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin YES - - YES - + YES @@ -2744,23 +2471,6 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - {{504, 612}, {346, 102}} - {{504, 612}, {346, 102}} - - - - {1000, 102} - {346, 102} - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin ToolTip @@ -2774,49 +2484,44 @@ com.apple.InterfaceBuilder.CocoaPlugin PBCommitList com.apple.InterfaceBuilder.CocoaPlugin - + - - - + + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - + PBUnsortableTableHeader com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin PBGitRevisionCell com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - + YES - - YES - + YES com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin {{321, 67}, {852, 432}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -2833,9 +2538,7 @@ YES - - YES - + YES @@ -2843,15 +2546,13 @@ YES - - YES - + YES - 291 + 295 @@ -2869,7 +2570,7 @@ NSTableView YES - + YES controller webController @@ -2892,8 +2593,9 @@ PBViewController YES - + YES + createBranch: openFilesAction: openSelectedFile: refresh: @@ -2915,11 +2617,12 @@ id id id + id YES - + YES commitController commitList @@ -2958,7 +2661,7 @@ NSActionCell YES - + YES contextMenuDelegate controller @@ -2999,42 +2702,32 @@ NSObject YES - + YES - addRef: changeBranch: - closeSheet: - saveSheet: + createBranch: YES - id NSMenuItem - id - id + PBRefMenuItem YES - + YES branchPopUp commitController commitList - errorMessage historyController - newBranchName - newBranchSheet YES NSPopUpButton NSArrayController PBCommitList - NSTextField PBGitHistoryController - NSTextField - NSWindow @@ -3042,6 +2735,18 @@ PBRefController.h + + PBRefMenuItem + NSMenuItem + + refish + id + + + IBProjectSource + PBRefMenuItem.h + + PBUnsortableTableHeader NSTableHeaderView @@ -3071,7 +2776,7 @@ NSObject YES - + YES repository view @@ -3092,7 +2797,7 @@ PBWebController YES - + YES contextMenuDelegate historyController @@ -3121,8 +2826,755 @@ + + YES + + NSActionCell + NSCell + + IBFrameworkSource + AppKit.framework/Headers/NSActionCell.h + + + + NSApplication + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSApplication.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSApplicationScripting.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSColorPanel.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSHelpManager.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSPageLayout.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSUserInterfaceItemSearching.h + + + + NSArrayController + NSObjectController + + IBFrameworkSource + AppKit.framework/Headers/NSArrayController.h + + + + NSButton + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSButton.h + + + + NSButtonCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSButtonCell.h + + + + NSCell + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSCell.h + + + + NSControl + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSControl.h + + + + NSController + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSController.h + + + + NSFormatter + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFormatter.h + + + + NSManagedObjectContext + NSObject + + IBFrameworkSource + CoreData.framework/Headers/NSManagedObjectContext.h + + + + NSMenu + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenu.h + + + + NSMenuItem + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItem.h + + + + NSMenuItemCell + NSButtonCell + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItemCell.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSAccessibility.h + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDictionaryController.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDragging.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontManager.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontPanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSKeyValueBinding.h + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSNibLoading.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSOutlineView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSPasteboard.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSSavePanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSToolbarItem.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSView.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSError.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFileManager.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueObserving.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyedArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObject.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObjectScripting.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSPortCoder.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSRunLoop.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptObjectSpecifiers.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptWhoseTests.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSThread.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURL.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLConnection.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLDownload.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUAppcast.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUUpdater.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebDownload.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebEditingDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebFrameLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebJavaPlugIn.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPlugin.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPluginContainer.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPolicyDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebResourceLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebScriptObject.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebUIDelegate.h + + + + NSObjectController + NSController + + IBFrameworkSource + AppKit.framework/Headers/NSObjectController.h + + + + NSOutlineView + NSTableView + + + + NSPopUpButton + NSButton + + IBFrameworkSource + AppKit.framework/Headers/NSPopUpButton.h + + + + NSPopUpButtonCell + NSMenuItemCell + + IBFrameworkSource + AppKit.framework/Headers/NSPopUpButtonCell.h + + + + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSInterfaceStyle.h + + + + NSResponder + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSResponder.h + + + + NSScrollView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSScrollView.h + + + + NSScroller + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSScroller.h + + + + NSSearchField + NSTextField + + IBFrameworkSource + AppKit.framework/Headers/NSSearchField.h + + + + NSSearchFieldCell + NSTextFieldCell + + IBFrameworkSource + AppKit.framework/Headers/NSSearchFieldCell.h + + + + NSSegmentedCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSSegmentedCell.h + + + + NSSegmentedControl + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSSegmentedControl.h + + + + NSSplitView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSSplitView.h + + + + NSTabView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSTabView.h + + + + NSTabViewItem + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTabViewItem.h + + + + NSTableColumn + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableColumn.h + + + + NSTableHeaderView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSTableHeaderView.h + + + + NSTableView + NSControl + + + + NSText + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSText.h + + + + NSTextField + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSTextField.h + + + + NSTextFieldCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSTextFieldCell.h + + + + NSTextView + NSText + + IBFrameworkSource + AppKit.framework/Headers/NSTextView.h + + + + NSToolbar + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSToolbar.h + + + + NSToolbarItem + NSObject + + + + NSTreeController + NSObjectController + + IBFrameworkSource + AppKit.framework/Headers/NSTreeController.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSClipView.h + + + + NSView + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSRulerView.h + + + + NSView + NSResponder + + + + NSViewController + NSResponder + + view + NSView + + + IBFrameworkSource + AppKit.framework/Headers/NSViewController.h + + + + WebView + NSView + + YES + + YES + goBack: + goForward: + makeTextLarger: + makeTextSmaller: + makeTextStandardSize: + reload: + reloadFromOrigin: + stopLoading: + takeStringURLFrom: + toggleContinuousSpellChecking: + toggleSmartInsertDelete: + + + YES + id + id + id + id + id + id + id + id + id + id + id + + + + IBFrameworkSource + WebKit.framework/Headers/WebView.h + + + 0 + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES GitX.xcodeproj 3 diff --git a/PBGitRepository.h b/PBGitRepository.h index c8bd680..e78a36f 100644 --- a/PBGitRepository.h +++ b/PBGitRepository.h @@ -10,6 +10,7 @@ #import "PBGitRevList.h" #import "PBGitRevSpecifier.h" #import "PBGitConfig.h" +#import "PBGitRefish.h" extern NSString* PBGitRepositoryErrorDomain; @@ -28,6 +29,8 @@ extern NSString* PBGitRepositoryErrorDomain; PBGitRevSpecifier *_headRef; // Caching } +- (BOOL) createBranch:(NSString *)branchName atRefish:(id )ref; + - (NSFileHandle*) handleForCommand:(NSString*) cmd; - (NSFileHandle*) handleForArguments:(NSArray*) args; - (NSFileHandle *) handleInWorkDirForArguments:(NSArray *)args; diff --git a/PBGitRepository.m b/PBGitRepository.m index 477d15b..a9ed922 100644 --- a/PBGitRepository.m +++ b/PBGitRepository.m @@ -424,7 +424,29 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; return [PBGitBinary path]; return nil; -} +} + +#pragma mark Repository commands + +- (BOOL) createBranch:(NSString *)branchName atRefish:(id )ref +{ + if (!branchName || !ref) + return NO; + + int retValue = 1; + NSArray *arguments = [NSArray arrayWithObjects:@"branch", branchName, [ref refishName], nil]; + NSString *output = [self outputInWorkdirForArguments:arguments retValue:&retValue]; + if (retValue) { + NSString *message = [NSString stringWithFormat:@"There was an error creating the branch '%@' at %@ '%@'.", branchName, [ref refishType], [ref shortName]]; + [self.windowController showErrorSheetTitle:@"Create Branch failed!" message:message arguments:arguments output:output]; + return NO; + } + + [self reloadRefs]; + return YES; +} + +#pragma mark low level - (int) returnValueForCommand:(NSString *)cmd { diff --git a/PBRefController.h b/PBRefController.h index 163c996..2c9ed59 100644 --- a/PBRefController.h +++ b/PBRefController.h @@ -20,16 +20,10 @@ IBOutlet NSArrayController *commitController; IBOutlet PBCommitList *commitList; - IBOutlet NSWindow *newBranchSheet; - IBOutlet NSTextField *newBranchName; - IBOutlet NSTextField *errorMessage; - IBOutlet NSPopUpButton *branchPopUp; } -- (IBAction)addRef:(id)sender; -- (IBAction)closeSheet:(id) sender; -- (IBAction)saveSheet:(id) sender; +- (void) createBranch:(PBRefMenuItem *)sender; - (NSArray *) menuItemsForRef:(PBGitRef *)ref; - (NSArray *) menuItemsForCommit:(PBGitCommit *)commit; diff --git a/PBRefController.m b/PBRefController.m index 63483be..781a656 100644 --- a/PBRefController.m +++ b/PBRefController.m @@ -9,6 +9,7 @@ #import "PBRefController.h" #import "PBGitRevisionCell.h" #import "PBRefMenuItem.h" +#import "PBCreateBranchSheet.h" @implementation PBRefController @@ -24,6 +25,7 @@ - (void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { if ([(NSString *)context isEqualToString: @"branchChange"]) { + [commitController rearrangeObjects]; [self updateBranchMenu]; } else if ([(NSString *)context isEqualToString:@"currentBranchChange"]) { @@ -34,6 +36,16 @@ } } + +#pragma mark Create Branch + +- (void) createBranch:(PBRefMenuItem *)sender +{ + id refish = [sender refish]; + [PBCreateBranchSheet beginCreateBranchSheetAtRefish:refish inRepository:historyController.repository]; +} + + - (void) removeRefSheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo { if (returnCode == NSAlertDefaultReturn) { @@ -179,53 +191,6 @@ return YES; } -# pragma mark Add ref methods --(void)addRef:(id)sender -{ - [errorMessage setStringValue:@""]; - [NSApp beginSheet:newBranchSheet - modalForWindow:[[historyController view] window] - modalDelegate:NULL - didEndSelector:NULL - contextInfo:NULL]; -} - --(void)saveSheet:(id) sender -{ - NSString *branchName = [@"refs/heads/" stringByAppendingString:[newBranchName stringValue]]; - - if ([[commitController selectedObjects] count] == 0) - return; - - PBGitCommit *commit = [[commitController selectedObjects] objectAtIndex:0]; - - int retValue = 1; - [historyController.repository outputForArguments:[NSArray arrayWithObjects:@"check-ref-format", branchName, nil] retValue:&retValue]; - if (retValue != 0) { - [errorMessage setStringValue:@"Invalid name"]; - return; - } - - retValue = 1; - [historyController.repository outputForArguments:[NSArray arrayWithObjects:@"update-ref", @"-mCreate branch from GitX", branchName, [commit realSha], @"0000000000000000000000000000000000000000", NULL] retValue:&retValue]; - if (retValue) - { - [errorMessage setStringValue:@"Branch exists"]; - return; - } - [historyController.repository addBranch:[[PBGitRevSpecifier alloc] initWithRef:[PBGitRef refFromString:branchName]]]; - [self closeSheet:sender]; - [commit addRef:[PBGitRef refFromString:branchName]]; - [commitController rearrangeObjects]; -} - --(void)closeSheet:(id) sender -{ - [NSApp endSheet:newBranchSheet]; - [newBranchName setStringValue:@""]; - [newBranchSheet orderOut:self]; -} - # pragma mark Branches menu - (void) updateBranchMenu diff --git a/PBRefMenuItem.m b/PBRefMenuItem.m index 6740b52..11b5a77 100644 --- a/PBRefMenuItem.m +++ b/PBRefMenuItem.m @@ -46,6 +46,10 @@ // checkout ref NSString *checkoutTitle = [@"Checkout " stringByAppendingString:targetRefName]; [items addObject:[PBRefMenuItem itemWithTitle:checkoutTitle action:@selector(checkoutRef:) enabled:!isHead]]; + [items addObject:[PBRefMenuItem separatorItem]]; + + // create branch + [items addObject:[PBRefMenuItem itemWithTitle:@"Create branch…" action:@selector(createBranch:) enabled:YES]]; // view tag info if ([ref isTag]) @@ -69,6 +73,8 @@ { NSMutableArray *items = [NSMutableArray array]; + [items addObject:[PBRefMenuItem itemWithTitle:@"Create Branch…" action:@selector(createBranch:) enabled:YES]]; + for (PBRefMenuItem *item in items) { [item setTarget:target]; [item setRefish:commit]; From db0bb87340271e90a4c10c271e646a7ac80c06f0 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Wed, 3 Feb 2010 18:40:01 -0700 Subject: [PATCH 29/90] Add Open in Terminal to the Repository menu. Code came from B. Ohr at: http://groups.google.com/group/gitx/browse_thread/thread/a103df7ef7c1f037 Added quotes to workingDirectory path to support paths with spaces. --- English.lproj/MainMenu.xib | 1328 ++++++++++++++++++++++++++++---- GitX.xcodeproj/project.pbxproj | 6 + PBGitWindowController.h | 1 + PBGitWindowController.m | 11 + Terminal.h | 159 ++++ 5 files changed, 1357 insertions(+), 148 deletions(-) create mode 100644 Terminal.h diff --git a/English.lproj/MainMenu.xib b/English.lproj/MainMenu.xib index 8dbbc74..cf17779 100644 --- a/English.lproj/MainMenu.xib +++ b/English.lproj/MainMenu.xib @@ -1,14 +1,18 @@ - + 1050 - 9G55 - 677 - 949.43 - 353.00 + 10C540 + 732 + 1038.25 + 458.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 732 + YES - + YES @@ -16,7 +20,7 @@ YES - + YES @@ -80,7 +84,7 @@ - RW5hYmxlIFRlcm1pbmFsIFVzYWdl4oCmA + Enable Terminal Usage… 1048576 2147483647 @@ -89,7 +93,7 @@ - UHJlZmVyZW5jZXPigKY + Preferences… , 1048576 2147483647 @@ -98,7 +102,7 @@ - Q2hlY2sgZm9yIFVwZGF0ZXPigKY + Check for Updates… 2147483647 @@ -213,7 +217,7 @@ YES - TmV34oCmA + New… n 1048576 2147483647 @@ -222,7 +226,7 @@ - T3BlbuKApg + Open… o 1048576 2147483647 @@ -288,7 +292,7 @@ - U2F2ZSBBc+KApg + Save As… S 1048576 2147483647 @@ -316,7 +320,7 @@ - UGFnZSBTZXR1cOKApg + Page Setup… P 1048576 2147483647 @@ -325,7 +329,7 @@ - UHJpbnTigKY + Print… p 1048576 2147483647 @@ -452,7 +456,7 @@ YES - RmluZOKApg + Find… f 1048576 2147483647 @@ -517,7 +521,7 @@ YES - U2hvdyBTcGVsbGluZ+KApg + Show Spelling… : 1048576 2147483647 @@ -632,6 +636,48 @@ + + + Repository + + 2147483647 + + + submenuAction: + + Repository + + YES + + + Create Branch + b + 1048576 + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Open In Terminal + + 2147483647 + + + + + + View @@ -656,7 +702,7 @@ - Q3VzdG9taXplIFRvb2xiYXLigKY + Customize Toolbar… 1048576 2147483647 @@ -1220,34 +1266,48 @@ 934 + + + createBranch: + + + + 941 + + + + openInTerminal: + + + + 944 + YES 0 - - YES - + -2 - - RmlsZSdzIE93bmVyA + + File's Owner -1 - + First Responder -3 - + Application @@ -1261,8 +1321,9 @@ + - + MainMenu @@ -1792,7 +1853,7 @@ 205 - + ApplicationController @@ -1818,7 +1879,7 @@ 908 - + 909 @@ -1828,7 +1889,7 @@ 912 - + 915 @@ -1843,7 +1904,7 @@ 918 - + 919 @@ -1865,14 +1926,47 @@ + + 936 + + + YES + + + + + + 937 + + + YES + + + + + + + + 938 + + + + + 942 + + + + + 943 + + + YES - + YES - -1.IBPluginDependency - -2.IBPluginDependency -3.IBPluginDependency -3.ImportedFromIB2 103.IBPluginDependency @@ -1886,6 +1980,7 @@ 112.ImportedFromIB2 124.IBPluginDependency 124.ImportedFromIB2 + 125.IBEditorWindowLastContentRect 125.IBPluginDependency 125.ImportedFromIB2 126.IBPluginDependency @@ -1920,6 +2015,7 @@ 157.ImportedFromIB2 158.IBPluginDependency 158.ImportedFromIB2 + 159.IBEditorWindowLastContentRect 159.IBPluginDependency 159.ImportedFromIB2 160.IBPluginDependency @@ -1950,6 +2046,7 @@ 174.ImportedFromIB2 184.IBPluginDependency 184.ImportedFromIB2 + 185.IBEditorWindowLastContentRect 185.IBPluginDependency 185.ImportedFromIB2 187.IBPluginDependency @@ -1960,12 +2057,12 @@ 191.ImportedFromIB2 196.IBPluginDependency 196.ImportedFromIB2 - 205.IBPluginDependency 205.ImportedFromIB2 212.IBPluginDependency 212.ImportedFromIB2 214.IBPluginDependency 214.ImportedFromIB2 + 215.IBEditorWindowLastContentRect 215.IBPluginDependency 215.ImportedFromIB2 216.IBPluginDependency @@ -1976,6 +2073,7 @@ 219.ImportedFromIB2 224.IBPluginDependency 224.ImportedFromIB2 + 225.IBEditorWindowLastContentRect 225.IBPluginDependency 225.ImportedFromIB2 227.IBPluginDependency @@ -2045,189 +2143,195 @@ 848.IBPluginDependency 851.IBPluginDependency 852.IBPluginDependency - 908.IBPluginDependency 909.IBPluginDependency 912.IBPluginDependency 915.IBPluginDependency 916.IBPluginDependency - 918.IBPluginDependency 919.IBPluginDependency 927.IBPluginDependency 928.IBPluginDependency 929.IBPluginDependency + 936.IBPluginDependency + 937.IBEditorWindowLastContentRect + 937.IBPluginDependency + 938.IBPluginDependency + 942.IBPluginDependency + 943.IBPluginDependency YES com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + {{880, 713}, {135, 23}} com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - - {{789, 713}, {138, 23}} + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + + {{778, 673}, {143, 23}} com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + + {{864, 473}, {238, 103}} com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + + {{624, 493}, {240, 243}} com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - {{370, 623}, {243, 243}} - com.apple.InterfaceBuilder.CocoaPlugin - + {{455, 493}, {243, 243}} com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + + {{864, 473}, {272, 83}} com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + + {{864, 473}, {212, 63}} com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + + {{864, 473}, {150, 43}} com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + + {{809, 663}, {194, 73}} com.apple.InterfaceBuilder.CocoaPlugin - - {{718, 767}, {197, 73}} + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + + {{521, 736}, {420, 20}} com.apple.InterfaceBuilder.CocoaPlugin - - {{521, 736}, {329, 20}} - com.apple.InterfaceBuilder.CocoaPlugin - + {{297, 739}, {329, 20}} com.apple.InterfaceBuilder.CocoaPlugin - - {{668, 647}, {234, 193}} + + {{759, 543}, {231, 193}} com.apple.InterfaceBuilder.CocoaPlugin - + {{499, 623}, {234, 113}} com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - - {{533, 513}, {262, 223}} + + {{533, 513}, {259, 223}} com.apple.InterfaceBuilder.CocoaPlugin - + {{309, 536}, {262, 203}} com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - - {{582, 533}, {199, 203}} + + {{582, 533}, {196, 203}} com.apple.InterfaceBuilder.CocoaPlugin - + {{358, 536}, {199, 203}} com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -2241,14 +2345,16 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + {{668, 683}, {192, 53}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin YES - - YES - + YES @@ -2256,15 +2362,13 @@ YES - - YES - + YES - 934 + 944 @@ -2274,12 +2378,12 @@ NSObject YES - + YES installCliTool: openPreferencesWindow: - showAboutPanel: saveAction: + showAboutPanel: showHelp: @@ -2293,7 +2397,7 @@ YES - + YES firstResponder window @@ -2322,7 +2426,7 @@ NSObject YES - + YES setDetailedView: setRawView: @@ -2341,14 +2445,22 @@ - PBGitCommitController - PBViewController + PBCollapsibleSplitView + PBNiceSplitView + + IBProjectSource + PBCollapsibleSplitView.h + + + + PBCreateBranchSheet + NSWindowController YES - + YES - commit: - refresh: + closeCreateBranchSheet: + createBranch: YES @@ -2358,9 +2470,52 @@ YES - + + YES + branchName + errorMessage + isTrackingBranch + remoteMenu + remotePopup + + + YES + NSTextField + NSTextField + NSButton + NSMenu + NSPopUpButton + + + + IBProjectSource + PBCreateBranchSheet.h + + + + PBGitCommitController + PBViewController + + YES + + YES + commit: + refresh: + signOff: + + + YES + id + id + id + + + + YES + YES cachedFilesController + commitButton commitMessageView indexController unstagedFilesController @@ -2369,10 +2524,11 @@ YES NSArrayController + NSButton NSTextView - id + PBGitIndexController NSArrayController - id + PBWebChangesController @@ -2385,13 +2541,17 @@ PBViewController YES - + YES + createBranch: + openFilesAction: openSelectedFile: refresh: setDetailedView: setRawView: setTreeView: + showCommitsFromTree: + showInFinderAction: toggleQuickView: @@ -2402,15 +2562,20 @@ id id id + id + id + id + id YES - + YES commitController commitList fileBrowser + historySplitView searchField treeController webView @@ -2420,6 +2585,7 @@ NSArrayController NSTableView NSOutlineView + PBCollapsibleSplitView NSSearchField NSTreeController id @@ -2430,13 +2596,54 @@ PBGitHistoryController.h + + PBGitIndexController + NSObject + + YES + + YES + rowClicked: + tableClicked: + + + YES + NSCell + NSTableView + + + + YES + + YES + commitController + stagedFilesController + stagedTable + unstagedFilesController + unstagedTable + + + YES + PBGitCommitController + NSArrayController + NSTableView + NSArrayController + NSTableView + + + + IBProjectSource + PBGitIndexController.h + + PBGitWindowController NSWindowController YES - + YES + openInTerminal: showCommitView: showHistoryView: @@ -2444,6 +2651,7 @@ YES id id + id @@ -2460,7 +2668,7 @@ NSWindowController YES - + YES openSelectedFile: refresh: @@ -2481,7 +2689,7 @@ YES - + YES commitController commitList @@ -2501,6 +2709,14 @@ + + PBNiceSplitView + NSSplitView + + IBProjectSource + PBNiceSplitView.h + + PBRepositoryDocumentController NSDocumentController @@ -2529,6 +2745,52 @@ PBViewController.h + + PBWebChangesController + PBWebController + + YES + + YES + cachedFilesController + controller + indexController + unstagedFilesController + + + YES + NSArrayController + PBGitCommitController + PBGitIndexController + NSArrayController + + + + IBProjectSource + PBWebChangesController.h + + + + PBWebController + NSObject + + YES + + YES + repository + view + + + YES + id + WebView + + + + IBProjectSource + PBWebController.h + + YES @@ -2553,8 +2815,778 @@ + + YES + + NSApplication + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSApplication.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSApplicationScripting.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSColorPanel.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSHelpManager.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSPageLayout.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSUserInterfaceItemSearching.h + + + + NSArrayController + NSObjectController + + IBFrameworkSource + AppKit.framework/Headers/NSArrayController.h + + + + NSBrowser + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSBrowser.h + + + + NSButton + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSButton.h + + + + NSCell + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSCell.h + + + + NSControl + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSControl.h + + + + NSController + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSController.h + + + + NSDocument + NSObject + + YES + + YES + printDocument: + revertDocumentToSaved: + runPageLayout: + saveDocument: + saveDocumentAs: + saveDocumentTo: + + + YES + id + id + id + id + id + id + + + + IBFrameworkSource + AppKit.framework/Headers/NSDocument.h + + + + NSDocument + + IBFrameworkSource + AppKit.framework/Headers/NSDocumentScripting.h + + + + NSDocumentController + NSObject + + YES + + YES + clearRecentDocuments: + newDocument: + openDocument: + saveAllDocuments: + + + YES + id + id + id + id + + + + IBFrameworkSource + AppKit.framework/Headers/NSDocumentController.h + + + + NSFormatter + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFormatter.h + + + + NSManagedObjectContext + NSObject + + IBFrameworkSource + CoreData.framework/Headers/NSManagedObjectContext.h + + + + NSMatrix + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSMatrix.h + + + + NSMenu + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenu.h + + + + NSMenuItem + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItem.h + + + + NSMovieView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSMovieView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSAccessibility.h + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDictionaryController.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDragging.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontManager.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontPanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSKeyValueBinding.h + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSNibLoading.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSOutlineView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSPasteboard.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSSavePanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSToolbarItem.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSView.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSError.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFileManager.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueObserving.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyedArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObject.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObjectScripting.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSPortCoder.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSRunLoop.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptObjectSpecifiers.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptWhoseTests.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSThread.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURL.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLConnection.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLDownload.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUAppcast.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUUpdater.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebDownload.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebEditingDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebFrameLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebJavaPlugIn.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPlugin.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPluginContainer.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPolicyDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebResourceLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebScriptObject.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebUIDelegate.h + + + + NSObjectController + NSController + + IBFrameworkSource + AppKit.framework/Headers/NSObjectController.h + + + + NSOutlineView + NSTableView + + + + NSPopUpButton + NSButton + + IBFrameworkSource + AppKit.framework/Headers/NSPopUpButton.h + + + + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSInterfaceStyle.h + + + + NSResponder + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSResponder.h + + + + NSSearchField + NSTextField + + IBFrameworkSource + AppKit.framework/Headers/NSSearchField.h + + + + NSSplitView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSSplitView.h + + + + NSTableView + NSControl + + + + NSText + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSText.h + + + + NSTextField + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSTextField.h + + + + NSTextView + NSText + + IBFrameworkSource + AppKit.framework/Headers/NSTextView.h + + + + NSToolbar + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSToolbar.h + + + + NSTreeController + NSObjectController + + IBFrameworkSource + AppKit.framework/Headers/NSTreeController.h + + + + NSUserDefaultsController + NSController + + IBFrameworkSource + AppKit.framework/Headers/NSUserDefaultsController.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSClipView.h + + + + NSView + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSRulerView.h + + + + NSView + NSResponder + + + + NSViewController + NSResponder + + view + NSView + + + IBFrameworkSource + AppKit.framework/Headers/NSViewController.h + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSDrawer.h + + + + NSWindow + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSWindow.h + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSWindowScripting.h + + + + NSWindowController + NSResponder + + showWindow: + id + + + IBFrameworkSource + AppKit.framework/Headers/NSWindowController.h + + + + SUUpdater + NSObject + + checkForUpdates: + id + + + delegate + id + + + + + WebView + NSView + + YES + + YES + goBack: + goForward: + makeTextLarger: + makeTextSmaller: + makeTextStandardSize: + reload: + reloadFromOrigin: + stopLoading: + takeStringURLFrom: + toggleContinuousSpellChecking: + toggleSmartInsertDelete: + + + YES + id + id + id + id + id + id + id + id + id + id + id + + + + IBFrameworkSource + WebKit.framework/Headers/WebView.h + + + 0 + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES ../GitX.xcodeproj 3 diff --git a/GitX.xcodeproj/project.pbxproj b/GitX.xcodeproj/project.pbxproj index 01cb711..5d2238f 100644 --- a/GitX.xcodeproj/project.pbxproj +++ b/GitX.xcodeproj/project.pbxproj @@ -46,6 +46,7 @@ D26DC6450E782C9000C777B2 /* gitx.icns in Resources */ = {isa = PBXBuildFile; fileRef = D26DC6440E782C9000C777B2 /* gitx.icns */; }; D854948610D5C01B0083B917 /* PBCreateBranchSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = D854948510D5C01B0083B917 /* PBCreateBranchSheet.m */; }; D85B939310E3D8B4007F3C28 /* PBCreateBranchSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = D85B939210E3D8B4007F3C28 /* PBCreateBranchSheet.xib */; }; + D8E3B2B810DC9FB2001096A3 /* ScriptingBridge.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D8E3B2B710DC9FB2001096A3 /* ScriptingBridge.framework */; }; EB2A734A0FEE3F09006601CF /* PBCollapsibleSplitView.m in Sources */ = {isa = PBXBuildFile; fileRef = EB2A73490FEE3F09006601CF /* PBCollapsibleSplitView.m */; }; F50A411F0EBB874C00208746 /* mainSplitterBar.tiff in Resources */ = {isa = PBXBuildFile; fileRef = F50A411D0EBB874C00208746 /* mainSplitterBar.tiff */; }; F50A41200EBB874C00208746 /* mainSplitterDimple.tiff in Resources */ = {isa = PBXBuildFile; fileRef = F50A411E0EBB874C00208746 /* mainSplitterDimple.tiff */; }; @@ -210,10 +211,12 @@ 93F7857E0EA3ABF100C1F443 /* PBCommitMessageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCommitMessageView.m; sourceTree = ""; }; 93FCCBA80EA8AF450061B02B /* PBGitConfig.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitConfig.m; sourceTree = ""; }; D26DC6440E782C9000C777B2 /* gitx.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = gitx.icns; sourceTree = ""; }; + D823487410CB382C00944BDE /* Terminal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Terminal.h; sourceTree = ""; }; D854948410D5C01B0083B917 /* PBCreateBranchSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCreateBranchSheet.h; sourceTree = ""; }; D854948510D5C01B0083B917 /* PBCreateBranchSheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCreateBranchSheet.m; sourceTree = ""; }; D854949310D5C3E20083B917 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/PBCreateBranchSheet.xib; sourceTree = ""; }; D85B93F610E51279007F3C28 /* PBGitRefish.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitRefish.h; sourceTree = ""; }; + D8E3B2B710DC9FB2001096A3 /* ScriptingBridge.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ScriptingBridge.framework; path = /System/Library/Frameworks/ScriptingBridge.framework; sourceTree = ""; }; EB2A73480FEE3F09006601CF /* PBCollapsibleSplitView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCollapsibleSplitView.h; sourceTree = ""; }; EB2A73490FEE3F09006601CF /* PBCollapsibleSplitView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCollapsibleSplitView.m; sourceTree = ""; }; F50A411D0EBB874C00208746 /* mainSplitterBar.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = mainSplitterBar.tiff; path = Images/mainSplitterBar.tiff; sourceTree = ""; }; @@ -329,6 +332,7 @@ F580E6AE0E733276009E2D3F /* Sparkle.framework in Frameworks */, F5E4DBFB0EAB58D90013FAFC /* SystemConfiguration.framework in Frameworks */, F5C580E50EDA250900995434 /* libgit2.a in Frameworks */, + D8E3B2B810DC9FB2001096A3 /* ScriptingBridge.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -384,6 +388,7 @@ 77C82804067257F0000B614F /* CoreData.framework */, 29B97325FDCFA39411CA2CEA /* Foundation.framework */, 29B97324FDCFA39411CA2CEA /* AppKit.framework */, + D8E3B2B710DC9FB2001096A3 /* ScriptingBridge.framework */, ); name = "Other Frameworks"; sourceTree = ""; @@ -586,6 +591,7 @@ EB2A73490FEE3F09006601CF /* PBCollapsibleSplitView.m */, F5FC41F20EBCBD4300191D80 /* PBGitXProtocol.h */, F5FC41F30EBCBD4300191D80 /* PBGitXProtocol.m */, + D823487410CB382C00944BDE /* Terminal.h */, ); name = Aux; sourceTree = ""; diff --git a/PBGitWindowController.h b/PBGitWindowController.h index b262fed..d40d436 100644 --- a/PBGitWindowController.h +++ b/PBGitWindowController.h @@ -35,4 +35,5 @@ - (IBAction) showCommitView:(id)sender; - (IBAction) showHistoryView:(id)sender; +- (IBAction) openInTerminal:(id)sender; @end diff --git a/PBGitWindowController.m b/PBGitWindowController.m index 7e277e1..0d7b8ee 100644 --- a/PBGitWindowController.m +++ b/PBGitWindowController.m @@ -9,6 +9,7 @@ #import "PBGitWindowController.h" #import "PBGitHistoryController.h" #import "PBGitCommitController.h" +#import "Terminal.h" @implementation PBGitWindowController @@ -149,6 +150,16 @@ [self showErrorSheet:error]; } +- (IBAction) openInTerminal:(id)sender +{ + TerminalApplication *term = [SBApplication applicationWithBundleIdentifier: @"com.apple.Terminal"]; + NSString *workingDirectory = [[repository workingDirectory] stringByAppendingString:@"/"]; + NSString *cmd = [NSString stringWithFormat: @"cd \"%@\"; clear; echo '# Opened by GitX:'; git status", workingDirectory]; + [term doScript: cmd in: nil]; + [NSThread sleepForTimeInterval: 0.1]; + [term activate]; +} + #pragma mark - #pragma mark Toolbar Delegates diff --git a/Terminal.h b/Terminal.h new file mode 100644 index 0000000..8050370 --- /dev/null +++ b/Terminal.h @@ -0,0 +1,159 @@ +/* + * Terminal.h + */ + +#import +#import + + +@class TerminalApplication, TerminalWindow, TerminalSettingsSet, TerminalTab; + +typedef enum { + TerminalSaveOptionsYes = 'yes ' /* Save the file. */, + TerminalSaveOptionsNo = 'no ' /* Do not save the file. */, + TerminalSaveOptionsAsk = 'ask ' /* Ask the user whether or not to save the file. */ +} TerminalSaveOptions; + +typedef enum { + TerminalPrintingErrorHandlingStandard = 'lwst' /* Standard PostScript error handling */, + TerminalPrintingErrorHandlingDetailed = 'lwdt' /* print a detailed report of PostScript errors */ +} TerminalPrintingErrorHandling; + + + +/* + * Standard Suite + */ + +// The application‘s top-level scripting object. +@interface TerminalApplication : SBApplication + +- (SBElementArray *) windows; + +@property (copy, readonly) NSString *name; // The name of the application. +@property (readonly) BOOL frontmost; // Is this the frontmost (active) application? +@property (copy, readonly) NSString *version; // The version of the application. + +- (void) open:(NSArray *)x; // Open a document. +- (void) print:(id)x withProperties:(NSDictionary *)withProperties printDialog:(BOOL)printDialog; // Print a document. +- (void) quitSaving:(TerminalSaveOptions)saving; // Quit the application. +- (TerminalTab *) doScript:(NSString *)x in:(id)in_; // Runs a UNIX shell script or command. + +@end + +// A window. +@interface TerminalWindow : SBObject + +- (SBElementArray *) tabs; + +@property (copy, readonly) NSString *name; // The full title of the window. +- (NSInteger) id; // The unique identifier of the window. +@property NSInteger index; // The index of the window, ordered front to back. +@property NSRect bounds; // The bounding rectangle of the window. +@property (readonly) BOOL closeable; // Whether the window has a close box. +@property (readonly) BOOL miniaturizable; // Whether the window can be minimized. +@property BOOL miniaturized; // Whether the window is currently minimized. +@property (readonly) BOOL resizable; // Whether the window can be resized. +@property BOOL visible; // Whether the window is currently visible. +@property (readonly) BOOL zoomable; // Whether the window can be zoomed. +@property BOOL zoomed; // Whether the window is currently zoomed. +@property BOOL frontmost; // Whether the window is currently the frontmost Terminal window. +@property NSPoint position; // The position of the window, relative to the upper left corner of the screen. +@property NSPoint origin; // The position of the window, relative to the lower left corner of the screen. +@property NSPoint size; // The width and height of the window +@property NSRect frame; // The bounding rectangle, relative to the lower left corner of the screen. + +- (void) closeSaving:(TerminalSaveOptions)saving savingIn:(NSURL *)savingIn; // Close a document. +- (void) saveIn:(NSURL *)in_; // Save a document. +- (void) printWithProperties:(NSDictionary *)withProperties printDialog:(BOOL)printDialog; // Print a document. +- (void) delete; // Delete an object. +- (void) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy object(s) and put the copies at a new location. +- (BOOL) exists; // Verify if an object exists. +- (void) moveTo:(SBObject *)to; // Move object(s) to a new location. + +@end + + + +/* + * Terminal Suite + */ + +@interface TerminalApplication (TerminalSuite) + +- (SBElementArray *) settingsSets; + +@property (copy) TerminalSettingsSet *defaultSettings; // The settings set used for new windows. +@property (copy) TerminalSettingsSet *startupSettings; // The settings set used for the window created on application startup. + +@end + +// A set of settings. +@interface TerminalSettingsSet : SBObject + +- (NSInteger) id; // The unique identifier of the settings set. +@property (copy) NSString *name; // The name of the settings set. +@property NSInteger numberOfRows; // The number of rows displayed in the tab. +@property NSInteger numberOfColumns; // The number of columns displayed in the tab. +@property (copy) NSColor *cursorColor; // The cursor color for the tab. +@property (copy) NSColor *backgroundColor; // The background color for the tab. +@property (copy) NSColor *normalTextColor; // The normal text color for the tab. +@property (copy) NSColor *boldTextColor; // The bold text color for the tab. +@property (copy) NSString *fontName; // The name of the font used to display the tab’s contents. +@property NSInteger fontSize; // The size of the font used to display the tab’s contents. +@property BOOL fontAntialiasing; // Whether the font used to display the tab’s contents is antialiased. +@property (copy) NSArray *cleanCommands; // The processes which will be ignored when checking whether a tab can be closed without showing a prompt. +@property BOOL titleDisplaysDeviceName; // Whether the title contains the device name. +@property BOOL titleDisplaysShellPath; // Whether the title contains the shell path. +@property BOOL titleDisplaysWindowSize; // Whether the title contains the tab’s size, in rows and columns. +@property BOOL titleDisplaysSettingsName; // Whether the title contains the settings name. +@property BOOL titleDisplaysCustomTitle; // Whether the title contains a custom title. +@property (copy) NSString *customTitle; // The tab’s custom title. + +- (void) closeSaving:(TerminalSaveOptions)saving savingIn:(NSURL *)savingIn; // Close a document. +- (void) saveIn:(NSURL *)in_; // Save a document. +- (void) printWithProperties:(NSDictionary *)withProperties printDialog:(BOOL)printDialog; // Print a document. +- (void) delete; // Delete an object. +- (void) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy object(s) and put the copies at a new location. +- (BOOL) exists; // Verify if an object exists. +- (void) moveTo:(SBObject *)to; // Move object(s) to a new location. + +@end + +// A tab. +@interface TerminalTab : SBObject + +@property NSInteger numberOfRows; // The number of rows displayed in the tab. +@property NSInteger numberOfColumns; // The number of columns displayed in the tab. +@property (copy, readonly) NSString *contents; // The currently visible contents of the tab. +@property (copy, readonly) NSString *history; // The contents of the entire scrolling buffer of the tab. +@property (readonly) BOOL busy; // Whether the tab is busy running a process. +@property (copy, readonly) NSArray *processes; // The processes currently running in the tab. +@property BOOL selected; // Whether the tab is selected. +@property BOOL titleDisplaysCustomTitle; // Whether the title contains a custom title. +@property (copy) NSString *customTitle; // The tab’s custom title. +@property (copy, readonly) NSString *tty; // The tab’s TTY device. +@property (copy) TerminalSettingsSet *currentSettings; // The set of settings which control the tab’s behavior and appearance. +@property (copy) NSColor *cursorColor; // The cursor color for the tab. +@property (copy) NSColor *backgroundColor; // The background color for the tab. +@property (copy) NSColor *normalTextColor; // The normal text color for the tab. +@property (copy) NSColor *boldTextColor; // The bold text color for the tab. +@property (copy) NSArray *cleanCommands; // The processes which will be ignored when checking whether a tab can be closed without showing a prompt. +@property BOOL titleDisplaysDeviceName; // Whether the title contains the device name. +@property BOOL titleDisplaysShellPath; // Whether the title contains the shell path. +@property BOOL titleDisplaysWindowSize; // Whether the title contains the tab’s size, in rows and columns. +@property BOOL titleDisplaysFileName; // Whether the title contains the file name. +@property (copy) NSString *fontName; // The name of the font used to display the tab’s contents. +@property NSInteger fontSize; // The size of the font used to display the tab’s contents. +@property BOOL fontAntialiasing; // Whether the font used to display the tab’s contents is antialiased. + +- (void) closeSaving:(TerminalSaveOptions)saving savingIn:(NSURL *)savingIn; // Close a document. +- (void) saveIn:(NSURL *)in_; // Save a document. +- (void) printWithProperties:(NSDictionary *)withProperties printDialog:(BOOL)printDialog; // Print a document. +- (void) delete; // Delete an object. +- (void) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy object(s) and put the copies at a new location. +- (BOOL) exists; // Verify if an object exists. +- (void) moveTo:(SBObject *)to; // Move object(s) to a new location. + +@end + From 509de290919f37bb270258dacb4b4d18813f7cb7 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sat, 26 Dec 2009 21:35:54 -0700 Subject: [PATCH 30/90] Add Reveal in Finder item to the Repository menu. --- English.lproj/MainMenu.xib | 46 +++++++++++++++++++++++++++++--------- PBGitWindowController.h | 1 + PBGitWindowController.m | 5 +++++ 3 files changed, 42 insertions(+), 10 deletions(-) diff --git a/English.lproj/MainMenu.xib b/English.lproj/MainMenu.xib index cf17779..8f619b8 100644 --- a/English.lproj/MainMenu.xib +++ b/English.lproj/MainMenu.xib @@ -657,7 +657,7 @@ - + YES YES @@ -667,9 +667,17 @@ - + - Open In Terminal + Open in Terminal + + 2147483647 + + + + + + Reveal in Finder 2147483647 @@ -1278,10 +1286,18 @@ openInTerminal: - + 944 + + + revealInFinder: + + + + 946 + @@ -1941,8 +1957,9 @@ YES - - + + + @@ -1953,12 +1970,17 @@ 942 - + 943 - + + + + + 945 + @@ -2157,6 +2179,7 @@ 938.IBPluginDependency 942.IBPluginDependency 943.IBPluginDependency + 945.IBPluginDependency YES @@ -2345,7 +2368,8 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{668, 683}, {192, 53}} + {{668, 663}, {192, 73}} + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -2368,7 +2392,7 @@ - 944 + 946 @@ -2644,6 +2668,7 @@ YES openInTerminal: + revealInFinder: showCommitView: showHistoryView: @@ -2652,6 +2677,7 @@ id id id + id diff --git a/PBGitWindowController.h b/PBGitWindowController.h index d40d436..d8815a0 100644 --- a/PBGitWindowController.h +++ b/PBGitWindowController.h @@ -35,5 +35,6 @@ - (IBAction) showCommitView:(id)sender; - (IBAction) showHistoryView:(id)sender; +- (IBAction) revealInFinder:(id)sender; - (IBAction) openInTerminal:(id)sender; @end diff --git a/PBGitWindowController.m b/PBGitWindowController.m index 0d7b8ee..4bfd0f7 100644 --- a/PBGitWindowController.m +++ b/PBGitWindowController.m @@ -150,6 +150,11 @@ [self showErrorSheet:error]; } +- (IBAction) revealInFinder:(id)sender +{ + [[NSWorkspace sharedWorkspace] openFile:[repository workingDirectory]]; +} + - (IBAction) openInTerminal:(id)sender { TerminalApplication *term = [SBApplication applicationWithBundleIdentifier: @"com.apple.Terminal"]; From e43a87e3f86e52d29bab29133a919bb0e2368cb4 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Fri, 19 Feb 2010 23:09:40 -0700 Subject: [PATCH 31/90] Add Copy SHA and Copy Patch items to commit contextual menu --- PBRefController.h | 2 ++ PBRefController.m | 29 +++++++++++++++++++++++++++++ PBRefMenuItem.m | 4 ++++ 3 files changed, 35 insertions(+) diff --git a/PBRefController.h b/PBRefController.h index 2c9ed59..c1d7175 100644 --- a/PBRefController.h +++ b/PBRefController.h @@ -24,6 +24,8 @@ } - (void) createBranch:(PBRefMenuItem *)sender; +- (void) copySHA:(PBRefMenuItem *)sender; +- (void) copyPatch:(PBRefMenuItem *)sender; - (NSArray *) menuItemsForRef:(PBGitRef *)ref; - (NSArray *) menuItemsForCommit:(PBGitCommit *)commit; diff --git a/PBRefController.m b/PBRefController.m index 781a656..c4e4e8d 100644 --- a/PBRefController.m +++ b/PBRefController.m @@ -46,6 +46,35 @@ } +#pragma mark Copy info + +- (void) copySHA:(PBRefMenuItem *)sender +{ + PBGitCommit *commit = nil; + if ([[sender refish] refishType] == kGitXCommitType) + commit = (PBGitCommit *)[sender refish]; + else + commit = [historyController.repository commitForRef:[sender refish]]; + + NSPasteboard *pasteboard = [NSPasteboard generalPasteboard]; + [pasteboard declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:nil]; + [pasteboard setString:[commit realSha] forType:NSStringPboardType]; +} + +- (void) copyPatch:(PBRefMenuItem *)sender +{ + PBGitCommit *commit = nil; + if ([[sender refish] refishType] == kGitXCommitType) + commit = (PBGitCommit *)[sender refish]; + else + commit = [historyController.repository commitForRef:[sender refish]]; + + NSPasteboard *pasteboard = [NSPasteboard generalPasteboard]; + [pasteboard declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:nil]; + [pasteboard setString:[commit patch] forType:NSStringPboardType]; +} + + - (void) removeRefSheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo { if (returnCode == NSAlertDefaultReturn) { diff --git a/PBRefMenuItem.m b/PBRefMenuItem.m index 11b5a77..875948a 100644 --- a/PBRefMenuItem.m +++ b/PBRefMenuItem.m @@ -74,6 +74,10 @@ NSMutableArray *items = [NSMutableArray array]; [items addObject:[PBRefMenuItem itemWithTitle:@"Create Branch…" action:@selector(createBranch:) enabled:YES]]; + [items addObject:[PBRefMenuItem separatorItem]]; + + [items addObject:[PBRefMenuItem itemWithTitle:@"Copy SHA" action:@selector(copySHA:) enabled:YES]]; + [items addObject:[PBRefMenuItem itemWithTitle:@"Copy Patch" action:@selector(copyPatch:) enabled:YES]]; for (PBRefMenuItem *item in items) { [item setTarget:target]; From ffa2e1aed421eb8e3f4f6e87638f811daab0d220 Mon Sep 17 00:00:00 2001 From: Morgan Schweers Date: Fri, 23 Oct 2009 23:56:06 -0700 Subject: [PATCH 32/90] Add stderror to the pipe results, so we can find out what happened when things go wrong. Not an optimal answer, but a quick one. --- PBEasyPipe.m | 1 + 1 file changed, 1 insertion(+) diff --git a/PBEasyPipe.m b/PBEasyPipe.m index 3b80184..5108254 100644 --- a/PBEasyPipe.m +++ b/PBEasyPipe.m @@ -32,6 +32,7 @@ NSPipe* pipe = [NSPipe pipe]; task.standardOutput = pipe; + task.standardError = pipe; return task; } From aa4a24a5799919cd74bbf52b090ea8cb153ae445 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sat, 20 Feb 2010 06:44:28 -0700 Subject: [PATCH 33/90] Add Create Tag A Create Tag item: - A new class (and xib) PBCreateTagSheet - In the Repository menu - In the contextual menu for commits PBRefController the method tagInfo: - renamed to showTagInfoSheet: - moved it under the Tags mark --- English.lproj/MainMenu.xib | 202 ++++- English.lproj/PBCreateTagSheet.xib | 1338 ++++++++++++++++++++++++++++ GitX.xcodeproj/project.pbxproj | 18 + PBCreateTagSheet.h | 38 + PBCreateTagSheet.m | 93 ++ PBGitHistoryController.h | 1 + PBGitHistoryController.m | 9 + PBGitRepository.h | 1 + PBGitRepository.m | 35 + PBRefController.h | 2 + PBRefController.m | 38 +- PBRefMenuItem.m | 6 +- 12 files changed, 1749 insertions(+), 32 deletions(-) create mode 100644 English.lproj/PBCreateTagSheet.xib create mode 100644 PBCreateTagSheet.h create mode 100644 PBCreateTagSheet.m diff --git a/English.lproj/MainMenu.xib b/English.lproj/MainMenu.xib index 8f619b8..34b4033 100644 --- a/English.lproj/MainMenu.xib +++ b/English.lproj/MainMenu.xib @@ -3,12 +3,12 @@ 1050 10C540 - 732 + 759 1038.25 458.00 com.apple.InterfaceBuilder.CocoaPlugin - 732 + 759 YES @@ -648,6 +648,15 @@ Repository YES + + + Create Tag + t + 1048576 + 2147483647 + + + Create Branch @@ -675,7 +684,7 @@ - + Reveal in Finder @@ -1294,9 +1303,17 @@ revealInFinder: - + - 946 + 948 + + + + createTag: + + + + 950 @@ -1959,7 +1976,8 @@ - + + @@ -1979,8 +1997,13 @@ - 945 - + 947 + + + + + 949 + @@ -2179,7 +2202,8 @@ 938.IBPluginDependency 942.IBPluginDependency 943.IBPluginDependency - 945.IBPluginDependency + 947.IBPluginDependency + 949.IBPluginDependency YES @@ -2368,7 +2392,8 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{668, 663}, {192, 73}} + {{668, 643}, {192, 93}} + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -2392,7 +2417,7 @@ - 946 + 950 @@ -2476,6 +2501,29 @@ PBCollapsibleSplitView.h + + PBCommitList + NSTableView + + YES + + YES + controller + webController + webView + + + YES + PBGitHistoryController + PBWebHistoryController + WebView + + + + IBProjectSource + PBCommitList.h + + PBCreateBranchSheet NSWindowController @@ -2496,19 +2544,15 @@ YES YES - branchName - errorMessage - isTrackingBranch - remoteMenu - remotePopup + branchNameField + errorMessageField + startRefish YES NSTextField NSTextField - NSButton - NSMenu - NSPopUpButton + id @@ -2516,6 +2560,44 @@ PBCreateBranchSheet.h + + PBCreateTagSheet + NSWindowController + + YES + + YES + closeCreateTagSheet: + createTag: + + + YES + id + id + + + + YES + + YES + errorMessageField + tagMessageText + tagNameField + targetRefish + + + YES + NSTextField + NSTextView + NSTextField + id + + + + IBProjectSource + PBCreateTagSheet.h + + PBGitCommitController PBViewController @@ -2568,6 +2650,7 @@ YES createBranch: + createTag: openFilesAction: openSelectedFile: refresh: @@ -2590,6 +2673,7 @@ id id id + id @@ -2743,6 +2827,64 @@ PBNiceSplitView.h + + PBRefController + NSObject + + YES + + YES + changeBranch: + copyPatch: + copySHA: + createBranch: + createTag: + showTagInfoSheet: + + + YES + NSMenuItem + PBRefMenuItem + PBRefMenuItem + PBRefMenuItem + PBRefMenuItem + PBRefMenuItem + + + + YES + + YES + branchPopUp + commitController + commitList + historyController + + + YES + NSPopUpButton + NSArrayController + PBCommitList + PBGitHistoryController + + + + IBProjectSource + PBRefController.h + + + + PBRefMenuItem + NSMenuItem + + refish + id + + + IBProjectSource + PBRefMenuItem.h + + PBRepositoryDocumentController NSDocumentController @@ -2817,6 +2959,27 @@ PBWebController.h + + PBWebHistoryController + PBWebController + + YES + + YES + contextMenuDelegate + historyController + + + YES + id + PBGitHistoryController + + + + IBProjectSource + PBWebHistoryController.h + + YES @@ -3600,6 +3763,7 @@ 0 + IBCocoaFramework com.apple.InterfaceBuilder.CocoaPlugin.macosx diff --git a/English.lproj/PBCreateTagSheet.xib b/English.lproj/PBCreateTagSheet.xib new file mode 100644 index 0000000..a47eb30 --- /dev/null +++ b/English.lproj/PBCreateTagSheet.xib @@ -0,0 +1,1338 @@ + + + + 1050 + 10C540 + 732 + 1038.25 + 458.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 732 + + + YES + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + YES + + YES + + + YES + + + + YES + + PBCreateTagSheet + + + FirstResponder + + + NSApplication + + + 1 + 2 + {{196, 233}, {425, 277}} + 544736256 + Window + NSWindow + + {1.79769e+308, 1.79769e+308} + {425, 277} + + + 256 + + YES + + + 268 + {{17, 240}, {77, 17}} + + YES + + 68288064 + 272630784 + Create Tag + + LucidaGrande-Bold + 13 + 16 + + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + + + + 268 + {{29, 204}, {71, 17}} + + YES + + 68288064 + 71304192 + Tag name: + + LucidaGrande + 13 + 1044 + + + + + + + + + 266 + {{105, 202}, {300, 22}} + + YES + + -1804468671 + 272630784 + + + Tag + + YES + + 6 + System + textBackgroundColor + + 3 + MQA + + + + 6 + System + textColor + + + + + + + 268 + {{37, 172}, {63, 17}} + + YES + + 68288064 + 71304192 + Message: + + + + + + + + + 266 + + YES + + + 2304 + + YES + + + 2322 + + YES + + YES + Apple HTML pasteboard type + Apple PDF pasteboard type + Apple PICT pasteboard type + Apple PNG pasteboard type + Apple URL pasteboard type + CorePasteboardFlavorType 0x6D6F6F76 + NSColor pasteboard type + NSFilenamesPboardType + NSStringPboardType + NeXT Encapsulated PostScript v1.2 pasteboard type + NeXT RTFD pasteboard type + NeXT Rich Text Format v1.0 pasteboard type + NeXT TIFF v4.0 pasteboard type + NeXT font pasteboard type + NeXT ruler pasteboard type + WebURLsWithTitlesPboardType + public.url + + + {298, 14} + + + + + + + + + + + YES + + + 134 + + + + 298 + 1 + + + 3971 + 0 + + + + YES + + YES + NSBackgroundColor + NSColor + + + YES + + 6 + System + selectedTextBackgroundColor + + + + 6 + System + selectedTextColor + + + + + + + YES + + YES + NSColor + NSCursor + NSUnderline + + + YES + + 1 + MCAwIDEAA + + + {8, -8} + 13 + + + + + + + 6 + {598, 1e+07} + {204, 0} + + + + {{1, 1}, {298, 133}} + + + + + + {4, -5} + 1 + + 4 + + + + -2147483392 + {{339, 1}, {15, 133}} + + + _doScroller: + 1 + 0.85256409645080566 + + + + -2147483392 + {{-100, -100}, {87, 18}} + + 1 + + _doScroller: + 1 + 0.94565218687057495 + + + {{105, 59}, {300, 135}} + + + 530 + + + + + + + 289 + {{315, 12}, {96, 32}} + + YES + + 67239424 + 134217728 + Create + + + -2038284033 + 129 + + DQ + 200 + 25 + + + + + 289 + {{219, 12}, {96, 32}} + + YES + + 67239424 + 134217728 + Cancel + + + -2038284033 + 129 + + Gw + 200 + 25 + + + + + -2147483358 + {{17, 22}, {203, 17}} + + YES + + 68288064 + 272630784 + Label + + + + + 1 + MSAwIDAAA + + + + + + 268 + {{50, 157}, {46, 11}} + + YES + + 68288064 + 272892928 + (optional) + + LucidaGrande + 9 + 3614 + + + + + + + + {425, 277} + + {{0, 0}, {1680, 1028}} + {425, 299} + {1.79769e+308, 1.79769e+308} + + + + + YES + + + window + + + + 28 + + + + closeCreateTagSheet: + + + + 29 + + + + createTag: + + + + 30 + + + + tagNameField + + + + 31 + + + + tagMessageText + + + + 32 + + + + errorMessageField + + + + 33 + + + + + YES + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 1 + + + YES + + + + + + 2 + + + YES + + + + + + + + + + + + + + 3 + + + YES + + + + + + 4 + + + + + 5 + + + YES + + + + + + 6 + + + + + 7 + + + YES + + + + + + 8 + + + + + 11 + + + YES + + + + + + 12 + + + + + 13 + + + YES + + + + + + 14 + + + + + 15 + + + YES + + + + + + 16 + + + + + 17 + + + YES + + + + + + 18 + + + + + 21 + + + YES + + + + + + + + 22 + + + + + 23 + + + + + 24 + + + + + 26 + + + YES + + + + + + 27 + + + + + + + YES + + YES + 1.IBEditorWindowLastContentRect + 1.IBPluginDependency + 1.IBWindowTemplateEditedContentRect + 1.NSWindowTemplate.visibleAtLaunch + 1.WindowOrigin + 1.editorWindowContentRectSynchronizationRect + 1.windowTemplate.hasMinSize + 1.windowTemplate.minSize + 11.IBPluginDependency + 12.IBPluginDependency + 13.IBPluginDependency + 14.IBPluginDependency + 15.IBPluginDependency + 16.IBPluginDependency + 17.IBPluginDependency + 18.IBPluginDependency + 2.IBPluginDependency + 21.IBPluginDependency + 22.IBPluginDependency + 23.IBPluginDependency + 24.IBPluginDependency + 26.IBPluginDependency + 27.IBPluginDependency + 3.IBPluginDependency + 4.IBPluginDependency + 5.IBPluginDependency + 6.IBPluginDependency + 7.IBPluginDependency + 8.IBPluginDependency + + + YES + {{798, 694}, {425, 277}} + com.apple.InterfaceBuilder.CocoaPlugin + {{798, 694}, {425, 277}} + + {196, 240} + {{202, 428}, {480, 270}} + + {425, 277} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + YES + + + YES + + + + + YES + + + YES + + + + 33 + + + + YES + + PBCreateTagSheet + NSWindowController + + YES + + YES + closeCreateTagSheet: + createTag: + + + YES + id + id + + + + YES + + YES + errorMessageField + tagMessageText + tagNameField + + + YES + NSTextField + NSTextView + NSTextField + + + + IBProjectSource + PBCreateTagSheet.h + + + + + YES + + NSActionCell + NSCell + + IBFrameworkSource + AppKit.framework/Headers/NSActionCell.h + + + + NSApplication + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSApplication.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSApplicationScripting.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSColorPanel.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSHelpManager.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSPageLayout.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSUserInterfaceItemSearching.h + + + + NSButton + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSButton.h + + + + NSButtonCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSButtonCell.h + + + + NSCell + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSCell.h + + + + NSControl + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSControl.h + + + + NSFormatter + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFormatter.h + + + + NSMenu + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenu.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSAccessibility.h + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDictionaryController.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDragging.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontManager.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontPanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSKeyValueBinding.h + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSNibLoading.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSOutlineView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSPasteboard.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSSavePanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSToolbarItem.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSView.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSError.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFileManager.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueObserving.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyedArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObject.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObjectScripting.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSPortCoder.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSRunLoop.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptObjectSpecifiers.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptWhoseTests.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSThread.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURL.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLConnection.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLDownload.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUAppcast.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUUpdater.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebDownload.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebEditingDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebFrameLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebJavaPlugIn.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPlugin.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPluginContainer.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPolicyDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebResourceLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebScriptObject.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebUIDelegate.h + + + + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSInterfaceStyle.h + + + + NSResponder + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSResponder.h + + + + NSScrollView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSScrollView.h + + + + NSScroller + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSScroller.h + + + + NSText + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSText.h + + + + NSTextField + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSTextField.h + + + + NSTextFieldCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSTextFieldCell.h + + + + NSTextView + NSText + + IBFrameworkSource + AppKit.framework/Headers/NSTextView.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSClipView.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItem.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSRulerView.h + + + + NSView + NSResponder + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSDrawer.h + + + + NSWindow + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSWindow.h + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSWindowScripting.h + + + + NSWindowController + NSResponder + + showWindow: + id + + + IBFrameworkSource + AppKit.framework/Headers/NSWindowController.h + + + + + 0 + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + GitX.xcodeproj + 3 + + diff --git a/GitX.xcodeproj/project.pbxproj b/GitX.xcodeproj/project.pbxproj index 5d2238f..7caba38 100644 --- a/GitX.xcodeproj/project.pbxproj +++ b/GitX.xcodeproj/project.pbxproj @@ -46,7 +46,9 @@ D26DC6450E782C9000C777B2 /* gitx.icns in Resources */ = {isa = PBXBuildFile; fileRef = D26DC6440E782C9000C777B2 /* gitx.icns */; }; D854948610D5C01B0083B917 /* PBCreateBranchSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = D854948510D5C01B0083B917 /* PBCreateBranchSheet.m */; }; D85B939310E3D8B4007F3C28 /* PBCreateBranchSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = D85B939210E3D8B4007F3C28 /* PBCreateBranchSheet.xib */; }; + D889EB3110E6BCBB00F08413 /* PBCreateTagSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = D889EB3010E6BCBB00F08413 /* PBCreateTagSheet.xib */; }; D8E3B2B810DC9FB2001096A3 /* ScriptingBridge.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D8E3B2B710DC9FB2001096A3 /* ScriptingBridge.framework */; }; + D8E3B34D10DCA958001096A3 /* PBCreateTagSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = D8E3B34C10DCA958001096A3 /* PBCreateTagSheet.m */; }; EB2A734A0FEE3F09006601CF /* PBCollapsibleSplitView.m in Sources */ = {isa = PBXBuildFile; fileRef = EB2A73490FEE3F09006601CF /* PBCollapsibleSplitView.m */; }; F50A411F0EBB874C00208746 /* mainSplitterBar.tiff in Resources */ = {isa = PBXBuildFile; fileRef = F50A411D0EBB874C00208746 /* mainSplitterBar.tiff */; }; F50A41200EBB874C00208746 /* mainSplitterDimple.tiff in Resources */ = {isa = PBXBuildFile; fileRef = F50A411E0EBB874C00208746 /* mainSplitterDimple.tiff */; }; @@ -217,6 +219,9 @@ D854949310D5C3E20083B917 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/PBCreateBranchSheet.xib; sourceTree = ""; }; D85B93F610E51279007F3C28 /* PBGitRefish.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitRefish.h; sourceTree = ""; }; D8E3B2B710DC9FB2001096A3 /* ScriptingBridge.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ScriptingBridge.framework; path = /System/Library/Frameworks/ScriptingBridge.framework; sourceTree = ""; }; + D8E3B34B10DCA958001096A3 /* PBCreateTagSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCreateTagSheet.h; sourceTree = ""; }; + D8E3B34C10DCA958001096A3 /* PBCreateTagSheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCreateTagSheet.m; sourceTree = ""; }; + D8E3B38110DD4E2C001096A3 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/PBCreateTagSheet.xib; sourceTree = ""; }; EB2A73480FEE3F09006601CF /* PBCollapsibleSplitView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCollapsibleSplitView.h; sourceTree = ""; }; EB2A73490FEE3F09006601CF /* PBCollapsibleSplitView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCollapsibleSplitView.m; sourceTree = ""; }; F50A411D0EBB874C00208746 /* mainSplitterBar.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = mainSplitterBar.tiff; path = Images/mainSplitterBar.tiff; sourceTree = ""; }; @@ -456,6 +461,7 @@ F52BCE020E84208300AA3741 /* PBGitHistoryView.xib */, F59116E50E843BB50072CCB1 /* PBGitCommitView.xib */, D85B939210E3D8B4007F3C28 /* PBCreateBranchSheet.xib */, + D889EB3010E6BCBB00F08413 /* PBCreateTagSheet.xib */, 47DBDB680E94EF6500671A1E /* Preferences.xib */, F569AE920F2CBD7C00C2FFA7 /* Credits.html */, ); @@ -503,6 +509,8 @@ children = ( D854948410D5C01B0083B917 /* PBCreateBranchSheet.h */, D854948510D5C01B0083B917 /* PBCreateBranchSheet.m */, + D8E3B34B10DCA958001096A3 /* PBCreateTagSheet.h */, + D8E3B34C10DCA958001096A3 /* PBCreateTagSheet.m */, ); name = Sheets; sourceTree = ""; @@ -844,6 +852,7 @@ 47DBDBB10E94F6CA00671A1E /* Updates.png in Resources */, F569AE930F2CBD7C00C2FFA7 /* Credits.html in Resources */, D85B939310E3D8B4007F3C28 /* PBCreateBranchSheet.xib in Resources */, + D889EB3110E6BCBB00F08413 /* PBCreateTagSheet.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -964,6 +973,7 @@ EB2A734A0FEE3F09006601CF /* PBCollapsibleSplitView.m in Sources */, F59F1DD5105C4FF300115F88 /* PBGitIndex.m in Sources */, D854948610D5C01B0083B917 /* PBCreateBranchSheet.m in Sources */, + D8E3B34D10DCA958001096A3 /* PBCreateTagSheet.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1064,6 +1074,14 @@ name = PBCreateBranchSheet.xib; sourceTree = ""; }; + D889EB3010E6BCBB00F08413 /* PBCreateTagSheet.xib */ = { + isa = PBXVariantGroup; + children = ( + D8E3B38110DD4E2C001096A3 /* English */, + ); + name = PBCreateTagSheet.xib; + sourceTree = ""; + }; F5B721C20E05CF7E00AF29DC /* MainMenu.xib */ = { isa = PBXVariantGroup; children = ( diff --git a/PBCreateTagSheet.h b/PBCreateTagSheet.h new file mode 100644 index 0000000..78c1793 --- /dev/null +++ b/PBCreateTagSheet.h @@ -0,0 +1,38 @@ +// +// PBCreateTagSheet.h +// GitX +// +// Created by Nathan Kinsinger on 12/18/09. +// Copyright 2009 Nathan Kinsinger. All rights reserved. +// + +#import +#import "PBGitRefish.h" + + +@class PBGitRepository; + + +@interface PBCreateTagSheet : NSWindowController { + PBGitRepository *repository; + id targetRefish; + + NSTextField *tagNameField; + NSTextView *tagMessageText; + NSTextField *errorMessageField; +} + ++ (void) beginCreateTagSheetAtRefish:(id )refish inRepository:(PBGitRepository *)repo; + +- (IBAction) createTag:(id)sender; +- (IBAction) closeCreateTagSheet:(id)sender; + + +@property (retain) PBGitRepository *repository; +@property (retain) id targetRefish; + +@property (assign) IBOutlet NSTextField *tagNameField; +@property (assign) IBOutlet NSTextView *tagMessageText; +@property (assign) IBOutlet NSTextField *errorMessageField; + +@end diff --git a/PBCreateTagSheet.m b/PBCreateTagSheet.m new file mode 100644 index 0000000..4ca5fb1 --- /dev/null +++ b/PBCreateTagSheet.m @@ -0,0 +1,93 @@ +// +// PBCreateTagSheet.m +// GitX +// +// Created by Nathan Kinsinger on 12/18/09. +// Copyright 2009 Nathan Kinsinger. All rights reserved. +// + +#import "PBCreateTagSheet.h" +#import "PBGitRepository.h" +#import "PBGitCommit.h" + + +@interface PBCreateTagSheet () + +- (void) beginCreateTagSheetAtRefish:(id )refish inRepository:(PBGitRepository *)repo; + +@end + + +@implementation PBCreateTagSheet + +@synthesize repository; +@synthesize targetRefish; + +@synthesize tagNameField; +@synthesize tagMessageText; +@synthesize errorMessageField; + + + +#pragma mark - +#pragma mark PBCreateTagSheet + ++ (void) beginCreateTagSheetAtRefish:(id )refish inRepository:(PBGitRepository *)repo +{ + PBCreateTagSheet *sheet = [[self alloc] initWithWindowNibName:@"PBCreateTagSheet"]; + [sheet beginCreateTagSheetAtRefish:refish inRepository:repo]; +} + + +- (void) beginCreateTagSheetAtRefish:(id )refish inRepository:(PBGitRepository *)repo +{ + self.repository = repo; + self.targetRefish = refish; + + [self window]; // loads the window (if it wasn't already) + [self.errorMessageField setStringValue:@""]; + + [NSApp beginSheet:[self window] modalForWindow:[self.repository.windowController window] modalDelegate:self didEndSelector:nil contextInfo:NULL]; +} + + + +#pragma mark IBActions + +- (IBAction) createTag:(id)sender +{ + NSString *tagName = [self.tagNameField stringValue]; + [self.errorMessageField setHidden:YES]; + + NSString *refName = [@"refs/tags/" stringByAppendingString:tagName]; + if (![self.repository checkRefFormat:refName]) { + [self.errorMessageField setStringValue:@"Invalid name"]; + [self.errorMessageField setHidden:NO]; + return; + } + + for (PBGitRevSpecifier *rev in self.repository.branches) { + NSString *name = [[rev ref] tagName]; + if ([tagName isEqualToString:name]) { + [self.errorMessageField setStringValue:@"Tag already exists"]; + [self.errorMessageField setHidden:NO]; + return; + } + } + + [self closeCreateTagSheet:sender]; + + NSString *message = [self.tagMessageText string]; + [self.repository createTag:tagName message:message atRefish:self.targetRefish]; +} + + +- (IBAction) closeCreateTagSheet:(id)sender +{ + [NSApp endSheet:[self window]]; + [[self window] orderOut:self]; +} + + + +@end diff --git a/PBGitHistoryController.h b/PBGitHistoryController.h index f45402b..2be198b 100644 --- a/PBGitHistoryController.h +++ b/PBGitHistoryController.h @@ -53,6 +53,7 @@ // Repository Methods - (IBAction) createBranch:(id)sender; +- (IBAction) createTag:(id)sender; - (void) copyCommitInfo; diff --git a/PBGitHistoryController.m b/PBGitHistoryController.m index abb7147..ba1517c 100644 --- a/PBGitHistoryController.m +++ b/PBGitHistoryController.m @@ -12,6 +12,7 @@ #import "PBGitRevisionCell.h" #import "PBCommitList.h" #import "PBCreateBranchSheet.h" +#import "PBCreateTagSheet.h" #define QLPreviewPanel NSClassFromString(@"QLPreviewPanel") @@ -335,4 +336,12 @@ [PBCreateBranchSheet beginCreateBranchSheetAtRefish:realCommit inRepository:self.repository]; } +- (IBAction) createTag:(id)sender +{ + if (!realCommit) + [PBCreateTagSheet beginCreateTagSheetAtRefish:[repository.currentBranch ref] inRepository:repository]; + else + [PBCreateTagSheet beginCreateTagSheetAtRefish:realCommit inRepository:repository]; +} + @end diff --git a/PBGitRepository.h b/PBGitRepository.h index e78a36f..2a0029f 100644 --- a/PBGitRepository.h +++ b/PBGitRepository.h @@ -30,6 +30,7 @@ extern NSString* PBGitRepositoryErrorDomain; } - (BOOL) createBranch:(NSString *)branchName atRefish:(id )ref; +- (BOOL) createTag:(NSString *)tagName message:(NSString *)message atRefish:(id )commitSHA; - (NSFileHandle*) handleForCommand:(NSString*) cmd; - (NSFileHandle*) handleForArguments:(NSArray*) args; diff --git a/PBGitRepository.m b/PBGitRepository.m index a9ed922..95f177d 100644 --- a/PBGitRepository.m +++ b/PBGitRepository.m @@ -446,6 +446,41 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; return YES; } +- (BOOL) createTag:(NSString *)tagName message:(NSString *)message atRefish:(id )target +{ + if (!tagName) + return NO; + + NSMutableArray *arguments = [NSMutableArray arrayWithObject:@"tag"]; + + // if there is a message then make this an annotated tag + if (message && ![message isEqualToString:@""] && ([message length] > 3)) { + [arguments addObject:@"-a"]; + [arguments addObject:[@"-m" stringByAppendingString:message]]; + } + + [arguments addObject:tagName]; + + // if no refish then git will add it to HEAD + if (target) + [arguments addObject:[target refishName]]; + + int retValue = 1; + NSString *output = [self outputInWorkdirForArguments:arguments retValue:&retValue]; + if (retValue) { + NSString *targetName = @"HEAD"; + if (target) + targetName = [NSString stringWithFormat:@"%@ '%@'", [target refishType], [target shortName]]; + NSString *message = [NSString stringWithFormat:@"There was an error creating the tag '%@' at %@.", tagName, targetName]; + [self.windowController showErrorSheetTitle:@"Create Tag failed!" message:message arguments:arguments output:output]; + return NO; + } + + [self reloadRefs]; + return YES; +} + + #pragma mark low level - (int) returnValueForCommand:(NSString *)cmd diff --git a/PBRefController.h b/PBRefController.h index c1d7175..6cd1631 100644 --- a/PBRefController.h +++ b/PBRefController.h @@ -26,6 +26,8 @@ - (void) createBranch:(PBRefMenuItem *)sender; - (void) copySHA:(PBRefMenuItem *)sender; - (void) copyPatch:(PBRefMenuItem *)sender; +- (void) createTag:(PBRefMenuItem *)sender; +- (void) showTagInfoSheet:(PBRefMenuItem *)sender; - (NSArray *) menuItemsForRef:(PBGitRef *)ref; - (NSArray *) menuItemsForCommit:(PBGitCommit *)commit; diff --git a/PBRefController.m b/PBRefController.m index c4e4e8d..3b7f81d 100644 --- a/PBRefController.m +++ b/PBRefController.m @@ -10,6 +10,7 @@ #import "PBGitRevisionCell.h" #import "PBRefMenuItem.h" #import "PBCreateBranchSheet.h" +#import "PBCreateTagSheet.h" @implementation PBRefController @@ -75,6 +76,31 @@ } +#pragma mark Tags + +- (void) createTag:(PBRefMenuItem *)sender +{ + id refish = [sender refish]; + [PBCreateTagSheet beginCreateTagSheetAtRefish:refish inRepository:historyController.repository]; +} + +- (void) showTagInfoSheet:(PBRefMenuItem *)sender +{ + if ([[sender refish] refishType] != kGitXTagType) + return; + + NSString *tagName = [(PBGitRef *)[sender refish] tagName]; + + int retValue = 1; + NSArray *args = [NSArray arrayWithObjects:@"tag", @"-n50", @"-l", tagName, nil]; + NSString *info = [historyController.repository outputInWorkdirForArguments:args retValue:&retValue]; + if (!retValue) { + NSString *message = [NSString stringWithFormat:@"Info for tag: %@", tagName]; + [historyController.repository.windowController showMessageSheet:message infoText:info]; + } +} + + - (void) removeRefSheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo { if (returnCode == NSAlertDefaultReturn) { @@ -111,18 +137,6 @@ [commitController rearrangeObjects]; } -- (void) tagInfo:(PBRefMenuItem *)sender -{ - NSString *message = [NSString stringWithFormat:@"Info for tag: %@", [[sender refish] shortName]]; - - int ret = 1; - NSString *info = [historyController.repository outputInWorkdirForArguments:[NSArray arrayWithObjects:@"tag", @"-n50", @"-l", [[sender refish] shortName], nil] retValue: &ret]; - - if (!ret) { - [[historyController.repository windowController] showMessageSheet:message infoText:info]; - } - return; -} #pragma mark Contextual menus diff --git a/PBRefMenuItem.m b/PBRefMenuItem.m index 875948a..54cd2ce 100644 --- a/PBRefMenuItem.m +++ b/PBRefMenuItem.m @@ -51,9 +51,12 @@ // create branch [items addObject:[PBRefMenuItem itemWithTitle:@"Create branch…" action:@selector(createBranch:) enabled:YES]]; + // create tag + [items addObject:[PBRefMenuItem itemWithTitle:@"Create Tag…" action:@selector(createTag:) enabled:YES]]; + // view tag info if ([ref isTag]) - [items addObject:[PBRefMenuItem itemWithTitle:@"View tag info" action:@selector(tagInfo:) enabled:YES]]; + [items addObject:[PBRefMenuItem itemWithTitle:@"View tag info…" action:@selector(showTagInfoSheet:) enabled:YES]]; // delete ref [items addObject:[PBRefMenuItem separatorItem]]; @@ -74,6 +77,7 @@ NSMutableArray *items = [NSMutableArray array]; [items addObject:[PBRefMenuItem itemWithTitle:@"Create Branch…" action:@selector(createBranch:) enabled:YES]]; + [items addObject:[PBRefMenuItem itemWithTitle:@"Create Tag…" action:@selector(createTag:) enabled:YES]]; [items addObject:[PBRefMenuItem separatorItem]]; [items addObject:[PBRefMenuItem itemWithTitle:@"Copy SHA" action:@selector(copySHA:) enabled:YES]]; From 69d67820f62a15d5899c82b17f40958c76315e19 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sat, 20 Feb 2010 06:47:47 -0700 Subject: [PATCH 34/90] Add Checkout Checkout: - PBGitRepository: add checkoutRefish: - PBRefController: renamed checkoutRef: to checkout: and use new method in PBGitRepository - add to the contextual menus for commits (it was already in the menu for refs) - add "Checkout branch" checkbox to the Create Branch sheet - store the state in the defaults - tell the commitController to rearrangeObjects so that the refs highlight correctly (seems to only be a problem when going from a branch to a detached HEAD at the same commit) --- English.lproj/PBCreateBranchSheet.xib | 78 ++++++++++++++++++++++----- PBCreateBranchSheet.h | 4 ++ PBCreateBranchSheet.m | 15 ++++-- PBGitDefaults.h | 2 + PBGitDefaults.m | 13 +++++ PBGitRepository.h | 1 + PBGitRepository.m | 22 ++++++++ PBRefController.h | 1 + PBRefController.m | 22 ++++---- PBRefMenuItem.m | 5 +- 10 files changed, 134 insertions(+), 29 deletions(-) diff --git a/English.lproj/PBCreateBranchSheet.xib b/English.lproj/PBCreateBranchSheet.xib index f02b020..e3abaf8 100644 --- a/English.lproj/PBCreateBranchSheet.xib +++ b/English.lproj/PBCreateBranchSheet.xib @@ -198,6 +198,33 @@ + + + 268 + {{122, 58}, {129, 18}} + + YES + + -2080244224 + 0 + Checkout branch + + + 1211912703 + 2 + + NSImage + NSSwitch + + + NSSwitch + + + + 200 + 25 + + {480, 167} @@ -258,6 +285,22 @@ 47 + + + value: shouldCheckoutBranch + + + + + + value: shouldCheckoutBranch + value + shouldCheckoutBranch + 2 + + + 59 + @@ -306,6 +349,7 @@ + @@ -393,6 +437,20 @@ + + 56 + + + YES + + + + + + 57 + + + @@ -417,6 +475,8 @@ 3.IBPluginDependency 4.IBPluginDependency 5.IBPluginDependency + 56.IBPluginDependency + 57.IBPluginDependency 6.IBPluginDependency 7.IBPluginDependency 8.IBPluginDependency @@ -444,6 +504,8 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin @@ -462,7 +524,7 @@ - 55 + 59 @@ -489,15 +551,13 @@ YES branchNameField errorMessageField - startingAtMenu - startingAtPopup + startRefish YES NSTextField NSTextField - NSMenu - NSPopUpButton + id @@ -935,14 +995,6 @@ WebKit.framework/Headers/WebUIDelegate.h - - NSPopUpButton - NSButton - - IBFrameworkSource - AppKit.framework/Headers/NSPopUpButton.h - - NSResponder diff --git a/PBCreateBranchSheet.h b/PBCreateBranchSheet.h index afded4f..b364e01 100644 --- a/PBCreateBranchSheet.h +++ b/PBCreateBranchSheet.h @@ -17,6 +17,8 @@ PBGitRepository *repository; id startRefish; + BOOL shouldCheckoutBranch; + NSTextField *branchNameField; NSTextField *errorMessageField; } @@ -31,6 +33,8 @@ @property (retain) PBGitRepository *repository; @property (retain) id startRefish; +@property (assign) BOOL shouldCheckoutBranch; + @property (assign) IBOutlet NSTextField *branchNameField; @property (assign) IBOutlet NSTextField *errorMessageField; diff --git a/PBCreateBranchSheet.m b/PBCreateBranchSheet.m index d7cb8cf..ebd2643 100644 --- a/PBCreateBranchSheet.m +++ b/PBCreateBranchSheet.m @@ -8,6 +8,7 @@ #import "PBCreateBranchSheet.h" #import "PBGitRepository.h" +#import "PBGitDefaults.h" #import "PBGitCommit.h" #import "PBGitRef.h" @@ -24,6 +25,8 @@ @synthesize repository; @synthesize startRefish; +@synthesize shouldCheckoutBranch; + @synthesize branchNameField; @synthesize errorMessageField; @@ -42,10 +45,11 @@ - (void) beginCreateBranchSheetAtRefish:(id )ref inRepository:(PBGitRepository *)repo { self.repository = repo; - self.startRefish = ref; + self.startRefish = ref; [self window]; // loads the window (if it wasn't already) [self.errorMessageField setStringValue:@""]; + self.shouldCheckoutBranch = [PBGitDefaults shouldCheckoutBranch]; [NSApp beginSheet:[self window] modalForWindow:[self.repository.windowController window] modalDelegate:self didEndSelector:nil contextInfo:NULL]; } @@ -57,14 +61,14 @@ - (IBAction) createBranch:(id)sender { NSString *name = [self.branchNameField stringValue]; - PBGitRef *ref = [PBGitRef refFromString:[@"refs/heads/" stringByAppendingString:name]]; + PBGitRef *ref = [PBGitRef refFromString:[kGitXBranchRefPrefix stringByAppendingString:name]]; if (![self.repository checkRefFormat:[ref ref]]) { [self.errorMessageField setStringValue:@"Invalid name"]; [self.errorMessageField setHidden:NO]; return; } - + if ([self.repository refExists:ref]) { [self.errorMessageField setStringValue:@"Branch already exists"]; [self.errorMessageField setHidden:NO]; @@ -74,6 +78,11 @@ [self closeCreateBranchSheet:self]; [self.repository createBranch:name atRefish:self.startRefish]; + + [PBGitDefaults setShouldCheckoutBranch:self.shouldCheckoutBranch]; + + if (self.shouldCheckoutBranch) + [self.repository checkoutRefish:ref]; } diff --git a/PBGitDefaults.h b/PBGitDefaults.h index fec2430..198c631 100644 --- a/PBGitDefaults.h +++ b/PBGitDefaults.h @@ -19,5 +19,7 @@ + (BOOL)showWhitespaceDifferences; + (BOOL)openCurDirOnLaunch; + (BOOL)showOpenPanelOnLaunch; ++ (BOOL) shouldCheckoutBranch; ++ (void) setShouldCheckoutBranch:(BOOL)shouldCheckout; @end diff --git a/PBGitDefaults.m b/PBGitDefaults.m index dc9cfd1..e01cd9e 100644 --- a/PBGitDefaults.m +++ b/PBGitDefaults.m @@ -17,6 +17,7 @@ #define kShowWhitespaceDifferences @"PBShowWhitespaceDifferences" #define kOpenCurDirOnLaunch @"PBOpenCurDirOnLaunch" #define kShowOpenPanelOnLaunch @"PBShowOpenPanelOnLaunch" +#define kShouldCheckoutBranch @"PBShouldCheckoutBranch" @implementation PBGitDefaults @@ -39,6 +40,8 @@ forKey:kOpenCurDirOnLaunch]; [defaultValues setObject:[NSNumber numberWithBool:YES] forKey:kShowOpenPanelOnLaunch]; + [defaultValues setObject:[NSNumber numberWithBool:YES] + forKey:kShouldCheckoutBranch]; [[NSUserDefaults standardUserDefaults] registerDefaults:defaultValues]; } @@ -82,4 +85,14 @@ return [[NSUserDefaults standardUserDefaults] boolForKey:kShowOpenPanelOnLaunch]; } ++ (BOOL) shouldCheckoutBranch +{ + return [[NSUserDefaults standardUserDefaults] boolForKey:kShouldCheckoutBranch]; +} + ++ (void) setShouldCheckoutBranch:(BOOL)shouldCheckout +{ + [[NSUserDefaults standardUserDefaults] setBool:shouldCheckout forKey:kShouldCheckoutBranch]; +} + @end diff --git a/PBGitRepository.h b/PBGitRepository.h index 2a0029f..fc89755 100644 --- a/PBGitRepository.h +++ b/PBGitRepository.h @@ -29,6 +29,7 @@ extern NSString* PBGitRepositoryErrorDomain; PBGitRevSpecifier *_headRef; // Caching } +- (BOOL) checkoutRefish:(id )ref; - (BOOL) createBranch:(NSString *)branchName atRefish:(id )ref; - (BOOL) createTag:(NSString *)tagName message:(NSString *)message atRefish:(id )commitSHA; diff --git a/PBGitRepository.m b/PBGitRepository.m index 95f177d..ab0fa04 100644 --- a/PBGitRepository.m +++ b/PBGitRepository.m @@ -428,6 +428,28 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; #pragma mark Repository commands +- (BOOL) checkoutRefish:(id )ref +{ + NSString *refName = nil; + if ([ref refishType] == kGitXBranchType) + refName = [ref shortName]; + else + refName = [ref refishName]; + + int retValue = 1; + NSArray *arguments = [NSArray arrayWithObjects:@"checkout", refName, nil]; + NSString *output = [self outputInWorkdirForArguments:arguments retValue:&retValue]; + if (retValue) { + NSString *message = [NSString stringWithFormat:@"There was an error checking out the %@ '%@'.\n\nPerhaps your working directory is not clean?", [ref refishType], [ref shortName]]; + [self.windowController showErrorSheetTitle:@"Checkout failed!" message:message arguments:arguments output:output]; + return NO; + } + + [self reloadRefs]; + [self readCurrentBranch]; + return YES; +} + - (BOOL) createBranch:(NSString *)branchName atRefish:(id )ref { if (!branchName || !ref) diff --git a/PBRefController.h b/PBRefController.h index 6cd1631..3aac522 100644 --- a/PBRefController.h +++ b/PBRefController.h @@ -23,6 +23,7 @@ IBOutlet NSPopUpButton *branchPopUp; } +- (void) checkout:(PBRefMenuItem *)sender; - (void) createBranch:(PBRefMenuItem *)sender; - (void) copySHA:(PBRefMenuItem *)sender; - (void) copyPatch:(PBRefMenuItem *)sender; diff --git a/PBRefController.m b/PBRefController.m index 3b7f81d..34caaa6 100644 --- a/PBRefController.m +++ b/PBRefController.m @@ -31,6 +31,7 @@ } else if ([(NSString *)context isEqualToString:@"currentBranchChange"]) { [self selectCurrentBranch]; + [commitController rearrangeObjects]; } else { [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; @@ -38,6 +39,15 @@ } +#pragma mark Checkout + +- (void) checkout:(PBRefMenuItem *)sender +{ + id refish = [sender refish]; + [historyController.repository checkoutRefish:refish]; +} + + #pragma mark Create Branch - (void) createBranch:(PBRefMenuItem *)sender @@ -125,18 +135,6 @@ NSBeginAlertSheet([NSString stringWithFormat:@"Delete %@?", ref_desc], @"Delete", @"Cancel", nil, [[historyController view] window], self, @selector(removeRefSheetDidEnd:returnCode:contextInfo:), NULL, sender, question); } -- (void) checkoutRef:(PBRefMenuItem *)sender -{ - int ret = 1; - [historyController.repository outputInWorkdirForArguments:[NSArray arrayWithObjects:@"checkout", [[sender refish] shortName], nil] retValue: &ret]; - if (ret) { - [[historyController.repository windowController] showMessageSheet:@"Checking out branch failed" infoText:@"There was an error checking out the branch. Perhaps your working directory is not clean?"]; - return; - } - [historyController.repository reloadRefs]; - [commitController rearrangeObjects]; -} - #pragma mark Contextual menus diff --git a/PBRefMenuItem.m b/PBRefMenuItem.m index 54cd2ce..82051b1 100644 --- a/PBRefMenuItem.m +++ b/PBRefMenuItem.m @@ -45,7 +45,7 @@ // checkout ref NSString *checkoutTitle = [@"Checkout " stringByAppendingString:targetRefName]; - [items addObject:[PBRefMenuItem itemWithTitle:checkoutTitle action:@selector(checkoutRef:) enabled:!isHead]]; + [items addObject:[PBRefMenuItem itemWithTitle:checkoutTitle action:@selector(checkout:) enabled:!isHead]]; [items addObject:[PBRefMenuItem separatorItem]]; // create branch @@ -76,6 +76,9 @@ { NSMutableArray *items = [NSMutableArray array]; + [items addObject:[PBRefMenuItem itemWithTitle:@"Checkout Commit" action:@selector(checkout:) enabled:YES]]; + [items addObject:[PBRefMenuItem separatorItem]]; + [items addObject:[PBRefMenuItem itemWithTitle:@"Create Branch…" action:@selector(createBranch:) enabled:YES]]; [items addObject:[PBRefMenuItem itemWithTitle:@"Create Tag…" action:@selector(createTag:) enabled:YES]]; [items addObject:[PBRefMenuItem separatorItem]]; From 859f77e71817eaedbfd671c04514e53627249c4a Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sat, 6 Mar 2010 16:41:49 -0700 Subject: [PATCH 35/90] Fix file names with spaces not working in the contextual menu Files with spaces end up with 4 extra spaces after the name. This stops them from working with the various commands in the contextual menus. --- PBGitHistoryController.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/PBGitHistoryController.m b/PBGitHistoryController.m index ba1517c..541dcf6 100644 --- a/PBGitHistoryController.m +++ b/PBGitHistoryController.m @@ -279,7 +279,11 @@ - (NSArray *)menuItemsForPaths:(NSArray *)paths { - BOOL multiple = [paths count] != 1; + NSMutableArray *filePaths = [NSMutableArray array]; + for (NSString *filePath in paths) + [filePaths addObject:[filePath stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]]; + + BOOL multiple = [filePaths count] != 1; NSMenuItem *historyItem = [[NSMenuItem alloc] initWithTitle:multiple? @"Show history of files" : @"Show history of file" action:@selector(showCommitsFromTree:) keyEquivalent:@""]; @@ -293,7 +297,7 @@ NSArray *menuItems = [NSArray arrayWithObjects:historyItem, finderItem, openFilesItem, nil]; for (NSMenuItem *item in menuItems) { [item setTarget:self]; - [item setRepresentedObject:paths]; + [item setRepresentedObject:filePaths]; } return menuItems; From dceabb67025e1e105a6e4b61055d2e6668ea5afa Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sat, 6 Feb 2010 19:07:22 -0700 Subject: [PATCH 36/90] Add Checkout Files to file browser contextual menu Allows checking out the state of a file from any commit to the working directory. --- PBGitHistoryController.m | 16 ++++++++++++++-- PBGitRepository.h | 1 + PBGitRepository.m | 24 ++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 2 deletions(-) diff --git a/PBGitHistoryController.m b/PBGitHistoryController.m index 541dcf6..0f6f578 100644 --- a/PBGitHistoryController.m +++ b/PBGitHistoryController.m @@ -266,6 +266,15 @@ } } +- (void) checkoutFiles:(id)sender +{ + NSMutableArray *files = [NSMutableArray array]; + for (NSString *filePath in [sender representedObject]) + [files addObject:[filePath stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]]; + + [repository checkoutFiles:files fromRefish:realCommit]; +} + - (NSMenu *)contextMenuForTreeView { @@ -286,7 +295,10 @@ BOOL multiple = [filePaths count] != 1; NSMenuItem *historyItem = [[NSMenuItem alloc] initWithTitle:multiple? @"Show history of files" : @"Show history of file" action:@selector(showCommitsFromTree:) - keyEquivalent:@""]; + keyEquivalent:@""]; + NSMenuItem *checkoutItem = [[NSMenuItem alloc] initWithTitle:multiple ? @"Checkout files" : @"Checkout file" + action:@selector(checkoutFiles:) + keyEquivalent:@""]; NSMenuItem *finderItem = [[NSMenuItem alloc] initWithTitle:@"Show in Finder" action:@selector(showInFinderAction:) keyEquivalent:@""]; @@ -294,7 +306,7 @@ action:@selector(openFilesAction:) keyEquivalent:@""]; - NSArray *menuItems = [NSArray arrayWithObjects:historyItem, finderItem, openFilesItem, nil]; + NSArray *menuItems = [NSArray arrayWithObjects:historyItem, checkoutItem, finderItem, openFilesItem, nil]; for (NSMenuItem *item in menuItems) { [item setTarget:self]; [item setRepresentedObject:filePaths]; diff --git a/PBGitRepository.h b/PBGitRepository.h index fc89755..18294d5 100644 --- a/PBGitRepository.h +++ b/PBGitRepository.h @@ -30,6 +30,7 @@ extern NSString* PBGitRepositoryErrorDomain; } - (BOOL) checkoutRefish:(id )ref; +- (BOOL) checkoutFiles:(NSArray *)files fromRefish:(id )ref; - (BOOL) createBranch:(NSString *)branchName atRefish:(id )ref; - (BOOL) createTag:(NSString *)tagName message:(NSString *)message atRefish:(id )commitSHA; diff --git a/PBGitRepository.m b/PBGitRepository.m index ab0fa04..4d5413a 100644 --- a/PBGitRepository.m +++ b/PBGitRepository.m @@ -450,6 +450,30 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; return YES; } +- (BOOL) checkoutFiles:(NSArray *)files fromRefish:(id )ref +{ + if (!files || ([files count] == 0)) + return NO; + + NSString *refName = nil; + if ([ref refishType] == kGitXBranchType) + refName = [ref shortName]; + else + refName = [ref refishName]; + + int retValue = 1; + NSMutableArray *arguments = [NSMutableArray arrayWithObjects:@"checkout", refName, @"--", nil]; + [arguments addObjectsFromArray:files]; + NSString *output = [self outputInWorkdirForArguments:arguments retValue:&retValue]; + if (retValue) { + NSString *message = [NSString stringWithFormat:@"There was an error checking out the file(s) from the %@ '%@'.\n\nPerhaps your working directory is not clean?", [ref refishType], [ref shortName]]; + [self.windowController showErrorSheetTitle:@"Checkout failed!" message:message arguments:arguments output:output]; + return NO; + } + + return YES; +} + - (BOOL) createBranch:(NSString *)branchName atRefish:(id )ref { if (!branchName || !ref) From 8359883c92f0e6e95cf59b6cf2bc749658012600 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Thu, 4 Feb 2010 19:25:17 -0700 Subject: [PATCH 37/90] Rename removeRef: to showDeleteRefSheet: - move the core of the delete implementation to the repository as deleteRef: - move it to it's own pragma mark section --- PBGitRepository.h | 1 + PBGitRepository.m | 22 ++++++++++++++++++++++ PBRefController.m | 44 +++++++++++++++++++++++++++----------------- PBRefMenuItem.m | 2 +- 4 files changed, 51 insertions(+), 18 deletions(-) diff --git a/PBGitRepository.h b/PBGitRepository.h index 18294d5..ac57508 100644 --- a/PBGitRepository.h +++ b/PBGitRepository.h @@ -33,6 +33,7 @@ extern NSString* PBGitRepositoryErrorDomain; - (BOOL) checkoutFiles:(NSArray *)files fromRefish:(id )ref; - (BOOL) createBranch:(NSString *)branchName atRefish:(id )ref; - (BOOL) createTag:(NSString *)tagName message:(NSString *)message atRefish:(id )commitSHA; +- (BOOL) deleteRef:(PBGitRef *)ref; - (NSFileHandle*) handleForCommand:(NSString*) cmd; - (NSFileHandle*) handleForArguments:(NSArray*) args; diff --git a/PBGitRepository.m b/PBGitRepository.m index 4d5413a..87935d9 100644 --- a/PBGitRepository.m +++ b/PBGitRepository.m @@ -526,6 +526,28 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; return YES; } +- (BOOL) deleteRef:(PBGitRef *)ref +{ + if (!ref) + return NO; + + int retValue = 1; + NSArray *arguments = [NSArray arrayWithObjects:@"update-ref", @"-d", [ref ref], nil]; + NSString * output = [self outputForArguments:arguments retValue:&retValue]; + if (retValue) { + NSString *message = [NSString stringWithFormat:@"There was an error deleting the ref: %@\n\n", [ref shortName]]; + [self.windowController showErrorSheetTitle:@"Delete ref failed!" message:message arguments:arguments output:output]; + return NO; + } + + [self removeBranch:[[PBGitRevSpecifier alloc] initWithRef:ref]]; + PBGitCommit *commit = [self commitForRef:ref]; + [commit removeRef:ref]; + + [self reloadRefs]; + return YES; +} + #pragma mark low level diff --git a/PBRefController.m b/PBRefController.m index 34caaa6..6b25b39 100644 --- a/PBRefController.m +++ b/PBRefController.m @@ -111,29 +111,39 @@ } -- (void) removeRefSheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo +#pragma mark Remove a branch, remote or tag + +- (void) showDeleteRefSheet:(PBRefMenuItem *)sender { + if ([[sender refish] refishType] == kGitXCommitType) + return; + + PBGitRef *ref = (PBGitRef *)[sender refish]; + NSString *ref_desc = [NSString stringWithFormat:@"%@ '%@'", [ref refishType], [ref shortName]]; + + NSAlert *alert = [NSAlert alertWithMessageText:[NSString stringWithFormat:@"Delete %@?", ref_desc] + defaultButton:@"Delete" + alternateButton:@"Cancel" + otherButton:nil + informativeTextWithFormat:@"Are you sure you want to remove the %@?", ref_desc]; + + [alert beginSheetModalForWindow:[historyController.repository.windowController window] + modalDelegate:self + didEndSelector:@selector(deleteRefSheetDidEnd:returnCode:contextInfo:) + contextInfo:ref]; +} + +- (void) deleteRefSheetDidEnd:(NSAlert *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo +{ + [[sheet window] orderOut:nil]; + if (returnCode == NSAlertDefaultReturn) { - int ret = 1; - PBRefMenuItem *refMenuItem = contextInfo; - [historyController.repository outputForArguments:[NSArray arrayWithObjects:@"update-ref", @"-d", [[refMenuItem refish] refishName], nil] retValue: &ret]; - if (ret) { - NSLog(@"Removing ref failed!"); - return; - } - [historyController.repository removeBranch:[[PBGitRevSpecifier alloc] initWithRef:[refMenuItem refish]]]; - PBGitCommit *commitForRef = [historyController.repository commitForRef:[refMenuItem refish]]; - [commitForRef removeRef:[refMenuItem refish]]; + PBGitRef *ref = (PBGitRef *)contextInfo; + [historyController.repository deleteRef:ref]; [commitController rearrangeObjects]; } } -- (void) removeRef:(PBRefMenuItem *)sender -{ - NSString *ref_desc = [NSString stringWithFormat:@"%@ %@", [(PBGitRef *)[sender refish] type], [[sender refish] shortName]]; - NSString *question = [NSString stringWithFormat:@"Are you sure you want to remove the %@?", ref_desc]; - NSBeginAlertSheet([NSString stringWithFormat:@"Delete %@?", ref_desc], @"Delete", @"Cancel", nil, [[historyController view] window], self, @selector(removeRefSheetDidEnd:returnCode:contextInfo:), NULL, sender, question); -} #pragma mark Contextual menus diff --git a/PBRefMenuItem.m b/PBRefMenuItem.m index 82051b1..dc9e29a 100644 --- a/PBRefMenuItem.m +++ b/PBRefMenuItem.m @@ -61,7 +61,7 @@ // delete ref [items addObject:[PBRefMenuItem separatorItem]]; NSString *deleteTitle = [NSString stringWithFormat:@"Delete %@…", targetRefName]; - [items addObject:[PBRefMenuItem itemWithTitle:deleteTitle action:@selector(removeRef:) enabled:YES]]; + [items addObject:[PBRefMenuItem itemWithTitle:deleteTitle action:@selector(showDeleteRefSheet:) enabled:YES]]; for (PBRefMenuItem *item in items) { [item setTarget:target]; From e2ccfe6fce1fcd8eb0a4c06222b10c140bd7c98b Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sat, 20 Feb 2010 06:54:29 -0700 Subject: [PATCH 38/90] Add Merge in the contextual menus for commits and refs --- PBGitRepository.h | 1 + PBGitRepository.m | 20 ++++++++++++++++++++ PBRefController.h | 1 + PBRefController.m | 9 +++++++++ PBRefMenuItem.m | 16 ++++++++++++++++ 5 files changed, 47 insertions(+) diff --git a/PBGitRepository.h b/PBGitRepository.h index ac57508..ffa9eb7 100644 --- a/PBGitRepository.h +++ b/PBGitRepository.h @@ -31,6 +31,7 @@ extern NSString* PBGitRepositoryErrorDomain; - (BOOL) checkoutRefish:(id )ref; - (BOOL) checkoutFiles:(NSArray *)files fromRefish:(id )ref; +- (BOOL) mergeWithRefish:(id )ref; - (BOOL) createBranch:(NSString *)branchName atRefish:(id )ref; - (BOOL) createTag:(NSString *)tagName message:(NSString *)message atRefish:(id )commitSHA; - (BOOL) deleteRef:(PBGitRef *)ref; diff --git a/PBGitRepository.m b/PBGitRepository.m index 87935d9..69c274c 100644 --- a/PBGitRepository.m +++ b/PBGitRepository.m @@ -474,6 +474,26 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; return YES; } + +- (BOOL) mergeWithRefish:(id )ref +{ + NSString *refName = [ref refishName]; + + int retValue = 1; + NSArray *arguments = [NSArray arrayWithObjects:@"merge", refName, nil]; + NSString *output = [self outputInWorkdirForArguments:arguments retValue:&retValue]; + if (retValue) { + NSString *headName = [[[self headRef] ref] shortName]; + NSString *message = [NSString stringWithFormat:@"There was an error merging %@ into %@.", refName, headName]; + [self.windowController showErrorSheetTitle:@"Merge failed!" message:message arguments:arguments output:output]; + return NO; + } + + [self reloadRefs]; + [self readCurrentBranch]; + return YES; +} + - (BOOL) createBranch:(NSString *)branchName atRefish:(id )ref { if (!branchName || !ref) diff --git a/PBRefController.h b/PBRefController.h index 3aac522..902d50d 100644 --- a/PBRefController.h +++ b/PBRefController.h @@ -24,6 +24,7 @@ } - (void) checkout:(PBRefMenuItem *)sender; +- (void) merge:(PBRefMenuItem *)sender; - (void) createBranch:(PBRefMenuItem *)sender; - (void) copySHA:(PBRefMenuItem *)sender; - (void) copyPatch:(PBRefMenuItem *)sender; diff --git a/PBRefController.m b/PBRefController.m index 6b25b39..e888745 100644 --- a/PBRefController.m +++ b/PBRefController.m @@ -39,6 +39,15 @@ } +#pragma mark Merge + +- (void) merge:(PBRefMenuItem *)sender +{ + id refish = [sender refish]; + [historyController.repository mergeWithRefish:refish]; +} + + #pragma mark Checkout - (void) checkout:(PBRefMenuItem *)sender diff --git a/PBRefMenuItem.m b/PBRefMenuItem.m index dc9e29a..ab87576 100644 --- a/PBRefMenuItem.m +++ b/PBRefMenuItem.m @@ -39,8 +39,11 @@ NSMutableArray *items = [NSMutableArray array]; NSString *targetRefName = [ref shortName]; + PBGitCommit *commit = [repo commitForRef:ref]; + BOOL isOnHeadBranch = [commit isOnHeadBranch]; PBGitRef *headRef = [[repo headRef] ref]; + NSString *headRefName = [headRef shortName]; BOOL isHead = [ref isEqualToRef:headRef]; // checkout ref @@ -57,6 +60,11 @@ // view tag info if ([ref isTag]) [items addObject:[PBRefMenuItem itemWithTitle:@"View tag info…" action:@selector(showTagInfoSheet:) enabled:YES]]; + [items addObject:[PBRefMenuItem separatorItem]]; + + // merge ref + NSString *mergeTitle = isOnHeadBranch ? @"Merge" : [NSString stringWithFormat:@"Merge %@ into %@", targetRefName, headRefName]; + [items addObject:[PBRefMenuItem itemWithTitle:mergeTitle action:@selector(merge:) enabled:!isOnHeadBranch]]; // delete ref [items addObject:[PBRefMenuItem separatorItem]]; @@ -76,6 +84,9 @@ { NSMutableArray *items = [NSMutableArray array]; + NSString *headBranchName = [[[commit.repository headRef] ref] shortName]; + BOOL isOnHeadBranch = [commit isOnHeadBranch]; + [items addObject:[PBRefMenuItem itemWithTitle:@"Checkout Commit" action:@selector(checkout:) enabled:YES]]; [items addObject:[PBRefMenuItem separatorItem]]; @@ -85,6 +96,11 @@ [items addObject:[PBRefMenuItem itemWithTitle:@"Copy SHA" action:@selector(copySHA:) enabled:YES]]; [items addObject:[PBRefMenuItem itemWithTitle:@"Copy Patch" action:@selector(copyPatch:) enabled:YES]]; + [items addObject:[PBRefMenuItem separatorItem]]; + + // merge commit + NSString *mergeTitle = isOnHeadBranch ? @"Merge commit" : [NSString stringWithFormat:@"Merge commit into %@", headBranchName]; + [items addObject:[PBRefMenuItem itemWithTitle:mergeTitle action:@selector(merge:) enabled:!isOnHeadBranch]]; for (PBRefMenuItem *item in items) { [item setTarget:target]; From e50ddbc503716d9676cf33a867462fc9b3a10622 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sun, 27 Dec 2009 13:29:50 -0700 Subject: [PATCH 39/90] Add Cherry Pick to contextual menu for commits. --- PBGitRepository.h | 1 + PBGitRepository.m | 21 +++++++++++++++++++++ PBRefController.h | 1 + PBRefController.m | 9 +++++++++ PBRefMenuItem.m | 4 ++++ 5 files changed, 36 insertions(+) diff --git a/PBGitRepository.h b/PBGitRepository.h index ffa9eb7..c4e25c4 100644 --- a/PBGitRepository.h +++ b/PBGitRepository.h @@ -32,6 +32,7 @@ extern NSString* PBGitRepositoryErrorDomain; - (BOOL) checkoutRefish:(id )ref; - (BOOL) checkoutFiles:(NSArray *)files fromRefish:(id )ref; - (BOOL) mergeWithRefish:(id )ref; +- (BOOL) cherryPickRefish:(id )ref; - (BOOL) createBranch:(NSString *)branchName atRefish:(id )ref; - (BOOL) createTag:(NSString *)tagName message:(NSString *)message atRefish:(id )commitSHA; - (BOOL) deleteRef:(PBGitRef *)ref; diff --git a/PBGitRepository.m b/PBGitRepository.m index 69c274c..675508b 100644 --- a/PBGitRepository.m +++ b/PBGitRepository.m @@ -494,6 +494,27 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; return YES; } +- (BOOL) cherryPickRefish:(id )ref +{ + if (!ref) + return NO; + + NSString *refName = [ref refishName]; + + int retValue = 1; + NSArray *arguments = [NSArray arrayWithObjects:@"cherry-pick", refName, nil]; + NSString *output = [self outputInWorkdirForArguments:arguments retValue:&retValue]; + if (retValue) { + NSString *message = [NSString stringWithFormat:@"There was an error cherry picking the %@ '%@'.\n\nPerhaps your working directory is not clean?", [ref refishType], [ref shortName]]; + [self.windowController showErrorSheetTitle:@"Cherry pick failed!" message:message arguments:arguments output:output]; + return NO; + } + + [self reloadRefs]; + [self readCurrentBranch]; + return YES; +} + - (BOOL) createBranch:(NSString *)branchName atRefish:(id )ref { if (!branchName || !ref) diff --git a/PBRefController.h b/PBRefController.h index 902d50d..0625759 100644 --- a/PBRefController.h +++ b/PBRefController.h @@ -25,6 +25,7 @@ - (void) checkout:(PBRefMenuItem *)sender; - (void) merge:(PBRefMenuItem *)sender; +- (void) cherryPick:(PBRefMenuItem *)sender; - (void) createBranch:(PBRefMenuItem *)sender; - (void) copySHA:(PBRefMenuItem *)sender; - (void) copyPatch:(PBRefMenuItem *)sender; diff --git a/PBRefController.m b/PBRefController.m index e888745..f98e320 100644 --- a/PBRefController.m +++ b/PBRefController.m @@ -57,6 +57,15 @@ } +#pragma mark Cherry Pick + +- (void) cherryPick:(PBRefMenuItem *)sender +{ + id refish = [sender refish]; + [historyController.repository cherryPickRefish:refish]; +} + + #pragma mark Create Branch - (void) createBranch:(PBRefMenuItem *)sender diff --git a/PBRefMenuItem.m b/PBRefMenuItem.m index ab87576..cecba01 100644 --- a/PBRefMenuItem.m +++ b/PBRefMenuItem.m @@ -102,6 +102,10 @@ NSString *mergeTitle = isOnHeadBranch ? @"Merge commit" : [NSString stringWithFormat:@"Merge commit into %@", headBranchName]; [items addObject:[PBRefMenuItem itemWithTitle:mergeTitle action:@selector(merge:) enabled:!isOnHeadBranch]]; + // cherry pick + NSString *cherryPickTitle = isOnHeadBranch ? @"Cherry pick commit" : [NSString stringWithFormat:@"Cherry pick commit to %@", headBranchName]; + [items addObject:[PBRefMenuItem itemWithTitle:cherryPickTitle action:@selector(cherryPick:) enabled:!isOnHeadBranch]]; + for (PBRefMenuItem *item in items) { [item setTarget:target]; [item setRefish:commit]; From 7eec230959b6572bb72c0e5eb356fa1848a8c4e8 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sat, 6 Feb 2010 12:55:51 -0700 Subject: [PATCH 40/90] Add Rebase to the contextual menu for commits and refs --- PBGitRepository.h | 1 + PBGitRepository.m | 26 ++++++++++++++++++++++++++ PBRefController.h | 1 + PBRefController.m | 11 +++++++++++ PBRefMenuItem.m | 8 ++++++++ 5 files changed, 47 insertions(+) diff --git a/PBGitRepository.h b/PBGitRepository.h index c4e25c4..7b8c9c5 100644 --- a/PBGitRepository.h +++ b/PBGitRepository.h @@ -33,6 +33,7 @@ extern NSString* PBGitRepositoryErrorDomain; - (BOOL) checkoutFiles:(NSArray *)files fromRefish:(id )ref; - (BOOL) mergeWithRefish:(id )ref; - (BOOL) cherryPickRefish:(id )ref; +- (BOOL) rebaseBranch:(id )branch onRefish:(id )upstream; - (BOOL) createBranch:(NSString *)branchName atRefish:(id )ref; - (BOOL) createTag:(NSString *)tagName message:(NSString *)message atRefish:(id )commitSHA; - (BOOL) deleteRef:(PBGitRef *)ref; diff --git a/PBGitRepository.m b/PBGitRepository.m index 675508b..ed95618 100644 --- a/PBGitRepository.m +++ b/PBGitRepository.m @@ -515,6 +515,32 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; return YES; } +- (BOOL) rebaseBranch:(id )branch onRefish:(id )upstream +{ + if (!upstream) + return NO; + + NSMutableArray *arguments = [NSMutableArray arrayWithObjects:@"rebase", [upstream refishName], nil]; + + if (branch) + [arguments addObject:[branch refishName]]; + + int retValue = 1; + NSString *output = [self outputInWorkdirForArguments:arguments retValue:&retValue]; + if (retValue) { + NSString *branchName = @"HEAD"; + if (branch) + branchName = [NSString stringWithFormat:@"%@ '%@'", [branch refishType], [branch shortName]]; + NSString *message = [NSString stringWithFormat:@"There was an error rebasing %@ with %@ '%@'.", branchName, [upstream refishType], [upstream shortName]]; + [self.windowController showErrorSheetTitle:@"Rebase failed!" message:message arguments:arguments output:output]; + return NO; + } + + [self reloadRefs]; + [self readCurrentBranch]; + return YES; +} + - (BOOL) createBranch:(NSString *)branchName atRefish:(id )ref { if (!branchName || !ref) diff --git a/PBRefController.h b/PBRefController.h index 0625759..21aab77 100644 --- a/PBRefController.h +++ b/PBRefController.h @@ -26,6 +26,7 @@ - (void) checkout:(PBRefMenuItem *)sender; - (void) merge:(PBRefMenuItem *)sender; - (void) cherryPick:(PBRefMenuItem *)sender; +- (void) rebaseHeadBranch:(PBRefMenuItem *)sender; - (void) createBranch:(PBRefMenuItem *)sender; - (void) copySHA:(PBRefMenuItem *)sender; - (void) copyPatch:(PBRefMenuItem *)sender; diff --git a/PBRefController.m b/PBRefController.m index f98e320..d4cd50e 100644 --- a/PBRefController.m +++ b/PBRefController.m @@ -66,6 +66,17 @@ } +#pragma mark Rebase + +- (void) rebaseHeadBranch:(PBRefMenuItem *)sender +{ + id refish = [sender refish]; + PBGitRef *headRef = [[historyController.repository headRef] ref]; + + [historyController.repository rebaseBranch:headRef onRefish:refish]; +} + + #pragma mark Create Branch - (void) createBranch:(PBRefMenuItem *)sender diff --git a/PBRefMenuItem.m b/PBRefMenuItem.m index cecba01..376a8cb 100644 --- a/PBRefMenuItem.m +++ b/PBRefMenuItem.m @@ -66,6 +66,10 @@ NSString *mergeTitle = isOnHeadBranch ? @"Merge" : [NSString stringWithFormat:@"Merge %@ into %@", targetRefName, headRefName]; [items addObject:[PBRefMenuItem itemWithTitle:mergeTitle action:@selector(merge:) enabled:!isOnHeadBranch]]; + // rebase + NSString *rebaseTitle = isOnHeadBranch ? @"Rebase" : [NSString stringWithFormat:@"Rebase %@ on %@", headRefName, targetRefName]; + [items addObject:[PBRefMenuItem itemWithTitle:rebaseTitle action:@selector(rebaseHeadBranch:) enabled:!isOnHeadBranch]]; + // delete ref [items addObject:[PBRefMenuItem separatorItem]]; NSString *deleteTitle = [NSString stringWithFormat:@"Delete %@…", targetRefName]; @@ -106,6 +110,10 @@ NSString *cherryPickTitle = isOnHeadBranch ? @"Cherry pick commit" : [NSString stringWithFormat:@"Cherry pick commit to %@", headBranchName]; [items addObject:[PBRefMenuItem itemWithTitle:cherryPickTitle action:@selector(cherryPick:) enabled:!isOnHeadBranch]]; + // rebase + NSString *rebaseTitle = isOnHeadBranch ? @"Rebase commit" : [NSString stringWithFormat:@"Rebase %@ on commit", headBranchName]; + [items addObject:[PBRefMenuItem itemWithTitle:rebaseTitle action:@selector(rebaseHeadBranch:) enabled:!isOnHeadBranch]]; + for (PBRefMenuItem *item in items) { [item setTarget:target]; [item setRefish:commit]; From 0c0b764005e392da1dbec3e4c0749b5d45d6db40 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sat, 6 Feb 2010 13:06:27 -0700 Subject: [PATCH 41/90] Remote progress sheet Add a progress sheet for remote operations that takes the arguments for a command and runs it in a task then shows a success or failure sheet. --- English.lproj/PBRemoteProgressSheet.xib | 807 ++++++++++++++++++++++++ GitX.xcodeproj/project.pbxproj | 18 + PBRemoteProgressSheet.h | 47 ++ PBRemoteProgressSheet.m | 249 ++++++++ 4 files changed, 1121 insertions(+) create mode 100644 English.lproj/PBRemoteProgressSheet.xib create mode 100644 PBRemoteProgressSheet.h create mode 100644 PBRemoteProgressSheet.m diff --git a/English.lproj/PBRemoteProgressSheet.xib b/English.lproj/PBRemoteProgressSheet.xib new file mode 100644 index 0000000..2a01a42 --- /dev/null +++ b/English.lproj/PBRemoteProgressSheet.xib @@ -0,0 +1,807 @@ + + + + 1050 + 10C540 + 732 + 1038.25 + 458.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 732 + + + YES + + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + YES + + YES + + + YES + + + + YES + + PBRemoteProgressSheet + + + FirstResponder + + + NSApplication + + + 1 + 2 + {{196, 412}, {397, 98}} + 544736256 + Window + NSWindow + + {1.79769e+308, 1.79769e+308} + + + 274 + + YES + + + 1314 + + {{35, 16}, {344, 20}} + + 16394 + 100 + + + + 274 + {{17, 44}, {363, 34}} + + YES + + 67239424 + 272891904 + Operation in progress. + + LucidaGrande + 13 + 16 + + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + + + {397, 98} + + + {{0, 0}, {1680, 1028}} + {1.79769e+308, 1.79769e+308} + + + + + YES + + + window + + + + 21 + + + + progressIndicator + + + + 22 + + + + progressDescription + + + + 33 + + + + + YES + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 1 + + + YES + + + + Progress Window (Window) + + + 2 + + + YES + + + + + + + 16 + + + + + 31 + + + YES + + + + + + 32 + + + + + + + YES + + YES + 1.IBEditorWindowLastContentRect + 1.IBPluginDependency + 1.IBWindowTemplateEditedContentRect + 1.NSWindowTemplate.visibleAtLaunch + 1.WindowOrigin + 1.editorWindowContentRectSynchronizationRect + 1.windowTemplate.hasMinSize + 1.windowTemplate.minSize + 16.IBPluginDependency + 2.IBPluginDependency + 31.IBPluginDependency + 32.IBPluginDependency + + + YES + {{639, 822}, {397, 98}} + com.apple.InterfaceBuilder.CocoaPlugin + {{639, 822}, {397, 98}} + + {196, 240} + {{202, 428}, {480, 270}} + + {420, 170} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + YES + + + YES + + + + + YES + + + YES + + + + 33 + + + + YES + + PBRemoteProgressSheet + NSWindowController + + YES + + YES + progressDescription + progressIndicator + + + YES + NSTextField + NSProgressIndicator + + + + IBProjectSource + PBRemoteProgressSheet.h + + + + + YES + + NSActionCell + NSCell + + IBFrameworkSource + AppKit.framework/Headers/NSActionCell.h + + + + NSApplication + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSApplication.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSApplicationScripting.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSColorPanel.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSHelpManager.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSPageLayout.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSUserInterfaceItemSearching.h + + + + NSCell + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSCell.h + + + + NSControl + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSControl.h + + + + NSFormatter + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFormatter.h + + + + NSMenu + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenu.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSAccessibility.h + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDictionaryController.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDragging.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontManager.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontPanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSKeyValueBinding.h + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSNibLoading.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSOutlineView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSPasteboard.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSSavePanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSToolbarItem.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSView.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSError.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFileManager.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueObserving.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyedArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObject.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObjectScripting.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSPortCoder.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSRunLoop.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptObjectSpecifiers.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptWhoseTests.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSThread.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURL.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLConnection.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLDownload.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUAppcast.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUUpdater.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebDownload.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebEditingDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebFrameLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebJavaPlugIn.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPlugin.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPluginContainer.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPolicyDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebResourceLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebScriptObject.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebUIDelegate.h + + + + NSProgressIndicator + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSProgressIndicator.h + + + + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSInterfaceStyle.h + + + + NSResponder + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSResponder.h + + + + NSTextField + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSTextField.h + + + + NSTextFieldCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSTextFieldCell.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSClipView.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItem.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSRulerView.h + + + + NSView + NSResponder + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSDrawer.h + + + + NSWindow + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSWindow.h + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSWindowScripting.h + + + + NSWindowController + NSResponder + + showWindow: + id + + + IBFrameworkSource + AppKit.framework/Headers/NSWindowController.h + + + + + 0 + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + ../GitX.xcodeproj + 3 + + diff --git a/GitX.xcodeproj/project.pbxproj b/GitX.xcodeproj/project.pbxproj index 7caba38..f8ee3bb 100644 --- a/GitX.xcodeproj/project.pbxproj +++ b/GitX.xcodeproj/project.pbxproj @@ -44,6 +44,8 @@ 93CB42C20EAB7B2200530609 /* PBGitDefaults.m in Sources */ = {isa = PBXBuildFile; fileRef = 93CB42C10EAB7B2200530609 /* PBGitDefaults.m */; }; 93F7857F0EA3ABF100C1F443 /* PBCommitMessageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 93F7857E0EA3ABF100C1F443 /* PBCommitMessageView.m */; }; D26DC6450E782C9000C777B2 /* gitx.icns in Resources */ = {isa = PBXBuildFile; fileRef = D26DC6440E782C9000C777B2 /* gitx.icns */; }; + D8083A43111E045D00337480 /* PBRemoteProgressSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = D8083A42111E045D00337480 /* PBRemoteProgressSheet.m */; }; + D8357535112640F100DE249D /* PBRemoteProgressSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = D8C1B77110E875CF009B7F8B /* PBRemoteProgressSheet.xib */; }; D854948610D5C01B0083B917 /* PBCreateBranchSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = D854948510D5C01B0083B917 /* PBCreateBranchSheet.m */; }; D85B939310E3D8B4007F3C28 /* PBCreateBranchSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = D85B939210E3D8B4007F3C28 /* PBCreateBranchSheet.xib */; }; D889EB3110E6BCBB00F08413 /* PBCreateTagSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = D889EB3010E6BCBB00F08413 /* PBCreateTagSheet.xib */; }; @@ -213,11 +215,14 @@ 93F7857E0EA3ABF100C1F443 /* PBCommitMessageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCommitMessageView.m; sourceTree = ""; }; 93FCCBA80EA8AF450061B02B /* PBGitConfig.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitConfig.m; sourceTree = ""; }; D26DC6440E782C9000C777B2 /* gitx.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = gitx.icns; sourceTree = ""; }; + D8083A2D111E045300337480 /* PBRemoteProgressSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBRemoteProgressSheet.h; sourceTree = ""; }; + D8083A42111E045D00337480 /* PBRemoteProgressSheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBRemoteProgressSheet.m; sourceTree = ""; }; D823487410CB382C00944BDE /* Terminal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Terminal.h; sourceTree = ""; }; D854948410D5C01B0083B917 /* PBCreateBranchSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCreateBranchSheet.h; sourceTree = ""; }; D854948510D5C01B0083B917 /* PBCreateBranchSheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCreateBranchSheet.m; sourceTree = ""; }; D854949310D5C3E20083B917 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/PBCreateBranchSheet.xib; sourceTree = ""; }; D85B93F610E51279007F3C28 /* PBGitRefish.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitRefish.h; sourceTree = ""; }; + D8C1B77210E875CF009B7F8B /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/PBRemoteProgressSheet.xib; sourceTree = ""; }; D8E3B2B710DC9FB2001096A3 /* ScriptingBridge.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ScriptingBridge.framework; path = /System/Library/Frameworks/ScriptingBridge.framework; sourceTree = ""; }; D8E3B34B10DCA958001096A3 /* PBCreateTagSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCreateTagSheet.h; sourceTree = ""; }; D8E3B34C10DCA958001096A3 /* PBCreateTagSheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCreateTagSheet.m; sourceTree = ""; }; @@ -462,6 +467,7 @@ F59116E50E843BB50072CCB1 /* PBGitCommitView.xib */, D85B939210E3D8B4007F3C28 /* PBCreateBranchSheet.xib */, D889EB3010E6BCBB00F08413 /* PBCreateTagSheet.xib */, + D8C1B77110E875CF009B7F8B /* PBRemoteProgressSheet.xib */, 47DBDB680E94EF6500671A1E /* Preferences.xib */, F569AE920F2CBD7C00C2FFA7 /* Credits.html */, ); @@ -511,6 +517,8 @@ D854948510D5C01B0083B917 /* PBCreateBranchSheet.m */, D8E3B34B10DCA958001096A3 /* PBCreateTagSheet.h */, D8E3B34C10DCA958001096A3 /* PBCreateTagSheet.m */, + D8083A2D111E045300337480 /* PBRemoteProgressSheet.h */, + D8083A42111E045D00337480 /* PBRemoteProgressSheet.m */, ); name = Sheets; sourceTree = ""; @@ -853,6 +861,7 @@ F569AE930F2CBD7C00C2FFA7 /* Credits.html in Resources */, D85B939310E3D8B4007F3C28 /* PBCreateBranchSheet.xib in Resources */, D889EB3110E6BCBB00F08413 /* PBCreateTagSheet.xib in Resources */, + D8357535112640F100DE249D /* PBRemoteProgressSheet.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -974,6 +983,7 @@ F59F1DD5105C4FF300115F88 /* PBGitIndex.m in Sources */, D854948610D5C01B0083B917 /* PBCreateBranchSheet.m in Sources */, D8E3B34D10DCA958001096A3 /* PBCreateTagSheet.m in Sources */, + D8083A43111E045D00337480 /* PBRemoteProgressSheet.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1082,6 +1092,14 @@ name = PBCreateTagSheet.xib; sourceTree = ""; }; + D8C1B77110E875CF009B7F8B /* PBRemoteProgressSheet.xib */ = { + isa = PBXVariantGroup; + children = ( + D8C1B77210E875CF009B7F8B /* English */, + ); + name = PBRemoteProgressSheet.xib; + sourceTree = ""; + }; F5B721C20E05CF7E00AF29DC /* MainMenu.xib */ = { isa = PBXVariantGroup; children = ( diff --git a/PBRemoteProgressSheet.h b/PBRemoteProgressSheet.h new file mode 100644 index 0000000..71a52b9 --- /dev/null +++ b/PBRemoteProgressSheet.h @@ -0,0 +1,47 @@ +// +// PBRemoteProgressSheetController.h +// GitX +// +// Created by Nathan Kinsinger on 12/6/09. +// Copyright 2009 Nathan Kinsinger. All rights reserved. +// + +#import + + +extern NSString * const kGitXProgressDescription; +extern NSString * const kGitXProgressSuccessDescription; +extern NSString * const kGitXProgressSuccessInfo; +extern NSString * const kGitXProgressErrorDescription; +extern NSString * const kGitXProgressErrorInfo; + + +@class PBGitRepository; +@class PBGitWindowController; + +@interface PBRemoteProgressSheet : NSWindowController { + PBGitWindowController *controller; + + NSArray *arguments; + NSString *title; + NSString *description; + + NSTask *gitTask; + NSInteger returnCode; + + NSTextField *progressDescription; + NSProgressIndicator *progressIndicator; + + NSTimer *taskTimer; +} + ++ (void) beginRemoteProgressSheetForArguments:(NSArray *)args title:(NSString *)theTitle description:(NSString *)theDescription inDir:(NSString *)dir windowController:(NSWindowController *)windowController; + ++ (void) beginRemoteProgressSheetForArguments:(NSArray *)args title:(NSString *)theTitle description:(NSString *)theDescription inRepository:(PBGitRepository *)repo; + + +@property (assign) IBOutlet NSTextField *progressDescription; +@property (assign) IBOutlet NSProgressIndicator *progressIndicator; + + +@end \ No newline at end of file diff --git a/PBRemoteProgressSheet.m b/PBRemoteProgressSheet.m new file mode 100644 index 0000000..77b250e --- /dev/null +++ b/PBRemoteProgressSheet.m @@ -0,0 +1,249 @@ +// +// PBRemoteProgressSheetController.m +// GitX +// +// Created by Nathan Kinsinger on 12/6/09. +// Copyright 2009 Nathan Kinsinger. All rights reserved. +// + +#import "PBRemoteProgressSheet.h" +#import "PBGitWindowController.h" +#import "PBGitRepository.h" +#import "PBGitBinary.h" +#import "PBEasyPipe.h" + + + +NSString * const kGitXProgressDescription = @"PBGitXProgressDescription"; +NSString * const kGitXProgressSuccessDescription = @"PBGitXProgressSuccessDescription"; +NSString * const kGitXProgressSuccessInfo = @"PBGitXProgressSuccessInfo"; +NSString * const kGitXProgressErrorDescription = @"PBGitXProgressErrorDescription"; +NSString * const kGitXProgressErrorInfo = @"PBGitXProgressErrorInfo"; + + + +@interface PBRemoteProgressSheet () + +- (void) beginRemoteProgressSheetForArguments:(NSArray *)args title:(NSString *)theTitle description:(NSString *)theDescription inDir:(NSString *)dir windowController:(PBGitWindowController *)controller; +- (void) showSuccessMessage; +- (void) showErrorMessage; + +- (NSString *) progressTitle; +- (NSString *) successTitle; +- (NSString *) successDescription; +- (NSString *) errorTitle; +- (NSString *) errorDescription; +- (NSString *) commandDescription; +- (NSString *) standardOutputDescription; +- (NSString *) standardErrorDescription; + +@end + + + +@implementation PBRemoteProgressSheet + + +@synthesize progressDescription; +@synthesize progressIndicator; + + + +#pragma mark - +#pragma mark PBRemoteProgressSheet + ++ (void) beginRemoteProgressSheetForArguments:(NSArray *)args title:(NSString *)theTitle description:(NSString *)theDescription inDir:(NSString *)dir windowController:(PBGitWindowController *)windowController +{ + PBRemoteProgressSheet *sheet = [[self alloc] initWithWindowNibName:@"PBRemoteProgressSheet"]; + [sheet beginRemoteProgressSheetForArguments:args title:theTitle description:theDescription inDir:dir windowController:windowController]; +} + + ++ (void) beginRemoteProgressSheetForArguments:(NSArray *)args title:(NSString *)theTitle description:(NSString *)theDescription inRepository:(PBGitRepository *)repo +{ + [PBRemoteProgressSheet beginRemoteProgressSheetForArguments:args title:theTitle description:theDescription inDir:[repo workingDirectory] windowController:repo.windowController]; +} + + +- (void) beginRemoteProgressSheetForArguments:(NSArray *)args title:(NSString *)theTitle description:(NSString *)theDescription inDir:(NSString *)dir windowController:(PBGitWindowController *)windowController +{ + controller = windowController; + arguments = args; + title = theTitle; + description = theDescription; + + [self window]; // loads the window (if it wasn't already) + [self.progressDescription setStringValue:[self progressTitle]]; + [self.progressIndicator startAnimation:nil]; + [NSApp beginSheet:[self window] modalForWindow:[controller window] modalDelegate:self didEndSelector:nil contextInfo:nil]; + + gitTask = [PBEasyPipe taskForCommand:[PBGitBinary path] withArgs:arguments inDir:dir]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(taskCompleted:) name:NSTaskDidTerminateNotification object:gitTask]; + + // having intermittent problem with long running git tasks not sending a termination notice, so periodically check whether the task is done + taskTimer = [NSTimer scheduledTimerWithTimeInterval:0.2 target:self selector:@selector(checkTask:) userInfo:nil repeats:YES]; + + [gitTask launch]; +} + + + +#pragma mark Notifications + +- (void) taskCompleted:(NSNotification *)notification +{ + [taskTimer invalidate]; + [[NSNotificationCenter defaultCenter] removeObserver:self]; + + [self.progressIndicator stopAnimation:nil]; + [NSApp endSheet:[self window]]; + [[self window] orderOut:self]; + + returnCode = [gitTask terminationStatus]; + if (returnCode) + [self showErrorMessage]; + else + [self showSuccessMessage]; + + if ([controller respondsToSelector:@selector(repository)]) + [controller.repository reloadRefs]; +} + + + +#pragma mark taskTimer + +- (void) checkTask:(NSTimer *)timer +{ + if (![gitTask isRunning]) { + NSLog(@"[%@ %s] gitTask terminated without notification", [self class], _cmd); + [self taskCompleted:nil]; + } +} + + + +#pragma mark Messages + +- (void) showSuccessMessage +{ + NSMutableString *info = [NSMutableString string]; + [info appendString:[self successDescription]]; + [info appendString:[self commandDescription]]; + [info appendString:[self standardOutputDescription]]; + + [(PBGitWindowController *)controller showMessageSheet:[self successTitle] infoText:info]; +} + + +- (void) showErrorMessage +{ + NSMutableString *info = [NSMutableString string]; + [info appendString:[self errorDescription]]; + [info appendString:[self commandDescription]]; + [info appendString:[self standardOutputDescription]]; + [info appendString:[self standardErrorDescription]]; + + NSDictionary *errorUserInfo = [NSDictionary dictionaryWithObjectsAndKeys: + [self errorTitle], NSLocalizedDescriptionKey, + info, NSLocalizedRecoverySuggestionErrorKey, + nil]; + NSError *error = [NSError errorWithDomain:PBGitRepositoryErrorDomain code:0 userInfo:errorUserInfo]; + + [(PBGitWindowController *)controller showErrorSheet:error]; +} + + + +#pragma mark Display Strings + +- (NSString *) progressTitle +{ + NSString *progress = description; + if (!progress) + progress = @"Operation in progress."; + + return progress; +} + + +- (NSString *) successTitle +{ + NSString *success = title; + if (!success) + success = @"Operation"; + + return [success stringByAppendingString:@" completed."]; +} + + +- (NSString *) successDescription +{ + NSString *info = description; + if (!info) + return @""; + + return [info stringByAppendingString:@" completed successfully.\n\n"]; +} + + +- (NSString *) errorTitle +{ + NSString *error = title; + if (!error) + error = @"Operation"; + + return [error stringByAppendingString:@" failed."]; +} + + +- (NSString *) errorDescription +{ + NSString *info = description; + if (!info) + return @""; + + return [info stringByAppendingString:@" encountered an error.\n\n"]; +} + + +- (NSString *) commandDescription +{ + if (!arguments || ([arguments count] == 0)) + return @""; + + return [NSString stringWithFormat:@"command: git %@", [arguments componentsJoinedByString:@" "]]; +} + + +- (NSString *) standardOutputDescription +{ + if (!gitTask || [gitTask isRunning]) + return @""; + + NSData *data = [[[gitTask standardOutput] fileHandleForReading] readDataToEndOfFile]; + NSString *standardOutput = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; + + if ([standardOutput isEqualToString:@""]) + return @""; + + return [NSString stringWithFormat:@"\n\n%@", standardOutput]; +} + + +- (NSString *) standardErrorDescription +{ + if (!gitTask || [gitTask isRunning]) + return @""; + + NSData *data = [[[gitTask standardError] fileHandleForReading] readDataToEndOfFile]; + NSString *standardError = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; + + if ([standardError isEqualToString:@""]) + return [NSString stringWithFormat:@"\nerror = %d", returnCode]; + + return [NSString stringWithFormat:@"\n\n%@\nerror = %d", standardError, returnCode]; +} + + +@end From 55973b4affc9f656a7cf474be289aacb782b6b65 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sat, 20 Feb 2010 07:11:35 -0700 Subject: [PATCH 42/90] Add convenience methods for remotes --- PBGitRepository.h | 6 ++++ PBGitRepository.m | 86 +++++++++++++++++++++++++++++++++++++++++++++++ PBRefMenuItem.m | 47 +++++++++++++++----------- 3 files changed, 119 insertions(+), 20 deletions(-) diff --git a/PBGitRepository.h b/PBGitRepository.h index 7b8c9c5..d60fca4 100644 --- a/PBGitRepository.h +++ b/PBGitRepository.h @@ -36,6 +36,7 @@ extern NSString* PBGitRepositoryErrorDomain; - (BOOL) rebaseBranch:(id )branch onRefish:(id )upstream; - (BOOL) createBranch:(NSString *)branchName atRefish:(id )ref; - (BOOL) createTag:(NSString *)tagName message:(NSString *)message atRefish:(id )commitSHA; +- (BOOL) deleteRemote:(PBGitRef *)ref; - (BOOL) deleteRef:(PBGitRef *)ref; - (NSFileHandle*) handleForCommand:(NSString*) cmd; @@ -72,6 +73,11 @@ extern NSString* PBGitRepositoryErrorDomain; - (BOOL) checkRefFormat:(NSString *)refName; - (BOOL) refExists:(PBGitRef *)ref; +- (NSArray *) remotes; +- (BOOL) hasRemotes; +- (PBGitRef *) remoteRefForBranch:(PBGitRef *)branch error:(NSError **)error; +- (NSString *) infoForRemote:(NSString *)remoteName; + - (void) readCurrentBranch; - (PBGitRevSpecifier*) addBranch: (PBGitRevSpecifier*) rev; - (BOOL)removeBranch:(PBGitRevSpecifier *)rev; diff --git a/PBGitRepository.m b/PBGitRepository.m index ed95618..13f8a06 100644 --- a/PBGitRepository.m +++ b/PBGitRepository.m @@ -426,6 +426,60 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; return nil; } +#pragma mark Remotes + +- (NSArray *) remotes +{ + int retValue = 1; + NSString *remotes = [self outputInWorkdirForArguments:[NSArray arrayWithObject:@"remote"] retValue:&retValue]; + if (retValue || [remotes isEqualToString:@""]) + return nil; + + return [remotes componentsSeparatedByCharactersInSet:[NSCharacterSet newlineCharacterSet]]; +} + +- (BOOL) hasRemotes +{ + return ([self remotes] != nil); +} + +- (PBGitRef *) remoteRefForBranch:(PBGitRef *)branch error:(NSError **)error +{ + if ([branch isRemote]) + return [branch remoteRef]; + + NSString *branchName = [branch branchName]; + if (branchName) { + NSString *remoteName = [[self config] valueForKeyPath:[NSString stringWithFormat:@"branch.%@.remote", branchName]]; + if (remoteName && ([remoteName isKindOfClass:[NSString class]] && ![remoteName isEqualToString:@""])) { + PBGitRef *remoteRef = [PBGitRef refFromString:[kGitXRemoteRefPrefix stringByAppendingString:remoteName]]; + // check that the remote is a valid ref and exists + if ([self checkRefFormat:[remoteRef ref]] && [self refExists:remoteRef]) + return remoteRef; + } + } + + if (error != NULL) { + NSString *info = [NSString stringWithFormat:@"There is no remote configured for the %@ '%@'.\n\nPlease select a branch from the popup menu, which has a corresponding remote tracking branch set up.\n\nYou can also use a contextual menu to choose a branch by right clicking on its label in the commit history list.", [branch refishType], [branch shortName]]; + *error = [NSError errorWithDomain:PBGitRepositoryErrorDomain code:0 + userInfo:[NSDictionary dictionaryWithObjectsAndKeys: + @"No remote configured for branch", NSLocalizedDescriptionKey, + info, NSLocalizedRecoverySuggestionErrorKey, + nil]]; + } + return nil; +} + +- (NSString *) infoForRemote:(NSString *)remoteName +{ + int retValue = 1; + NSString *output = [self outputInWorkdirForArguments:[NSArray arrayWithObjects:@"remote", @"show", remoteName, nil] retValue:&retValue]; + if (retValue) + return nil; + + return output; +} + #pragma mark Repository commands - (BOOL) checkoutRefish:(id )ref @@ -593,11 +647,43 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; return YES; } +- (BOOL) deleteRemote:(PBGitRef *)ref +{ + if (!ref || ([ref refishType] != kGitXRemoteType)) + return NO; + + int retValue = 1; + NSArray *arguments = [NSArray arrayWithObjects:@"remote", @"rm", [ref remoteName], nil]; + NSString * output = [self outputForArguments:arguments retValue:&retValue]; + if (retValue) { + NSString *message = [NSString stringWithFormat:@"There was an error deleting the remote: %@\n\n", [ref remoteName]]; + [self.windowController showErrorSheetTitle:@"Delete remote failed!" message:message arguments:arguments output:output]; + return NO; + } + + // remove the remote's branches + NSString *remoteRef = [kGitXRemoteRefPrefix stringByAppendingString:[ref remoteName]]; + for (PBGitRevSpecifier *rev in [branches copy]) { + PBGitRef *branch = [rev ref]; + if ([[branch ref] hasPrefix:remoteRef]) { + [self removeBranch:rev]; + PBGitCommit *commit = [self commitForRef:branch]; + [commit removeRef:branch]; + } + } + + [self reloadRefs]; + return YES; +} + - (BOOL) deleteRef:(PBGitRef *)ref { if (!ref) return NO; + if ([ref refishType] == kGitXRemoteType) + return [self deleteRemote:ref]; + int retValue = 1; NSArray *arguments = [NSArray arrayWithObjects:@"update-ref", @"-d", [ref ref], nil]; NSString * output = [self outputForArguments:arguments retValue:&retValue]; diff --git a/PBRefMenuItem.m b/PBRefMenuItem.m index 376a8cb..6d27972 100644 --- a/PBRefMenuItem.m +++ b/PBRefMenuItem.m @@ -39,36 +39,43 @@ NSMutableArray *items = [NSMutableArray array]; NSString *targetRefName = [ref shortName]; - PBGitCommit *commit = [repo commitForRef:ref]; - BOOL isOnHeadBranch = [commit isOnHeadBranch]; PBGitRef *headRef = [[repo headRef] ref]; NSString *headRefName = [headRef shortName]; BOOL isHead = [ref isEqualToRef:headRef]; + BOOL isOnHeadBranch = isHead ? YES : [repo isRefOnHeadBranch:ref]; - // checkout ref - NSString *checkoutTitle = [@"Checkout " stringByAppendingString:targetRefName]; - [items addObject:[PBRefMenuItem itemWithTitle:checkoutTitle action:@selector(checkout:) enabled:!isHead]]; - [items addObject:[PBRefMenuItem separatorItem]]; + NSString *remoteName = [ref remoteName]; + if (!remoteName && [ref isBranch]) + remoteName = [[repo remoteRefForBranch:ref error:NULL] remoteName]; + BOOL hasRemote = (remoteName ? YES : NO); + BOOL isRemote = ([ref isRemote] && ![ref isRemoteBranch]); - // create branch - [items addObject:[PBRefMenuItem itemWithTitle:@"Create branch…" action:@selector(createBranch:) enabled:YES]]; + if (!isRemote) { + // checkout ref + NSString *checkoutTitle = [@"Checkout " stringByAppendingString:targetRefName]; + [items addObject:[PBRefMenuItem itemWithTitle:checkoutTitle action:@selector(checkout:) enabled:!isHead]]; + [items addObject:[PBRefMenuItem separatorItem]]; - // create tag - [items addObject:[PBRefMenuItem itemWithTitle:@"Create Tag…" action:@selector(createTag:) enabled:YES]]; + // create branch + [items addObject:[PBRefMenuItem itemWithTitle:@"Create branch…" action:@selector(createBranch:) enabled:YES]]; - // view tag info - if ([ref isTag]) - [items addObject:[PBRefMenuItem itemWithTitle:@"View tag info…" action:@selector(showTagInfoSheet:) enabled:YES]]; - [items addObject:[PBRefMenuItem separatorItem]]; + // create tag + [items addObject:[PBRefMenuItem itemWithTitle:@"Create Tag…" action:@selector(createTag:) enabled:YES]]; - // merge ref - NSString *mergeTitle = isOnHeadBranch ? @"Merge" : [NSString stringWithFormat:@"Merge %@ into %@", targetRefName, headRefName]; - [items addObject:[PBRefMenuItem itemWithTitle:mergeTitle action:@selector(merge:) enabled:!isOnHeadBranch]]; + // view tag info + if ([ref isTag]) + [items addObject:[PBRefMenuItem itemWithTitle:@"View tag info…" action:@selector(showTagInfoSheet:) enabled:YES]]; + [items addObject:[PBRefMenuItem separatorItem]]; - // rebase - NSString *rebaseTitle = isOnHeadBranch ? @"Rebase" : [NSString stringWithFormat:@"Rebase %@ on %@", headRefName, targetRefName]; - [items addObject:[PBRefMenuItem itemWithTitle:rebaseTitle action:@selector(rebaseHeadBranch:) enabled:!isOnHeadBranch]]; + // merge ref + NSString *mergeTitle = isOnHeadBranch ? @"Merge" : [NSString stringWithFormat:@"Merge %@ into %@", targetRefName, headRefName]; + [items addObject:[PBRefMenuItem itemWithTitle:mergeTitle action:@selector(merge:) enabled:!isOnHeadBranch]]; + + // rebase + NSString *rebaseTitle = isOnHeadBranch ? @"Rebase" : [NSString stringWithFormat:@"Rebase %@ on %@", headRefName, targetRefName]; + [items addObject:[PBRefMenuItem itemWithTitle:rebaseTitle action:@selector(rebaseHeadBranch:) enabled:!isOnHeadBranch]]; + } // delete ref [items addObject:[PBRefMenuItem separatorItem]]; From 4654dc105fd007bf85f08ec46f095cef927200d9 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sat, 6 Feb 2010 18:27:17 -0700 Subject: [PATCH 43/90] Add Fetch to the contextual menus for refs --- PBGitRepository.h | 1 + PBGitRepository.m | 22 ++++++++++++++++++++++ PBRefController.h | 2 ++ PBRefController.m | 12 ++++++++++++ PBRefMenuItem.m | 6 ++++++ 5 files changed, 43 insertions(+) diff --git a/PBGitRepository.h b/PBGitRepository.h index d60fca4..8433ff7 100644 --- a/PBGitRepository.h +++ b/PBGitRepository.h @@ -29,6 +29,7 @@ extern NSString* PBGitRepositoryErrorDomain; PBGitRevSpecifier *_headRef; // Caching } +- (void) beginFetchFromRemoteForRef:(PBGitRef *)ref; - (BOOL) checkoutRefish:(id )ref; - (BOOL) checkoutFiles:(NSArray *)files fromRefish:(id )ref; - (BOOL) mergeWithRefish:(id )ref; diff --git a/PBGitRepository.m b/PBGitRepository.m index 13f8a06..821b855 100644 --- a/PBGitRepository.m +++ b/PBGitRepository.m @@ -15,6 +15,7 @@ #import "PBEasyPipe.h" #import "PBGitRef.h" #import "PBGitRevSpecifier.h" +#import "PBRemoteProgressSheet.h" NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; @@ -482,6 +483,27 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; #pragma mark Repository commands +- (void) beginFetchFromRemoteForRef:(PBGitRef *)ref +{ + NSMutableArray *arguments = [NSMutableArray arrayWithObject:@"fetch"]; + + if (![ref isRemote]) { + NSError *error = nil; + ref = [self remoteRefForBranch:ref error:&error]; + if (!ref) { + if (error) + [self.windowController showErrorSheet:error]; + return; + } + } + NSString *remoteName = [ref remoteName]; + [arguments addObject:remoteName]; + + NSString *description = [NSString stringWithFormat:@"Fetching all tracking branches from %@", remoteName]; + NSString *title = @"Fetching from remote"; + [PBRemoteProgressSheet beginRemoteProgressSheetForArguments:arguments title:title description:description inRepository:self]; +} + - (BOOL) checkoutRefish:(id )ref { NSString *refName = nil; diff --git a/PBRefController.h b/PBRefController.h index 21aab77..c4eee08 100644 --- a/PBRefController.h +++ b/PBRefController.h @@ -23,6 +23,8 @@ IBOutlet NSPopUpButton *branchPopUp; } +- (void) fetchRemote:(PBRefMenuItem *)sender; + - (void) checkout:(PBRefMenuItem *)sender; - (void) merge:(PBRefMenuItem *)sender; - (void) cherryPick:(PBRefMenuItem *)sender; diff --git a/PBRefController.m b/PBRefController.m index d4cd50e..cb25cb1 100644 --- a/PBRefController.m +++ b/PBRefController.m @@ -39,6 +39,18 @@ } +#pragma mark Fetch + +- (void) fetchRemote:(PBRefMenuItem *)sender +{ + id refish = [sender refish]; + if ([refish refishType] == kGitXCommitType) + return; + + [historyController.repository beginFetchFromRemoteForRef:refish]; +} + + #pragma mark Merge - (void) merge:(PBRefMenuItem *)sender diff --git a/PBRefMenuItem.m b/PBRefMenuItem.m index 6d27972..ef3d6b1 100644 --- a/PBRefMenuItem.m +++ b/PBRefMenuItem.m @@ -75,8 +75,14 @@ // rebase NSString *rebaseTitle = isOnHeadBranch ? @"Rebase" : [NSString stringWithFormat:@"Rebase %@ on %@", headRefName, targetRefName]; [items addObject:[PBRefMenuItem itemWithTitle:rebaseTitle action:@selector(rebaseHeadBranch:) enabled:!isOnHeadBranch]]; + + [items addObject:[PBRefMenuItem separatorItem]]; } + // fetch + NSString *fetchTitle = hasRemote ? [NSString stringWithFormat:@"Fetch %@", remoteName] : @"Fetch"; + [items addObject:[PBRefMenuItem itemWithTitle:fetchTitle action:@selector(fetchRemote:) enabled:hasRemote]]; + // delete ref [items addObject:[PBRefMenuItem separatorItem]]; NSString *deleteTitle = [NSString stringWithFormat:@"Delete %@…", targetRefName]; From 46e996f5c69684ddc84beb3c4c2f07dafa0aaea6 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sat, 6 Feb 2010 19:45:36 -0700 Subject: [PATCH 44/90] Add Pull to the contextual menus for refs --- PBGitRepository.h | 1 + PBGitRepository.m | 39 +++++++++++++++++++++++++++++++++++++++ PBRefController.h | 1 + PBRefController.m | 9 +++++++++ PBRefMenuItem.m | 5 +++++ 5 files changed, 55 insertions(+) diff --git a/PBGitRepository.h b/PBGitRepository.h index 8433ff7..5423b24 100644 --- a/PBGitRepository.h +++ b/PBGitRepository.h @@ -30,6 +30,7 @@ extern NSString* PBGitRepositoryErrorDomain; } - (void) beginFetchFromRemoteForRef:(PBGitRef *)ref; +- (void) beginPullFromRemote:(PBGitRef *)remoteRef forRef:(PBGitRef *)ref; - (BOOL) checkoutRefish:(id )ref; - (BOOL) checkoutFiles:(NSArray *)files fromRefish:(id )ref; - (BOOL) mergeWithRefish:(id )ref; diff --git a/PBGitRepository.m b/PBGitRepository.m index 821b855..6e39bea 100644 --- a/PBGitRepository.m +++ b/PBGitRepository.m @@ -504,6 +504,45 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; [PBRemoteProgressSheet beginRemoteProgressSheetForArguments:arguments title:title description:description inRepository:self]; } +- (void) beginPullFromRemote:(PBGitRef *)remoteRef forRef:(PBGitRef *)ref +{ + NSMutableArray *arguments = [NSMutableArray arrayWithObject:@"pull"]; + + // a nil remoteRef means lookup the ref's default remote + if (!remoteRef || ![remoteRef isRemote]) { + NSError *error = nil; + remoteRef = [self remoteRefForBranch:ref error:&error]; + if (!remoteRef) { + if (error) + [self.windowController showErrorSheet:error]; + return; + } + } + NSString *remoteName = [remoteRef remoteName]; + [arguments addObject:remoteName]; + + NSString *branchName = nil; + NSString *refSpec = nil; + if ([ref isRemoteBranch]) { + branchName = [ref shortName]; + refSpec = [ref remoteBranchName]; + } + else if ([ref isRemote] || !ref) { + branchName = @"all tracking branches"; + } + else { + branchName = [ref shortName]; + refSpec = [NSString stringWithFormat:@"%@:%@", branchName, branchName]; + } + if (refSpec) + [arguments addObject:refSpec]; + + NSString *headRefName = [[[self headRef] ref] shortName]; + NSString *description = [NSString stringWithFormat:@"Pulling %@ from %@ and updating %@", branchName, remoteName, headRefName]; + NSString *title = @"Pulling from remote"; + [PBRemoteProgressSheet beginRemoteProgressSheetForArguments:arguments title:title description:description inRepository:self]; +} + - (BOOL) checkoutRefish:(id )ref { NSString *refName = nil; diff --git a/PBRefController.h b/PBRefController.h index c4eee08..444faf2 100644 --- a/PBRefController.h +++ b/PBRefController.h @@ -24,6 +24,7 @@ } - (void) fetchRemote:(PBRefMenuItem *)sender; +- (void) pullRemote:(PBRefMenuItem *)sender; - (void) checkout:(PBRefMenuItem *)sender; - (void) merge:(PBRefMenuItem *)sender; diff --git a/PBRefController.m b/PBRefController.m index cb25cb1..635f5c2 100644 --- a/PBRefController.m +++ b/PBRefController.m @@ -51,6 +51,15 @@ } +#pragma mark Pull + +- (void) pullRemote:(PBRefMenuItem *)sender +{ + id refish = [sender refish]; + [historyController.repository beginPullFromRemote:nil forRef:refish]; +} + + #pragma mark Merge - (void) merge:(PBRefMenuItem *)sender diff --git a/PBRefMenuItem.m b/PBRefMenuItem.m index ef3d6b1..b670b01 100644 --- a/PBRefMenuItem.m +++ b/PBRefMenuItem.m @@ -83,6 +83,11 @@ NSString *fetchTitle = hasRemote ? [NSString stringWithFormat:@"Fetch %@", remoteName] : @"Fetch"; [items addObject:[PBRefMenuItem itemWithTitle:fetchTitle action:@selector(fetchRemote:) enabled:hasRemote]]; + // pull + NSString *pullRemoteName = [ref isRemoteBranch] ? [ref shortName] : remoteName; + NSString *pullTitle = hasRemote ? [NSString stringWithFormat:@"Pull %@ and update %@", pullRemoteName, headRefName] : @"Pull"; + [items addObject:[PBRefMenuItem itemWithTitle:pullTitle action:@selector(pullRemote:) enabled:hasRemote]]; + // delete ref [items addObject:[PBRefMenuItem separatorItem]]; NSString *deleteTitle = [NSString stringWithFormat:@"Delete %@…", targetRefName]; From 6e405972e860641806453f35b72bd34ac4044aa4 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sat, 6 Feb 2010 21:57:24 -0700 Subject: [PATCH 45/90] Add Push to the contextual menus for refs --- PBGitRepository.h | 1 + PBGitRepository.m | 36 ++++++++++++++++++++++++ PBRefController.h | 3 ++ PBRefController.m | 71 +++++++++++++++++++++++++++++++++++++++++++++++ PBRefMenuItem.m | 33 ++++++++++++++++++++++ 5 files changed, 144 insertions(+) diff --git a/PBGitRepository.h b/PBGitRepository.h index 5423b24..f40ec92 100644 --- a/PBGitRepository.h +++ b/PBGitRepository.h @@ -31,6 +31,7 @@ extern NSString* PBGitRepositoryErrorDomain; - (void) beginFetchFromRemoteForRef:(PBGitRef *)ref; - (void) beginPullFromRemote:(PBGitRef *)remoteRef forRef:(PBGitRef *)ref; +- (void) beginPushRef:(PBGitRef *)ref toRemote:(PBGitRef *)remoteRef; - (BOOL) checkoutRefish:(id )ref; - (BOOL) checkoutFiles:(NSArray *)files fromRefish:(id )ref; - (BOOL) mergeWithRefish:(id )ref; diff --git a/PBGitRepository.m b/PBGitRepository.m index 6e39bea..acbcf35 100644 --- a/PBGitRepository.m +++ b/PBGitRepository.m @@ -543,6 +543,42 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; [PBRemoteProgressSheet beginRemoteProgressSheetForArguments:arguments title:title description:description inRepository:self]; } +- (void) beginPushRef:(PBGitRef *)ref toRemote:(PBGitRef *)remoteRef +{ + NSMutableArray *arguments = [NSMutableArray arrayWithObject:@"push"]; + + // a nil remoteRef means lookup the ref's default remote + if (!remoteRef || ![remoteRef isRemote]) { + NSError *error = nil; + remoteRef = [self remoteRefForBranch:ref error:&error]; + if (!remoteRef) { + if (error) + [self.windowController showErrorSheet:error]; + return; + } + } + NSString *remoteName = [remoteRef remoteName]; + [arguments addObject:remoteName]; + + NSString *branchName = nil; + if ([ref isRemote] || !ref) { + branchName = @"all updates"; + } + else if ([ref isTag]) { + branchName = [NSString stringWithFormat:@"tag '%@'", [ref tagName]]; + [arguments addObject:@"tag"]; + [arguments addObject:[ref tagName]]; + } + else { + branchName = [ref shortName]; + [arguments addObject:branchName]; + } + + NSString *description = [NSString stringWithFormat:@"Pushing %@ to %@", branchName, remoteName]; + NSString *title = @"Pushing to remote"; + [PBRemoteProgressSheet beginRemoteProgressSheetForArguments:arguments title:title description:description inRepository:self]; +} + - (BOOL) checkoutRefish:(id )ref { NSString *refName = nil; diff --git a/PBRefController.h b/PBRefController.h index 444faf2..fb11cdb 100644 --- a/PBRefController.h +++ b/PBRefController.h @@ -25,6 +25,9 @@ - (void) fetchRemote:(PBRefMenuItem *)sender; - (void) pullRemote:(PBRefMenuItem *)sender; +- (void) pushUpdatesToRemote:(PBRefMenuItem *)sender; +- (void) pushDefaultRemoteForRef:(PBRefMenuItem *)sender; +- (void) pushToRemote:(PBRefMenuItem *)sender; - (void) checkout:(PBRefMenuItem *)sender; - (void) merge:(PBRefMenuItem *)sender; diff --git a/PBRefController.m b/PBRefController.m index 635f5c2..e82a52e 100644 --- a/PBRefController.m +++ b/PBRefController.m @@ -60,6 +60,77 @@ } +#pragma mark Push + +- (void) showConfirmPushRefSheet:(PBGitRef *)ref remote:(PBGitRef *)remoteRef +{ + if ((!ref && !remoteRef) + || (ref && ![ref isBranch] && ![ref isRemoteBranch]) + || (remoteRef && !([remoteRef refishType] == kGitXRemoteType))) + return; + + NSString *description = nil; + if (ref && remoteRef) + description = [NSString stringWithFormat:@"Push %@ '%@' to remote %@", [ref refishType], [ref shortName], [remoteRef remoteName]]; + else if (ref) + description = [NSString stringWithFormat:@"Push %@ '%@' to default remote", [ref refishType], [ref shortName]]; + else + description = [NSString stringWithFormat:@"Push updates to remote %@", [remoteRef remoteName]]; + + NSAlert *alert = [NSAlert alertWithMessageText:description + defaultButton:@"Push" + alternateButton:@"Cancel" + otherButton:nil + informativeTextWithFormat:@"Are you sure you want to %@?", description]; + + NSMutableDictionary *info = [NSMutableDictionary dictionary]; + if (ref) + [info setObject:ref forKey:kGitXBranchType]; + if (remoteRef) + [info setObject:remoteRef forKey:kGitXRemoteType]; + + [alert beginSheetModalForWindow:[historyController.repository.windowController window] + modalDelegate:self + didEndSelector:@selector(confirmPushRefSheetDidEnd:returnCode:contextInfo:) + contextInfo:info]; +} + +- (void) confirmPushRefSheetDidEnd:(NSAlert *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo +{ + [[sheet window] orderOut:nil]; + + if (returnCode == NSAlertDefaultReturn) { + PBGitRef *ref = [(NSDictionary *)contextInfo objectForKey:kGitXBranchType]; + PBGitRef *remoteRef = [(NSDictionary *)contextInfo objectForKey:kGitXRemoteType]; + + [historyController.repository beginPushRef:ref toRemote:remoteRef]; + } +} + +- (void) pushUpdatesToRemote:(PBRefMenuItem *)sender +{ + PBGitRef *remoteRef = [(PBGitRef *)[sender refish] remoteRef]; + + [self showConfirmPushRefSheet:nil remote:remoteRef]; +} + +- (void) pushDefaultRemoteForRef:(PBRefMenuItem *)sender +{ + PBGitRef *ref = (PBGitRef *)[sender refish]; + + [self showConfirmPushRefSheet:ref remote:nil]; +} + +- (void) pushToRemote:(PBRefMenuItem *)sender +{ + PBGitRef *ref = (PBGitRef *)[sender refish]; + NSString *remoteName = [sender representedObject]; + PBGitRef *remoteRef = [PBGitRef refFromString:[kGitXRemoteRefPrefix stringByAppendingString:remoteName]]; + + [self showConfirmPushRefSheet:ref remote:remoteRef]; +} + + #pragma mark Merge - (void) merge:(PBRefMenuItem *)sender diff --git a/PBRefMenuItem.m b/PBRefMenuItem.m index b670b01..532636e 100644 --- a/PBRefMenuItem.m +++ b/PBRefMenuItem.m @@ -88,6 +88,39 @@ NSString *pullTitle = hasRemote ? [NSString stringWithFormat:@"Pull %@ and update %@", pullRemoteName, headRefName] : @"Pull"; [items addObject:[PBRefMenuItem itemWithTitle:pullTitle action:@selector(pullRemote:) enabled:hasRemote]]; + // push + if (isRemote || [ref isRemoteBranch]) { + // push updates to remote + NSString *pushTitle = [NSString stringWithFormat:@"Push updates to %@", remoteName]; + [items addObject:[PBRefMenuItem itemWithTitle:pushTitle action:@selector(pushUpdatesToRemote:) enabled:YES]]; + } + else { + // push to default remote + BOOL hasDefaultRemote = NO; + if (![ref isTag] && hasRemote) { + hasDefaultRemote = YES; + NSString *pushTitle = [NSString stringWithFormat:@"Push %@ to %@", targetRefName, remoteName]; + [items addObject:[PBRefMenuItem itemWithTitle:pushTitle action:@selector(pushDefaultRemoteForRef:) enabled:YES]]; + } + + // push to remotes submenu + NSArray *remoteNames = [repo remotes]; + if ([remoteNames count] && !(hasDefaultRemote && ([remoteNames count] == 1))) { + NSString *pushToTitle = [NSString stringWithFormat:@"Push %@ to", targetRefName]; + PBRefMenuItem *pushToItem = [PBRefMenuItem itemWithTitle:pushToTitle action:nil enabled:YES]; + NSMenu *remotesMenu = [[NSMenu alloc] initWithTitle:@"remotesMenu"]; + for (NSString *remote in remoteNames) { + PBRefMenuItem *remoteItem = [PBRefMenuItem itemWithTitle:remote action:@selector(pushToRemote:) enabled:YES]; + [remoteItem setTarget:target]; + [remoteItem setRefish:ref]; + [remoteItem setRepresentedObject:remote]; + [remotesMenu addItem:remoteItem]; + } + [pushToItem setSubmenu:remotesMenu]; + [items addObject:pushToItem]; + } + } + // delete ref [items addObject:[PBRefMenuItem separatorItem]]; NSString *deleteTitle = [NSString stringWithFormat:@"Delete %@…", targetRefName]; From fe5dddc681974a01ed01aacedb8f0a33e96e2670 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sat, 13 Feb 2010 09:28:54 -0700 Subject: [PATCH 46/90] Add Add Remote - Add Remote in the Repository menu - an Add Remote Sheet --- English.lproj/MainMenu.xib | 51 +- English.lproj/PBAddRemoteSheet.xib | 1272 ++++++++++++++++++++++++++++ GitX.xcodeproj/project.pbxproj | 18 + PBAddRemoteSheet.h | 42 + PBAddRemoteSheet.m | 142 ++++ PBGitHistoryController.h | 1 + PBGitHistoryController.m | 6 + PBGitRepository.h | 1 + PBGitRepository.m | 9 + 9 files changed, 1539 insertions(+), 3 deletions(-) create mode 100644 English.lproj/PBAddRemoteSheet.xib create mode 100644 PBAddRemoteSheet.h create mode 100644 PBAddRemoteSheet.m diff --git a/English.lproj/MainMenu.xib b/English.lproj/MainMenu.xib index 34b4033..5f85dac 100644 --- a/English.lproj/MainMenu.xib +++ b/English.lproj/MainMenu.xib @@ -666,6 +666,15 @@ + + + Add Remote + r + 1572864 + 2147483647 + + + YES @@ -1315,6 +1324,14 @@ 950 + + + showAddRemoteSheet: + + + + 953 + @@ -1978,6 +1995,7 @@ + @@ -2006,6 +2024,11 @@ + + 951 + + + @@ -2204,6 +2227,7 @@ 943.IBPluginDependency 947.IBPluginDependency 949.IBPluginDependency + 951.IBPluginDependency YES @@ -2392,7 +2416,8 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{668, 643}, {192, 93}} + {{668, 623}, {206, 113}} + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -2417,7 +2442,7 @@ - 950 + 953 @@ -2650,13 +2675,13 @@ YES createBranch: - createTag: openFilesAction: openSelectedFile: refresh: setDetailedView: setRawView: setTreeView: + showAddRemoteSheet: showCommitsFromTree: showInFinderAction: toggleQuickView: @@ -2835,10 +2860,20 @@ YES changeBranch: + checkout: + cherryPick: copyPatch: copySHA: createBranch: createTag: + fetchRemote: + merge: + pullRemote: + pushDefaultRemoteForRef: + pushToRemote: + pushUpdatesToRemote: + rebaseActiveBranch: + rebaseHeadBranch: showTagInfoSheet: @@ -2849,6 +2884,16 @@ PBRefMenuItem PBRefMenuItem PBRefMenuItem + PBRefMenuItem + PBRefMenuItem + PBRefMenuItem + PBRefMenuItem + PBRefMenuItem + PBRefMenuItem + PBRefMenuItem + PBRefMenuItem + PBRefMenuItem + PBRefMenuItem diff --git a/English.lproj/PBAddRemoteSheet.xib b/English.lproj/PBAddRemoteSheet.xib new file mode 100644 index 0000000..03ecd45 --- /dev/null +++ b/English.lproj/PBAddRemoteSheet.xib @@ -0,0 +1,1272 @@ + + + + 1050 + 10C540 + 759 + 1038.25 + 458.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 759 + + + YES + + + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + YES + + YES + + + YES + + + + YES + + PBAddRemoteSheet + + + FirstResponder + + + NSApplication + + + 1 + 2 + {{196, 317}, {480, 193}} + 544736256 + Add Remote Sheet + NSWindow + + {1.79769e+308, 1.79769e+308} + {480, 156} + + + 256 + + YES + + + 266 + {{117, 114}, {343, 22}} + + YES + + -1804468671 + 272630784 + + + LucidaGrande + 13 + 1044 + + name + + YES + + 6 + System + textBackgroundColor + + 3 + MQA + + + + 6 + System + textColor + + 3 + MAA + + + + + + + 268 + {{17, 116}, {95, 17}} + + YES + + 68288064 + 71304192 + Remote name: + + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + + + + + + 266 + {{117, 83}, {343, 22}} + + YES + + -1804468671 + 272630784 + + + URL + + YES + + + + + + + 268 + {{27, 85}, {85, 17}} + + YES + + 68288064 + 71304192 + Remote URL: + + + + + + + + + 289 + {{370, 12}, {96, 32}} + + YES + + 67239424 + 134217728 + Add + + + -2038284033 + 129 + + DQ + 200 + 25 + + + + + 289 + {{274, 12}, {96, 32}} + + YES + + 67239424 + 134217728 + Cancel + + + -2038284033 + 129 + + Gw + 200 + 25 + + + + + 292 + {{17, 22}, {258, 17}} + + YES + + 68288064 + 272634880 + Invalid name + + + + + 1 + MSAwIDAAA + + + + + + 268 + {{384, 58}, {76, 17}} + + YES + + -2080244224 + 134479872 + Browse... + + LucidaGrande + 9 + 3614 + + + -2038152961 + 164 + + + 400 + 75 + + + + + 268 + {{17, 156}, {86, 17}} + + YES + + 68288064 + 272630784 + Add Remote + + LucidaGrande-Bold + 13 + 16 + + + + + + + + {480, 193} + + + {{0, 0}, {1680, 1028}} + {480, 178} + {1.79769e+308, 1.79769e+308} + + + + 268 + + YES + + + 268 + {{53, 18}, {133, 18}} + + YES + + 67239424 + 0 + Show hidden files + + + 1211912703 + 2 + + NSImage + NSSwitch + + + NSSwitch + + + + 200 + 25 + + + + {239, 54} + + NSView + + + + + YES + + + errorMessage + + + + 27 + + + + addRemote: + + + + 29 + + + + browseFolders: + + + + 30 + + + + window + + + + 31 + + + + orderOutAddRemoteSheet: + + + + 41 + + + + browseAccessoryView + + + + 48 + + + + showHideHiddenFiles: + + + + 49 + + + + remoteURL + + + + 50 + + + + remoteName + + + + 51 + + + + + YES + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 1 + + + YES + + + + Add Remote Sheet + + + 2 + + + YES + + + + + + + + + + + + + + 3 + + + YES + + + + Text Field (Name) + + + 4 + + + YES + + + + + + 5 + + + YES + + + + Text Field (URL) + + + 6 + + + YES + + + + + + 7 + + + YES + + + + + + 8 + + + YES + + + + + + 9 + + + YES + + + + + + 10 + + + + + 11 + + + + + 12 + + + + + 13 + + + + + 14 + + + + + 15 + + + + + 16 + + + + + 17 + + + YES + + + + + + 18 + + + + + 38 + + + YES + + + + Open Panel Accessory + + + 39 + + + YES + + + + + + 40 + + + + + 54 + + + YES + + + + + + 55 + + + + + + + YES + + YES + 1.IBEditorWindowLastContentRect + 1.IBPluginDependency + 1.IBWindowTemplateEditedContentRect + 1.NSWindowTemplate.visibleAtLaunch + 1.WindowOrigin + 1.editorWindowContentRectSynchronizationRect + 1.windowTemplate.hasMinSize + 1.windowTemplate.minSize + 10.IBPluginDependency + 11.IBPluginDependency + 12.IBPluginDependency + 13.IBPluginDependency + 14.IBPluginDependency + 15.IBPluginDependency + 16.IBPluginDependency + 17.IBPluginDependency + 18.IBPluginDependency + 2.IBPluginDependency + 3.IBPluginDependency + 38.IBEditorWindowLastContentRect + 38.IBPluginDependency + 39.IBPluginDependency + 4.IBPluginDependency + 40.IBPluginDependency + 5.IBAttributePlaceholdersKey + 5.IBPluginDependency + 54.IBPluginDependency + 55.IBPluginDependency + 6.IBPluginDependency + 7.IBPluginDependency + 8.IBPluginDependency + 9.IBPluginDependency + + + YES + {{509, 781}, {480, 193}} + com.apple.InterfaceBuilder.CocoaPlugin + {{509, 781}, {480, 193}} + + {196, 240} + {{202, 428}, {480, 270}} + + {480, 156} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{632, 734}, {239, 54}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + RXhhbXBsZXM6Ci9Vc2Vycy91c2VybmFtZS9wYXRoL3RvL3JlcG8uZ2l0LwpnaXQ6Ly9ob3N0Lnh6L3Bh +dGgvdG8vcmVwby5naXQvCnNzaDovL1t1c2VyQF1ob3N0Lnh6L3BhdGgvdG8vcmVwby5naXQvA + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + YES + + + YES + + + + + YES + + + YES + + + + 55 + + + + YES + + PBAddRemoteSheet + NSWindowController + + YES + + YES + addRemote: + browseFolders: + orderOutAddRemoteSheet: + showHideHiddenFiles: + + + YES + id + id + id + id + + + + YES + + YES + browseAccessoryView + errorMessage + remoteName + remoteURL + + + YES + NSView + NSTextField + NSTextField + NSTextField + + + + IBProjectSource + PBAddRemoteSheet.h + + + + + YES + + NSActionCell + NSCell + + IBFrameworkSource + AppKit.framework/Headers/NSActionCell.h + + + + NSApplication + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSApplication.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSApplicationScripting.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSColorPanel.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSHelpManager.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSPageLayout.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSUserInterfaceItemSearching.h + + + + NSButton + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSButton.h + + + + NSButtonCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSButtonCell.h + + + + NSCell + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSCell.h + + + + NSControl + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSControl.h + + + + NSFormatter + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFormatter.h + + + + NSMenu + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenu.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSAccessibility.h + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDictionaryController.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDragging.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontManager.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontPanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSKeyValueBinding.h + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSNibLoading.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSOutlineView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSPasteboard.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSSavePanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSToolbarItem.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSView.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSError.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFileManager.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueObserving.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyedArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObject.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObjectScripting.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSPortCoder.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSRunLoop.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptObjectSpecifiers.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptWhoseTests.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSThread.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURL.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLConnection.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLDownload.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUAppcast.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUUpdater.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebDownload.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebEditingDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebFrameLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebJavaPlugIn.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPlugin.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPluginContainer.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPolicyDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebResourceLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebScriptObject.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebUIDelegate.h + + + + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSInterfaceStyle.h + + + + NSResponder + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSResponder.h + + + + NSTextField + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSTextField.h + + + + NSTextFieldCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSTextFieldCell.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSClipView.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItem.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSRulerView.h + + + + NSView + NSResponder + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSDrawer.h + + + + NSWindow + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSWindow.h + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSWindowScripting.h + + + + NSWindowController + NSResponder + + showWindow: + id + + + IBFrameworkSource + AppKit.framework/Headers/NSWindowController.h + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + ../GitX.xcodeproj + 3 + + diff --git a/GitX.xcodeproj/project.pbxproj b/GitX.xcodeproj/project.pbxproj index f8ee3bb..a5ef6dd 100644 --- a/GitX.xcodeproj/project.pbxproj +++ b/GitX.xcodeproj/project.pbxproj @@ -45,6 +45,8 @@ 93F7857F0EA3ABF100C1F443 /* PBCommitMessageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 93F7857E0EA3ABF100C1F443 /* PBCommitMessageView.m */; }; D26DC6450E782C9000C777B2 /* gitx.icns in Resources */ = {isa = PBXBuildFile; fileRef = D26DC6440E782C9000C777B2 /* gitx.icns */; }; D8083A43111E045D00337480 /* PBRemoteProgressSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = D8083A42111E045D00337480 /* PBRemoteProgressSheet.m */; }; + D8083C44111F106800337480 /* PBAddRemoteSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = D8083C43111F106800337480 /* PBAddRemoteSheet.m */; }; + D8083C47111F136400337480 /* PBAddRemoteSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = D8083C45111F136400337480 /* PBAddRemoteSheet.xib */; }; D8357535112640F100DE249D /* PBRemoteProgressSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = D8C1B77110E875CF009B7F8B /* PBRemoteProgressSheet.xib */; }; D854948610D5C01B0083B917 /* PBCreateBranchSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = D854948510D5C01B0083B917 /* PBCreateBranchSheet.m */; }; D85B939310E3D8B4007F3C28 /* PBCreateBranchSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = D85B939210E3D8B4007F3C28 /* PBCreateBranchSheet.xib */; }; @@ -217,6 +219,9 @@ D26DC6440E782C9000C777B2 /* gitx.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = gitx.icns; sourceTree = ""; }; D8083A2D111E045300337480 /* PBRemoteProgressSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBRemoteProgressSheet.h; sourceTree = ""; }; D8083A42111E045D00337480 /* PBRemoteProgressSheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBRemoteProgressSheet.m; sourceTree = ""; }; + D8083C42111F106800337480 /* PBAddRemoteSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBAddRemoteSheet.h; sourceTree = ""; }; + D8083C43111F106800337480 /* PBAddRemoteSheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBAddRemoteSheet.m; sourceTree = ""; }; + D8083C46111F136400337480 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/PBAddRemoteSheet.xib; sourceTree = ""; }; D823487410CB382C00944BDE /* Terminal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Terminal.h; sourceTree = ""; }; D854948410D5C01B0083B917 /* PBCreateBranchSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCreateBranchSheet.h; sourceTree = ""; }; D854948510D5C01B0083B917 /* PBCreateBranchSheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCreateBranchSheet.m; sourceTree = ""; }; @@ -468,6 +473,7 @@ D85B939210E3D8B4007F3C28 /* PBCreateBranchSheet.xib */, D889EB3010E6BCBB00F08413 /* PBCreateTagSheet.xib */, D8C1B77110E875CF009B7F8B /* PBRemoteProgressSheet.xib */, + D8083C45111F136400337480 /* PBAddRemoteSheet.xib */, 47DBDB680E94EF6500671A1E /* Preferences.xib */, F569AE920F2CBD7C00C2FFA7 /* Credits.html */, ); @@ -519,6 +525,8 @@ D8E3B34C10DCA958001096A3 /* PBCreateTagSheet.m */, D8083A2D111E045300337480 /* PBRemoteProgressSheet.h */, D8083A42111E045D00337480 /* PBRemoteProgressSheet.m */, + D8083C42111F106800337480 /* PBAddRemoteSheet.h */, + D8083C43111F106800337480 /* PBAddRemoteSheet.m */, ); name = Sheets; sourceTree = ""; @@ -862,6 +870,7 @@ D85B939310E3D8B4007F3C28 /* PBCreateBranchSheet.xib in Resources */, D889EB3110E6BCBB00F08413 /* PBCreateTagSheet.xib in Resources */, D8357535112640F100DE249D /* PBRemoteProgressSheet.xib in Resources */, + D8083C47111F136400337480 /* PBAddRemoteSheet.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -984,6 +993,7 @@ D854948610D5C01B0083B917 /* PBCreateBranchSheet.m in Sources */, D8E3B34D10DCA958001096A3 /* PBCreateTagSheet.m in Sources */, D8083A43111E045D00337480 /* PBRemoteProgressSheet.m in Sources */, + D8083C44111F106800337480 /* PBAddRemoteSheet.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1076,6 +1086,14 @@ name = RepositoryWindow.xib; sourceTree = ""; }; + D8083C45111F136400337480 /* PBAddRemoteSheet.xib */ = { + isa = PBXVariantGroup; + children = ( + D8083C46111F136400337480 /* English */, + ); + name = PBAddRemoteSheet.xib; + sourceTree = ""; + }; D85B939210E3D8B4007F3C28 /* PBCreateBranchSheet.xib */ = { isa = PBXVariantGroup; children = ( diff --git a/PBAddRemoteSheet.h b/PBAddRemoteSheet.h new file mode 100644 index 0000000..529fbce --- /dev/null +++ b/PBAddRemoteSheet.h @@ -0,0 +1,42 @@ +// +// PBAddRemoteSheet.h +// GitX +// +// Created by Nathan Kinsinger on 12/8/09. +// Copyright 2009 Nathan Kinsinger. All rights reserved. +// + +#import + + +@class PBGitRepository; + +@interface PBAddRemoteSheet : NSWindowController { + PBGitRepository *repository; + + NSTextField *remoteName; + NSTextField *remoteURL; + NSTextField *errorMessage; + + NSOpenPanel *browseSheet; + NSView *browseAccessoryView; +} + ++ (void) beginAddRemoteSheetForRepository:(PBGitRepository *)repo; + +- (IBAction) browseFolders:(id)sender; +- (IBAction) addRemote:(id)sender; +- (IBAction) orderOutAddRemoteSheet:(id)sender; +- (IBAction) showHideHiddenFiles:(id)sender; + + +@property (readwrite) PBGitRepository *repository; + +@property (readwrite) IBOutlet NSTextField *remoteName; +@property (readwrite) IBOutlet NSTextField *remoteURL; +@property (readwrite) IBOutlet NSTextField *errorMessage; + +@property (readwrite) NSOpenPanel *browseSheet; +@property (readwrite) IBOutlet NSView *browseAccessoryView; + +@end diff --git a/PBAddRemoteSheet.m b/PBAddRemoteSheet.m new file mode 100644 index 0000000..2d6a332 --- /dev/null +++ b/PBAddRemoteSheet.m @@ -0,0 +1,142 @@ +// +// PBAddRemoteSheet.m +// GitX +// +// Created by Nathan Kinsinger on 12/8/09. +// Copyright 2009 Nathan Kinsinger. All rights reserved. +// + +#import "PBAddRemoteSheet.h" +#import "PBGitWindowController.h" +#import "PBGitRepository.h" + + + +@interface PBAddRemoteSheet () + +- (void) beginAddRemoteSheetForRepository:(PBGitRepository *)repo; +- (void) openAddRemoteSheet; + +@end + + +@implementation PBAddRemoteSheet + + +@synthesize repository; + +@synthesize remoteName; +@synthesize remoteURL; +@synthesize errorMessage; + +@synthesize browseSheet; +@synthesize browseAccessoryView; + + + +#pragma mark - +#pragma mark PBAddRemoteSheet + ++ (void) beginAddRemoteSheetForRepository:(PBGitRepository *)repo +{ + PBAddRemoteSheet *sheet = [[self alloc] initWithWindowNibName:@"PBAddRemoteSheet"]; + [sheet beginAddRemoteSheetForRepository:repo]; +} + + +- (void) beginAddRemoteSheetForRepository:(PBGitRepository *)repo +{ + self.repository = repo; + + [self window]; + [self openAddRemoteSheet]; +} + + +- (void) openAddRemoteSheet +{ + [self.errorMessage setStringValue:@""]; + + [NSApp beginSheet:[self window] modalForWindow:[self.repository.windowController window] modalDelegate:self didEndSelector:nil contextInfo:NULL]; +} + + +- (void) browseSheetDidEnd:(NSWindow *)sheet returnCode:(NSInteger)code contextInfo:(void *)info +{ + [sheet orderOut:self]; + + if (code == NSOKButton) + [self.remoteURL setStringValue:[(NSOpenPanel *)sheet filename]]; + + [self openAddRemoteSheet]; +} + + + +#pragma mark IBActions + +- (IBAction) browseFolders:(id)sender +{ + [self orderOutAddRemoteSheet:nil]; + + self.browseSheet = [NSOpenPanel openPanel]; + + [browseSheet setTitle:@"Add remote"]; + [browseSheet setMessage:@"Select a folder with a git repository"]; + [browseSheet setCanChooseFiles:NO]; + [browseSheet setCanChooseDirectories:YES]; + [browseSheet setAllowsMultipleSelection:NO]; + [browseSheet setCanCreateDirectories:NO]; + [browseSheet setAccessoryView:browseAccessoryView]; + + [browseSheet beginSheetForDirectory:nil file:nil types:nil + modalForWindow:[self.repository.windowController window] + modalDelegate:self + didEndSelector:@selector(browseSheetDidEnd:returnCode:contextInfo:) + contextInfo:NULL]; +} + + +- (IBAction) addRemote:(id)sender +{ + [self.errorMessage setStringValue:@""]; + + NSString *name = [[self.remoteName stringValue] copy]; + + if ([name isEqualToString:@""]) { + [self.errorMessage setStringValue:@"Remote name is required"]; + return; + } + + if (![self.repository checkRefFormat:[@"refs/remotes/" stringByAppendingString:name]]) { + [self.errorMessage setStringValue:@"Invalid remote name"]; + return; + } + + NSString *url = [[self.remoteURL stringValue] copy]; + if ([url isEqualToString:@""]) { + [self.errorMessage setStringValue:@"Remote URL is required"]; + return; + } + + [self orderOutAddRemoteSheet:self]; + [self.repository beginAddRemote:name forURL:url]; +} + + +- (IBAction) orderOutAddRemoteSheet:(id)sender +{ + [NSApp endSheet:[self window]]; + [[self window] orderOut:self]; +} + + +- (IBAction) showHideHiddenFiles:(id)sender +{ + // This uses undocumented OpenPanel features to show hidden files (required for 10.5 support) + NSNumber *showHidden = [NSNumber numberWithBool:[sender state] == NSOnState]; + [[self.browseSheet valueForKey:@"_navView"] setValue:showHidden forKey:@"showsHiddenFiles"]; +} + + +@end diff --git a/PBGitHistoryController.h b/PBGitHistoryController.h index 2be198b..bd0635e 100644 --- a/PBGitHistoryController.h +++ b/PBGitHistoryController.h @@ -54,6 +54,7 @@ // Repository Methods - (IBAction) createBranch:(id)sender; - (IBAction) createTag:(id)sender; +- (IBAction) showAddRemoteSheet:(id)sender; - (void) copyCommitInfo; diff --git a/PBGitHistoryController.m b/PBGitHistoryController.m index 0f6f578..d28c9b2 100644 --- a/PBGitHistoryController.m +++ b/PBGitHistoryController.m @@ -13,6 +13,7 @@ #import "PBCommitList.h" #import "PBCreateBranchSheet.h" #import "PBCreateTagSheet.h" +#import "PBAddRemoteSheet.h" #define QLPreviewPanel NSClassFromString(@"QLPreviewPanel") @@ -360,4 +361,9 @@ [PBCreateTagSheet beginCreateTagSheetAtRefish:realCommit inRepository:repository]; } +- (IBAction) showAddRemoteSheet:(id)sender +{ + [PBAddRemoteSheet beginAddRemoteSheetForRepository:self.repository]; +} + @end diff --git a/PBGitRepository.h b/PBGitRepository.h index f40ec92..166aaa0 100644 --- a/PBGitRepository.h +++ b/PBGitRepository.h @@ -29,6 +29,7 @@ extern NSString* PBGitRepositoryErrorDomain; PBGitRevSpecifier *_headRef; // Caching } +- (void) beginAddRemote:(NSString *)remoteName forURL:(NSString *)remoteURL; - (void) beginFetchFromRemoteForRef:(PBGitRef *)ref; - (void) beginPullFromRemote:(PBGitRef *)remoteRef forRef:(PBGitRef *)ref; - (void) beginPushRef:(PBGitRef *)ref toRemote:(PBGitRef *)remoteRef; diff --git a/PBGitRepository.m b/PBGitRepository.m index acbcf35..e5fd9a9 100644 --- a/PBGitRepository.m +++ b/PBGitRepository.m @@ -483,6 +483,15 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; #pragma mark Repository commands +- (void) beginAddRemote:(NSString *)remoteName forURL:(NSString *)remoteURL +{ + NSArray *arguments = [NSArray arrayWithObjects:@"remote", @"add", @"-f", remoteName, remoteURL, nil]; + + NSString *description = [NSString stringWithFormat:@"Adding the remote %@ and fetching tracking branches", remoteName]; + NSString *title = @"Adding a remote"; + [PBRemoteProgressSheet beginRemoteProgressSheetForArguments:arguments title:title description:description inRepository:self]; +} + - (void) beginFetchFromRemoteForRef:(PBGitRef *)ref { NSMutableArray *arguments = [NSMutableArray arrayWithObject:@"fetch"]; From 4bcbf43dc4dc10e7ccca3b2d2b2a3f3bd02212ed Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sun, 7 Feb 2010 17:35:48 -0700 Subject: [PATCH 47/90] Add convenience method for the repository's projectName Update the displayName method to use it --- PBGitRepository.h | 1 + PBGitRepository.m | 26 ++++++++++++++------------ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/PBGitRepository.h b/PBGitRepository.h index 166aaa0..4108749 100644 --- a/PBGitRepository.h +++ b/PBGitRepository.h @@ -60,6 +60,7 @@ extern NSString* PBGitRepositoryErrorDomain; - (BOOL)executeHook:(NSString *)name withArgs:(NSArray*) arguments output:(NSString **)output; - (NSString *)workingDirectory; +- (NSString *) projectName; - (NSString *)gitIgnoreFilename; - (BOOL)isBareRepository; diff --git a/PBGitRepository.m b/PBGitRepository.m index e5fd9a9..68b69cb 100644 --- a/PBGitRepository.m +++ b/PBGitRepository.m @@ -152,20 +152,22 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; // The fileURL the document keeps is to the .git dir, but that’s pretty // useless for display in the window title bar, so we show the directory above -- (NSString*)displayName +- (NSString *) displayName { - NSString* dirName = self.fileURL.path.lastPathComponent; - if ([dirName isEqualToString:@".git"]) - dirName = [self.fileURL.path stringByDeletingLastPathComponent].lastPathComponent; - NSString* displayName; - if (![[PBGitRef refFromString:[[self headRef] simpleRef]] type]) { - displayName = [NSString stringWithFormat:@"%@ (detached HEAD)", dirName]; - } else { - displayName = [NSString stringWithFormat:@"%@ (branch: %@)", dirName, - [[self headRef] description]]; - } + if (![[PBGitRef refFromString:[[self headRef] simpleRef]] type]) + return [NSString stringWithFormat:@"%@ (detached HEAD)", [self projectName]]; - return displayName; + return [NSString stringWithFormat:@"%@ (branch: %@)", [self projectName], [[self headRef] description]]; +} + +- (NSString *) projectName +{ + NSString *projectPath = [[self fileURL] path]; + + if ([[projectPath lastPathComponent] isEqualToString:@".git"]) + projectPath = [projectPath stringByDeletingLastPathComponent]; + + return [projectPath lastPathComponent]; } // Get the .gitignore file at the root of the repository From d3d700a13821a1db065af402862b603ea0ac8acb Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Fri, 12 Feb 2010 19:13:13 -0700 Subject: [PATCH 48/90] =?UTF-8?q?Add=20Clone=20To=E2=80=A6=20to=20the=20Fi?= =?UTF-8?q?le=20menu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Will clone an open repository to a folder. Opens a sheet with a custom accessory view that has a checkbox to allow creating a bare repo. --- English.lproj/MainMenu.xib | 32 +- English.lproj/PBCloneRepsitoryToSheet.xib | 818 ++++++++++++++++++++++ GitX.xcodeproj/project.pbxproj | 18 + PBCloneRepsitoryToSheet.h | 33 + PBCloneRepsitoryToSheet.m | 80 +++ PBGitRepository.h | 1 + PBGitRepository.m | 14 + PBGitWindowController.h | 1 + PBGitWindowController.m | 6 + 9 files changed, 1000 insertions(+), 3 deletions(-) create mode 100644 English.lproj/PBCloneRepsitoryToSheet.xib create mode 100644 PBCloneRepsitoryToSheet.h create mode 100644 PBCloneRepsitoryToSheet.m diff --git a/English.lproj/MainMenu.xib b/English.lproj/MainMenu.xib index 5f85dac..4779db1 100644 --- a/English.lproj/MainMenu.xib +++ b/English.lproj/MainMenu.xib @@ -12,7 +12,7 @@ YES - + YES @@ -281,6 +281,14 @@ + + + Clone To… + + 2147483647 + + + Save @@ -1332,6 +1340,14 @@ 953 + + + cloneTo: + + + + 955 + @@ -1495,6 +1511,7 @@ + @@ -2029,6 +2046,11 @@ + + 954 + + + @@ -2228,6 +2250,7 @@ 947.IBPluginDependency 949.IBPluginDependency 951.IBPluginDependency + 954.IBPluginDependency YES @@ -2395,7 +2418,7 @@ com.apple.InterfaceBuilder.CocoaPlugin - {{582, 533}, {196, 203}} + {{582, 513}, {196, 223}} com.apple.InterfaceBuilder.CocoaPlugin {{358, 536}, {199, 203}} @@ -2424,6 +2447,7 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin @@ -2442,7 +2466,7 @@ - 953 + 955 @@ -2776,6 +2800,7 @@ YES YES + cloneTo: openInTerminal: revealInFinder: showCommitView: @@ -2787,6 +2812,7 @@ id id id + id diff --git a/English.lproj/PBCloneRepsitoryToSheet.xib b/English.lproj/PBCloneRepsitoryToSheet.xib new file mode 100644 index 0000000..85fac39 --- /dev/null +++ b/English.lproj/PBCloneRepsitoryToSheet.xib @@ -0,0 +1,818 @@ + + + + 1050 + 10C540 + 759 + 1038.25 + 458.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 759 + + + YES + + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + YES + + YES + + + YES + + + + YES + + PBCloneRepsitoryToSheet + + + FirstResponder + + + NSApplication + + + + 268 + + YES + + + 268 + {{17, 36}, {283, 17}} + + YES + + 68288064 + 138413056 + Select a folder to clone into + + LucidaGrande + 13 + 1044 + + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + + + + 269 + {{77, 12}, {163, 18}} + + YES + + -2080244224 + 0 + Create bare repository + + + 1211912703 + 2 + + NSImage + NSSwitch + + + NSSwitch + + + + 200 + 25 + + + + {317, 63} + + NSView + + + + + YES + + + cloneToAccessoryView + + + + 6 + + + + value: isBare + + + + + + value: isBare + value + isBare + 2 + + + 8 + + + + message + + + + 11 + + + + + YES + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 3 + + + YES + + + + + + + 4 + + + YES + + + + + + 5 + + + + + 9 + + + YES + + + + + + 10 + + + + + + + YES + + YES + 10.IBPluginDependency + 3.IBEditorWindowLastContentRect + 3.IBPluginDependency + 4.IBPluginDependency + 5.IBPluginDependency + 9.IBPluginDependency + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + {{758, 1074}, {317, 63}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + YES + + + YES + + + + + YES + + + YES + + + + 11 + + + + YES + + PBCloneRepsitoryToSheet + NSWindowController + + YES + + YES + cloneToAccessoryView + message + + + YES + NSView + NSTextField + + + + IBProjectSource + PBCloneRepsitoryToSheet.h + + + + + YES + + NSActionCell + NSCell + + IBFrameworkSource + AppKit.framework/Headers/NSActionCell.h + + + + NSApplication + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSApplication.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSApplicationScripting.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSColorPanel.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSHelpManager.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSPageLayout.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSUserInterfaceItemSearching.h + + + + NSButton + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSButton.h + + + + NSButtonCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSButtonCell.h + + + + NSCell + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSCell.h + + + + NSControl + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSControl.h + + + + NSFormatter + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFormatter.h + + + + NSMenu + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenu.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSAccessibility.h + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDictionaryController.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDragging.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontManager.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontPanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSKeyValueBinding.h + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSNibLoading.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSOutlineView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSPasteboard.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSSavePanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSToolbarItem.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSView.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSError.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFileManager.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueObserving.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyedArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObject.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObjectScripting.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSPortCoder.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSRunLoop.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptObjectSpecifiers.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptWhoseTests.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSThread.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURL.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLConnection.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLDownload.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUAppcast.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUUpdater.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebDownload.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebEditingDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebFrameLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebJavaPlugIn.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPlugin.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPluginContainer.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPolicyDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebResourceLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebScriptObject.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebUIDelegate.h + + + + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSInterfaceStyle.h + + + + NSResponder + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSResponder.h + + + + NSTextField + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSTextField.h + + + + NSTextFieldCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSTextFieldCell.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSClipView.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItem.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSRulerView.h + + + + NSView + NSResponder + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSDrawer.h + + + + NSWindow + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSWindow.h + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSWindowScripting.h + + + + NSWindowController + NSResponder + + showWindow: + id + + + IBFrameworkSource + AppKit.framework/Headers/NSWindowController.h + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + ../GitX.xcodeproj + 3 + + diff --git a/GitX.xcodeproj/project.pbxproj b/GitX.xcodeproj/project.pbxproj index a5ef6dd..683c8e1 100644 --- a/GitX.xcodeproj/project.pbxproj +++ b/GitX.xcodeproj/project.pbxproj @@ -47,6 +47,8 @@ D8083A43111E045D00337480 /* PBRemoteProgressSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = D8083A42111E045D00337480 /* PBRemoteProgressSheet.m */; }; D8083C44111F106800337480 /* PBAddRemoteSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = D8083C43111F106800337480 /* PBAddRemoteSheet.m */; }; D8083C47111F136400337480 /* PBAddRemoteSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = D8083C45111F136400337480 /* PBAddRemoteSheet.xib */; }; + D8083DC4111F90F300337480 /* PBCloneRepsitoryToSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = D8083DC3111F90F300337480 /* PBCloneRepsitoryToSheet.m */; }; + D8083DCD111F918900337480 /* PBCloneRepsitoryToSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = D8083DCB111F918900337480 /* PBCloneRepsitoryToSheet.xib */; }; D8357535112640F100DE249D /* PBRemoteProgressSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = D8C1B77110E875CF009B7F8B /* PBRemoteProgressSheet.xib */; }; D854948610D5C01B0083B917 /* PBCreateBranchSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = D854948510D5C01B0083B917 /* PBCreateBranchSheet.m */; }; D85B939310E3D8B4007F3C28 /* PBCreateBranchSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = D85B939210E3D8B4007F3C28 /* PBCreateBranchSheet.xib */; }; @@ -222,6 +224,9 @@ D8083C42111F106800337480 /* PBAddRemoteSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBAddRemoteSheet.h; sourceTree = ""; }; D8083C43111F106800337480 /* PBAddRemoteSheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBAddRemoteSheet.m; sourceTree = ""; }; D8083C46111F136400337480 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/PBAddRemoteSheet.xib; sourceTree = ""; }; + D8083DC2111F90F300337480 /* PBCloneRepsitoryToSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCloneRepsitoryToSheet.h; sourceTree = ""; }; + D8083DC3111F90F300337480 /* PBCloneRepsitoryToSheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCloneRepsitoryToSheet.m; sourceTree = ""; }; + D8083DCC111F918900337480 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/PBCloneRepsitoryToSheet.xib; sourceTree = ""; }; D823487410CB382C00944BDE /* Terminal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Terminal.h; sourceTree = ""; }; D854948410D5C01B0083B917 /* PBCreateBranchSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCreateBranchSheet.h; sourceTree = ""; }; D854948510D5C01B0083B917 /* PBCreateBranchSheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCreateBranchSheet.m; sourceTree = ""; }; @@ -474,6 +479,7 @@ D889EB3010E6BCBB00F08413 /* PBCreateTagSheet.xib */, D8C1B77110E875CF009B7F8B /* PBRemoteProgressSheet.xib */, D8083C45111F136400337480 /* PBAddRemoteSheet.xib */, + D8083DCB111F918900337480 /* PBCloneRepsitoryToSheet.xib */, 47DBDB680E94EF6500671A1E /* Preferences.xib */, F569AE920F2CBD7C00C2FFA7 /* Credits.html */, ); @@ -527,6 +533,8 @@ D8083A42111E045D00337480 /* PBRemoteProgressSheet.m */, D8083C42111F106800337480 /* PBAddRemoteSheet.h */, D8083C43111F106800337480 /* PBAddRemoteSheet.m */, + D8083DC2111F90F300337480 /* PBCloneRepsitoryToSheet.h */, + D8083DC3111F90F300337480 /* PBCloneRepsitoryToSheet.m */, ); name = Sheets; sourceTree = ""; @@ -871,6 +879,7 @@ D889EB3110E6BCBB00F08413 /* PBCreateTagSheet.xib in Resources */, D8357535112640F100DE249D /* PBRemoteProgressSheet.xib in Resources */, D8083C47111F136400337480 /* PBAddRemoteSheet.xib in Resources */, + D8083DCD111F918900337480 /* PBCloneRepsitoryToSheet.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -994,6 +1003,7 @@ D8E3B34D10DCA958001096A3 /* PBCreateTagSheet.m in Sources */, D8083A43111E045D00337480 /* PBRemoteProgressSheet.m in Sources */, D8083C44111F106800337480 /* PBAddRemoteSheet.m in Sources */, + D8083DC4111F90F300337480 /* PBCloneRepsitoryToSheet.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1094,6 +1104,14 @@ name = PBAddRemoteSheet.xib; sourceTree = ""; }; + D8083DCB111F918900337480 /* PBCloneRepsitoryToSheet.xib */ = { + isa = PBXVariantGroup; + children = ( + D8083DCC111F918900337480 /* English */, + ); + name = PBCloneRepsitoryToSheet.xib; + sourceTree = ""; + }; D85B939210E3D8B4007F3C28 /* PBCreateBranchSheet.xib */ = { isa = PBXVariantGroup; children = ( diff --git a/PBCloneRepsitoryToSheet.h b/PBCloneRepsitoryToSheet.h new file mode 100644 index 0000000..b79039f --- /dev/null +++ b/PBCloneRepsitoryToSheet.h @@ -0,0 +1,33 @@ +// +// PBCloneRepsitoryToSheet.h +// GitX +// +// Created by Nathan Kinsinger on 2/7/10. +// Copyright 2010 Nathan Kinsinger. All rights reserved. +// + +#import + + +@class PBGitRepository; + +@interface PBCloneRepsitoryToSheet : NSWindowController { + PBGitRepository *repository; + + BOOL isBare; + + NSTextField *message; + NSView *cloneToAccessoryView; +} + ++ (void) beginCloneRepsitoryToSheetForRepository:(PBGitRepository *)repo; + + +@property (readwrite) PBGitRepository *repository; + +@property (readwrite) BOOL isBare; + +@property (readwrite) IBOutlet NSTextField *message; +@property (readwrite) IBOutlet NSView *cloneToAccessoryView; + +@end diff --git a/PBCloneRepsitoryToSheet.m b/PBCloneRepsitoryToSheet.m new file mode 100644 index 0000000..f9c60d6 --- /dev/null +++ b/PBCloneRepsitoryToSheet.m @@ -0,0 +1,80 @@ +// +// PBCloneRepsitoryToSheet.m +// GitX +// +// Created by Nathan Kinsinger on 2/7/10. +// Copyright 2010 Nathan Kinsinger. All rights reserved. +// + +#import "PBCloneRepsitoryToSheet.h" +#import "PBGitRepository.h" + + + +@interface PBCloneRepsitoryToSheet () + +- (void) beginCloneRepsitoryToSheetForRepository:(PBGitRepository *)repo; + +@end + + +@implementation PBCloneRepsitoryToSheet + +@synthesize repository; +@synthesize isBare; +@synthesize message; +@synthesize cloneToAccessoryView; + + +#pragma mark - +#pragma mark PBCloneRepsitoryToSheet + ++ (void) beginCloneRepsitoryToSheetForRepository:(PBGitRepository *)repo +{ + PBCloneRepsitoryToSheet *sheet = [[self alloc] initWithWindowNibName:@"PBCloneRepsitoryToSheet"]; + [sheet beginCloneRepsitoryToSheetForRepository:repo]; +} + + +- (void) beginCloneRepsitoryToSheetForRepository:(PBGitRepository *)repo +{ + self.repository = repo; + [self window]; +} + + +- (void) awakeFromNib +{ + NSOpenPanel *cloneToSheet = [NSOpenPanel openPanel]; + + [cloneToSheet setTitle:@"Clone Repository To"]; + [cloneToSheet setPrompt:@"Clone"]; + [self.message setStringValue:[NSString stringWithFormat:@"Select a folder to clone %@ into", [self.repository projectName]]]; + [cloneToSheet setCanSelectHiddenExtension:NO]; + [cloneToSheet setCanChooseFiles:NO]; + [cloneToSheet setCanChooseDirectories:YES]; + [cloneToSheet setAllowsMultipleSelection:NO]; + [cloneToSheet setCanCreateDirectories:YES]; + [cloneToSheet setAccessoryView:cloneToAccessoryView]; + + [cloneToSheet beginSheetForDirectory:nil file:nil types:nil + modalForWindow:[self.repository.windowController window] + modalDelegate:self + didEndSelector:@selector(cloneToSheetDidEnd:returnCode:contextInfo:) + contextInfo:NULL]; +} + + +- (void) cloneToSheetDidEnd:(NSWindow *)sheet returnCode:(NSInteger)code contextInfo:(void *)info +{ + [sheet orderOut:self]; + + if (code == NSOKButton) { + NSString *clonePath = [(NSOpenPanel *)sheet filename]; + NSLog(@"clone path = %@", clonePath); + [self.repository cloneRepositoryToPath:clonePath bare:self.isBare]; + } +} + + +@end diff --git a/PBGitRepository.h b/PBGitRepository.h index 4108749..ea81888 100644 --- a/PBGitRepository.h +++ b/PBGitRepository.h @@ -29,6 +29,7 @@ extern NSString* PBGitRepositoryErrorDomain; PBGitRevSpecifier *_headRef; // Caching } +- (void) cloneRepositoryToPath:(NSString *)path bare:(BOOL)isBare; - (void) beginAddRemote:(NSString *)remoteName forURL:(NSString *)remoteURL; - (void) beginFetchFromRemoteForRef:(PBGitRef *)ref; - (void) beginPullFromRemote:(PBGitRef *)remoteRef forRef:(PBGitRef *)ref; diff --git a/PBGitRepository.m b/PBGitRepository.m index 68b69cb..63534d0 100644 --- a/PBGitRepository.m +++ b/PBGitRepository.m @@ -485,6 +485,20 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; #pragma mark Repository commands +- (void) cloneRepositoryToPath:(NSString *)path bare:(BOOL)isBare +{ + if (!path || [path isEqualToString:@""]) + return; + + NSMutableArray *arguments = [NSMutableArray arrayWithObjects:@"clone", @"--no-hardlinks", @"--", @".", path, nil]; + if (isBare) + [arguments insertObject:@"--bare" atIndex:1]; + + NSString *description = [NSString stringWithFormat:@"Cloning the repository %@ to %@", [self projectName], path]; + NSString *title = @"Cloning Repository"; + [PBRemoteProgressSheet beginRemoteProgressSheetForArguments:arguments title:title description:description inRepository:self]; +} + - (void) beginAddRemote:(NSString *)remoteName forURL:(NSString *)remoteURL { NSArray *arguments = [NSArray arrayWithObjects:@"remote", @"add", @"-f", remoteName, remoteURL, nil]; diff --git a/PBGitWindowController.h b/PBGitWindowController.h index d8815a0..9b15482 100644 --- a/PBGitWindowController.h +++ b/PBGitWindowController.h @@ -37,4 +37,5 @@ - (IBAction) showHistoryView:(id)sender; - (IBAction) revealInFinder:(id)sender; - (IBAction) openInTerminal:(id)sender; +- (IBAction) cloneTo:(id)sender; @end diff --git a/PBGitWindowController.m b/PBGitWindowController.m index 4bfd0f7..1b4b322 100644 --- a/PBGitWindowController.m +++ b/PBGitWindowController.m @@ -10,6 +10,7 @@ #import "PBGitHistoryController.h" #import "PBGitCommitController.h" #import "Terminal.h" +#import "PBCloneRepsitoryToSheet.h" @implementation PBGitWindowController @@ -165,6 +166,11 @@ [term activate]; } +- (IBAction) cloneTo:(id)sender +{ + [PBCloneRepsitoryToSheet beginCloneRepsitoryToSheetForRepository:repository]; +} + #pragma mark - #pragma mark Toolbar Delegates From 0ad92349e6e909289b70a74718933e9fa0d5ef29 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Fri, 12 Feb 2010 21:49:01 -0700 Subject: [PATCH 49/90] Add Clone Repository MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added Clone… to the File menu which opens a window to select the repository URL and the path for the destination. --- ApplicationController.h | 3 + ApplicationController.m | 9 + English.lproj/MainMenu.xib | 32 +- English.lproj/PBCloneRepositoryPanel.xib | 1443 ++++++++++++++++++++++ GitX.xcodeproj/project.pbxproj | 18 + PBCloneRepositoryPanel.h | 41 + PBCloneRepositoryPanel.m | 199 +++ PBGitDefaults.h | 2 + PBGitDefaults.m | 11 + 9 files changed, 1756 insertions(+), 2 deletions(-) create mode 100644 English.lproj/PBCloneRepositoryPanel.xib create mode 100644 PBCloneRepositoryPanel.h create mode 100644 PBCloneRepositoryPanel.m diff --git a/ApplicationController.h b/ApplicationController.h index 1c8e5f4..4305662 100644 --- a/ApplicationController.h +++ b/ApplicationController.h @@ -10,6 +10,7 @@ #import "PBGitRepository.h" @class PBCLIProxy; +@class PBCloneRepositoryPanel; @interface ApplicationController : NSObject { @@ -20,6 +21,7 @@ NSManagedObjectContext *managedObjectContext; PBCLIProxy *cliProxy; + PBCloneRepositoryPanel *cloneRepositoryPanel; } @property (retain) PBCLIProxy* cliProxy; @@ -35,4 +37,5 @@ - (IBAction)saveAction:sender; - (IBAction) showHelp:(id) sender; +- (IBAction) showCloneRepository:(id)sender; @end diff --git a/ApplicationController.m b/ApplicationController.m index 3bc6724..650c9b9 100644 --- a/ApplicationController.m +++ b/ApplicationController.m @@ -16,6 +16,7 @@ #import "PBPrefsWindowController.h" #import "PBNSURLPathUserDefaultsTransfomer.h" #import "PBGitDefaults.h" +#import "PBCloneRepositoryPanel.h" @implementation ApplicationController @synthesize cliProxy; @@ -118,6 +119,14 @@ [NSApp orderFrontStandardAboutPanelWithOptions:dict]; } +- (IBAction) showCloneRepository:(id)sender +{ + if (!cloneRepositoryPanel) + cloneRepositoryPanel = [PBCloneRepositoryPanel panel]; + + [cloneRepositoryPanel showWindow:self]; +} + - (IBAction)installCliTool:(id)sender; { BOOL success = NO; diff --git a/English.lproj/MainMenu.xib b/English.lproj/MainMenu.xib index 4779db1..49d3d49 100644 --- a/English.lproj/MainMenu.xib +++ b/English.lproj/MainMenu.xib @@ -233,6 +233,14 @@ + + + Clone… + + 2147483647 + + + Open Recent @@ -1348,6 +1356,14 @@ 955 + + + showCloneRepository: + + + + 958 + @@ -1512,6 +1528,7 @@ + @@ -2051,6 +2068,11 @@ + + 956 + + + @@ -2251,6 +2273,7 @@ 949.IBPluginDependency 951.IBPluginDependency 954.IBPluginDependency + 956.IBPluginDependency YES @@ -2418,7 +2441,7 @@ com.apple.InterfaceBuilder.CocoaPlugin - {{582, 513}, {196, 223}} + {{582, 493}, {196, 243}} com.apple.InterfaceBuilder.CocoaPlugin {{358, 536}, {199, 203}} @@ -2448,6 +2471,7 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin @@ -2466,7 +2490,7 @@ - 955 + 958 @@ -2482,7 +2506,9 @@ openPreferencesWindow: saveAction: showAboutPanel: + showCloneRepository: showHelp: + showRepositoryListWindow: YES @@ -2491,6 +2517,8 @@ id id id + id + id diff --git a/English.lproj/PBCloneRepositoryPanel.xib b/English.lproj/PBCloneRepositoryPanel.xib new file mode 100644 index 0000000..01e2318 --- /dev/null +++ b/English.lproj/PBCloneRepositoryPanel.xib @@ -0,0 +1,1443 @@ + + + + 1050 + 10C540 + 759 + 1038.25 + 458.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 759 + + + YES + + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + YES + + YES + + + YES + + + + YES + + PBCloneRepositoryPanel + + + FirstResponder + + + NSApplication + + + 15 + 2 + {{63, 1353}, {488, 185}} + 544735232 + Clone Git Repository + NSWindow + + {1.79769e+308, 1.79769e+308} + + + 256 + + YES + + + 266 + {{126, 143}, {342, 22}} + + YES + + -1804468671 + 272630784 + + + LucidaGrande + 13 + 1044 + + URL + + YES + + 6 + System + textBackgroundColor + + 3 + MQA + + + + 6 + System + textColor + + 3 + MAA + + + + + + + 268 + {{17, 145}, {104, 17}} + + YES + + 68288064 + 71304192 + Repository URL: + + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + + + + + + 289 + {{378, 12}, {96, 32}} + + YES + + 67239424 + 134217728 + Clone + + + -2038284033 + 129 + + DQ + 200 + 25 + + + + + 289 + {{282, 12}, {96, 32}} + + YES + + 67239424 + 134217728 + Cancel + + + -2038284033 + 129 + + Gw + 200 + 25 + + + + + 292 + {{26, 22}, {258, 17}} + + YES + + 68288064 + 272634880 + error message + + + + + 1 + MSAwIDAAA + + + + + + 265 + {{392, 118}, {76, 17}} + + YES + + -2080244224 + 134479872 + Browse... + + LucidaGrande + 9 + 3614 + + + -2038152961 + 164 + + + 400 + 75 + + + + + 266 + {{126, 88}, {342, 22}} + + YES + + -1804468671 + 272630784 + + + file path + + YES + + + + + + + 268 + {{17, 90}, {104, 17}} + + YES + + 68288064 + 71304192 + Destination: + + + + + + + + + 265 + {{392, 63}, {76, 17}} + + YES + + -2080244224 + 134479872 + Browse... + + + -2038152961 + 164 + + + 400 + 75 + + + + + 265 + {{136, 63}, {177, 18}} + + YES + + 67239424 + 0 + Create bare repository + + + 1211912703 + 2 + + NSImage + NSSwitch + + + NSSwitch + + + + 200 + 25 + + + + {488, 185} + + + {{0, 0}, {2560, 1578}} + {1.79769e+308, 1.79769e+308} + PBCloneRepositoryPanel + + + + 268 + + YES + + + 268 + {{53, 18}, {133, 18}} + + YES + + 67239424 + 0 + Show hidden files + + + 1211912703 + 2 + + + + + 200 + 25 + + + + {239, 54} + NSView + + + 1 + 2 + {{196, 412}, {397, 98}} + 544736256 + Window + NSWindow + + {1.79769e+308, 1.79769e+308} + + + 274 + + YES + + + 1314 + + {{35, 16}, {344, 20}} + + 16394 + 100 + + + + 274 + {{17, 44}, {363, 34}} + + YES + + 67239424 + 272891904 + Operation in progress. + + LucidaGrande + 13 + 16 + + + + + + + + {397, 98} + + {{0, 0}, {2560, 1578}} + {1.79769e+308, 1.79769e+308} + + + + + YES + + + repositoryURL + + + + 28 + + + + destinationPath + + + + 29 + + + + repositoryAccessoryView + + + + 31 + + + + clone: + + + + 32 + + + + closeCloneRepositoryPanel: + + + + 33 + + + + browseRepository: + + + + 34 + + + + browseDestination: + + + + 35 + + + + showHideHiddenFiles: + + + + 36 + + + + window + + + + 37 + + + + errorMessage + + + + 38 + + + + + YES + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 1 + + + YES + + + + + + 2 + + + YES + + + + + + + + + + + + + + + 3 + + + YES + + + + Text Field (URL) + + + 4 + + + YES + + + + + + 5 + + + YES + + + + + + 6 + + + YES + + + + + + 7 + + + YES + + + + + + 8 + + + YES + + + + + + 9 + + + + + 10 + + + + + 11 + + + + + 12 + + + + + 13 + + + + + 14 + + + + + 15 + + + YES + + + + Text Field (URL) + + + 16 + + + YES + + + + + + 17 + + + YES + + + + + + 18 + + + + + 19 + + + + + 20 + + + + + 21 + + + YES + + + + Open Panel Accessory + + + 22 + + + YES + + + + + + 23 + + + + + 26 + + + YES + + + + + + 27 + + + + + 39 + + + YES + + + + Progress Window (Window) + + + 40 + + + YES + + + + + + + 41 + + + + + 42 + + + YES + + + + + + 43 + + + + + + + YES + + YES + 1.IBEditorWindowLastContentRect + 1.IBPluginDependency + 1.IBWindowTemplateEditedContentRect + 1.NSWindowTemplate.visibleAtLaunch + 1.WindowOrigin + 1.editorWindowContentRectSynchronizationRect + 10.IBPluginDependency + 11.IBPluginDependency + 12.IBPluginDependency + 13.IBPluginDependency + 14.IBPluginDependency + 15.IBAttributePlaceholdersKey + 15.IBPluginDependency + 16.IBPluginDependency + 17.IBPluginDependency + 18.IBPluginDependency + 19.IBPluginDependency + 2.IBPluginDependency + 20.IBPluginDependency + 21.IBEditorWindowLastContentRect + 21.IBPluginDependency + 22.IBPluginDependency + 23.IBPluginDependency + 26.IBPluginDependency + 27.IBPluginDependency + 3.IBAttributePlaceholdersKey + 3.IBPluginDependency + 39.IBEditorWindowLastContentRect + 39.IBPluginDependency + 39.IBWindowTemplateEditedContentRect + 39.NSWindowTemplate.visibleAtLaunch + 39.WindowOrigin + 39.editorWindowContentRectSynchronizationRect + 39.windowTemplate.hasMinSize + 39.windowTemplate.minSize + 4.IBPluginDependency + 40.IBPluginDependency + 41.IBPluginDependency + 42.IBPluginDependency + 43.IBPluginDependency + 5.IBPluginDependency + 6.IBPluginDependency + 7.IBPluginDependency + 8.IBPluginDependency + 9.IBPluginDependency + + + YES + {{468, 1011}, {488, 185}} + com.apple.InterfaceBuilder.CocoaPlugin + {{468, 1011}, {488, 185}} + + {196, 240} + {{202, 428}, {480, 270}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + YES + + + YES + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{632, 734}, {239, 54}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + RXhhbXBsZXM6Ci9Vc2Vycy91c2VybmFtZS9wYXRoL3RvL3JlcG8uZ2l0LwpnaXQ6Ly9ob3N0Lnh6L3Bh +dGgvdG8vcmVwby5naXQvCnNzaDovL1t1c2VyQF1ob3N0Lnh6L3BhdGgvdG8vcmVwby5naXQvA + + + com.apple.InterfaceBuilder.CocoaPlugin + {{639, 822}, {397, 98}} + com.apple.InterfaceBuilder.CocoaPlugin + {{639, 822}, {397, 98}} + + {196, 240} + {{202, 428}, {480, 270}} + + {420, 170} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + YES + + + YES + + + + + YES + + + YES + + + + 44 + + + + YES + + PBCloneRepositoryPanel + NSWindowController + + YES + + YES + browseDestination: + browseRepository: + clone: + closeCloneRepositoryPanel: + showHideHiddenFiles: + + + YES + id + id + id + id + id + + + + YES + + YES + destinationPath + errorMessage + repositoryAccessoryView + repositoryURL + + + YES + NSTextField + NSTextField + NSView + NSTextField + + + + IBProjectSource + PBCloneRepositoryPanel.h + + + + + YES + + NSActionCell + NSCell + + IBFrameworkSource + AppKit.framework/Headers/NSActionCell.h + + + + NSApplication + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSApplication.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSApplicationScripting.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSColorPanel.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSHelpManager.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSPageLayout.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSUserInterfaceItemSearching.h + + + + NSButton + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSButton.h + + + + NSButtonCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSButtonCell.h + + + + NSCell + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSCell.h + + + + NSControl + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSControl.h + + + + NSFormatter + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFormatter.h + + + + NSMenu + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenu.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSAccessibility.h + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDictionaryController.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDragging.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontManager.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontPanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSKeyValueBinding.h + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSNibLoading.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSOutlineView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSPasteboard.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSSavePanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSToolbarItem.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSView.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSError.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFileManager.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueObserving.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyedArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObject.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObjectScripting.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSPortCoder.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSRunLoop.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptObjectSpecifiers.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptWhoseTests.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSThread.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURL.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLConnection.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLDownload.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUAppcast.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUUpdater.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebDownload.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebEditingDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebFrameLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebJavaPlugIn.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPlugin.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPluginContainer.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPolicyDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebResourceLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebScriptObject.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebUIDelegate.h + + + + NSProgressIndicator + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSProgressIndicator.h + + + + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSInterfaceStyle.h + + + + NSResponder + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSResponder.h + + + + NSTextField + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSTextField.h + + + + NSTextFieldCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSTextFieldCell.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSClipView.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItem.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSRulerView.h + + + + NSView + NSResponder + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSDrawer.h + + + + NSWindow + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSWindow.h + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSWindowScripting.h + + + + NSWindowController + NSResponder + + showWindow: + id + + + IBFrameworkSource + AppKit.framework/Headers/NSWindowController.h + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + ../GitX.xcodeproj + 3 + + diff --git a/GitX.xcodeproj/project.pbxproj b/GitX.xcodeproj/project.pbxproj index 683c8e1..907f618 100644 --- a/GitX.xcodeproj/project.pbxproj +++ b/GitX.xcodeproj/project.pbxproj @@ -49,12 +49,14 @@ D8083C47111F136400337480 /* PBAddRemoteSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = D8083C45111F136400337480 /* PBAddRemoteSheet.xib */; }; D8083DC4111F90F300337480 /* PBCloneRepsitoryToSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = D8083DC3111F90F300337480 /* PBCloneRepsitoryToSheet.m */; }; D8083DCD111F918900337480 /* PBCloneRepsitoryToSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = D8083DCB111F918900337480 /* PBCloneRepsitoryToSheet.xib */; }; + D8083E03111FA33700337480 /* PBCloneRepositoryPanel.m in Sources */ = {isa = PBXBuildFile; fileRef = D8083E02111FA33700337480 /* PBCloneRepositoryPanel.m */; }; D8357535112640F100DE249D /* PBRemoteProgressSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = D8C1B77110E875CF009B7F8B /* PBRemoteProgressSheet.xib */; }; D854948610D5C01B0083B917 /* PBCreateBranchSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = D854948510D5C01B0083B917 /* PBCreateBranchSheet.m */; }; D85B939310E3D8B4007F3C28 /* PBCreateBranchSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = D85B939210E3D8B4007F3C28 /* PBCreateBranchSheet.xib */; }; D889EB3110E6BCBB00F08413 /* PBCreateTagSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = D889EB3010E6BCBB00F08413 /* PBCreateTagSheet.xib */; }; D8E3B2B810DC9FB2001096A3 /* ScriptingBridge.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D8E3B2B710DC9FB2001096A3 /* ScriptingBridge.framework */; }; D8E3B34D10DCA958001096A3 /* PBCreateTagSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = D8E3B34C10DCA958001096A3 /* PBCreateTagSheet.m */; }; + D8FDD9F711432A12005647F6 /* PBCloneRepositoryPanel.xib in Resources */ = {isa = PBXBuildFile; fileRef = D8FDD9F511432A12005647F6 /* PBCloneRepositoryPanel.xib */; }; EB2A734A0FEE3F09006601CF /* PBCollapsibleSplitView.m in Sources */ = {isa = PBXBuildFile; fileRef = EB2A73490FEE3F09006601CF /* PBCollapsibleSplitView.m */; }; F50A411F0EBB874C00208746 /* mainSplitterBar.tiff in Resources */ = {isa = PBXBuildFile; fileRef = F50A411D0EBB874C00208746 /* mainSplitterBar.tiff */; }; F50A41200EBB874C00208746 /* mainSplitterDimple.tiff in Resources */ = {isa = PBXBuildFile; fileRef = F50A411E0EBB874C00208746 /* mainSplitterDimple.tiff */; }; @@ -227,6 +229,8 @@ D8083DC2111F90F300337480 /* PBCloneRepsitoryToSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCloneRepsitoryToSheet.h; sourceTree = ""; }; D8083DC3111F90F300337480 /* PBCloneRepsitoryToSheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCloneRepsitoryToSheet.m; sourceTree = ""; }; D8083DCC111F918900337480 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/PBCloneRepsitoryToSheet.xib; sourceTree = ""; }; + D8083E01111FA33700337480 /* PBCloneRepositoryPanel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCloneRepositoryPanel.h; sourceTree = ""; }; + D8083E02111FA33700337480 /* PBCloneRepositoryPanel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCloneRepositoryPanel.m; sourceTree = ""; }; D823487410CB382C00944BDE /* Terminal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Terminal.h; sourceTree = ""; }; D854948410D5C01B0083B917 /* PBCreateBranchSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCreateBranchSheet.h; sourceTree = ""; }; D854948510D5C01B0083B917 /* PBCreateBranchSheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCreateBranchSheet.m; sourceTree = ""; }; @@ -237,6 +241,7 @@ D8E3B34B10DCA958001096A3 /* PBCreateTagSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCreateTagSheet.h; sourceTree = ""; }; D8E3B34C10DCA958001096A3 /* PBCreateTagSheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCreateTagSheet.m; sourceTree = ""; }; D8E3B38110DD4E2C001096A3 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/PBCreateTagSheet.xib; sourceTree = ""; }; + D8FDD9F611432A12005647F6 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/PBCloneRepositoryPanel.xib; sourceTree = ""; }; EB2A73480FEE3F09006601CF /* PBCollapsibleSplitView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCollapsibleSplitView.h; sourceTree = ""; }; EB2A73490FEE3F09006601CF /* PBCollapsibleSplitView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCollapsibleSplitView.m; sourceTree = ""; }; F50A411D0EBB874C00208746 /* mainSplitterBar.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = mainSplitterBar.tiff; path = Images/mainSplitterBar.tiff; sourceTree = ""; }; @@ -480,6 +485,7 @@ D8C1B77110E875CF009B7F8B /* PBRemoteProgressSheet.xib */, D8083C45111F136400337480 /* PBAddRemoteSheet.xib */, D8083DCB111F918900337480 /* PBCloneRepsitoryToSheet.xib */, + D8FDD9F511432A12005647F6 /* PBCloneRepositoryPanel.xib */, 47DBDB680E94EF6500671A1E /* Preferences.xib */, F569AE920F2CBD7C00C2FFA7 /* Credits.html */, ); @@ -535,6 +541,8 @@ D8083C43111F106800337480 /* PBAddRemoteSheet.m */, D8083DC2111F90F300337480 /* PBCloneRepsitoryToSheet.h */, D8083DC3111F90F300337480 /* PBCloneRepsitoryToSheet.m */, + D8083E01111FA33700337480 /* PBCloneRepositoryPanel.h */, + D8083E02111FA33700337480 /* PBCloneRepositoryPanel.m */, ); name = Sheets; sourceTree = ""; @@ -880,6 +888,7 @@ D8357535112640F100DE249D /* PBRemoteProgressSheet.xib in Resources */, D8083C47111F136400337480 /* PBAddRemoteSheet.xib in Resources */, D8083DCD111F918900337480 /* PBCloneRepsitoryToSheet.xib in Resources */, + D8FDD9F711432A12005647F6 /* PBCloneRepositoryPanel.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1004,6 +1013,7 @@ D8083A43111E045D00337480 /* PBRemoteProgressSheet.m in Sources */, D8083C44111F106800337480 /* PBAddRemoteSheet.m in Sources */, D8083DC4111F90F300337480 /* PBCloneRepsitoryToSheet.m in Sources */, + D8083E03111FA33700337480 /* PBCloneRepositoryPanel.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1136,6 +1146,14 @@ name = PBRemoteProgressSheet.xib; sourceTree = ""; }; + D8FDD9F511432A12005647F6 /* PBCloneRepositoryPanel.xib */ = { + isa = PBXVariantGroup; + children = ( + D8FDD9F611432A12005647F6 /* English */, + ); + name = PBCloneRepositoryPanel.xib; + sourceTree = ""; + }; F5B721C20E05CF7E00AF29DC /* MainMenu.xib */ = { isa = PBXVariantGroup; children = ( diff --git a/PBCloneRepositoryPanel.h b/PBCloneRepositoryPanel.h new file mode 100644 index 0000000..7c7d102 --- /dev/null +++ b/PBCloneRepositoryPanel.h @@ -0,0 +1,41 @@ +// +// PBCloneRepositoryPanel.h +// GitX +// +// Created by Nathan Kinsinger on 2/7/10. +// Copyright 2010 Nathan Kinsinger. All rights reserved. +// + +#import + + +@interface PBCloneRepositoryPanel : NSWindowController { + NSTextField *repositoryURL; + NSTextField *destinationPath; + NSTextField *errorMessage; + NSView *repositoryAccessoryView; + + NSOpenPanel *browseRepositoryPanel; + NSOpenPanel *browseDestinationPanel; + + NSString *path; + BOOL isBare; +} + ++ (id) panel; + +- (void)showMessageSheet:(NSString *)messageText infoText:(NSString *)infoText; +- (void)showErrorSheet:(NSError *)error; + +- (IBAction) closeCloneRepositoryPanel:(id)sender; +- (IBAction) clone:(id)sender; +- (IBAction) browseRepository:(id)sender; +- (IBAction) showHideHiddenFiles:(id)sender; +- (IBAction) browseDestination:(id)sender; + +@property (assign) IBOutlet NSTextField *repositoryURL; +@property (assign) IBOutlet NSTextField *destinationPath; +@property (assign) IBOutlet NSTextField *errorMessage; +@property (assign) IBOutlet NSView *repositoryAccessoryView; + +@end diff --git a/PBCloneRepositoryPanel.m b/PBCloneRepositoryPanel.m new file mode 100644 index 0000000..20baaa2 --- /dev/null +++ b/PBCloneRepositoryPanel.m @@ -0,0 +1,199 @@ +// +// PBCloneRepositoryPanel.m +// GitX +// +// Created by Nathan Kinsinger on 2/7/10. +// Copyright 2010 Nathan Kinsinger. All rights reserved. +// + +#import "PBCloneRepositoryPanel.h" +#import "PBRemoteProgressSheet.h" +#import "PBRepositoryDocumentController.h" +#import "PBGitDefaults.h" + + + +@implementation PBCloneRepositoryPanel + + +@synthesize repositoryURL; +@synthesize destinationPath; +@synthesize errorMessage; +@synthesize repositoryAccessoryView; + + + +#pragma mark - +#pragma mark PBCloneRepositoryPanel + ++ (id) panel +{ + return [[self alloc] initWithWindowNibName:@"PBCloneRepositoryPanel"]; +} + + +- (void) awakeFromNib +{ + [self window]; + [self.errorMessage setStringValue:@""]; + path = [PBGitDefaults recentCloneDestination]; + if (path) + [self.destinationPath setStringValue:path]; + + browseRepositoryPanel = [NSOpenPanel openPanel]; + [browseRepositoryPanel setTitle:@"Browse for git repository"]; + [browseRepositoryPanel setMessage:@"Select a folder with a git repository"]; + [browseRepositoryPanel setPrompt:@"Select"]; + [browseRepositoryPanel setCanChooseFiles:NO]; + [browseRepositoryPanel setCanChooseDirectories:YES]; + [browseRepositoryPanel setAllowsMultipleSelection:NO]; + [browseRepositoryPanel setCanCreateDirectories:NO]; + [browseRepositoryPanel setAccessoryView:repositoryAccessoryView]; + + browseDestinationPanel = [NSOpenPanel openPanel]; + [browseDestinationPanel setTitle:@"Browse clone destination"]; + [browseDestinationPanel setMessage:@"Select a folder to clone the git repository into"]; + [browseDestinationPanel setPrompt:@"Select"]; + [browseDestinationPanel setCanChooseFiles:NO]; + [browseDestinationPanel setCanChooseDirectories:YES]; + [browseDestinationPanel setAllowsMultipleSelection:NO]; + [browseDestinationPanel setCanCreateDirectories:YES]; +} + + +- (void)showMessageSheet:(NSString *)messageText infoText:(NSString *)infoText +{ + NSAlert *alert = [NSAlert alertWithMessageText:messageText + defaultButton:nil alternateButton:nil otherButton:nil + informativeTextWithFormat:infoText]; + + [alert beginSheetModalForWindow:[self window] + modalDelegate:self + didEndSelector:@selector(messageSheetDidEnd:returnCode:contextInfo:) + contextInfo:NULL]; +} + + +- (void)showErrorSheet:(NSError *)error +{ + [[NSAlert alertWithError:error] beginSheetModalForWindow:[self window] + modalDelegate:self + didEndSelector:@selector(errorSheetDidEnd:returnCode:contextInfo:) + contextInfo:NULL]; +} + + + +#pragma mark IBActions + +- (IBAction) closeCloneRepositoryPanel:(id)sender +{ + [self close]; +} + + +- (IBAction) clone:(id)sender +{ + [self.errorMessage setStringValue:@""]; + + NSString *url = [self.repositoryURL stringValue]; + if ([url isEqualToString:@""]) { + [self.errorMessage setStringValue:@"Repository URL is required"]; + return; + } + + path = [self.destinationPath stringValue]; + if ([path isEqualToString:@""]) { + [self.errorMessage setStringValue:@"Destination path is required"]; + return; + } + + NSMutableArray *arguments = [NSMutableArray arrayWithObjects:@"clone", @"--", url, path, nil]; + if (isBare) + [arguments insertObject:@"--bare" atIndex:1]; + + NSString *description = [NSString stringWithFormat:@"Cloning repository at: %@", url]; + NSString *title = @"Cloning Repository"; + [PBRemoteProgressSheet beginRemoteProgressSheetForArguments:arguments title:title description:description inDir:nil windowController:self]; +} + + +- (IBAction) browseRepository:(id)sender +{ + [browseRepositoryPanel beginSheetForDirectory:nil file:nil types:nil + modalForWindow:[self window] + modalDelegate:self + didEndSelector:@selector(browseRepositorySheetDidEnd:returnCode:contextInfo:) + contextInfo:NULL]; +} + + +- (IBAction) showHideHiddenFiles:(id)sender +{ + // This uses undocumented OpenPanel features to show hidden files (required for 10.5 support) + NSNumber *showHidden = [NSNumber numberWithBool:[sender state] == NSOnState]; + [[browseRepositoryPanel valueForKey:@"_navView"] setValue:showHidden forKey:@"showsHiddenFiles"]; +} + + +- (IBAction) browseDestination:(id)sender +{ + [browseDestinationPanel beginSheetForDirectory:nil file:nil types:nil + modalForWindow:[self window] + modalDelegate:self + didEndSelector:@selector(browseDestinationSheetDidEnd:returnCode:contextInfo:) + contextInfo:NULL]; +} + + + +#pragma mark Callbacks + +- (void) browseRepositorySheetDidEnd:(NSOpenPanel *)sheet returnCode:(NSInteger)code contextInfo:(void *)info +{ + [sheet orderOut:self]; + + if (code == NSOKButton) { + NSURL *url = [[sheet URLs] lastObject]; + [self.repositoryURL setStringValue:[url path]]; + } +} + + +- (void) browseDestinationSheetDidEnd:(NSOpenPanel *)sheet returnCode:(NSInteger)code contextInfo:(void *)info +{ + [sheet orderOut:self]; + + if (code == NSOKButton) { + NSURL *url = [[sheet URLs] lastObject]; + [self.destinationPath setStringValue:[url path]]; + } +} + + +- (void) messageSheetDidEnd:(NSOpenPanel *)sheet returnCode:(NSInteger)code contextInfo:(void *)info +{ + NSURL *documentURL = [NSURL fileURLWithPath:path]; + + NSError *error = nil; + id document = [[PBRepositoryDocumentController sharedDocumentController] openDocumentWithContentsOfURL:documentURL display:YES error:&error]; + if (!document && error) + [self showErrorSheet:error]; + else { + [self close]; + + NSString *containingPath = [path stringByDeletingLastPathComponent]; + [PBGitDefaults setRecentCloneDestination:containingPath]; + [self.destinationPath setStringValue:containingPath]; + [self.repositoryURL setStringValue:@""]; + } +} + + +- (void) errorSheetDidEnd:(NSOpenPanel *)sheet returnCode:(NSInteger)code contextInfo:(void *)info +{ + [self close]; +} + + +@end diff --git a/PBGitDefaults.h b/PBGitDefaults.h index 198c631..b463dd6 100644 --- a/PBGitDefaults.h +++ b/PBGitDefaults.h @@ -21,5 +21,7 @@ + (BOOL)showOpenPanelOnLaunch; + (BOOL) shouldCheckoutBranch; + (void) setShouldCheckoutBranch:(BOOL)shouldCheckout; ++ (NSString *) recentCloneDestination; ++ (void) setRecentCloneDestination:(NSString *)path; @end diff --git a/PBGitDefaults.m b/PBGitDefaults.m index e01cd9e..1cadd14 100644 --- a/PBGitDefaults.m +++ b/PBGitDefaults.m @@ -18,6 +18,7 @@ #define kOpenCurDirOnLaunch @"PBOpenCurDirOnLaunch" #define kShowOpenPanelOnLaunch @"PBShowOpenPanelOnLaunch" #define kShouldCheckoutBranch @"PBShouldCheckoutBranch" +#define kRecentCloneDestination @"PBRecentCloneDestination" @implementation PBGitDefaults @@ -95,4 +96,14 @@ [[NSUserDefaults standardUserDefaults] setBool:shouldCheckout forKey:kShouldCheckoutBranch]; } ++ (NSString *) recentCloneDestination +{ + return [[NSUserDefaults standardUserDefaults] stringForKey:kRecentCloneDestination]; +} + ++ (void) setRecentCloneDestination:(NSString *)path +{ + [[NSUserDefaults standardUserDefaults] setObject:path forKey:kRecentCloneDestination]; +} + @end From 4ea04358ba07af1a3fcd4b3ee15d489d99776dcd Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sat, 13 Feb 2010 11:58:03 -0700 Subject: [PATCH 50/90] replace depreciated selectRow:byExtendingSelection: method --- PBGitSidebarController.m | 4 ++-- PBQLOutlineView.m | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/PBGitSidebarController.m b/PBGitSidebarController.m index b19eaaa..fd31fbc 100644 --- a/PBGitSidebarController.m +++ b/PBGitSidebarController.m @@ -67,9 +67,9 @@ } [sourceView PBExpandItem:item expandParents:YES]; - NSInteger index = [sourceView rowForItem:item]; + NSIndexSet *index = [NSIndexSet indexSetWithIndex:[sourceView rowForItem:item]]; - [sourceView selectRow:index byExtendingSelection:NO]; + [sourceView selectRowIndexes:index byExtendingSelection:NO]; } - (void)addRevSpec:(PBGitRevSpecifier *)rev diff --git a/PBQLOutlineView.m b/PBQLOutlineView.m index 459d908..c3dde23 100644 --- a/PBQLOutlineView.m +++ b/PBQLOutlineView.m @@ -70,8 +70,10 @@ int row = [self rowAtPoint:mousePoint]; // figure out if the row that was just clicked on is currently selected - if ([selectedRowIndexes containsIndex:row] == NO) - [self selectRow:row byExtendingSelection:NO]; + if ([selectedRowIndexes containsIndex:row] == NO) { + NSIndexSet *index = [NSIndexSet indexSetWithIndex:row]; + [self selectRowIndexes:index byExtendingSelection:NO]; + } } return [controller contextMenuForTreeView]; From c36726b9850c6ceecc07a428f3b3f57263c9cfbb Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Thu, 7 Jan 2010 21:24:32 -0700 Subject: [PATCH 51/90] Update the GUI to be more iApp like - In PBGitSidebarView.xib - change indentation to 12 - change font size to 11 - disable the editable behavior - disable autoresizing - disable user resizing (column should resize with view) - remove the window - remove the shared user defaults controller (not being used) - add a project item with the project's name - a "Stage" item to go to what has been called the commit view - new icons for branches, remote branches and tags (created by Nathan Kinsinger) - remove the old tiff icons, PBSourceViewRemote.h/m and PBSourceViewAction.h/m from the xcode project - uses system icon for folder - uses Network icon for remotes - capitalize group names - rename the Custom group to Other (you can't really customize items in the traditional sense) - create a class for each item type that takes care of it's image (instead of trying to guess the image from it or it's parent's name) - remove the branch menu toolbar item from the history view, it's redundant now --- GitX.xcodeproj/project.pbxproj | 101 +++-- Images/Branch.acorn | Bin 0 -> 1849 bytes Images/Branch.png | Bin 0 -> 546 bytes Images/RemoteBranch.acorn | Bin 0 -> 1810 bytes Images/RemoteBranch.png | Bin 0 -> 513 bytes Images/StageView.png | Bin 0 -> 271 bytes Images/Tag.acorn | Bin 0 -> 1794 bytes Images/Tag.png | Bin 0 -> 527 bytes PBGitHistoryView.xib | 304 +++++--------- PBGitRevSpecifier.h | 1 + PBGitRevSpecifier.m | 22 + PBGitSVBranchItem.h | 19 + PBGitSVBranchItem.m | 33 ++ PBGitSVFolderItem.h | 19 + PBGitSVFolderItem.m | 34 ++ PBGitSVOtherRevItem.h | 19 + PBGitSVOtherRevItem.m | 34 ++ PBGitSVRemoteBranchItem.h | 19 + PBGitSVRemoteBranchItem.m | 33 ++ PBGitSVRemoteItem.h | 19 + PBGitSVRemoteItem.m | 41 ++ PBGitSVStageItem.h | 19 + PBGitSVStageItem.m | 32 ++ PBGitSVTagItem.h | 19 + PBGitSVTagItem.m | 33 ++ PBGitSidebarController.h | 6 +- PBGitSidebarController.m | 44 +- PBGitSidebarView.xib | 714 ++++++++++++++++++++++++++++----- PBRefController.h | 3 - PBRefController.m | 116 ------ PBSourceViewItem.h | 5 +- PBSourceViewItem.m | 73 ++-- PBSourceViewItems.h | 19 + 33 files changed, 1257 insertions(+), 524 deletions(-) create mode 100644 Images/Branch.acorn create mode 100644 Images/Branch.png create mode 100644 Images/RemoteBranch.acorn create mode 100644 Images/RemoteBranch.png create mode 100644 Images/StageView.png create mode 100644 Images/Tag.acorn create mode 100644 Images/Tag.png create mode 100644 PBGitSVBranchItem.h create mode 100644 PBGitSVBranchItem.m create mode 100644 PBGitSVFolderItem.h create mode 100644 PBGitSVFolderItem.m create mode 100644 PBGitSVOtherRevItem.h create mode 100644 PBGitSVOtherRevItem.m create mode 100644 PBGitSVRemoteBranchItem.h create mode 100644 PBGitSVRemoteBranchItem.m create mode 100644 PBGitSVRemoteItem.h create mode 100644 PBGitSVRemoteItem.m create mode 100644 PBGitSVStageItem.h create mode 100644 PBGitSVStageItem.m create mode 100644 PBGitSVTagItem.h create mode 100644 PBGitSVTagItem.m create mode 100644 PBSourceViewItems.h diff --git a/GitX.xcodeproj/project.pbxproj b/GitX.xcodeproj/project.pbxproj index 46c6917..7c1bab3 100644 --- a/GitX.xcodeproj/project.pbxproj +++ b/GitX.xcodeproj/project.pbxproj @@ -52,11 +52,22 @@ D8083E03111FA33700337480 /* PBCloneRepositoryPanel.m in Sources */ = {isa = PBXBuildFile; fileRef = D8083E02111FA33700337480 /* PBCloneRepositoryPanel.m */; }; D8357535112640F100DE249D /* PBRemoteProgressSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = D8C1B77110E875CF009B7F8B /* PBRemoteProgressSheet.xib */; }; D854948610D5C01B0083B917 /* PBCreateBranchSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = D854948510D5C01B0083B917 /* PBCreateBranchSheet.m */; }; + D85810551127476E007F254B /* StageView.png in Resources */ = {isa = PBXBuildFile; fileRef = D85810541127476E007F254B /* StageView.png */; }; + D858108311274D28007F254B /* Branch.png in Resources */ = {isa = PBXBuildFile; fileRef = D858108011274D28007F254B /* Branch.png */; }; + D858108411274D28007F254B /* RemoteBranch.png in Resources */ = {isa = PBXBuildFile; fileRef = D858108111274D28007F254B /* RemoteBranch.png */; }; + D858108511274D28007F254B /* Tag.png in Resources */ = {isa = PBXBuildFile; fileRef = D858108211274D28007F254B /* Tag.png */; }; D85B939310E3D8B4007F3C28 /* PBCreateBranchSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = D85B939210E3D8B4007F3C28 /* PBCreateBranchSheet.xib */; }; D889EB3110E6BCBB00F08413 /* PBCreateTagSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = D889EB3010E6BCBB00F08413 /* PBCreateTagSheet.xib */; }; D8E3B2B810DC9FB2001096A3 /* ScriptingBridge.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D8E3B2B710DC9FB2001096A3 /* ScriptingBridge.framework */; }; D8E3B34D10DCA958001096A3 /* PBCreateTagSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = D8E3B34C10DCA958001096A3 /* PBCreateTagSheet.m */; }; D8FDD9F711432A12005647F6 /* PBCloneRepositoryPanel.xib in Resources */ = {isa = PBXBuildFile; fileRef = D8FDD9F511432A12005647F6 /* PBCloneRepositoryPanel.xib */; }; + D8FDDA6A114335E8005647F6 /* PBGitSVBranchItem.m in Sources */ = {isa = PBXBuildFile; fileRef = D8FDDA5D114335E8005647F6 /* PBGitSVBranchItem.m */; }; + D8FDDA6B114335E8005647F6 /* PBGitSVFolderItem.m in Sources */ = {isa = PBXBuildFile; fileRef = D8FDDA5F114335E8005647F6 /* PBGitSVFolderItem.m */; }; + D8FDDA6C114335E8005647F6 /* PBGitSVOtherRevItem.m in Sources */ = {isa = PBXBuildFile; fileRef = D8FDDA61114335E8005647F6 /* PBGitSVOtherRevItem.m */; }; + D8FDDA6D114335E8005647F6 /* PBGitSVRemoteBranchItem.m in Sources */ = {isa = PBXBuildFile; fileRef = D8FDDA63114335E8005647F6 /* PBGitSVRemoteBranchItem.m */; }; + D8FDDA6E114335E8005647F6 /* PBGitSVRemoteItem.m in Sources */ = {isa = PBXBuildFile; fileRef = D8FDDA65114335E8005647F6 /* PBGitSVRemoteItem.m */; }; + D8FDDA6F114335E8005647F6 /* PBGitSVStageItem.m in Sources */ = {isa = PBXBuildFile; fileRef = D8FDDA67114335E8005647F6 /* PBGitSVStageItem.m */; }; + D8FDDA70114335E8005647F6 /* PBGitSVTagItem.m in Sources */ = {isa = PBXBuildFile; fileRef = D8FDDA69114335E8005647F6 /* PBGitSVTagItem.m */; }; EB2A734A0FEE3F09006601CF /* PBCollapsibleSplitView.m in Sources */ = {isa = PBXBuildFile; fileRef = EB2A73490FEE3F09006601CF /* PBCollapsibleSplitView.m */; }; F50A411F0EBB874C00208746 /* mainSplitterBar.tiff in Resources */ = {isa = PBXBuildFile; fileRef = F50A411D0EBB874C00208746 /* mainSplitterBar.tiff */; }; F50A41200EBB874C00208746 /* mainSplitterDimple.tiff in Resources */ = {isa = PBXBuildFile; fileRef = F50A411E0EBB874C00208746 /* mainSplitterDimple.tiff */; }; @@ -65,8 +76,6 @@ F513085B0E0740F2000C8BCD /* PBQLOutlineView.m in Sources */ = {isa = PBXBuildFile; fileRef = F513085A0E0740F2000C8BCD /* PBQLOutlineView.m */; }; F5140DC90E8A8EB20091E9F3 /* RoundedRectangle.m in Sources */ = {isa = PBXBuildFile; fileRef = F5140DC80E8A8EB20091E9F3 /* RoundedRectangle.m */; }; F523CEB60ED3399200DDD714 /* PBGitIndexController.m in Sources */ = {isa = PBXBuildFile; fileRef = F523CEB50ED3399200DDD714 /* PBGitIndexController.m */; }; - F528210A1056A7C1001D1511 /* PBSourceViewRemote.m in Sources */ = {isa = PBXBuildFile; fileRef = F52821091056A7C1001D1511 /* PBSourceViewRemote.m */; }; - F528210D1056A7EB001D1511 /* PBSourceViewAction.m in Sources */ = {isa = PBXBuildFile; fileRef = F528210C1056A7EB001D1511 /* PBSourceViewAction.m */; }; F52BCE030E84208300AA3741 /* PBGitHistoryView.xib in Resources */ = {isa = PBXBuildFile; fileRef = F52BCE020E84208300AA3741 /* PBGitHistoryView.xib */; }; F52BCE070E84211300AA3741 /* PBGitHistoryController.m in Sources */ = {isa = PBXBuildFile; fileRef = F52BCE060E84211300AA3741 /* PBGitHistoryController.m */; }; F53C4DF70E97FC630022AD59 /* PBGitBinary.m in Sources */ = {isa = PBXBuildFile; fileRef = F53C4DF60E97FC630022AD59 /* PBGitBinary.m */; }; @@ -121,10 +130,6 @@ F58DB55910566D3500CFDF4A /* PBGitSidebarController.m in Sources */ = {isa = PBXBuildFile; fileRef = F58DB55810566D3500CFDF4A /* PBGitSidebarController.m */; }; F58DB56010566E3900CFDF4A /* PBGitSidebarView.xib in Resources */ = {isa = PBXBuildFile; fileRef = F58DB55F10566E3900CFDF4A /* PBGitSidebarView.xib */; }; F58DB5E8105671B600CFDF4A /* PBSourceViewItem.m in Sources */ = {isa = PBXBuildFile; fileRef = F58DB5E7105671B600CFDF4A /* PBSourceViewItem.m */; }; - F58DB7711056860900CFDF4A /* branch.tiff in Resources */ = {isa = PBXBuildFile; fileRef = F58DB76D1056860900CFDF4A /* branch.tiff */; }; - F58DB7721056860900CFDF4A /* remote.tiff in Resources */ = {isa = PBXBuildFile; fileRef = F58DB76E1056860900CFDF4A /* remote.tiff */; }; - F58DB7731056860900CFDF4A /* folder.tiff in Resources */ = {isa = PBXBuildFile; fileRef = F58DB76F1056860900CFDF4A /* folder.tiff */; }; - F58DB7741056860900CFDF4A /* tag.tiff in Resources */ = {isa = PBXBuildFile; fileRef = F58DB7701056860900CFDF4A /* tag.tiff */; }; F59116E60E843BB50072CCB1 /* PBGitCommitView.xib in Resources */ = {isa = PBXBuildFile; fileRef = F59116E50E843BB50072CCB1 /* PBGitCommitView.xib */; }; F59116E90E843BCB0072CCB1 /* PBGitCommitController.m in Sources */ = {isa = PBXBuildFile; fileRef = F59116E80E843BCB0072CCB1 /* PBGitCommitController.m */; }; F593DF780E9E636C003A8559 /* PBFileChangesTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = F593DF770E9E636C003A8559 /* PBFileChangesTableView.m */; }; @@ -245,6 +250,10 @@ D854948410D5C01B0083B917 /* PBCreateBranchSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCreateBranchSheet.h; sourceTree = ""; }; D854948510D5C01B0083B917 /* PBCreateBranchSheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCreateBranchSheet.m; sourceTree = ""; }; D854949310D5C3E20083B917 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/PBCreateBranchSheet.xib; sourceTree = ""; }; + D85810541127476E007F254B /* StageView.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = StageView.png; path = Images/StageView.png; sourceTree = ""; }; + D858108011274D28007F254B /* Branch.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Branch.png; path = Images/Branch.png; sourceTree = ""; }; + D858108111274D28007F254B /* RemoteBranch.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = RemoteBranch.png; path = Images/RemoteBranch.png; sourceTree = ""; }; + D858108211274D28007F254B /* Tag.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Tag.png; path = Images/Tag.png; sourceTree = ""; }; D85B93F610E51279007F3C28 /* PBGitRefish.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitRefish.h; sourceTree = ""; }; D8C1B77210E875CF009B7F8B /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/PBRemoteProgressSheet.xib; sourceTree = ""; }; D8E3B2B710DC9FB2001096A3 /* ScriptingBridge.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ScriptingBridge.framework; path = /System/Library/Frameworks/ScriptingBridge.framework; sourceTree = ""; }; @@ -252,6 +261,21 @@ D8E3B34C10DCA958001096A3 /* PBCreateTagSheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCreateTagSheet.m; sourceTree = ""; }; D8E3B38110DD4E2C001096A3 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/PBCreateTagSheet.xib; sourceTree = ""; }; D8FDD9F611432A12005647F6 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/PBCloneRepositoryPanel.xib; sourceTree = ""; }; + D8FDDA5C114335E8005647F6 /* PBGitSVBranchItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitSVBranchItem.h; sourceTree = ""; }; + D8FDDA5D114335E8005647F6 /* PBGitSVBranchItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitSVBranchItem.m; sourceTree = ""; }; + D8FDDA5E114335E8005647F6 /* PBGitSVFolderItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitSVFolderItem.h; sourceTree = ""; }; + D8FDDA5F114335E8005647F6 /* PBGitSVFolderItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitSVFolderItem.m; sourceTree = ""; }; + D8FDDA60114335E8005647F6 /* PBGitSVOtherRevItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitSVOtherRevItem.h; sourceTree = ""; }; + D8FDDA61114335E8005647F6 /* PBGitSVOtherRevItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitSVOtherRevItem.m; sourceTree = ""; }; + D8FDDA62114335E8005647F6 /* PBGitSVRemoteBranchItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitSVRemoteBranchItem.h; sourceTree = ""; }; + D8FDDA63114335E8005647F6 /* PBGitSVRemoteBranchItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitSVRemoteBranchItem.m; sourceTree = ""; }; + D8FDDA64114335E8005647F6 /* PBGitSVRemoteItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitSVRemoteItem.h; sourceTree = ""; }; + D8FDDA65114335E8005647F6 /* PBGitSVRemoteItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitSVRemoteItem.m; sourceTree = ""; }; + D8FDDA66114335E8005647F6 /* PBGitSVStageItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitSVStageItem.h; sourceTree = ""; }; + D8FDDA67114335E8005647F6 /* PBGitSVStageItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitSVStageItem.m; sourceTree = ""; }; + D8FDDA68114335E8005647F6 /* PBGitSVTagItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitSVTagItem.h; sourceTree = ""; }; + D8FDDA69114335E8005647F6 /* PBGitSVTagItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitSVTagItem.m; sourceTree = ""; }; + D8FDDA7311433634005647F6 /* PBSourceViewItems.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBSourceViewItems.h; sourceTree = ""; }; EB2A73480FEE3F09006601CF /* PBCollapsibleSplitView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCollapsibleSplitView.h; sourceTree = ""; }; EB2A73490FEE3F09006601CF /* PBCollapsibleSplitView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCollapsibleSplitView.m; sourceTree = ""; }; F50A411D0EBB874C00208746 /* mainSplitterBar.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = mainSplitterBar.tiff; path = Images/mainSplitterBar.tiff; sourceTree = ""; }; @@ -266,10 +290,6 @@ F5140DC80E8A8EB20091E9F3 /* RoundedRectangle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RoundedRectangle.m; sourceTree = ""; }; F523CEB40ED3399100DDD714 /* PBGitIndexController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitIndexController.h; sourceTree = ""; }; F523CEB50ED3399200DDD714 /* PBGitIndexController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitIndexController.m; sourceTree = ""; }; - F52821081056A7C1001D1511 /* PBSourceViewRemote.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBSourceViewRemote.h; sourceTree = ""; }; - F52821091056A7C1001D1511 /* PBSourceViewRemote.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBSourceViewRemote.m; sourceTree = ""; }; - F528210B1056A7EB001D1511 /* PBSourceViewAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBSourceViewAction.h; sourceTree = ""; }; - F528210C1056A7EB001D1511 /* PBSourceViewAction.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBSourceViewAction.m; sourceTree = ""; }; F52BCE020E84208300AA3741 /* PBGitHistoryView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PBGitHistoryView.xib; sourceTree = ""; }; F52BCE050E84211300AA3741 /* PBGitHistoryController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitHistoryController.h; sourceTree = ""; }; F52BCE060E84211300AA3741 /* PBGitHistoryController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitHistoryController.m; sourceTree = ""; }; @@ -317,10 +337,6 @@ F58DB55F10566E3900CFDF4A /* PBGitSidebarView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PBGitSidebarView.xib; sourceTree = ""; }; F58DB5E6105671B600CFDF4A /* PBSourceViewItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBSourceViewItem.h; sourceTree = ""; }; F58DB5E7105671B600CFDF4A /* PBSourceViewItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBSourceViewItem.m; sourceTree = ""; }; - F58DB76D1056860900CFDF4A /* branch.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = branch.tiff; path = Images/branch.tiff; sourceTree = ""; }; - F58DB76E1056860900CFDF4A /* remote.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = remote.tiff; path = Images/remote.tiff; sourceTree = ""; }; - F58DB76F1056860900CFDF4A /* folder.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = folder.tiff; path = Images/folder.tiff; sourceTree = ""; }; - F58DB7701056860900CFDF4A /* tag.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = tag.tiff; path = Images/tag.tiff; sourceTree = ""; }; F59116E50E843BB50072CCB1 /* PBGitCommitView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PBGitCommitView.xib; sourceTree = ""; }; F59116E70E843BCB0072CCB1 /* PBGitCommitController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitCommitController.h; sourceTree = ""; }; F59116E80E843BCB0072CCB1 /* PBGitCommitController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitCommitController.m; sourceTree = ""; }; @@ -478,10 +494,10 @@ 29B97315FDCFA39411CA2CEA /* Other Sources */ = { isa = PBXGroup; children = ( - F58DB76D1056860900CFDF4A /* branch.tiff */, - F58DB76E1056860900CFDF4A /* remote.tiff */, - F58DB76F1056860900CFDF4A /* folder.tiff */, - F58DB7701056860900CFDF4A /* tag.tiff */, + D858108011274D28007F254B /* Branch.png */, + D858108111274D28007F254B /* RemoteBranch.png */, + D858108211274D28007F254B /* Tag.png */, + D85810541127476E007F254B /* StageView.png */, 3BC07F4A0ED5A5C5009A7768 /* HistoryViewTemplate.png */, 3BC07F4B0ED5A5C5009A7768 /* CommitViewTemplate.png */, F56ADDD70ED19F9E002AC78F /* AddBranchTemplate.png */, @@ -577,6 +593,30 @@ name = Sheets; sourceTree = ""; }; + D8FDDA58114335B0005647F6 /* Source View Items */ = { + isa = PBXGroup; + children = ( + D8FDDA7311433634005647F6 /* PBSourceViewItems.h */, + F58DB5E6105671B600CFDF4A /* PBSourceViewItem.h */, + F58DB5E7105671B600CFDF4A /* PBSourceViewItem.m */, + D8FDDA66114335E8005647F6 /* PBGitSVStageItem.h */, + D8FDDA67114335E8005647F6 /* PBGitSVStageItem.m */, + D8FDDA5C114335E8005647F6 /* PBGitSVBranchItem.h */, + D8FDDA5D114335E8005647F6 /* PBGitSVBranchItem.m */, + D8FDDA64114335E8005647F6 /* PBGitSVRemoteItem.h */, + D8FDDA65114335E8005647F6 /* PBGitSVRemoteItem.m */, + D8FDDA62114335E8005647F6 /* PBGitSVRemoteBranchItem.h */, + D8FDDA63114335E8005647F6 /* PBGitSVRemoteBranchItem.m */, + D8FDDA68114335E8005647F6 /* PBGitSVTagItem.h */, + D8FDDA69114335E8005647F6 /* PBGitSVTagItem.m */, + D8FDDA60114335E8005647F6 /* PBGitSVOtherRevItem.h */, + D8FDDA61114335E8005647F6 /* PBGitSVOtherRevItem.m */, + D8FDDA5E114335E8005647F6 /* PBGitSVFolderItem.h */, + D8FDDA5F114335E8005647F6 /* PBGitSVFolderItem.m */, + ); + name = "Source View Items"; + sourceTree = ""; + }; F50A41130EBB872D00208746 /* Widgets */ = { isa = PBXGroup; children = ( @@ -682,12 +722,7 @@ children = ( F58DB55710566D3500CFDF4A /* PBGitSidebarController.h */, F58DB55810566D3500CFDF4A /* PBGitSidebarController.m */, - F58DB5E6105671B600CFDF4A /* PBSourceViewItem.h */, - F58DB5E7105671B600CFDF4A /* PBSourceViewItem.m */, - F52821081056A7C1001D1511 /* PBSourceViewRemote.h */, - F52821091056A7C1001D1511 /* PBSourceViewRemote.m */, - F528210B1056A7EB001D1511 /* PBSourceViewAction.h */, - F528210C1056A7EB001D1511 /* PBSourceViewAction.m */, + D8FDDA58114335B0005647F6 /* Source View Items */, ); name = Sidebar; sourceTree = ""; @@ -931,6 +966,7 @@ 47DBDB6A0E94EF6500671A1E /* Preferences.xib in Resources */, 47DBDBB10E94F6CA00671A1E /* Updates.png in Resources */, F569AE930F2CBD7C00C2FFA7 /* Credits.html in Resources */, + F58DB56010566E3900CFDF4A /* PBGitSidebarView.xib in Resources */, D85B939310E3D8B4007F3C28 /* PBCreateBranchSheet.xib in Resources */, D889EB3110E6BCBB00F08413 /* PBCreateTagSheet.xib in Resources */, D8357535112640F100DE249D /* PBRemoteProgressSheet.xib in Resources */, @@ -938,10 +974,10 @@ D8083DCD111F918900337480 /* PBCloneRepsitoryToSheet.xib in Resources */, D8FDD9F711432A12005647F6 /* PBCloneRepositoryPanel.xib in Resources */, F58DB56010566E3900CFDF4A /* PBGitSidebarView.xib in Resources */, - F58DB7711056860900CFDF4A /* branch.tiff in Resources */, - F58DB7721056860900CFDF4A /* remote.tiff in Resources */, - F58DB7731056860900CFDF4A /* folder.tiff in Resources */, - F58DB7741056860900CFDF4A /* tag.tiff in Resources */, + D85810551127476E007F254B /* StageView.png in Resources */, + D858108311274D28007F254B /* Branch.png in Resources */, + D858108411274D28007F254B /* RemoteBranch.png in Resources */, + D858108511274D28007F254B /* Tag.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1070,8 +1106,13 @@ F58DB55910566D3500CFDF4A /* PBGitSidebarController.m in Sources */, F58DB5E8105671B600CFDF4A /* PBSourceViewItem.m in Sources */, F567B88D1057FA9F000DB976 /* NSOutlineViewExt.m in Sources */, - F528210A1056A7C1001D1511 /* PBSourceViewRemote.m in Sources */, - F528210D1056A7EB001D1511 /* PBSourceViewAction.m in Sources */, + D8FDDA6A114335E8005647F6 /* PBGitSVBranchItem.m in Sources */, + D8FDDA6B114335E8005647F6 /* PBGitSVFolderItem.m in Sources */, + D8FDDA6C114335E8005647F6 /* PBGitSVOtherRevItem.m in Sources */, + D8FDDA6D114335E8005647F6 /* PBGitSVRemoteBranchItem.m in Sources */, + D8FDDA6E114335E8005647F6 /* PBGitSVRemoteItem.m in Sources */, + D8FDDA6F114335E8005647F6 /* PBGitSVStageItem.m in Sources */, + D8FDDA70114335E8005647F6 /* PBGitSVTagItem.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Images/Branch.acorn b/Images/Branch.acorn new file mode 100644 index 0000000000000000000000000000000000000000..6e6498df6eab81e4b3f55f82c173d3b2665f9111 GIT binary patch literal 1849 zcmZ`)2~ZPf6#h56i3#T-r*g<8Dg;TO96FVBII3U{AgCO5;*u<|nq=edMvN3IlBTtc zI;AQGgPmdv*s8TUV5uVtwcdENouN8bgrU`GZ3pd)Iu%R*L}bF){{QUm+y8ywizCyM>k5-`4;9|4P=I&}gLpsS)I&=kL}t2S0w-mtMS|ScgQxHq66UsEHI=COKPQQ;z(&)oyrf{gn6VDD8B}Cr;mRx5cz+n&%fm;f~~F<$uL= zb5}sXeGpC>ToK!vfh%C()K?MuS0Fr_&8EU-|4lxmz*Uxz4L9Pgh!(T*Dk~cXuE;YR zU{+&X_n$(N)@z@ zT%pwyEUUo-rWreX4fG*Hv{8l6+vw1)3E{^Cj&~d@mBh8sA>J@t29Ppw6bDJts76 zmnTLCZ!Q-9usipep*K+3jU>oZ4;7d8ZPq;K^BM999>iv-JwsO)UXTedeVc(lJDR}t z4|J_*IQ(Agk^blvEzPHk+f8vhM+#=2*?-;JcgUvb_FE_4-jjG^XkFS{2`R$4=hut9 z`;s2_U#?lxxGwF)+`qs6v#+81gHW^2@Mx@Z)DJtm`KfgwTi!MyQ9k_q+1OrYMAYk~$oDB_%HomS|ai(Qdbt zNR#8EqElW=6_va^uvK`+Mn~5bg-5>xw+-JpU-wnw^8Ad{j;@M z>6iA_e0jQ%r}=I?;amy-?eIr~=DK;G9jd3Z{`o@iG_CK%nHo_q+N&B{GM2q{&Xzg; zcROTH9g7Q7%K16hq!@~}5X=Mf!UC}vOpHmf z94r@G&i|O-&hO-R^H1~7@(1}p@rMPC0=uA1&>`rAeGdoE`M+?Ej2DlWcfrAb0cI5grfj_~!IB^UTd=ZfAF9e>*dq zGeuEA#29mrQ>$Fmd>Hq&W*d>(Y#kgP?x=Mzf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LGK}7uOPLN?iQRcV_t&zdngo_|6*F!7~c~V`9AF`n41G&a{8F z-My+09^5zBYWf&InP{^G+G<7J2k_}pc{hb|b?6L-_^jp%JK=(4fv&&lh<U`n zjMW2{s9XKZI@VSk!H-QMbJ9<3vg|)v$gB8iB=vYP|HG;GFPZJrx9@c@IWP7Ip2&Xq z>U)b{589&|o--`3i>ZwX8}S|4IJh(GiR<0MndTjlw{Mh<4BWBY4}J_>Ng$6Ks=UBQ_Q$SR|m3CW7L}vpGn?b}dQCEzc@L^)HYF4M zMkQvd2FBWSHX8P#|0vSjq|0hHtfFlHIfj|pL1(0eKg^;d;6iSE@gdeG2q9wG%XST=G@AXW~ zd_EWL(IG&^`Hqp-X06K>VCjqxmu{Zg74lwQmL4gxuBSnlzz zHaCk6e*=o)Eo+SO5@I;D>NeQ8VLAdtN=Oi>@i_TYmjY-Lj?ZtIi#2*M&2X!-nczI{ zf%oCyb8f?0hipK$ATh)yjPDEUAIJyf3-XG%J81d?IhkqDx&i;n00000NkvXXu0mjf D@lDac literal 0 HcmV?d00001 diff --git a/Images/StageView.png b/Images/StageView.png new file mode 100644 index 0000000000000000000000000000000000000000..36ff76474f642e737f98b11267ab7ad9733cccd5 GIT binary patch literal 271 zcmeAS@N?(olHy`uVBq!ia0vp^0zk~q!3HGX7W?Z1Db50q$YKTtZeb8+WSBKa0w{RU z)5S4FLv(5ILEdHq0qZOIOTErq;FVZ#`^(kPU#|>4B=W?~U1+?dOmz7Zk%hu8Ms|AX z>N1^6r>tQ$-p%0u;L5D^iRWf3 z9QWPu?0k=TLHz6xC&}E7)IUyV*YB+6%{cPxo2=ZQ7QV#>vCYXzvaO=V;s<(W?Grks zp1V$TWf|1qG%eorP`4pVoPR{E4eado71;uiRa0E23`H zny3|HwurPiQRAOPT!!(_k}=&-!KraDwnd|3Y#N=Is8gnkO7~ikluX~t^}fFE_x-+m zzxREw+H9aXUM9PS2vAHY3JMla2nh|F7>-9oW@HdrGp)v>@>p_p9;2}sDHC5tu^i2q zs`M+R%%{1gyu7;W0!Ku)Zw7Cj7RK_XK<( z^XT+_A)Mv)X_+a~w9E!o1hNJT;dquJjlA7VX+ODxI*|7q4o8TR7}E)HID(ags=Aia z@L=N(=#5em#TK5dhT_s19_miAcHnS?Dv5yqpE(dZ*oTI}1P?{mBXDWfL?xkMc%Cs9 zldPULIY$vni?NzwAxV&uC?gFP3P5nO!-42pDhpjb)^eQu9q=T5{Angn?%mZvr2A#FZxxZ4uOJdXKgQn;fcO82^) z0dz}AxDV1NgFoZmoxq;`z>`&)8q%bvav6(>SL5Lt7|n1r50A8% z(Nd)v1Ick}eA2jJU#~&V<&3WzdAqn|iH0$$@cA~6X60nzJ`lYhdAL5MS<*ST?Xfz2 zI9D|LQkKOZ5MA+tCAGlAMxAriLk63FA>*9WS_HOpRx=(95o6N^U z27jjek32d2jUsYbdM?R@#??PpwHDWAF50srt?y~e`T5no2kLregdJOTD`$CAPoLO@ zxN=+*y`0wCetp%8t=aCrQyVuk+j~MX|7uw=>&XU1o4O{u_tc;3od%Y+zR-E=TAU%R zm$x6Tk4ro@6#ne*&DG-8D_3uRcdzz%s%yjf@9))irbf`#_G{i-zafbQD|>O|jhd#` z4+Ll`OM|7BK6jqD{M8Mt!rN?~~LmqQENEn#b;9;q|VoD3Zh45Y0MT6^Weq6cVK_?f0qxj>%w z{Bh71L~QMWqy35-io&PvF6GFeRXiAV>W!O&1rzMMB;!E>$O5@Q1uB6Sn1CHLf+o-m zT7U;xf#?J`(HUqmx(IzARiPGi8`^>%K|9b3XfN7_{)$CmahL>~j?KlgvBg*kR*F># rR}1aJO~UQM&xMDChlL%YGLcqf6tN->HZU9l-^K46SubC&entF$Po;Ds literal 0 HcmV?d00001 diff --git a/Images/Tag.png b/Images/Tag.png new file mode 100644 index 0000000000000000000000000000000000000000..4d72ca61d5c8625b27d5775976203ae9851a5df6 GIT binary patch literal 527 zcmV+q0`UEbP)9E_>ky-rmma%$v7!D+YrBu?ZoT z@ktmbWI^6@NSKrrOgOGvvwVO1Sgmq{^)M2fKzuj0NIRNzAMneGy4^$SbUHPVq(KsB zBCR}ODE{^0j$Wp#dXxSKTCr63wxm?T3>N`^1_6SR62HLSTwiTt26G6Rv4s-Y z`GI{te@6Sc6lu2w1$IwJ@w!5O3ROv98sH}x1MrND^|AJVAK({gqV5G>`UiY~qpTrw RkqQ6+002ovPDHLkV1h(9;P?Ol literal 0 HcmV?d00001 diff --git a/PBGitHistoryView.xib b/PBGitHistoryView.xib index 1bdcd50..43cdaca 100644 --- a/PBGitHistoryView.xib +++ b/PBGitHistoryView.xib @@ -3,7 +3,7 @@ 1050 10C540 - 732 + 759 1038.25 458.00 @@ -15,12 +15,13 @@ YES - 732 - 732 + 759 + 759 YES + YES @@ -101,8 +102,8 @@ PBWebHistoryController - - 274 + + 4370 YES @@ -149,7 +150,7 @@ - 274 + 4370 YES @@ -164,7 +165,7 @@ YES - 256 + 4352 {852, 194} YES @@ -405,7 +406,7 @@ - 18 + 4114 {{0, 212}, {852, 186}} @@ -414,12 +415,12 @@ 1 - 274 + 4370 YES - 274 + 4370 YES @@ -484,17 +485,17 @@ Item 2 - 256 + 4352 YES - 274 + 4370 YES - 276 + 4372 YES @@ -504,7 +505,7 @@ YES - 256 + 4352 {191, 186} YES @@ -598,7 +599,7 @@ - 274 + 4370 YES @@ -609,7 +610,7 @@ 2322 - {543, 0} + {543, 112} @@ -913,6 +914,7 @@ {852, 432} + NSView @@ -936,7 +938,6 @@ 1E431E79-1591-49E7-9E17-49497CA4622A 7FFB691C-2D2F-49A9-997F-AE1AE8BFF3F1 86360841-A2B1-4802-845A-AE424521FE99 - 99C2C9EB-AE16-42A9-BE52-46CE903E9AF9 NSToolbarFlexibleSpaceItem NSToolbarSeparatorItem @@ -950,9 +951,11 @@ View selector - + 268 {{0, 14}, {87, 25}} + + 3 YES @@ -1009,9 +1012,11 @@ - + 265 {{0, 14}, {183, 22}} + + YES 343014976 @@ -1093,9 +1098,11 @@ Create Branch - + 268 {{21, 14}, {40, 25}} + + YES -2080244224 @@ -1126,94 +1133,6 @@ YES 0 - - - 99C2C9EB-AE16-42A9-BE52-46CE903E9AF9 - - Branch - Branch - - - - 268 - {{0, 14}, {134, 26}} - YES - - -2076049856 - 2048 - - - 109199615 - 1 - - - 400 - 75 - - - master - - 1048576 - 2147483647 - 1 - - NSImage - NSMenuCheckmark - - - NSImage - NSMenuMixedState - - _popUpItemAction: - - - YES - - OtherViews - - YES - - - - Item 2 - - 1048576 - 2147483647 - - - _popUpItemAction: - - - - - Item 3 - - 1048576 - 2147483647 - - - _popUpItemAction: - - - - - 1 - YES - YES - 2 - - - - - - {134, 25} - {134, 26} - YES - YES - 0 - YES - 0 - NSToolbarFlexibleSpaceItem @@ -1237,8 +1156,14 @@ 1048576 2147483647 - - + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + @@ -1264,8 +1189,8 @@ 1048576 2147483647 - - + + @@ -1274,7 +1199,6 @@ YES - @@ -1283,7 +1207,6 @@ YES - @@ -1743,14 +1666,6 @@ 260 - - - branchPopUp - - - - 268 - predicate3: filterPredicate @@ -2181,7 +2096,6 @@ - History Toolbar @@ -2265,59 +2179,6 @@ - - 114 - - - YES - - - - - - 119 - - - YES - - - - - - 120 - - - YES - - - - - - 121 - - - YES - - - - - - - - 124 - - - - - 123 - - - - - 122 - - - 287 @@ -2344,19 +2205,10 @@ 113.IBEditorWindowLastContentRect 113.IBPluginDependency 113.editorWindowContentRectSynchronizationRect - 114.IBPluginDependency 116.IBPluginDependency 117.IBPluginDependency 118.IBPluginDependency - 119.IBPluginDependency 12.IBPluginDependency - 120.IBPluginDependency - 121.IBEditorWindowLastContentRect - 121.IBPluginDependency - 121.editorWindowContentRectSynchronizationRect - 122.IBPluginDependency - 123.IBPluginDependency - 124.IBPluginDependency 13.IBPluginDependency 14.IBPluginDependency 15.CustomClassName @@ -2431,7 +2283,7 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{312, 366}, {616, 227}} + {{312, 424}, {616, 169}} com.apple.InterfaceBuilder.CocoaPlugin {{132, 614}, {616, 0}} com.apple.InterfaceBuilder.CocoaPlugin @@ -2440,15 +2292,6 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - {{725, 616}, {134, 63}} - com.apple.InterfaceBuilder.CocoaPlugin - {{848, 458}, {116, 63}} - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin PBQLOutlineView com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -2522,7 +2365,7 @@ com.apple.InterfaceBuilder.CocoaPlugin - {{321, 67}, {852, 432}} + {{486, 542}, {852, 432}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -2557,6 +2400,13 @@ YES + + NSOutlineView + + IBProjectSource + NSOutlineViewExt.h + + PBCollapsibleSplitView PBNiceSplitView @@ -2596,12 +2446,14 @@ YES createBranch: + createTag: openFilesAction: openSelectedFile: refresh: setDetailedView: setRawView: setTreeView: + showAddRemoteSheet: showCommitsFromTree: showInFinderAction: toggleQuickView: @@ -2618,6 +2470,8 @@ id id id + id + id @@ -2705,12 +2559,40 @@ YES changeBranch: + checkout: + cherryPick: + copyPatch: + copySHA: createBranch: + createTag: + fetchRemote: + merge: + pullRemote: + pushDefaultRemoteForRef: + pushToRemote: + pushUpdatesToRemote: + rebaseActiveBranch: + rebaseHeadBranch: + showTagInfoSheet: YES NSMenuItem PBRefMenuItem + PBRefMenuItem + PBRefMenuItem + PBRefMenuItem + PBRefMenuItem + PBRefMenuItem + PBRefMenuItem + PBRefMenuItem + PBRefMenuItem + PBRefMenuItem + PBRefMenuItem + PBRefMenuItem + PBRefMenuItem + PBRefMenuItem + PBRefMenuItem @@ -2959,14 +2841,6 @@ AppKit.framework/Headers/NSMenuItem.h - - NSMenuItemCell - NSButtonCell - - IBFrameworkSource - AppKit.framework/Headers/NSMenuItemCell.h - - NSObject @@ -3316,14 +3190,6 @@ AppKit.framework/Headers/NSPopUpButton.h - - NSPopUpButtonCell - NSMenuItemCell - - IBFrameworkSource - AppKit.framework/Headers/NSPopUpButtonCell.h - - NSResponder @@ -3562,6 +3428,7 @@ 0 + IBCocoaFramework com.apple.InterfaceBuilder.CocoaPlugin.macosx @@ -3577,5 +3444,18 @@ YES GitX.xcodeproj 3 + + YES + + YES + AddBranchTemplate + NSQuickLookTemplate + + + YES + {25, 13} + {19, 11} + + diff --git a/PBGitRevSpecifier.h b/PBGitRevSpecifier.h index bc2724c..7c822ab 100644 --- a/PBGitRevSpecifier.h +++ b/PBGitRevSpecifier.h @@ -23,6 +23,7 @@ - (PBGitRef *) ref; - (BOOL) hasPathLimiter; - (BOOL) hasLeftRight; +- (NSString *) title; - (BOOL) isEqualTo: (PBGitRevSpecifier*) other; - (BOOL) isAllBranchesRev; diff --git a/PBGitRevSpecifier.m b/PBGitRevSpecifier.m index 398a175..910140f 100644 --- a/PBGitRevSpecifier.m +++ b/PBGitRevSpecifier.m @@ -85,6 +85,28 @@ return [parameters componentsJoinedByString:@" "]; } +- (NSString *) title +{ + NSString *title = nil; + + if ([self.description isEqualToString:@"HEAD"]) + title = @"detached HEAD"; + else if ([self isSimpleRef]) + title = [[self ref] shortName]; + else if ([self.description hasPrefix:@"-S"]) + title = [self.description substringFromIndex:[@"-S" length]]; + else if ([self.description hasPrefix:@"HEAD -- "]) + title = [self.description substringFromIndex:[@"HEAD -- " length]]; + else if ([self.description hasPrefix:@"-- "]) + title = [self.description substringFromIndex:[@"-- " length]]; + else if ([self.description hasPrefix:@"--left-right "]) + title = [self.description substringFromIndex:[@"--left-right " length]]; + else + title = self.description; + + return [NSString stringWithFormat:@"\"%@\"", title]; +} + - (BOOL) hasPathLimiter; { for (NSString* param in parameters) diff --git a/PBGitSVBranchItem.h b/PBGitSVBranchItem.h new file mode 100644 index 0000000..c5e4538 --- /dev/null +++ b/PBGitSVBranchItem.h @@ -0,0 +1,19 @@ +// +// PBGitSVBranchItem.h +// GitX +// +// Created by Nathan Kinsinger on 3/2/10. +// Copyright 2010 Nathan Kinsinger. All rights reserved. +// + +#import +#import "PBSourceViewItem.h" + + +@interface PBGitSVBranchItem : PBSourceViewItem { + +} + ++ (id)branchItemWithRevSpec:(PBGitRevSpecifier *)revSpecifier; + +@end diff --git a/PBGitSVBranchItem.m b/PBGitSVBranchItem.m new file mode 100644 index 0000000..6723096 --- /dev/null +++ b/PBGitSVBranchItem.m @@ -0,0 +1,33 @@ +// +// PBGitSVBranchItem.m +// GitX +// +// Created by Nathan Kinsinger on 3/2/10. +// Copyright 2010 Nathan Kinsinger. All rights reserved. +// + +#import "PBGitSVBranchItem.h" + + +@implementation PBGitSVBranchItem + + ++ (id)branchItemWithRevSpec:(PBGitRevSpecifier *)revSpecifier +{ + PBGitSVBranchItem *item = [self itemWithTitle:[[revSpecifier description] lastPathComponent]]; + item.revSpecifier = revSpecifier; + + return item; +} + + +- (NSImage *) icon +{ + static NSImage *branchImage = nil; + if (!branchImage) + branchImage = [NSImage imageNamed:@"Branch.png"]; + + return branchImage; +} + +@end diff --git a/PBGitSVFolderItem.h b/PBGitSVFolderItem.h new file mode 100644 index 0000000..5d5882d --- /dev/null +++ b/PBGitSVFolderItem.h @@ -0,0 +1,19 @@ +// +// PBGitSVFolderItem.h +// GitX +// +// Created by Nathan Kinsinger on 3/2/10. +// Copyright 2010 Nathan Kinsinger. All rights reserved. +// + +#import +#import "PBSourceViewItem.h" + + +@interface PBGitSVFolderItem : PBSourceViewItem { + +} + ++ (id)folderItemWithTitle:(NSString *)title; + +@end diff --git a/PBGitSVFolderItem.m b/PBGitSVFolderItem.m new file mode 100644 index 0000000..8332902 --- /dev/null +++ b/PBGitSVFolderItem.m @@ -0,0 +1,34 @@ +// +// PBGitSVFolderItem.m +// GitX +// +// Created by Nathan Kinsinger on 3/2/10. +// Copyright 2010 Nathan Kinsinger. All rights reserved. +// + +#import "PBGitSVFolderItem.h" + + +@implementation PBGitSVFolderItem + + ++ (id)folderItemWithTitle:(NSString *)title +{ + PBGitSVFolderItem *item = [self itemWithTitle:title]; + + return item; +} + + +- (NSImage *) icon +{ + static NSImage *folderImage = nil; + if (!folderImage) { + folderImage = [[NSWorkspace sharedWorkspace] iconForFileType:NSFileTypeForHFSTypeCode(kGenericFolderIcon)]; + [folderImage setSize:NSMakeSize(16,16)]; + } + + return folderImage; +} + +@end diff --git a/PBGitSVOtherRevItem.h b/PBGitSVOtherRevItem.h new file mode 100644 index 0000000..f3e6711 --- /dev/null +++ b/PBGitSVOtherRevItem.h @@ -0,0 +1,19 @@ +// +// PBGitSVOtherRevItem.h +// GitX +// +// Created by Nathan Kinsinger on 3/2/10. +// Copyright 2010 Nathan Kinsinger. All rights reserved. +// + +#import +#import "PBSourceViewItem.h" + + +@interface PBGitSVOtherRevItem : PBSourceViewItem { + +} + ++ (id)otherItemWithRevSpec:(PBGitRevSpecifier *)revSpecifier; + +@end diff --git a/PBGitSVOtherRevItem.m b/PBGitSVOtherRevItem.m new file mode 100644 index 0000000..5cd280b --- /dev/null +++ b/PBGitSVOtherRevItem.m @@ -0,0 +1,34 @@ +// +// PBGitSVOtherRevItem.m +// GitX +// +// Created by Nathan Kinsinger on 3/2/10. +// Copyright 2010 Nathan Kinsinger. All rights reserved. +// + +#import "PBGitSVOtherRevItem.h" +#import "PBGitRevSpecifier.h" + + +@implementation PBGitSVOtherRevItem + + ++ (id)otherItemWithRevSpec:(PBGitRevSpecifier *)revSpecifier +{ + PBGitSVOtherRevItem *item = [self itemWithTitle:[revSpecifier title]]; + item.revSpecifier = revSpecifier; + + return item; +} + + +- (NSImage *) icon +{ + static NSImage *otherRevImage = nil; + if (!otherRevImage) + otherRevImage = [NSImage imageNamed:@"Branch.png"]; + + return otherRevImage; +} + +@end diff --git a/PBGitSVRemoteBranchItem.h b/PBGitSVRemoteBranchItem.h new file mode 100644 index 0000000..e04fb33 --- /dev/null +++ b/PBGitSVRemoteBranchItem.h @@ -0,0 +1,19 @@ +// +// PBGitSVRemoteBranchItem.h +// GitX +// +// Created by Nathan Kinsinger on 3/2/10. +// Copyright 2010 Nathan Kinsinger. All rights reserved. +// + +#import +#import "PBSourceViewItem.h" + + +@interface PBGitSVRemoteBranchItem : PBSourceViewItem { + +} + ++ (id)remoteBranchItemWithRevSpec:(PBGitRevSpecifier *)revSpecifier; + +@end diff --git a/PBGitSVRemoteBranchItem.m b/PBGitSVRemoteBranchItem.m new file mode 100644 index 0000000..d514f52 --- /dev/null +++ b/PBGitSVRemoteBranchItem.m @@ -0,0 +1,33 @@ +// +// PBGitSVRemoteBranchItem.m +// GitX +// +// Created by Nathan Kinsinger on 3/2/10. +// Copyright 2010 Nathan Kinsinger. All rights reserved. +// + +#import "PBGitSVRemoteBranchItem.h" + + +@implementation PBGitSVRemoteBranchItem + + ++ (id)remoteBranchItemWithRevSpec:(PBGitRevSpecifier *)revSpecifier +{ + PBGitSVRemoteBranchItem *item = [self itemWithTitle:[[revSpecifier description] lastPathComponent]]; + item.revSpecifier = revSpecifier; + + return item; +} + + +- (NSImage *) icon +{ + static NSImage *remoteBranchImage = nil; + if (!remoteBranchImage) + remoteBranchImage = [NSImage imageNamed:@"RemoteBranch.png"]; + + return remoteBranchImage; +} + +@end diff --git a/PBGitSVRemoteItem.h b/PBGitSVRemoteItem.h new file mode 100644 index 0000000..a64084c --- /dev/null +++ b/PBGitSVRemoteItem.h @@ -0,0 +1,19 @@ +// +// PBGitSVRemoteItem.h +// GitX +// +// Created by Nathan Kinsinger on 3/2/10. +// Copyright 2010 Nathan Kinsinger. All rights reserved. +// + +#import +#import "PBSourceViewItem.h" + + +@interface PBGitSVRemoteItem : PBSourceViewItem { + +} + ++ (id)remoteItemWithTitle:(NSString *)title; + +@end diff --git a/PBGitSVRemoteItem.m b/PBGitSVRemoteItem.m new file mode 100644 index 0000000..4ce251d --- /dev/null +++ b/PBGitSVRemoteItem.m @@ -0,0 +1,41 @@ +// +// PBGitSVRemoteItem.m +// GitX +// +// Created by Nathan Kinsinger on 3/2/10. +// Copyright 2010 Nathan Kinsinger. All rights reserved. +// + +#import "PBGitSVRemoteItem.h" +#import "PBGitRef.h" + + +@implementation PBGitSVRemoteItem + + ++ (id)remoteItemWithTitle:(NSString *)title +{ + PBGitSVRemoteItem *item = [self itemWithTitle:title]; + + return item; +} + + +- (NSImage *) icon +{ + static NSImage *networkImage = nil; + if (!networkImage) { + networkImage = [NSImage imageNamed:NSImageNameNetwork]; + [networkImage setSize:NSMakeSize(16,16)]; + } + + return networkImage; +} + + +- (PBGitRef *) ref +{ + return [PBGitRef refFromString:[kGitXRemoteRefPrefix stringByAppendingString:self.title]]; +} + +@end diff --git a/PBGitSVStageItem.h b/PBGitSVStageItem.h new file mode 100644 index 0000000..8b37c91 --- /dev/null +++ b/PBGitSVStageItem.h @@ -0,0 +1,19 @@ +// +// PBGitSVStageItem.h +// GitX +// +// Created by Nathan Kinsinger on 3/2/10. +// Copyright 2010 Nathan Kinsinger. All rights reserved. +// + +#import +#import "PBSourceViewItem.h" + + +@interface PBGitSVStageItem : PBSourceViewItem { + +} + ++ (id) stageItem; + +@end diff --git a/PBGitSVStageItem.m b/PBGitSVStageItem.m new file mode 100644 index 0000000..3ae1725 --- /dev/null +++ b/PBGitSVStageItem.m @@ -0,0 +1,32 @@ +// +// PBGitSVStageItem.m +// GitX +// +// Created by Nathan Kinsinger on 3/2/10. +// Copyright 2010 Nathan Kinsinger. All rights reserved. +// + +#import "PBGitSVStageItem.h" + + +@implementation PBGitSVStageItem + + ++ (id) stageItem +{ + PBGitSVStageItem *item = [self itemWithTitle:@"Stage"]; + + return item; +} + + +- (NSImage *) icon +{ + static NSImage *stageImage = nil; + if (!stageImage) + stageImage = [NSImage imageNamed:@"StageView"]; + + return stageImage; +} + +@end diff --git a/PBGitSVTagItem.h b/PBGitSVTagItem.h new file mode 100644 index 0000000..a8e2aeb --- /dev/null +++ b/PBGitSVTagItem.h @@ -0,0 +1,19 @@ +// +// PBGitSVTagItem.h +// GitX +// +// Created by Nathan Kinsinger on 3/2/10. +// Copyright 2010 Nathan Kinsinger. All rights reserved. +// + +#import +#import "PBSourceViewItem.h" + + +@interface PBGitSVTagItem : PBSourceViewItem { + +} + ++ (id)tagItemWithRevSpec:(PBGitRevSpecifier *)revSpecifier; + +@end diff --git a/PBGitSVTagItem.m b/PBGitSVTagItem.m new file mode 100644 index 0000000..818fde6 --- /dev/null +++ b/PBGitSVTagItem.m @@ -0,0 +1,33 @@ +// +// PBGitSVTagItem.m +// GitX +// +// Created by Nathan Kinsinger on 3/2/10. +// Copyright 2010 Nathan Kinsinger. All rights reserved. +// + +#import "PBGitSVTagItem.h" + + +@implementation PBGitSVTagItem + + ++ (id)tagItemWithRevSpec:(PBGitRevSpecifier *)revSpecifier +{ + PBGitSVTagItem *item = [self itemWithTitle:[[revSpecifier description] lastPathComponent]]; + item.revSpecifier = revSpecifier; + + return item; +} + + +- (NSImage *) icon +{ + static NSImage *tagImage = nil; + if (!tagImage) + tagImage = [NSImage imageNamed:@"Tag.png"]; + + return tagImage; +} + +@end diff --git a/PBGitSidebarController.h b/PBGitSidebarController.h index 9bc7581..8e2677a 100644 --- a/PBGitSidebarController.h +++ b/PBGitSidebarController.h @@ -9,7 +9,7 @@ #import #import "PBViewController.h" -@class PBSourceViewAction, PBSourceViewItem; +@class PBSourceViewItem; @interface PBGitSidebarController : PBViewController { IBOutlet NSWindow *window; @@ -18,9 +18,9 @@ NSMutableArray *items; /* Specific things */ - PBSourceViewAction *commitAction; + PBSourceViewItem *stage; - PBSourceViewItem *branches, *remotes, *tags, *custom; + PBSourceViewItem *branches, *remotes, *tags, *others; } @property(readonly) NSMutableArray *items; diff --git a/PBGitSidebarController.m b/PBGitSidebarController.m index fd31fbc..c537e39 100644 --- a/PBGitSidebarController.m +++ b/PBGitSidebarController.m @@ -7,9 +7,8 @@ // #import "PBGitSidebarController.h" -#import "PBSourceViewItem.h" +#import "PBSourceViewItems.h" #import "NSOutlineViewExt.h" -#import "PBSourceViewAction.h" @interface PBGitSidebarController () @@ -75,7 +74,7 @@ - (void)addRevSpec:(PBGitRevSpecifier *)rev { if (![rev isSimpleRef]) { - [custom addChild:[PBSourceViewItem itemWithRevSpec:rev]]; + [others addChild:[PBSourceViewItem itemWithRevSpec:rev]]; return; } @@ -103,7 +102,7 @@ return; } - if (item == commitAction) + if (item == stage) [[repository windowController] showCommitView:self]; /* ... */ @@ -129,51 +128,42 @@ } // -// The next two methods are necessary to hide the triangle for uncollapsible items -// That is, items which should always be displayed, such as the action items. -// -- (BOOL)outlineView:(NSOutlineView *)outlineView shouldCollapseItem:(id)item +// The next method is necessary to hide the triangle for uncollapsible items +// That is, items which should always be displayed, such as the Project group. +// This also moves the group item to the left edge. +- (BOOL) outlineView:(NSOutlineView *)outlineView shouldShowOutlineCellForItem:(id)item { - return !([item isUncollapsible]); + return ![item isUncollapsible]; } -- (void)outlineView:(NSOutlineView *)outlineView willDisplayOutlineCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item -{ - [cell setTransparent:[item isUncollapsible]]; -} - - (void)populateList { - PBSourceViewItem *actions = [PBSourceViewItem groupItemWithTitle:@"Actions"]; + PBSourceViewItem *project = [PBSourceViewItem groupItemWithTitle:[repository projectName]]; + project.isUncollapsible = YES; - actions.isUncollapsible = YES; - - commitAction = [PBSourceViewAction itemWithTitle:@"Index / Commit"]; - commitAction.icon = [NSImage imageNamed:@"CommitViewTemplate"]; - [actions addChild:commitAction]; + stage = [PBGitSVStageItem stageItem]; + [project addChild:stage]; branches = [PBSourceViewItem groupItemWithTitle:@"Branches"]; remotes = [PBSourceViewItem groupItemWithTitle:@"Remotes"]; tags = [PBSourceViewItem groupItemWithTitle:@"Tags"]; - custom = [PBSourceViewItem groupItemWithTitle:@"Custom"]; + others = [PBSourceViewItem groupItemWithTitle:@"Other"]; for (PBGitRevSpecifier *rev in repository.branches) [self addRevSpec:rev]; - //[items addObject:actions]; - + [items addObject:project]; [items addObject:branches]; [items addObject:remotes]; [items addObject:tags]; - [items addObject:custom]; + [items addObject:others]; [sourceView reloadData]; + [sourceView expandItem:project]; [sourceView expandItem:branches expandChildren:YES]; - [sourceView expandItem:actions]; + [sourceView expandItem:remotes]; - NSAssert(branches == [sourceView itemAtRow:0], @"First item is not the Branches"); [sourceView reloadItem:nil reloadChildren:YES]; - } #pragma mark NSOutlineView Datasource methods diff --git a/PBGitSidebarView.xib b/PBGitSidebarView.xib index c264858..57a3096 100644 --- a/PBGitSidebarView.xib +++ b/PBGitSidebarView.xib @@ -1,24 +1,26 @@ - + 1050 - 9L31a - 677 - 949.54 - 353.00 + 10C540 + 759 + 1038.25 + 458.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 759 + YES - - + YES - com.apple.InterfaceBuilderKit com.apple.InterfaceBuilder.CocoaPlugin YES - + YES @@ -36,24 +38,6 @@ NSApplication - - 15 - 2 - {{196, 106}, {186, 404}} - 603979776 - Window - NSWindow - - {3.40282e+38, 3.40282e+38} - - - 274 - {186, 404} - - - {{0, 0}, {1280, 1002}} - {3.40282e+38, 3.40282e+38} - 4370 @@ -67,7 +51,7 @@ 4352 - {151, 352} + {153, 354} YES @@ -78,16 +62,16 @@ YES - 1.500000e+02 - 1.600000e+01 - 1.000000e+03 + 150 + 16 + 1000 - 75628032 - 0 + 75628096 + 2048 LucidaGrande - 1.100000e+01 + 11 3100 @@ -105,13 +89,13 @@ - 337772096 + 69336641 2048 Text Cell LucidaGrande - 1.300000e+01 - 1044 + 11 + 16 @@ -120,7 +104,7 @@ controlBackgroundColor 3 - MC42NjY2NjY2OQA + MC42NjY2NjY2NjY3AA @@ -130,20 +114,20 @@ - 3 + 1 YES - YES - 3.000000e+00 + 3 + 0.0 6 System _sourceListBackgroundColor 1 - MC44MzkyMTU3IDAuODY2NjY2NjcgMC44OTgwMzkyMgA + MC44MzkyMTU2OTU5IDAuODY2NjY2Njc0NiAwLjg5ODAzOTIyMTgAA @@ -155,14 +139,18 @@ MC41AA - 2.000000e+01 - -767557632 + 20 + 306184192 + + 4 15 0 YES 1 - 1.400000e+01 + 1 + NO + 12 {153, 354} @@ -179,17 +167,17 @@ _doScroller: - 9.969879e-01 + 0.99698790000000004 - 256 + -2147483392 {{-100, -100}, {196, 15}} 1 _doScroller: - 5.714286e-01 + 0.57142859999999995 {153, 354} @@ -201,21 +189,10 @@ QSAAAEEgAABBoAAAQaAAAA - - YES - YES - - - window - - - - 5 - view @@ -254,44 +231,28 @@ YES 0 - - YES - + -2 - - RmlsZSdzIE93bmVyA + + File's Owner -1 - + First Responder -3 - + Application - - 2 - - - YES - - - - - - 3 - - - 8 @@ -301,7 +262,7 @@ - + 9 @@ -336,30 +297,18 @@ - - 21 - - - YES - + YES - -1.IBPluginDependency - -2.IBPluginDependency -3.IBPluginDependency 10.IBPluginDependency 11.IBPluginDependency 13.IBPluginDependency 16.CustomClassName 16.IBPluginDependency - 2.IBEditorWindowLastContentRect - 2.IBPluginDependency - 2.IBWindowTemplateEditedContentRect - 2.NSWindowTemplate.visibleAtLaunch - 3.IBPluginDependency 8.IBEditorWindowLastContentRect 8.IBPluginDependency 9.IBPluginDependency @@ -367,18 +316,11 @@ YES com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilderKit - com.apple.InterfaceBuilderKit com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin PBIconAndTextCell com.apple.InterfaceBuilder.CocoaPlugin - {{297, 477}, {186, 404}} - com.apple.InterfaceBuilder.CocoaPlugin - {{297, 477}, {186, 404}} - - com.apple.InterfaceBuilder.CocoaPlugin {{105, 545}, {153, 354}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -386,9 +328,7 @@ YES - - YES - + YES @@ -396,9 +336,7 @@ YES - - YES - + YES @@ -409,12 +347,19 @@ YES + + NSOutlineView + + IBProjectSource + NSOutlineViewExt.h + + PBGitSidebarController PBViewController YES - + YES sourceView window @@ -451,8 +396,561 @@ + + YES + + NSActionCell + NSCell + + IBFrameworkSource + AppKit.framework/Headers/NSActionCell.h + + + + NSApplication + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSApplication.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSApplicationScripting.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSColorPanel.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSHelpManager.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSPageLayout.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSUserInterfaceItemSearching.h + + + + NSCell + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSCell.h + + + + NSControl + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSControl.h + + + + NSFormatter + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFormatter.h + + + + NSMenu + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenu.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSAccessibility.h + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDictionaryController.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDragging.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontManager.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontPanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSKeyValueBinding.h + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSNibLoading.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSOutlineView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSPasteboard.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSSavePanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSToolbarItem.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSView.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSError.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFileManager.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueObserving.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyedArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObject.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObjectScripting.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSPortCoder.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSRunLoop.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptObjectSpecifiers.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptWhoseTests.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSThread.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURL.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLConnection.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLDownload.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUAppcast.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUUpdater.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebDownload.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebEditingDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebFrameLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebJavaPlugIn.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPlugin.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPluginContainer.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPolicyDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebResourceLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebScriptObject.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebUIDelegate.h + + + + NSOutlineView + NSTableView + + + + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSInterfaceStyle.h + + + + NSResponder + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSResponder.h + + + + NSScrollView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSScrollView.h + + + + NSScroller + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSScroller.h + + + + NSTableColumn + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableColumn.h + + + + NSTableView + NSControl + + + + NSTextFieldCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSTextFieldCell.h + + + + NSToolbar + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSToolbar.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSClipView.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItem.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSRulerView.h + + + + NSView + NSResponder + + + + NSViewController + NSResponder + + view + NSView + + + IBFrameworkSource + AppKit.framework/Headers/NSViewController.h + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSDrawer.h + + + + NSWindow + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSWindow.h + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSWindowScripting.h + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES GitX.xcodeproj 3 diff --git a/PBRefController.h b/PBRefController.h index fb11cdb..29ea030 100644 --- a/PBRefController.h +++ b/PBRefController.h @@ -42,8 +42,5 @@ - (NSArray *) menuItemsForRef:(PBGitRef *)ref; - (NSArray *) menuItemsForCommit:(PBGitCommit *)commit; -- (void) changeBranch:(NSMenuItem *)sender; -- (void) selectCurrentBranch; -- (void) updateBranchMenu; @end diff --git a/PBRefController.m b/PBRefController.m index e82a52e..adb4630 100644 --- a/PBRefController.m +++ b/PBRefController.m @@ -19,18 +19,14 @@ [commitList registerForDraggedTypes:[NSArray arrayWithObject:@"PBGitRef"]]; [historyController addObserver:self forKeyPath:@"repository.branches" options:0 context:@"branchChange"]; [historyController addObserver:self forKeyPath:@"repository.currentBranch" options:0 context:@"currentBranchChange"]; - [self updateBranchMenu]; - [self selectCurrentBranch]; } - (void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { if ([(NSString *)context isEqualToString: @"branchChange"]) { [commitController rearrangeObjects]; - [self updateBranchMenu]; } else if ([(NSString *)context isEqualToString:@"currentBranchChange"]) { - [self selectCurrentBranch]; [commitController rearrangeObjects]; } else { @@ -363,116 +359,4 @@ return YES; } -# pragma mark Branches menu - -- (void) updateBranchMenu -{ - if (!branchPopUp) - return; - - NSMutableArray *localBranches = [NSMutableArray array]; - NSMutableArray *remoteBranches = [NSMutableArray array]; - NSMutableArray *tags = [NSMutableArray array]; - NSMutableArray *other = [NSMutableArray array]; - - NSMenu *menu = [[NSMenu alloc] initWithTitle:@"Branch menu"]; - for (PBGitRevSpecifier *rev in historyController.repository.branches) - { - if (![rev isSimpleRef]) - { - [other addObject:rev]; - continue; - } - - NSString *ref = [rev simpleRef]; - - if ([ref hasPrefix:@"refs/heads"]) - [localBranches addObject:rev]; - else if ([ref hasPrefix:@"refs/tags"]) - [tags addObject:rev]; - else if ([ref hasPrefix:@"refs/remote"]) - [remoteBranches addObject:rev]; - } - - for (PBGitRevSpecifier *rev in localBranches) - { - NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:[rev description] action:@selector(changeBranch:) keyEquivalent:@""]; - [item setRepresentedObject:rev]; - [item setTarget:self]; - [menu addItem:item]; - } - - [menu addItem:[NSMenuItem separatorItem]]; - - // Remotes - NSMenu *remoteMenu = [[NSMenu alloc] initWithTitle:@"Remotes"]; - NSMenu *currentMenu = NULL; - for (PBGitRevSpecifier *rev in remoteBranches) - { - NSString *ref = [rev simpleRef]; - NSArray *components = [ref componentsSeparatedByString:@"/"]; - - NSString *remoteName = [components objectAtIndex:2]; - NSString *branchName = [[components subarrayWithRange:NSMakeRange(3, [components count] - 3)] componentsJoinedByString:@"/"]; - - if (![[currentMenu title] isEqualToString:remoteName]) - { - currentMenu = [[NSMenu alloc] initWithTitle:remoteName]; - NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:remoteName action:NULL keyEquivalent:@""]; - [item setSubmenu:currentMenu]; - [remoteMenu addItem:item]; - } - - NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:branchName action:@selector(changeBranch:) keyEquivalent:@""]; - [item setTarget:self]; - [item setRepresentedObject:rev]; - [currentMenu addItem:item]; - } - - NSMenuItem *remoteItem = [[NSMenuItem alloc] initWithTitle:@"Remotes" action:NULL keyEquivalent:@""]; - [remoteItem setSubmenu:remoteMenu]; - [menu addItem:remoteItem]; - - // Tags - NSMenu *tagMenu = [[NSMenu alloc] initWithTitle:@"Tags"]; - for (PBGitRevSpecifier *rev in tags) - { - NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:[rev description] action:@selector(changeBranch:) keyEquivalent:@""]; - [item setTarget:self]; - [item setRepresentedObject:rev]; - [tagMenu addItem:item]; - } - - NSMenuItem *tagItem = [[NSMenuItem alloc] initWithTitle:@"Tags" action:NULL keyEquivalent:@""]; - [tagItem setSubmenu:tagMenu]; - [menu addItem:tagItem]; - - - // Others - [menu addItem:[NSMenuItem separatorItem]]; - - for (PBGitRevSpecifier *rev in other) - { - NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:[rev description] action:@selector(changeBranch:) keyEquivalent:@""]; - [item setRepresentedObject:rev]; - [item setTarget:self]; - [menu addItem:item]; - } - - [[branchPopUp cell] setMenu: menu]; -} - -- (void) changeBranch:(NSMenuItem *)sender -{ - PBGitRevSpecifier *rev = [sender representedObject]; - historyController.repository.currentBranch = rev; -} - -- (void) selectCurrentBranch -{ - PBGitRevSpecifier *rev = historyController.repository.currentBranch; - if (rev) - [branchPopUp setTitle:[rev description]]; -} - @end diff --git a/PBSourceViewItem.h b/PBSourceViewItem.h index 1748f5a..399f8e7 100644 --- a/PBSourceViewItem.h +++ b/PBSourceViewItem.h @@ -9,6 +9,7 @@ #import @class PBGitRevSpecifier; +@class PBGitRef; @interface PBSourceViewItem : NSObject { NSMutableArray *children; @@ -26,6 +27,7 @@ + (id)itemWithTitle:(NSString *)title; - (void)addChild:(PBSourceViewItem *)child; +- (void)removeChild:(PBSourceViewItem *)child; // This adds the ref to the path, which should match the item's title, // so "refs/heads/pu/pb/sidebar" would have the path [@"pu", @"pb", @"sidebare"] @@ -33,11 +35,12 @@ - (void)addRev:(PBGitRevSpecifier *)revSpecifier toPath:(NSArray *)path; - (PBSourceViewItem *)findRev:(PBGitRevSpecifier *)rev; -- (NSImage *)icon; +- (PBGitRef *) ref; @property(retain) NSString *title; @property(readonly) NSMutableArray *children; @property(assign) BOOL isGroupItem, isUncollapsible; @property(retain) PBGitRevSpecifier *revSpecifier; @property(retain) PBSourceViewItem *parent; +@property(readonly) NSImage *icon; @end diff --git a/PBSourceViewItem.m b/PBSourceViewItem.m index b7f4045..5e81501 100644 --- a/PBSourceViewItem.m +++ b/PBSourceViewItem.m @@ -7,10 +7,12 @@ // #import "PBSourceViewItem.h" -#import "PBGitRevSpecifier.h" +#import "PBSourceViewItems.h" +#import "PBGitRef.h" @implementation PBSourceViewItem @synthesize parent, title, isGroupItem, children, revSpecifier, isUncollapsible; +@dynamic icon; - (id)init { @@ -21,33 +23,52 @@ return self; } -+ (id)groupItemWithTitle:(NSString *)title ++ (id)itemWithTitle:(NSString *)title { PBSourceViewItem *item = [[[self class] alloc] init]; item.title = title; + return item; +} + ++ (id)groupItemWithTitle:(NSString *)title +{ + PBSourceViewItem *item = [self itemWithTitle:[title uppercaseString]]; item.isGroupItem = YES; return item; } + (id)itemWithRevSpec:(PBGitRevSpecifier *)revSpecifier { - PBSourceViewItem *item = [[[self class] alloc] init]; - item.revSpecifier = revSpecifier; + PBGitRef *ref = [revSpecifier ref]; - return item; -} + if ([ref isTag]) + return [PBGitSVTagItem tagItemWithRevSpec:revSpecifier]; + else if ([ref isBranch]) + return [PBGitSVBranchItem branchItemWithRevSpec:revSpecifier]; + else if ([ref isRemoteBranch]) + return [PBGitSVRemoteBranchItem remoteBranchItemWithRevSpec:revSpecifier]; -+ (id)itemWithTitle:(NSString *)title; -{ - PBSourceViewItem *item = [[[self class] alloc] init]; - item.title = title; - return item; + return [PBGitSVOtherRevItem otherItemWithRevSpec:revSpecifier]; } - (void)addChild:(PBSourceViewItem *)child { + if (!child) + return; + [self.children addObject:child]; child.parent = self; + [self.children sortUsingDescriptors:[NSArray arrayWithObject:[[NSSortDescriptor alloc] initWithKey:@"title" ascending:YES selector:@selector(localizedCaseInsensitiveCompare:)]]]; +} + +- (void)removeChild:(PBSourceViewItem *)child +{ + if (!child) + return; + + [self.children removeObject:child]; + if (!self.isGroupItem && ([self.children count] == 0)) + [self.parent removeChild:self]; } - (void)addRev:(PBGitRevSpecifier *)theRevSpecifier toPath:(NSArray *)path @@ -65,7 +86,10 @@ node = child; if (!node) { - node = [PBSourceViewItem itemWithTitle:firstTitle]; + if ([firstTitle isEqualToString:[[theRevSpecifier ref] remoteName]]) + node = [PBGitSVRemoteItem remoteItemWithTitle:firstTitle]; + else + node = [PBGitSVFolderItem folderItemWithTitle:firstTitle]; [self addChild:node]; } @@ -85,6 +109,11 @@ return nil; } +- (NSImage *) icon +{ + return nil; +} + - (NSString *)title { if (title) @@ -93,21 +122,17 @@ return [[revSpecifier description] lastPathComponent]; } -- (NSImage *)icon +- (NSString *) stringValue { - if ([self isGroupItem]) - return nil; + return self.title; +} - if (self.parent && !self.parent.parent && [self.parent.title isEqualToString:@"Remotes"]) - return [NSImage imageNamed:@"remote"]; +- (PBGitRef *) ref +{ + if (self.revSpecifier) + return [self.revSpecifier ref]; - if (self.parent && !self.parent.parent && [self.parent.title isEqualToString:@"Tags"]) - return [NSImage imageNamed:@"tag"]; - - if ([[self children] count]) - return [NSImage imageNamed:@"folder"]; - - return [NSImage imageNamed:@"branch"]; + return nil; } @end diff --git a/PBSourceViewItems.h b/PBSourceViewItems.h new file mode 100644 index 0000000..8589d6b --- /dev/null +++ b/PBSourceViewItems.h @@ -0,0 +1,19 @@ +// +// PBSourceViewItems.h +// GitX +// +// Created by Nathan Kinsinger on 3/2/10. +// Copyright 2010 Nathan Kinsinger. All rights reserved. +// + +#import "PBSourceViewItem.h" + +#import "PBGitSVStageItem.h" + +#import "PBGitRevSpecifier.h" +#import "PBGitSVBranchItem.h" +#import "PBGitSVRemoteItem.h" +#import "PBGitSVRemoteBranchItem.h" +#import "PBGitSVTagItem.h" +#import "PBGitSVOtherRevItem.h" +#import "PBGitSVFolderItem.h" \ No newline at end of file From b1e632cf6f143f0447b04a0c51109a80eb1c20a5 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sat, 6 Mar 2010 18:34:22 -0700 Subject: [PATCH 52/90] Move the sidebar to the window controller Remove the sidebar from the history controller and put it under the control of the window controller. - the window controller is the delegate of the split view and controls resizing so the source list stays the same width as the window resizes - the sidebar controller tells the window controller which content view to show - removed the view selector from the toolbars of the history and commit xibs (the menu and keyboard shortcuts command-1 and command-2 still switch between the views) - added horizontal lines to the history and commit xibs to delineate the bottom toolbar area --- English.lproj/RepositoryWindow.xib | 675 +++++++++++++++-- PBGitCommitView.xib | 1102 ++++++++++++++++++++++------ PBGitHistoryController.h | 1 - PBGitHistoryController.m | 16 +- PBGitHistoryView.xib | 171 ++--- PBGitSidebarController.h | 8 + PBGitSidebarController.m | 22 +- PBGitSidebarView.xib | 331 +++++---- PBGitWindowController.h | 16 +- PBGitWindowController.m | 164 ++--- 10 files changed, 1864 insertions(+), 642 deletions(-) diff --git a/English.lproj/RepositoryWindow.xib b/English.lproj/RepositoryWindow.xib index 003254b..1688483 100644 --- a/English.lproj/RepositoryWindow.xib +++ b/English.lproj/RepositoryWindow.xib @@ -1,23 +1,26 @@ - + 1050 - 9F33 - 677 - 949.34 - 352.00 + 10C540 + 759 + 1038.25 + 458.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 759 + YES YES - com.apple.InterfaceBuilderKit com.apple.InterfaceBuilder.CocoaPlugin YES - + YES @@ -38,36 +41,57 @@ 15 2 - {{4, 386}, {850, 418}} + {{4, 290}, {890, 514}} 1886912512 GitX NSWindow - {3.40282e+38, 3.40282e+38} + {1.79769e+308, 1.79769e+308} {213, 107} 274 - {850, 418} + + YES + + + 274 + + YES + + + 272 + {184, 514} + + NSView + + + + 274 + {{185, 0}, {705, 514}} + + NSView + + + {890, 514} + + YES + 2 + sourceSplitView + + + {890, 514} {{0, 0}, {1440, 878}} {213, 129} - {3.40282e+38, 3.40282e+38} + {1.79769e+308, 1.79769e+308} GitX YES - - - contentView - - - - 245 - window @@ -76,34 +100,64 @@ 292 + + + delegate + + + + 354 + + + + sourceSplitView + + + + 355 + + + + contentSplitView + + + + 356 + + + + splitView + + + + 357 + YES 0 - - YES - + -2 - - RmlsZSdzIE93bmVyA + + File's Owner -1 - + First Responder -3 - + Application @@ -113,7 +167,7 @@ YES - + Window @@ -121,19 +175,44 @@ YES + + + 351 + + + YES + + + + + + + 353 + + + YES + + + Source SplitView + + + 352 + + + Content SplitView + YES - + YES - -1.IBPluginDependency - -2.IBPluginDependency -3.IBPluginDependency 3.IBEditorWindowLastContentRect + 3.IBPluginDependency 3.IBWindowTemplateEditedContentRect 3.ImportedFromIB2 3.NSWindowTemplate.visibleAtLaunch @@ -142,32 +221,35 @@ 3.windowTemplate.hasMinSize 3.windowTemplate.maxSize 3.windowTemplate.minSize + 351.IBPluginDependency + 352.IBPluginDependency + 353.IBPluginDependency 5.IBPluginDependency 5.ImportedFromIB2 YES com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilderKit - com.apple.InterfaceBuilderKit - {{1047, 395}, {850, 418}} - {{1047, 395}, {850, 418}} - - + {{484, 718}, {890, 514}} + com.apple.InterfaceBuilder.CocoaPlugin + {{484, 718}, {890, 514}} + + {{15, 196}, {850, 418}} - + {3.40282e+38, 3.40282e+38} {213, 107} com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + YES - - YES - + YES @@ -175,15 +257,13 @@ YES - - YES - + YES - 350 + 366 @@ -193,8 +273,11 @@ NSWindowController YES - + YES + cloneTo: + openInTerminal: + revealInFinder: showCommitView: showHistoryView: @@ -202,11 +285,25 @@ YES id id + id + id + id - contentView - NSView + YES + + YES + contentSplitView + sourceSplitView + splitView + + + YES + NSView + NSView + NSSplitView + IBProjectSource @@ -222,8 +319,490 @@ + + YES + + NSApplication + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSApplication.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSApplicationScripting.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSColorPanel.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSHelpManager.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSPageLayout.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSUserInterfaceItemSearching.h + + + + NSMenu + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenu.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSAccessibility.h + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSControl.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDictionaryController.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDragging.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontManager.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontPanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSKeyValueBinding.h + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSNibLoading.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSOutlineView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSPasteboard.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSSavePanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSToolbarItem.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSView.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSError.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFileManager.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueObserving.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyedArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObject.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObjectScripting.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSPortCoder.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSRunLoop.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptObjectSpecifiers.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptWhoseTests.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSThread.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURL.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLConnection.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLDownload.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUAppcast.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUUpdater.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebDownload.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebEditingDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebFrameLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebJavaPlugIn.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPlugin.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPluginContainer.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPolicyDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebResourceLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebScriptObject.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebUIDelegate.h + + + + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSInterfaceStyle.h + + + + NSResponder + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSResponder.h + + + + NSSplitView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSSplitView.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSClipView.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItem.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSRulerView.h + + + + NSView + NSResponder + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSDrawer.h + + + + NSWindow + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSWindow.h + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSWindowScripting.h + + + + NSWindowController + NSResponder + + showWindow: + id + + + IBFrameworkSource + AppKit.framework/Headers/NSWindowController.h + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES ../GitX.xcodeproj 3 diff --git a/PBGitCommitView.xib b/PBGitCommitView.xib index 7d0e8a7..1e9aee1 100644 --- a/PBGitCommitView.xib +++ b/PBGitCommitView.xib @@ -1,25 +1,36 @@ - + 1050 - 9L31a - 677 - 949.54 - 353.00 + 10C540 + 759 + 1038.25 + 458.00 + + YES + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.WebKitIBPlugin + + + YES + 759 + 759 + + YES - - + YES - com.apple.WebKitIBPlugin - com.apple.InterfaceBuilderKit com.apple.InterfaceBuilder.CocoaPlugin + com.apple.WebKitIBPlugin YES - + YES @@ -42,21 +53,51 @@ 274 YES + + + 34 + {{0, 32}, {852, 5}} + + {0, 0} + + 67239424 + 0 + Box + + LucidaGrande + 13 + 1044 + + + 6 + System + textBackgroundColor + + 3 + MQA + + + + 3 + MCAwLjgwMDAwMDAxMTkAA + + + 3 + 2 + 0 + NO + 292 - {{27, 7}, {305, 17}} + {{27, 8}, {305, 17}} YES 67239488 272630784 Ready to commit - - LucidaGrande - 1.300000e+01 - 1044 - + 6 @@ -64,7 +105,7 @@ controlColor 3 - MC42NjY2NjY2OQA + MC42NjY2NjY2NjY3AA @@ -88,7 +129,7 @@ 274 YES - + YES Apple HTML pasteboard type Apple PDF pasteboard type @@ -116,7 +157,7 @@ YES - + YES WebKitDefaultFixedFontSize WebKitDefaultFontSize @@ -124,9 +165,9 @@ YES - - - + + + @@ -172,26 +213,23 @@ YES - 1.860000e+02 - 1.000000e+01 - 3.402823e+38 + 186 + 10 + 3.4028229999999999e+38 - 75628032 - 0 + 75628096 + 2048 LucidaGrande - 1.100000e+01 + 11 3100 6 System headerColor - - 3 - MQA - + 6 @@ -219,8 +257,8 @@ - 3.000000e+00 - 2.000000e+00 + 3 + 2 6 @@ -231,12 +269,15 @@ MC41AA - 1.500000e+01 + 15 -566231040 + + 4 15 0 YES + 0 {{1, 1}, {189, 194}} @@ -253,7 +294,7 @@ _doScroller: - 9.933775e-01 + 0.99337750000000002 @@ -263,7 +304,7 @@ 1 _doScroller: - 9.947090e-01 + 0.99470899999999995 {{-1, -1}, {191, 196}} @@ -288,12 +329,7 @@ 0 Unstaged Changes - - 6 - System - textBackgroundColor - - + 3 MCAwLjgwMDAwMDAxAA @@ -350,7 +386,7 @@ 2322 YES - + YES Apple HTML pasteboard type Apple PDF pasteboard type @@ -369,6 +405,7 @@ NeXT font pasteboard type NeXT ruler pasteboard type WebURLsWithTitlesPboardType + public.url {427, 14} @@ -389,16 +426,17 @@ - 4.270000e+02 + 427 1 11235 + 0 + - YES - + YES NSBackgroundColor NSColor @@ -419,10 +457,10 @@ - + YES - + YES NSColor NSUnderline @@ -433,7 +471,7 @@ 1 MCAwIDEAA - + @@ -462,18 +500,18 @@ _doScroller: - 9.916667e-01 + 0.99166670000000001 - 256 + -2147483392 {{-100, -100}, {87, 18}} 1 _doScroller: - 1.000000e+00 - 9.456522e-01 + 1 + 0.94565220000000005 {{0, 36}, {429, 159}} @@ -591,12 +629,12 @@ YES - 2.110000e+02 - 1.000000e+01 - 3.402823e+38 + 211 + 10 + 3.4028229999999999e+38 - 75628032 - 0 + 75628096 + 2048 @@ -617,16 +655,19 @@ - 3.000000e+00 - 2.000000e+00 + 3 + 2 - 1.500000e+01 + 15 -566231040 + + 4 15 0 YES + 0 {{1, 1}, {214, 194}} @@ -643,7 +684,7 @@ _doScroller: - 9.951923e-01 + 0.99519230000000003 @@ -653,7 +694,7 @@ 1 _doScroller: - 9.003322e-01 + 0.90033220000000003 {{0, -1}, {216, 196}} @@ -704,11 +745,11 @@ 1316 - {{6, 7}, {16, 16}} + {{6, 8}, {16, 16}} 28938 - 1.600000e+01 - 1.000000e+02 + 16 + 100 {852, 432} @@ -750,7 +791,7 @@ - F94591D2-A188-4B08-A8B2-8C8CEC03CB14 + A24FCE70-61F0-46AC-8017-F662C25122F8 YES @@ -761,71 +802,13 @@ 1 YES - + YES - 1E431E79-1591-49E7-9E17-49497CA4622A NSToolbarSeparatorItem + NSToolbarSpaceItem YES - - - 1E431E79-1591-49E7-9E17-49497CA4622A - - View - View selector - - - - 268 - {{0, 14}, {87, 25}} - - 3 - YES - - 67239424 - 0 - - - - YES - - 4.000000e+01 - - NSImage - HistoryViewTemplate - - - History View - 0 - - - 4.000000e+01 - - NSImage - CommitViewTemplate - - - Commit View - YES - 0 - - - 1 - 2 - - - - - - {87, 25} - {87, 25} - YES - YES - 3 - YES - 0 - NSToolbarSeparatorItem @@ -849,27 +832,54 @@ 1048576 2147483647 - + NSImage NSMenuCheckmark - + NSImage NSMenuMixedState + + NSToolbarSpaceItem + + Space + + + + + + {32, 5} + {32, 32} + YES + YES + -1 + YES + 0 + + YES + YES + + + 1048576 + 2147483647 + + + + YES - + YES - + YES @@ -1216,28 +1226,26 @@ YES 0 - - YES - + -2 - - RmlsZSdzIE93bmVyA + + File's Owner -1 - + First Responder -3 - + Application @@ -1248,30 +1256,31 @@ + - + 77 - + 81 - + Unstaged Files 86 - + Cached Files 96 - + Diff Controller @@ -1478,45 +1487,6 @@ - - 225 - - - YES - - - - - Commit Toolbar - - - 226 - - - YES - - - - - - 227 - - - - - 239 - - - YES - - - - - - 240 - - - 247 @@ -1534,7 +1504,7 @@ 254 - + 278 @@ -1550,21 +1520,49 @@ + + 308 + + + + + 225 + + + YES + + + + + Commit Toolbar + + + 227 + + + + + 309 + + + YES - + YES - -1.IBPluginDependency - -2.IBPluginDependency -3.IBPluginDependency 1.IBEditorWindowLastContentRect 1.IBPluginDependency 1.IBViewEditorWindowController.showingBoundsRectangles 1.IBViewEditorWindowController.showingLayoutRectangles + 104.IBPluginDependency 105.CustomClassName + 105.IBPluginDependency + 113.IBPluginDependency 114.CustomClassName + 114.IBPluginDependency 125.IBPluginDependency 130.IBPluginDependency 131.IBPluginDependency @@ -1574,19 +1572,22 @@ 163.IBPluginDependency 164.IBPluginDependency 186.CustomClassName + 186.IBPluginDependency 2.IBPluginDependency + 206.IBPluginDependency + 207.IBPluginDependency + 208.IBPluginDependency + 209.IBPluginDependency 217.IBPluginDependency 225.IBEditorWindowLastContentRect 225.IBPluginDependency 225.editorWindowContentRectSynchronizationRect - 227.IBPluginDependency - 239.IBPluginDependency - 240.IBPluginDependency 247.IBPluginDependency 248.IBPluginDependency - 254.IBPluginDependency 278.IBPluginDependency 279.IBPluginDependency + 308.IBPluginDependency + 309.IBPluginDependency 42.IBPluginDependency 45.IBPluginDependency 46.IBPluginDependency @@ -1598,21 +1599,23 @@ 56.IBPluginDependency 57.CustomClassName 57.IBPluginDependency + 77.IBPluginDependency 81.IBPluginDependency 86.IBPluginDependency - 96.IBPluginDependency YES com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilderKit - com.apple.InterfaceBuilderKit - {{428, 510}, {852, 432}} + {{101, 477}, {852, 432}} + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin - - PBIconAndTextCell + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin PBIconAndTextCell + com.apple.InterfaceBuilder.CocoaPlugin com.apple.WebKitIBPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -1624,7 +1627,12 @@ PBNiceSplitView com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{295, 587}, {616, 169}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{16, 1434}, {616, 0}} com.apple.InterfaceBuilder.CocoaPlugin {{132, 614}, {616, 0}} com.apple.InterfaceBuilder.CocoaPlugin @@ -1637,8 +1645,6 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin PBFileChangesTableView com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -1653,9 +1659,7 @@ YES - - YES - + YES @@ -1663,15 +1667,13 @@ YES - - YES - + YES - 307 + 311 @@ -1697,7 +1699,7 @@ PBViewController YES - + YES commit: refresh: @@ -1712,7 +1714,7 @@ YES - + YES cachedFilesController commitButton @@ -1741,7 +1743,7 @@ NSObject YES - + YES rowClicked: tableClicked: @@ -1754,7 +1756,7 @@ YES - + YES commitController stagedFilesController @@ -1809,7 +1811,7 @@ PBWebController YES - + YES cachedFilesController controller @@ -1834,7 +1836,7 @@ NSObject YES - + YES repository view @@ -1851,8 +1853,682 @@ + + YES + + NSActionCell + NSCell + + IBFrameworkSource + AppKit.framework/Headers/NSActionCell.h + + + + NSApplication + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSApplication.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSApplicationScripting.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSColorPanel.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSHelpManager.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSPageLayout.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSUserInterfaceItemSearching.h + + + + NSArrayController + NSObjectController + + IBFrameworkSource + AppKit.framework/Headers/NSArrayController.h + + + + NSBox + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSBox.h + + + + NSButton + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSButton.h + + + + NSButtonCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSButtonCell.h + + + + NSCell + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSCell.h + + + + NSControl + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSControl.h + + + + NSController + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSController.h + + + + NSFormatter + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFormatter.h + + + + NSManagedObjectContext + NSObject + + IBFrameworkSource + CoreData.framework/Headers/NSManagedObjectContext.h + + + + NSMenu + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenu.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSAccessibility.h + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDictionaryController.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDragging.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontManager.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontPanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSKeyValueBinding.h + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSNibLoading.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSOutlineView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSPasteboard.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSSavePanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSToolbarItem.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSView.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSError.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFileManager.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueObserving.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyedArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObject.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObjectScripting.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSPortCoder.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSRunLoop.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptObjectSpecifiers.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptWhoseTests.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSThread.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURL.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLConnection.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLDownload.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUAppcast.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUUpdater.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebDownload.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebEditingDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebFrameLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebJavaPlugIn.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPlugin.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPluginContainer.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPolicyDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebResourceLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebScriptObject.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebUIDelegate.h + + + + NSObjectController + NSController + + IBFrameworkSource + AppKit.framework/Headers/NSObjectController.h + + + + NSProgressIndicator + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSProgressIndicator.h + + + + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSInterfaceStyle.h + + + + NSResponder + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSResponder.h + + + + NSScrollView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSScrollView.h + + + + NSScroller + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSScroller.h + + + + NSSplitView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSSplitView.h + + + + NSTableColumn + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableColumn.h + + + + NSTableView + NSControl + + + + NSText + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSText.h + + + + NSTextField + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSTextField.h + + + + NSTextFieldCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSTextFieldCell.h + + + + NSTextView + NSText + + IBFrameworkSource + AppKit.framework/Headers/NSTextView.h + + + + NSToolbar + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSToolbar.h + + + + NSToolbarItem + NSObject + + + + NSUserDefaultsController + NSController + + IBFrameworkSource + AppKit.framework/Headers/NSUserDefaultsController.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSClipView.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItem.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSRulerView.h + + + + NSView + NSResponder + + + + NSViewController + NSResponder + + view + NSView + + + IBFrameworkSource + AppKit.framework/Headers/NSViewController.h + + + + WebView + NSView + + YES + + YES + goBack: + goForward: + makeTextLarger: + makeTextSmaller: + makeTextStandardSize: + reload: + reloadFromOrigin: + stopLoading: + takeStringURLFrom: + toggleContinuousSpellChecking: + toggleSmartInsertDelete: + + + YES + id + id + id + id + id + id + id + id + id + id + id + + + + IBFrameworkSource + WebKit.framework/Headers/WebView.h + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES GitX.xcodeproj 3 diff --git a/PBGitHistoryController.h b/PBGitHistoryController.h index 20893f6..fb3abad 100644 --- a/PBGitHistoryController.h +++ b/PBGitHistoryController.h @@ -15,7 +15,6 @@ @class PBGitSidebarController; @interface PBGitHistoryController : PBViewController { - PBGitSidebarController *sidebarController; IBOutlet NSSearchField *searchField; IBOutlet NSArrayController* commitController; IBOutlet NSTreeController* treeController; diff --git a/PBGitHistoryController.m b/PBGitHistoryController.m index cc676fa..501db43 100644 --- a/PBGitHistoryController.m +++ b/PBGitHistoryController.m @@ -33,19 +33,6 @@ [fileBrowser setTarget:self]; [fileBrowser setDoubleAction:@selector(openSelectedFile:)]; - [historySplitView removeFromSuperview]; - NSSplitView *newView = [[NSSplitView alloc] initWithFrame:[historySplitView frame]]; - - sidebarController = [[PBGitSidebarController alloc] initWithRepository:repository superController:superController]; - [newView setDividerStyle:NSSplitViewDividerStyleThin]; - [newView addSubview:[sidebarController view]]; - [newView addSubview:historySplitView]; - [newView setVertical:YES]; - [newView adjustSubviews]; - [newView setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; - - [[self view] addSubview:newView]; - if (!repository.currentBranch) { [repository reloadRefs]; [repository readCurrentBranch]; @@ -107,6 +94,7 @@ else if([(NSString *)context isEqualToString:@"branchChange"]) { // Reset the sorting commitController.sortDescriptors = [NSArray array]; + [repository reloadRefs]; } else { [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; @@ -194,7 +182,7 @@ - (void) updateView { - [self refresh:nil]; + } - (NSResponder *)firstResponder; diff --git a/PBGitHistoryView.xib b/PBGitHistoryView.xib index 43cdaca..3c99f6d 100644 --- a/PBGitHistoryView.xib +++ b/PBGitHistoryView.xib @@ -21,7 +21,8 @@ YES - + + YES @@ -106,6 +107,40 @@ 4370 YES + + + 34 + {{0, 32}, {852, 5}} + + {0, 0} + + 67239424 + 0 + Box + + LucidaGrande + 13 + 1044 + + + 6 + System + textBackgroundColor + + 3 + MQA + + + + 3 + MCAwLjgwMDAwMDAxMTkAA + + + 3 + 2 + 0 + NO + 293 @@ -115,11 +150,7 @@ -2080244224 0 - - LucidaGrande - 13 - 1044 - + YES @@ -278,10 +309,7 @@ 6 System headerColor - - 3 - MQA - + @@ -875,7 +903,7 @@ 292 - {{17, 7}, {305, 17}} + {{17, 8}, {305, 17}} YES @@ -935,7 +963,6 @@ YES YES - 1E431E79-1591-49E7-9E17-49497CA4622A 7FFB691C-2D2F-49A9-997F-AE1AE8BFF3F1 86360841-A2B1-4802-845A-AE424521FE99 NSToolbarFlexibleSpaceItem @@ -943,65 +970,6 @@ YES - - - 1E431E79-1591-49E7-9E17-49497CA4622A - - View - View selector - - - - 268 - {{0, 14}, {87, 25}} - - - 3 - YES - - 67239424 - 0 - - - - YES - - 40 - - NSImage - HistoryViewTemplate - - - History View - 0 - - - 40 - - NSImage - CommitViewTemplate - - - Commit View - YES - 0 - - - 1 - 2 - - - - - - {87, 25} - {87, 25} - YES - YES - 3 - YES - 0 - 7FFB691C-2D2F-49A9-997F-AE1AE8BFF3F1 @@ -1016,7 +984,6 @@ 265 {{0, 14}, {183, 22}} - YES 343014976 @@ -1026,12 +993,7 @@ YES 1 - - 6 - System - textBackgroundColor - - + 130560 @@ -1102,7 +1064,6 @@ 268 {{21, 14}, {40, 25}} - YES -2080244224 @@ -1197,7 +1158,6 @@ YES - @@ -1205,7 +1165,6 @@ YES - @@ -1810,6 +1769,7 @@ + @@ -2094,7 +2054,6 @@ - @@ -2119,15 +2078,6 @@ - - 223 - - - YES - - - - 263 @@ -2151,20 +2101,6 @@ - - 224 - - - YES - - - - - - 225 - - - 117 @@ -2193,6 +2129,11 @@ + + 296 + + + @@ -2224,9 +2165,6 @@ 20.IBPluginDependency 21.IBAttributePlaceholdersKey 21.IBPluginDependency - 223.IBPluginDependency - 224.IBPluginDependency - 225.IBPluginDependency 261.IBAttributePlaceholdersKey 261.IBPluginDependency 262.IBPluginDependency @@ -2244,6 +2182,7 @@ 288.IBPluginDependency 29.IBPluginDependency 29.IBShouldRemoveOnLegacySave + 296.IBPluginDependency 3.IBPluginDependency 3.ImportedFromIB2 30.CustomClassName @@ -2311,9 +2250,6 @@ com.apple.WebKitIBPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin ToolTip @@ -2339,6 +2275,7 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin PBUnsortableTableHeader com.apple.InterfaceBuilder.CocoaPlugin @@ -2365,7 +2302,7 @@ com.apple.InterfaceBuilder.CocoaPlugin - {{486, 542}, {852, 432}} + {{612, 517}, {852, 432}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -2395,7 +2332,7 @@ - 295 + 296 @@ -2769,6 +2706,14 @@ AppKit.framework/Headers/NSArrayController.h + + NSBox + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSBox.h + + NSButton NSControl diff --git a/PBGitSidebarController.h b/PBGitSidebarController.h index 8e2677a..56d6935 100644 --- a/PBGitSidebarController.h +++ b/PBGitSidebarController.h @@ -10,6 +10,8 @@ #import "PBViewController.h" @class PBSourceViewItem; +@class PBGitHistoryController; +@class PBGitCommitController; @interface PBGitSidebarController : PBViewController { IBOutlet NSWindow *window; @@ -21,7 +23,13 @@ PBSourceViewItem *stage; PBSourceViewItem *branches, *remotes, *tags, *others; + + PBGitHistoryController *historyViewController; + PBGitCommitController *commitViewController; } +- (void) selectStage; +- (void) selectCurrentBranch; + @property(readonly) NSMutableArray *items; @end diff --git a/PBGitSidebarController.m b/PBGitSidebarController.m index c537e39..d4b5d86 100644 --- a/PBGitSidebarController.m +++ b/PBGitSidebarController.m @@ -8,12 +8,13 @@ #import "PBGitSidebarController.h" #import "PBSourceViewItems.h" +#import "PBGitHistoryController.h" +#import "PBGitCommitController.h" #import "NSOutlineViewExt.h" @interface PBGitSidebarController () - (void)populateList; -- (void)updateSelection; - (void)addRevSpec:(PBGitRevSpecifier *)revSpec; @end @@ -35,17 +36,26 @@ window.contentView = self.view; [self populateList]; + historyViewController = [[PBGitHistoryController alloc] initWithRepository:repository superController:superController]; + commitViewController = [[PBGitCommitController alloc] initWithRepository:repository superController:superController]; + [repository addObserver:self forKeyPath:@"currentBranch" options:0 context:@"currentBranchChange"]; - [self updateSelection]; + [self selectCurrentBranch]; } - (void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { if ([@"currentBranchChange" isEqualTo:context]) - [self updateSelection]; + [self selectCurrentBranch]; } -- (void)updateSelection +- (void) selectStage +{ + NSIndexSet *index = [NSIndexSet indexSetWithIndex:[sourceView rowForItem:stage]]; + [sourceView selectRowIndexes:index byExtendingSelection:NO]; +} + +- (void) selectCurrentBranch { PBGitRevSpecifier *rev = repository.currentBranch; if (!rev) @@ -97,13 +107,13 @@ PBSourceViewItem *item = [sourceView itemAtRow:index]; if ([item revSpecifier]) { - [[repository windowController] showHistoryView:self]; repository.currentBranch = [item revSpecifier]; + [superController changeContentController:historyViewController]; return; } if (item == stage) - [[repository windowController] showCommitView:self]; + [superController changeContentController:commitViewController]; /* ... */ diff --git a/PBGitSidebarView.xib b/PBGitSidebarView.xib index 57a3096..e598b9a 100644 --- a/PBGitSidebarView.xib +++ b/PBGitSidebarView.xib @@ -12,7 +12,7 @@ YES - + YES @@ -38,169 +38,171 @@ NSApplication - + - 4370 + 274 YES - - - 2304 + + + 4370 YES - - - 4352 - {153, 354} - - YES - - - 256 - {{197, 0}, {16, 17}} - - + + + 2304 + YES - - 150 - 16 - 1000 - - 75628096 - 2048 - - - LucidaGrande - 11 - 3100 + + + 4352 + {153, 354} + + YES + + + 256 + {{197, 0}, {16, 17}} + + + YES + + 150 + 16 + 1000 + + 75628096 + 2048 + + + LucidaGrande + 11 + 3100 + + + 3 + MC4zMzMzMzI5OQA + + + 6 + System + headerTextColor + + 3 + MAA + + + + + 69336641 + 2048 + Text Cell + + LucidaGrande + 11 + 16 + + + + 6 + System + controlBackgroundColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + + + 1 + YES + - + + 3 + 0.0 + + 6 + System + _sourceListBackgroundColor + + 1 + MC44MzkyMTU2OTU5IDAuODY2NjY2Njc0NiAwLjg5ODAzOTIyMTgAA + + + + 6 + System + gridColor + 3 - MC4zMzMzMzI5OQA - - - 6 - System - headerTextColor - - 3 - MAA - + MC41AA - - 69336641 - 2048 - Text Cell - - LucidaGrande - 11 - 16 - - - - 6 - System - controlBackgroundColor - - 3 - MC42NjY2NjY2NjY3AA - - - - 6 - System - controlTextColor - - - - 1 - YES - + 20 + 306184192 + + + 4 + 15 + 0 + YES + 1 + 1 + NO + 12 - 3 - 0.0 - - 6 - System - _sourceListBackgroundColor - - 1 - MC44MzkyMTU2OTU5IDAuODY2NjY2Njc0NiAwLjg5ODAzOTIyMTgAA - - - - 6 - System - gridColor - - 3 - MC41AA - - - 20 - 306184192 - - - 4 - 15 - 0 - YES - 1 - 1 - NO - 12 + {153, 354} + + + + + 4 + + + + -2147483392 + {{137, 1}, {15, 338}} + + + _doScroller: + 0.99698790000000004 + + + + -2147483392 + {{-100, -100}, {196, 15}} + + 1 + + _doScroller: + 0.57142859999999995 {153, 354} - - - - - 4 - - - - -2147483392 - {{137, 1}, {15, 338}} - - - _doScroller: - 0.99698790000000004 - - - - -2147483392 - {{-100, -100}, {196, 15}} - - 1 - - _doScroller: - 0.57142859999999995 + + + 528 + + + + QSAAAEEgAABBoAAAQaAAAA {153, 354} - - 528 - - - - QSAAAEEgAABBoAAAQaAAAA + NSView YES - - - view - - - - 25 - sourceView @@ -225,6 +227,14 @@ 35 + + + view + + + + 37 + @@ -254,25 +264,24 @@ Application - 8 - + 36 + YES - - - + - 9 - - - - - 10 - - + 8 + + + YES + + + + + 11 @@ -283,6 +292,16 @@ + + 10 + + + + + 9 + + + 13 @@ -309,6 +328,8 @@ 13.IBPluginDependency 16.CustomClassName 16.IBPluginDependency + 36.IBEditorWindowLastContentRect + 36.IBPluginDependency 8.IBEditorWindowLastContentRect 8.IBPluginDependency 9.IBPluginDependency @@ -321,6 +342,8 @@ com.apple.InterfaceBuilder.CocoaPlugin PBIconAndTextCell com.apple.InterfaceBuilder.CocoaPlugin + {{482, 590}, {153, 354}} + com.apple.InterfaceBuilder.CocoaPlugin {{105, 545}, {153, 354}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -342,7 +365,7 @@ - 35 + 37 diff --git a/PBGitWindowController.h b/PBGitWindowController.h index ed5162a..e31d9dc 100644 --- a/PBGitWindowController.h +++ b/PBGitWindowController.h @@ -13,23 +13,23 @@ @interface PBGitWindowController : NSWindowController { __weak PBGitRepository* repository; - int selectedViewIndex; - IBOutlet NSView* contentView; - PBViewController *historyViewController; - PBViewController *commitViewController; + PBViewController *contentController; + + PBGitSidebarController *sidebarController; + IBOutlet NSSplitView *splitView; + IBOutlet NSView *sourceSplitView; + IBOutlet NSView *contentSplitView; PBViewController* viewController; } @property (assign) __weak PBGitRepository *repository; -@property (readonly) NSViewController *viewController; -@property (assign) int selectedViewIndex; - (id)initWithRepository:(PBGitRepository*)theRepository displayDefault:(BOOL)display; -- (void)changeViewController:(NSInteger)whichViewTag; -- (void)useToolbar:(NSToolbar *)toolbar; +- (void)changeContentController:(PBViewController *)controller; + - (void)showMessageSheet:(NSString *)messageText infoText:(NSString *)infoText; - (void)showErrorSheet:(NSError *)error; - (void)showErrorSheetTitle:(NSString *)title message:(NSString *)message arguments:(NSArray *)arguments output:(NSString *)output; diff --git a/PBGitWindowController.m b/PBGitWindowController.m index 1b8c88e..48b178a 100644 --- a/PBGitWindowController.m +++ b/PBGitWindowController.m @@ -16,7 +16,7 @@ @implementation PBGitWindowController -@synthesize repository, viewController, selectedViewIndex; +@synthesize repository; - (id)initWithRepository:(PBGitRepository*)theRepository displayDefault:(BOOL)displayDefault { @@ -24,12 +24,6 @@ return nil; self.repository = theRepository; - [self showWindow:nil]; - - if (displayDefault) - self.selectedViewIndex = [[NSUserDefaults standardUserDefaults] integerForKey:@"selectedViewIndex"]; - else - self.selectedViewIndex = -1; return self; } @@ -37,10 +31,9 @@ - (void)windowWillClose:(NSNotification *)notification { NSLog(@"Window will close!"); - if (historyViewController) - [historyViewController removeView]; - if (commitViewController) - [commitViewController removeView]; + + if (sidebarController) + [sidebarController removeView]; } - (BOOL)validateMenuItem:(NSMenuItem *)menuItem @@ -51,78 +44,51 @@ return YES; } -- (void) setSelectedViewIndex: (int) i -{ - [self changeViewController: i]; -} - -- (void)changeViewController:(NSInteger)whichViewTag -{ - [self willChangeValueForKey:@"viewController"]; - - if (viewController != nil) - [[viewController view] removeFromSuperview]; - - if ([repository isBareRepository]) { // in bare repository we don't want to view commit - whichViewTag = 0; // even if it was selected by default - } - - // Set our default here because we might have changed it (based on bare repo) before - selectedViewIndex = whichViewTag; - [[NSUserDefaults standardUserDefaults] setInteger:whichViewTag forKey:@"selectedViewIndex"]; - - switch (whichViewTag) - { - case 0: // swap in the "CustomImageViewController - NSImageView" - if (!historyViewController) - historyViewController = [[PBGitHistoryController alloc] initWithRepository:repository superController:self]; - else - [historyViewController updateView]; - viewController = historyViewController; - break; - case 1: - if (!commitViewController) - commitViewController = [[PBGitCommitController alloc] initWithRepository:repository superController:self]; - else - [commitViewController updateView]; - - viewController = commitViewController; - break; - } - - // make sure we automatically resize the controller's view to the current window size - [[viewController view] setFrame: [contentView bounds]]; - - //// embed the current view to our host view - [contentView addSubview: [viewController view]]; - - [self useToolbar: [viewController viewToolbar]]; - - // Allow the viewcontroller to catch actions - [self setNextResponder: viewController]; - [self didChangeValueForKey:@"viewController"]; // this will trigger the NSTextField's value binding to change - - [[self window] makeFirstResponder:[viewController firstResponder]]; -} - -- (void)awakeFromNib +- (void) awakeFromNib { [[self window] setDelegate:self]; - [[self window] setAutorecalculatesContentBorderThickness:NO forEdge:NSMinYEdge]; - [[self window] setContentBorderThickness:35.0f forEdge:NSMinYEdge]; - [self showHistoryView:nil]; + + sidebarController = [[PBGitSidebarController alloc] initWithRepository:repository superController:self]; + [[sidebarController view] setFrame:[sourceSplitView bounds]]; + [sourceSplitView addSubview:[sidebarController view]]; + + [self showWindow:nil]; +} + +- (void) removeAllContentSubViews +{ + if ([contentSplitView subviews]) + while ([[contentSplitView subviews] count] > 0) + [[[contentSplitView subviews] lastObject] removeFromSuperviewWithoutNeedingDisplay]; +} + +- (void) changeContentController:(PBViewController *)controller +{ + if (!controller || (contentController == controller)) + return; + + [self removeAllContentSubViews]; + + contentController = controller; + + [[contentController view] setFrame:[contentSplitView bounds]]; + [contentSplitView addSubview:[contentController view]]; + + [self setNextResponder: contentController]; + [[self window] makeFirstResponder:[contentController firstResponder]]; + + [[self window] setToolbar:[contentController viewToolbar]]; + [contentController updateView]; } - (void) showCommitView:(id)sender { - if (self.selectedViewIndex != 1) - self.selectedViewIndex = 1; + [sidebarController selectStage]; } - (void) showHistoryView:(id)sender { - if (self.selectedViewIndex != 0) - self.selectedViewIndex = 0; + [sidebarController selectCurrentBranch]; } - (void)showMessageSheet:(NSString *)messageText infoText:(NSString *)infoText @@ -173,21 +139,49 @@ #pragma mark - -#pragma mark Toolbar Delegates +#pragma mark SplitView Delegates -- (void) useToolbar:(NSToolbar *)toolbar +#define kGitSplitViewMinWidth 150.0f +#define kGitSplitViewMaxWidth 300.0f + +#pragma mark min/max widths while moving the divider + +- (CGFloat)splitView:(NSSplitView *)view constrainMinCoordinate:(CGFloat)proposedMin ofSubviewAt:(NSInteger)dividerIndex { - NSSegmentedControl *item = nil; - for (NSToolbarItem *toolbarItem in [toolbar items]) { - if ([[toolbarItem view] isKindOfClass:[NSSegmentedControl class]]) { - item = (NSSegmentedControl *)[toolbarItem view]; - break; - } - } - [item bind:@"selectedIndex" toObject:self withKeyPath:@"selectedViewIndex" options:0]; - [item setEnabled: ![repository isBareRepository]]; + if (proposedMin < kGitSplitViewMinWidth) + return kGitSplitViewMinWidth; - [self.window setToolbar:toolbar]; + return proposedMin; +} + +- (CGFloat)splitView:(NSSplitView *)view constrainMaxCoordinate:(CGFloat)proposedMax ofSubviewAt:(NSInteger)dividerIndex +{ + if (dividerIndex == 0) + return kGitSplitViewMaxWidth; + + return proposedMax; +} + +#pragma mark constrain sidebar width while resizing the window + +- (void)splitView:(NSSplitView *)sender resizeSubviewsWithOldSize:(NSSize)oldSize +{ + NSRect newFrame = [sender frame]; + + float dividerThickness = [sender dividerThickness]; + + NSView *sourceView = [[sender subviews] objectAtIndex:0]; + NSRect sourceFrame = [sourceView frame]; + sourceFrame.size.height = newFrame.size.height; + + NSView *mainView = [[sender subviews] objectAtIndex:1]; + NSRect mainFrame = [mainView frame]; + mainFrame.origin.x = sourceFrame.size.width + dividerThickness; + mainFrame.size.width = newFrame.size.width - mainFrame.origin.x; + mainFrame.size.height = newFrame.size.height; + + [sourceView setFrame:sourceFrame]; + [mainView setFrame:mainFrame]; } @end From 64f4276e21148670142f71af9d21d9dc34e3f813 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sat, 6 Mar 2010 19:12:06 -0700 Subject: [PATCH 53/90] Delete old toolbars and create new ones - remove the separate window toolbars from the history and commit views and create a new window toolbar in the repository window - add new toolbars inside the history view - new class to draw a gradient in the background of a view - moved the search field from the main toolbar to the scope bar --- English.lproj/RepositoryWindow.xib | 203 ++- GitX.xcodeproj/project.pbxproj | 6 + PBGitCommitView.xib | 140 +- PBGitGradientBarView.h | 19 + PBGitGradientBarView.m | 52 + PBGitHistoryController.h | 3 + PBGitHistoryController.m | 9 +- PBGitHistoryView.xib | 2705 ++++++++++++++-------------- PBGitWindowController.m | 2 - PBViewController.h | 3 - PBViewController.m | 2 +- 11 files changed, 1604 insertions(+), 1540 deletions(-) create mode 100644 PBGitGradientBarView.h create mode 100644 PBGitGradientBarView.m diff --git a/English.lproj/RepositoryWindow.xib b/English.lproj/RepositoryWindow.xib index 1688483..3376679 100644 --- a/English.lproj/RepositoryWindow.xib +++ b/English.lproj/RepositoryWindow.xib @@ -45,7 +45,152 @@ 1886912512 GitX NSWindow - + + + A66F2540-5B64-4016-89F7-892563371FAF + + + NO + YES + YES + YES + 1 + 1 + + YES + + YES + NSToolbarCustomizeToolbarItem + NSToolbarFlexibleSpaceItem + NSToolbarSeparatorItem + NSToolbarSpaceItem + + + YES + + NSToolbarCustomizeToolbarItem + Customize + Customize + Customize Toolbar + + + NSImage + NSToolbarCustomizeToolbarItemImage + + + runToolbarCustomizationPalette: + {0, 0} + {0, 0} + YES + YES + -1 + YES + 0 + + + NSToolbarFlexibleSpaceItem + + Flexible Space + + + + + + {1, 5} + {20000, 32} + YES + YES + -1 + YES + 0 + + YES + YES + + + 1048576 + 2147483647 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + + + + NSToolbarSeparatorItem + + Separator + + + + + + {12, 5} + {12, 1000} + YES + YES + -1 + YES + 0 + + YES + YES + + + 1048576 + 2147483647 + + + + + + NSToolbarSpaceItem + + Space + + + + + + {32, 5} + {32, 32} + YES + YES + -1 + YES + 0 + + YES + YES + + + 1048576 + 2147483647 + + + + + + + + YES + + + + + + + YES + + + + YES + + {1.79769e+308, 1.79769e+308} {213, 107} @@ -166,6 +311,7 @@ YES + Window @@ -204,6 +350,38 @@ Content SplitView + + 367 + + + YES + + + + + + + + + 370 + + + + + 372 + + + + + 373 + + + + + 374 + + + @@ -224,6 +402,9 @@ 351.IBPluginDependency 352.IBPluginDependency 353.IBPluginDependency + 367.IBEditorWindowLastContentRect + 367.IBPluginDependency + 374.IBPluginDependency 5.IBPluginDependency 5.ImportedFromIB2 @@ -243,6 +424,9 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + {{621, 1213}, {616, 0}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -263,7 +447,7 @@ - 366 + 374 @@ -474,7 +658,7 @@ NSObject - + IBFrameworkSource AppKit.framework/Headers/NSToolbarItem.h @@ -726,6 +910,19 @@ AppKit.framework/Headers/NSSplitView.h + + NSToolbar + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSToolbar.h + + + + NSToolbarItem + NSObject + + NSView diff --git a/GitX.xcodeproj/project.pbxproj b/GitX.xcodeproj/project.pbxproj index 7c1bab3..ecb9aa7 100644 --- a/GitX.xcodeproj/project.pbxproj +++ b/GitX.xcodeproj/project.pbxproj @@ -58,6 +58,7 @@ D858108511274D28007F254B /* Tag.png in Resources */ = {isa = PBXBuildFile; fileRef = D858108211274D28007F254B /* Tag.png */; }; D85B939310E3D8B4007F3C28 /* PBCreateBranchSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = D85B939210E3D8B4007F3C28 /* PBCreateBranchSheet.xib */; }; D889EB3110E6BCBB00F08413 /* PBCreateTagSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = D889EB3010E6BCBB00F08413 /* PBCreateTagSheet.xib */; }; + D8A4BB6F11337D5C00E92D51 /* PBGitGradientBarView.m in Sources */ = {isa = PBXBuildFile; fileRef = D8A4BB6E11337D5C00E92D51 /* PBGitGradientBarView.m */; }; D8E3B2B810DC9FB2001096A3 /* ScriptingBridge.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D8E3B2B710DC9FB2001096A3 /* ScriptingBridge.framework */; }; D8E3B34D10DCA958001096A3 /* PBCreateTagSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = D8E3B34C10DCA958001096A3 /* PBCreateTagSheet.m */; }; D8FDD9F711432A12005647F6 /* PBCloneRepositoryPanel.xib in Resources */ = {isa = PBXBuildFile; fileRef = D8FDD9F511432A12005647F6 /* PBCloneRepositoryPanel.xib */; }; @@ -255,6 +256,8 @@ D858108111274D28007F254B /* RemoteBranch.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = RemoteBranch.png; path = Images/RemoteBranch.png; sourceTree = ""; }; D858108211274D28007F254B /* Tag.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Tag.png; path = Images/Tag.png; sourceTree = ""; }; D85B93F610E51279007F3C28 /* PBGitRefish.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitRefish.h; sourceTree = ""; }; + D8A4BB6D11337D5C00E92D51 /* PBGitGradientBarView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitGradientBarView.h; sourceTree = ""; }; + D8A4BB6E11337D5C00E92D51 /* PBGitGradientBarView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitGradientBarView.m; sourceTree = ""; }; D8C1B77210E875CF009B7F8B /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/PBRemoteProgressSheet.xib; sourceTree = ""; }; D8E3B2B710DC9FB2001096A3 /* ScriptingBridge.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ScriptingBridge.framework; path = /System/Library/Frameworks/ScriptingBridge.framework; sourceTree = ""; }; D8E3B34B10DCA958001096A3 /* PBCreateTagSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCreateTagSheet.h; sourceTree = ""; }; @@ -705,6 +708,8 @@ D823487410CB382C00944BDE /* Terminal.h */, F567B88B1057FA9F000DB976 /* NSOutlineViewExt.h */, F567B88C1057FA9F000DB976 /* NSOutlineViewExt.m */, + D8A4BB6D11337D5C00E92D51 /* PBGitGradientBarView.h */, + D8A4BB6E11337D5C00E92D51 /* PBGitGradientBarView.m */, ); name = Aux; sourceTree = ""; @@ -1113,6 +1118,7 @@ D8FDDA6E114335E8005647F6 /* PBGitSVRemoteItem.m in Sources */, D8FDDA6F114335E8005647F6 /* PBGitSVStageItem.m in Sources */, D8FDDA70114335E8005647F6 /* PBGitSVTagItem.m in Sources */, + D8A4BB6F11337D5C00E92D51 /* PBGitGradientBarView.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/PBGitCommitView.xib b/PBGitCommitView.xib index 1e9aee1..93e4f5d 100644 --- a/PBGitCommitView.xib +++ b/PBGitCommitView.xib @@ -789,102 +789,6 @@ PBWebChangesController - - - A24FCE70-61F0-46AC-8017-F662C25122F8 - - - YES - YES - YES - YES - 1 - 1 - - YES - - YES - NSToolbarSeparatorItem - NSToolbarSpaceItem - - - YES - - NSToolbarSeparatorItem - - Separator - - - - - - {12, 5} - {12, 1000} - YES - YES - -1 - YES - 0 - - YES - YES - - - 1048576 - 2147483647 - - NSImage - NSMenuCheckmark - - - NSImage - NSMenuMixedState - - - - - NSToolbarSpaceItem - - Space - - - - - - {32, 5} - {32, 32} - YES - YES - -1 - YES - 0 - - YES - YES - - - 1048576 - 2147483647 - - - - - - - - YES - - - - - YES - - - - - YES - - PBGitIndexController @@ -1036,14 +940,6 @@ 222 - - - viewToolbar - - - - 241 - webController @@ -1525,27 +1421,6 @@ - - 225 - - - YES - - - - - Commit Toolbar - - - 227 - - - - - 309 - - - @@ -1579,15 +1454,11 @@ 208.IBPluginDependency 209.IBPluginDependency 217.IBPluginDependency - 225.IBEditorWindowLastContentRect - 225.IBPluginDependency - 225.editorWindowContentRectSynchronizationRect 247.IBPluginDependency 248.IBPluginDependency 278.IBPluginDependency 279.IBPluginDependency 308.IBPluginDependency - 309.IBPluginDependency 42.IBPluginDependency 45.IBPluginDependency 46.IBPluginDependency @@ -1632,10 +1503,6 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{16, 1434}, {616, 0}} - com.apple.InterfaceBuilder.CocoaPlugin - {{132, 614}, {616, 0}} - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -2085,7 +1952,7 @@ NSObject - + IBFrameworkSource AppKit.framework/Headers/NSToolbarItem.h @@ -2422,11 +2289,6 @@ AppKit.framework/Headers/NSToolbar.h - - NSToolbarItem - NSObject - - NSUserDefaultsController NSController diff --git a/PBGitGradientBarView.h b/PBGitGradientBarView.h new file mode 100644 index 0000000..7a500a2 --- /dev/null +++ b/PBGitGradientBarView.h @@ -0,0 +1,19 @@ +// +// PBGitGradientBarView.h +// GitX +// +// Created by Nathan Kinsinger on 2/22/10. +// Copyright 2010 Nathan Kinsinger. All rights reserved. +// + +#import + + +@interface PBGitGradientBarView : NSView { + NSGradient *gradient; +} + +- (void) setTopShade:(float)topShade bottomShade:(float)bottomShade; +- (void) setTopColor:(NSColor *)topShade bottomColor:(NSColor *)bottomColor; + +@end diff --git a/PBGitGradientBarView.m b/PBGitGradientBarView.m new file mode 100644 index 0000000..5f48317 --- /dev/null +++ b/PBGitGradientBarView.m @@ -0,0 +1,52 @@ +// +// PBGitGradientBarView.m +// GitX +// +// Created by Nathan Kinsinger on 2/22/10. +// Copyright 2010 Nathan Kinsinger. All rights reserved. +// + +#import "PBGitGradientBarView.h" + + + +@implementation PBGitGradientBarView + + +- (id) initWithFrame:(NSRect)frame +{ + self = [super initWithFrame:frame]; + if (!self) + return nil; + + [self setTopShade:1.0 bottomShade:0.0]; + + return self; +} + + +- (void) drawRect:(NSRect)dirtyRect +{ + [gradient drawInRect:[self bounds] angle:90]; +} + + +- (void) setTopColor:(NSColor *)topColor bottomColor:(NSColor *)bottomColor +{ + if (!topColor || !bottomColor) + return; + + gradient = [[NSGradient alloc] initWithStartingColor:bottomColor endingColor:topColor]; + [self setNeedsDisplay:YES]; +} + + +- (void) setTopShade:(float)topShade bottomShade:(float)bottomShade +{ + NSColor *topColor = [NSColor colorWithCalibratedWhite:topShade alpha:1.0]; + NSColor *bottomColor = [NSColor colorWithCalibratedWhite:bottomShade alpha:1.0]; + [self setTopColor:topColor bottomColor:bottomColor]; +} + + +@end diff --git a/PBGitHistoryController.h b/PBGitHistoryController.h index fb3abad..666ed79 100644 --- a/PBGitHistoryController.h +++ b/PBGitHistoryController.h @@ -13,6 +13,7 @@ #import "PBCollapsibleSplitView.h" @class PBGitSidebarController; +@class PBGitGradientBarView; @interface PBGitHistoryController : PBViewController { IBOutlet NSSearchField *searchField; @@ -21,6 +22,8 @@ IBOutlet NSOutlineView* fileBrowser; IBOutlet NSTableView* commitList; IBOutlet PBCollapsibleSplitView *historySplitView; + IBOutlet PBGitGradientBarView *upperToolbarView; + IBOutlet PBGitGradientBarView *scopeBarView; IBOutlet id webView; int selectedTab; diff --git a/PBGitHistoryController.m b/PBGitHistoryController.m index 501db43..9100735 100644 --- a/PBGitHistoryController.m +++ b/PBGitHistoryController.m @@ -15,6 +15,7 @@ #import "PBCreateTagSheet.h" #import "PBAddRemoteSheet.h" #import "PBGitSidebarController.h" +#import "PBGitGradientBarView.h" #define QLPreviewPanel NSClassFromString(@"QLPreviewPanel") @@ -45,8 +46,14 @@ [[commitList tableColumnWithIdentifier:@"subject"] setSortDescriptorPrototype:[[NSSortDescriptor alloc] initWithKey:@"subject" ascending:YES]]; // Add a menu that allows a user to select which columns to view [[commitList headerView] setMenu:[self tableColumnMenu]]; - [historySplitView setTopMin:33.0 andBottomMin:100.0]; + [historySplitView setTopMin:58.0 andBottomMin:100.0]; [historySplitView uncollapse]; + + [upperToolbarView setTopShade:237/255.0 bottomShade:216/255.0]; + [scopeBarView setTopColor:[NSColor colorWithCalibratedHue:0.579 saturation:0.068 brightness:0.898 alpha:1.000] + bottomColor:[NSColor colorWithCalibratedHue:0.579 saturation:0.119 brightness:0.765 alpha:1.000]]; + //[scopeBarView setTopShade:207/255.0 bottomShade:180/255.0]; + [super awakeFromNib]; } diff --git a/PBGitHistoryView.xib b/PBGitHistoryView.xib index 3c99f6d..52f6874 100644 --- a/PBGitHistoryView.xib +++ b/PBGitHistoryView.xib @@ -21,8 +21,7 @@ YES - - + YES @@ -107,839 +106,993 @@ 4370 YES - + - 34 - {{0, 32}, {852, 5}} - - {0, 0} - - 67239424 - 0 - Box - - LucidaGrande - 13 - 1044 - - - 6 - System - textBackgroundColor - - 3 - MQA + 290 + + YES + + + 293 + {{376, 1}, {71, 25}} + + YES + + -2080244224 + 0 + + LucidaGrande + 13 + 1044 + + + + YES + + 32 + + NSImage + DetailViewTemplate + + + Detailed View + YES + 2 + + + + NSImage + NSPathTemplate + + + Tree View + 9 + 2 + + + 2 - - 3 - MCAwLjgwMDAwMDAxMTkAA + + + 292 + {{17, 5}, {305, 17}} + + YES + + 67239488 + 272630784 + Label + + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + + + + 289 + {{795, 1}, {37, 25}} + + YES + + -2080244224 + 134217728 + QuickLook + + + -2033958657 + 163 + + NSImage + NSQuickLookTemplate + + + + 400 + 75 + + + + + 10 + {{0, 27}, {852, 5}} + + {0, 0} + + 67239424 + 0 + Box + + + 6 + System + textBackgroundColor + + 3 + MQA + + + + 3 + MCAwLjgwMDAwMDAxMTkAA + + + 3 + 2 + 0 + NO - 3 - 2 - 0 - NO + {852, 30} + + NSView - + - 293 - {{376, 6}, {71, 25}} - - YES - - -2080244224 - 0 - - - - YES - - 32 - - NSImage - DetailViewTemplate + 266 + + YES + + + 10 + {{0, -2}, {852, 5}} + + {0, 0} + + 67239424 + 0 + Box + + + + 3 + MCAwLjgwMDAwMDAxMTkAA - - Detailed View - YES - 2 - - - - NSImage - NSPathTemplate - - - Tree View - 9 - 2 + 3 + 2 + 0 + NO - 2 + {{0, 402}, {852, 30}} + + PBGitGradientBarView 4370 YES - + - 4370 + 274 YES - - - 2304 + + + 10 + {{0, 135}, {852, 5}} + + {0, 0} + + 67239424 + 0 + Box + + + + 3 + MCAwLjgwMDAwMDAxMTkAA + + + 3 + 2 + 0 + NO + + + + 4370 YES - - - 4352 - {852, 194} - - YES - - - 256 - {852, 17} - - - - - - -2147483392 - {{-26, 0}, {16, 17}} - - - + + + 2304 + YES - - SubjectColumn - 509 - 40 - 1000 - - 75628096 - 2048 - Subject - - LucidaGrande - 11 - 3100 + + + 4352 + {852, 121} + + YES + + + 256 + {852, 17} + + + + + + -2147483392 + {{-26, 0}, {16, 17}} + + + + YES + + SubjectColumn + 509 + 40 + 1000 + + 75628096 + 2048 + Subject + + LucidaGrande + 11 + 3100 + + + 3 + MC4zMzMzMzI5OQA + + + 6 + System + headerTextColor + + + + + 337772096 + 2048 + Text Cell + + + + 6 + System + controlBackgroundColor + + + + + 3 + YES + - + + AuthorColumn + 190 + 40 + 1000 + + 75628096 + 2048 + Author + + + + + + 337772096 + 2048 + Text Cell + + + + + + 3 + YES + + + + DateColumn + 144 + 10 + 3.4028229999999999e+38 + + 75628096 + 2048 + Date + + + 6 + System + headerColor + + + + + + 337772096 + 2048 + Text Cell + + + + + + 3 + YES + + + + SHAColumn + 64 + 10 + 3.4028229999999999e+38 + + 75628096 + 2048 + SHA + + + + + + 338820672 + 1024 + Text Cell + + + + + + 3 + YES + + YES + + + 3 + 2 + + + 6 + System + gridColor + 3 - MC4zMzMzMzI5OQA - - - 6 - System - headerTextColor - - 3 - MAA - + MC41AA - - 337772096 - 2048 - Text Cell - - - - 6 - System - controlBackgroundColor - - 3 - MC42NjY2NjY2NjY3AA - - - - 6 - System - controlTextColor - - - - 3 - YES - - - - AuthorColumn - 190 - 40 - 1000 - - 75628096 - 2048 - Author - - - - - - 337772096 - 2048 - Text Cell - - - - - - 3 - YES - - - - DateColumn - 144 - 10 - 3.4028229999999999e+38 - - 75628096 - 2048 - Date - - - 6 - System - headerColor - - - - - - 337772096 - 2048 - Text Cell - - - - - - 3 - YES - - - - SHAColumn - 64 - 10 - 3.4028229999999999e+38 - - 75628096 - 2048 - SHA - - - - - - 338820672 - 1024 - Text Cell - - - - - - 3 - YES - - YES + 17 + -683671552 + + + CommitView + 5 + 15 + 0 + YES + 0 - 3 - 2 - - - 6 - System - gridColor - - 3 - MC41AA - - - 17 - -683671552 - - - CommitView - 5 - 15 - 0 - YES - 0 + {{0, 17}, {852, 121}} + + + + + 2 + + + -2147483392 + {{837, 17}, {15, 179}} + + + _doScroller: + 0.9494949494949495 + + + + -2147483392 + {{0, 196}, {837, 15}} + + 1 + + _doScroller: + 0.21932109999999999 + + + + 2304 + + YES + + + {852, 17} + + + + + 4 + + - {{0, 17}, {852, 194}} - - - - - 2 + {852, 138} + + + 560 + + + + + + QSAAAEEgAABBmAAAQZgAAA - - - -2147483392 - {{837, 17}, {15, 179}} - - - _doScroller: - 37 - 0.19473679999999999 - - - - -2147483392 - {{0, 196}, {837, 15}} - - 1 - - _doScroller: - 0.21932109999999999 - - - - 2304 + + + 266 YES - - - {852, 17} - - - - - 4 - - - - {852, 211} - - - 560 - - - - - - QSAAAEEgAABBmAAAQZgAAA - - - - 4114 - {{0, 212}, {852, 186}} - - - YES - - 1 - - - 4370 - - YES - - - 4370 - - YES - - YES - Apple HTML pasteboard type - Apple PDF pasteboard type - Apple PICT pasteboard type - Apple URL pasteboard type - Apple Web Archive pasteboard type - NSColor pasteboard type - NSFilenamesPboardType - NSStringPboardType - NeXT RTFD pasteboard type - NeXT Rich Text Format v1.0 pasteboard type - NeXT TIFF v4.0 pasteboard type - WebURLsWithTitlesPboardType - public.png - public.url - public.url-name - + + + 265 + {{662, 2}, {180, 19}} + + YES + + 343014976 + 268567552 + + Subject + + YES + 1 + + + + 130560 + 0 + search + + _searchFieldSearch: + + 138690815 + 0 + + 400 + 75 - {{1, 0}, {851, 186}} - - - - - - - + + 130560 + 0 + clear + YES - + YES - WebKitDefaultFixedFontSize - WebKitDefaultFontSize - WebKitMinimumFontSize - - - YES - - - + + YES + AXDescription + NSAccessibilityEncodedAttributesValueType + + + YES + cancel + + + + _searchFieldCancel: + + 138690815 + 0 + + 400 + 75 - YES - YES + 255 - {852, 186} - - Details - - 6 - System - controlColor - - - + {{0, 138}, {852, 24}} + + PBGitGradientBarView - - Item 2 - - - 4352 - - YES - - + + {852, 162} + + NSView + + + + 274 + + YES + + + 18 + {852, 210} + + + YES + + 1 + + 4370 YES - - - 4372 - + + + 4370 + YES - - - 2304 - - YES - - - 4352 - {191, 186} - - YES - - - 256 - {{223, 0}, {16, 17}} - - - YES - - 188 - 16 - 1000 - - 75628096 - 2048 - - - - 3 - MC4zMzMzMzI5OQA - - - - - 337772096 - 2048 - Text Cell - - - - - - 3 - YES - - - - 3 - 2 - - - 17 - -624951296 - - - 4 - 15 - 0 - YES - 0 - - - {{1, 1}, {191, 186}} - - - - - 4 - - - - 256 - {{192, 1}, {15, 186}} - - - _doScroller: - 0.9948186 - - - - -2147483392 - {{-100, -100}, {502, 15}} - - 1 - - _doScroller: - 0.0045045049999999998 - 0.99801189999999995 + + YES + Apple HTML pasteboard type + Apple PDF pasteboard type + Apple PICT pasteboard type + Apple URL pasteboard type + Apple Web Archive pasteboard type + NSColor pasteboard type + NSFilenamesPboardType + NSStringPboardType + NeXT RTFD pasteboard type + NeXT Rich Text Format v1.0 pasteboard type + NeXT TIFF v4.0 pasteboard type + WebURLsWithTitlesPboardType + public.png + public.url + public.url-name - {208, 188} - - - 18 - - - - QSAAAEEgAABBmAAAQZgAAA + {{1, 0}, {851, 211}} + + + + + + + + YES + + YES + WebKitDefaultFixedFontSize + WebKitDefaultFontSize + WebKitMinimumFontSize + + + YES + + + + + + + YES + YES - - + + {852, 210} + + + Details + + + + + Item 2 + + + 4352 + + YES + + 4370 YES - - - 2304 + + + 4372 YES - - - 2322 - {543, 112} - - - - - - Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum Et harumd und lookum like Greek to me, dereud facilis est er expedit distinct. Nam liber te conscient to factor tum poen legum odioque civiuda - - - YES - - YES - NSFont - NSParagraphStyle - - - YES - - Monaco - 10 - 16 + + + 2304 + + YES + + + 4368 + {191, 210} + + YES + + + 256 + {{223, 0}, {16, 17}} + + + YES + + 188 + 16 + 1000 + + 75628096 + 2048 + + + + 3 + MC4zMzMzMzI5OQA - - 3 - + + + + 337772096 + 2048 + Text Cell + + + + + + 3 + YES + + + + 3 + 2 + + + 17 + -624951296 + + + 4 + 15 + 0 + YES + 0 + + + {{1, 1}, {191, 210}} + + + + + 4 + + + + 256 + {{192, 1}, {15, 210}} + + + _doScroller: + 0.9948186 + + + + -2147483392 + {{-100, -100}, {502, 15}} + + 1 + + _doScroller: + 0.0045045049999999998 + 0.99801189999999995 + + + {208, 212} + + + 18 + + + + QSAAAEEgAABBmAAAQZgAAA + + + + 4370 + + YES + + + 2304 + + YES + + + 2322 + {545, 98} + + + + + + Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum Et harumd und lookum like Greek to me, dereud facilis est er expedit distinct. Nam liber te conscient to factor tum poen legum odioque civiuda + + + YES + YES - - 0.0 + NSFont + NSParagraphStyle + + + YES + + Monaco + 10 + 16 - - 56 - - - 112 - - - 168 - - - 224 - - - 280 - - - 336 - - - 392 - - - 448 - - - 504 - - - 560 - - - 616 - - - 672 - - - 728 - - - 784 - - - 840 - - - 896 - - - 952 - - - 1008 - - - 1064 - - - 1120 - - - 1176 - - - 1232 - - - 1288 - - - 1344 - - - 1400 - - - 1456 - - - 1512 - - - 1568 - - - 1624 - - - 1680 - - - 1736 + + 3 + + YES + + 0.0 + + + 56 + + + 112 + + + 168 + + + 224 + + + 280 + + + 336 + + + 392 + + + 448 + + + 504 + + + 560 + + + 616 + + + 672 + + + 728 + + + 784 + + + 840 + + + 896 + + + 952 + + + 1008 + + + 1064 + + + 1120 + + + 1176 + + + 1232 + + + 1288 + + + 1344 + + + 1400 + + + 1456 + + + 1512 + + + 1568 + + + 1624 + + + 1680 + + + 1736 + + + + + + YES + + + 6 + + + + 545 + 1 + + + 11233 + 0 + + + + YES + + YES + NSBackgroundColor + NSColor + + + YES + + 6 + System + selectedTextBackgroundColor + + + + 6 + System + selectedTextColor + + - + + + YES + + YES + NSColor + NSUnderline + + + YES + + 1 + MCAwIDEAA + + + + + - - YES - - - 6 + 6 + {1186, 1e+07} + {0, 0} - - 543 - 1 - - 11233 - 0 - - - - YES - - YES - NSBackgroundColor - NSColor - - - YES - - 6 - System - selectedTextBackgroundColor - - - - 6 - System - selectedTextColor - - - - - - - YES - - YES - NSColor - NSUnderline - - - YES - - 1 - MCAwIDEAA - - - - - + {{1, 1}, {628, 210}} + + + + + + {4, -5} + 1 - 6 - {1186, 1e+07} - {0, 0} - + 4 + + + + 256 + {{629, 1}, {15, 210}} + + + _doScroller: + 0.030031680000000002 + + + + -2147483392 + {{-100, -100}, {87, 18}} + + 1 + + _doScroller: + 1 + 0.94565220000000005 - {{1, 1}, {626, 186}} - - - - - - {4, -5} - 1 - - 4 - - - - 256 - {{627, 1}, {15, 186}} - - - _doScroller: - 0.030031680000000002 - - - - -2147483392 - {{-100, -100}, {87, 18}} - - 1 - - _doScroller: - 1 - 0.94565220000000005 + {{209, 0}, {645, 212}} + + + 18 + + + - {{209, 0}, {643, 188}} - - - 18 - - - + {{-1, -1}, {854, 212}} + + YES + 2 - {852, 188} - - YES - 2 + {852, 210} + Tree + + - {852, 186} - Tree - - + + + 6 + YES + YES + + YES + + - - - 6 - YES - YES - - YES - - + {{0, 163}, {852, 210}} + + NSView - {{0, 35}, {852, 398}} + {{0, 30}, {852, 373}} 2 HistoryViewSplitView - - - 292 - {{17, 8}, {305, 17}} - - YES - - 67239488 - 272630784 - Label - - - - - - - - - 289 - {{795, 6}, {37, 25}} - - YES - - -2080244224 - 134217728 - Textured Button - - - -2033958657 - 163 - - NSImage - NSQuickLookTemplate - - - - 400 - 75 - - {852, 432} @@ -948,232 +1101,6 @@ PBRefController - - - FFA3AADE-2DC8-4306-B161-4916009C1071 - - - YES - YES - YES - YES - 1 - 1 - - YES - - YES - 7FFB691C-2D2F-49A9-997F-AE1AE8BFF3F1 - 86360841-A2B1-4802-845A-AE424521FE99 - NSToolbarFlexibleSpaceItem - NSToolbarSeparatorItem - - - YES - - - 7FFB691C-2D2F-49A9-997F-AE1AE8BFF3F1 - - Search - - Search Field - - - - - 265 - {{0, 14}, {183, 22}} - - YES - - 343014976 - 268436480 - - Subject - - YES - 1 - - - - 130560 - 0 - search - - _searchFieldSearch: - - 138690815 - 0 - - 400 - 75 - - - 130560 - 0 - clear - - YES - - YES - - YES - AXDescription - NSAccessibilityEncodedAttributesValueType - - - YES - cancel - - - - - - _searchFieldCancel: - - 138690815 - 0 - - 400 - 75 - - 255 - CAAAAA - - - - - - {183, 22} - {183, 22} - YES - YES - 0 - YES - 0 - - - - 86360841-A2B1-4802-845A-AE424521FE99 - - Create Branch - Create Branch - - - - 268 - {{21, 14}, {40, 25}} - - YES - - -2080244224 - 134217728 - - - - -2033434369 - 163 - - NSImage - AddBranchTemplate - - - - 400 - 75 - - - - - - {40, 25} - {40, 25} - YES - YES - 0 - YES - 0 - - - NSToolbarFlexibleSpaceItem - - Flexible Space - - - - - - {1, 5} - {20000, 32} - YES - YES - -1 - YES - 0 - - YES - YES - - - 1048576 - 2147483647 - - NSImage - NSMenuCheckmark - - - NSImage - NSMenuMixedState - - - - - NSToolbarSeparatorItem - - Separator - - - - - - {12, 5} - {12, 1000} - YES - YES - -1 - YES - 0 - - YES - YES - - - 1048576 - 2147483647 - - - - - - - - YES - - - - - - - YES - - - - - - - YES - - @@ -1494,81 +1421,6 @@ 112 - - - viewToolbar - - - - 160 - - - - searchField - - - - 185 - - - - predicate: filterPredicate - - - - - - predicate: filterPredicate - predicate - filterPredicate - - YES - - YES - NSDisplayName - NSPredicateFormat - - - YES - Subject - subject contains[c] $value - - - 2 - - - 214 - - - - predicate2: filterPredicate - - - - - - predicate2: filterPredicate - predicate2 - filterPredicate - - YES - - YES - NSDisplayName - NSPredicateFormat - - - YES - Author - author contains[c] $value - - - - 2 - - - 215 - controller @@ -1625,36 +1477,6 @@ 260 - - - predicate3: filterPredicate - - - - - - predicate3: filterPredicate - predicate3 - filterPredicate - - YES - - YES - NSDisplayName - NSPredicateFormat - - - YES - SHA - realSha contains $value - - - - 2 - - - 271 - historySplitView @@ -1709,12 +1531,117 @@ 291 - - createBranch: - - + + predicate: filterPredicate + + + + + + predicate: filterPredicate + predicate + filterPredicate + + YES + + YES + NSDisplayName + NSPredicateFormat + + + YES + Subject + subject contains[c] $value + + + 2 + - 295 + 301 + + + + predicate2: filterPredicate + + + + + + predicate2: filterPredicate + predicate2 + filterPredicate + + YES + + YES + NSDisplayName + NSPredicateFormat + + + YES + Author + author contains[c] $value + + + + 2 + + + 304 + + + + predicate3: filterPredicate + + + + + + predicate3: filterPredicate + predicate3 + filterPredicate + + YES + + YES + NSDisplayName + NSPredicateFormat + + + YES + SHA + realSha contains[c] $value + + + + 2 + + + 308 + + + + searchField + + + + 315 + + + + upperToolbarView + + + + 326 + + + + scopeBarView + + + + 328 @@ -1766,44 +1693,157 @@ YES - - - - + + + History 2 YES - - + + - History View + History Content View + + + 231 + + + + + 309 + + + YES + + + + + + Commits Split View + + + 310 + + + YES + + + + Details Split View + + + 3 + + + YES + + + + + + + Commits Scroll View + + + 30 + + + + + 29 + + + + + 28 + + + + + 27 + + + YES + + + + + + + Commit List + + + 287 + + + YES + + + + + + 33 + + + YES + + + + + + 32 + + + YES + + + + + + 31 + + + YES + + + + + + 36 + + + + + 35 + + + + + 34 + + + + + 288 + + 4 YES - + - - Bottom View - - - 6 - - - YES - - - - Web View + + Detail / Tree Tab View 7 @@ -1813,6 +1853,31 @@ + Tree Tab + + + 6 + + + YES + + + + Details Tab + + + 20 + + + YES + + + + + + 21 + + 8 @@ -1828,55 +1893,38 @@ YES - + - - 10 - - - YES - - - - - - 11 YES - - + + + File Contents Scroll View - 12 - - - - - 13 - - - - - 14 - - - - - 15 - + 10 + YES - + + + + + File List Scroll View + + + 17 + @@ -1885,8 +1933,12 @@ - 17 - + 15 + + + YES + + @@ -1904,36 +1956,61 @@ - 20 - + 14 + + + + + 13 + + + + + 12 + + + + + 311 + YES - + - + + Commits Scope Bar - 21 - - - - - 47 - + 297 + YES - + + + + + + 298 + + + + + 312 + + + YES + + + + + History Bottom Toolbar - 48 - - - YES - - - + 314 + + 49 @@ -1942,12 +2019,25 @@ YES - + - 50 - - + 47 + + + YES + + + + + + 48 + + + YES + + + 51 @@ -1960,179 +2050,29 @@ - 231 - - + 50 + + - 3 - + 316 + YES - - - - + - - - - 27 - - - YES - - - - - - - Commit List - - - 31 - - - YES - - - - - - 36 - - - - - 32 - - - YES - - - - - - 35 - - - - - 33 - - - YES - - - - - - 34 - - - - - 28 - - - - - 29 - - - - - 30 - - - - - 113 - - - YES - - - - - - - History Toolbar - - - 115 - - - - - 116 - - - YES - - - - - - 222 - - - - - 263 - - - YES - - - - - - 261 - - - YES - - - - - - 262 - - - - - 117 - - - YES - - - - - - 118 - - - - - 287 - - - YES - - - - - - 288 - - - - - 296 - + History Upper Toolbar + + + 317 + + + + + 327 + + @@ -2143,12 +2083,6 @@ -3.IBPluginDependency 10.IBPluginDependency 11.IBPluginDependency - 113.IBEditorWindowLastContentRect - 113.IBPluginDependency - 113.editorWindowContentRectSynchronizationRect - 116.IBPluginDependency - 117.IBPluginDependency - 118.IBPluginDependency 12.IBPluginDependency 13.IBPluginDependency 14.IBPluginDependency @@ -2165,10 +2099,6 @@ 20.IBPluginDependency 21.IBAttributePlaceholdersKey 21.IBPluginDependency - 261.IBAttributePlaceholdersKey - 261.IBPluginDependency - 262.IBPluginDependency - 263.IBPluginDependency 27.CustomClassName 27.IBPluginDependency 27.IBViewIntegration.shadowBlurRadius @@ -2182,16 +2112,25 @@ 288.IBPluginDependency 29.IBPluginDependency 29.IBShouldRemoveOnLegacySave - 296.IBPluginDependency + 297.IBPluginDependency + 298.IBPluginDependency 3.IBPluginDependency 3.ImportedFromIB2 30.CustomClassName 30.IBPluginDependency 30.IBShouldRemoveOnLegacySave + 309.IBPluginDependency 31.IBPluginDependency 31.ImportedFromIB2 + 310.IBPluginDependency + 311.IBPluginDependency + 312.IBPluginDependency + 314.IBPluginDependency + 316.IBPluginDependency + 317.IBPluginDependency 32.IBPluginDependency 32.ImportedFromIB2 + 327.IBPluginDependency 33.IBPluginDependency 34.IBPluginDependency 35.CustomClassName @@ -2222,12 +2161,6 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{312, 424}, {616, 169}} - com.apple.InterfaceBuilder.CocoaPlugin - {{132, 614}, {616, 0}} - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -2250,17 +2183,6 @@ com.apple.WebKitIBPlugin - - ToolTip - - ToolTip - - Create Branch - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin PBCommitList com.apple.InterfaceBuilder.CocoaPlugin @@ -2276,16 +2198,25 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin PBUnsortableTableHeader com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin PBGitRevisionCell com.apple.InterfaceBuilder.CocoaPlugin @@ -2302,7 +2233,7 @@ com.apple.InterfaceBuilder.CocoaPlugin - {{612, 517}, {852, 432}} + {{627, 791}, {852, 432}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -2332,7 +2263,7 @@ - 296 + 328 @@ -2375,6 +2306,22 @@ PBCommitList.h + + PBGitGradientBarView + NSView + + IBProjectSource + PBGitGradientBarView.h + + + + PBGitGradientBarView + NSView + + IBUserSource + + + PBGitHistoryController PBViewController @@ -2419,8 +2366,10 @@ commitList fileBrowser historySplitView + scopeBarView searchField treeController + upperToolbarView webView @@ -2429,8 +2378,10 @@ NSTableView NSOutlineView PBCollapsibleSplitView + PBGitGradientBarView NSSearchField NSTreeController + PBGitGradientBarView id @@ -2495,7 +2446,6 @@ YES YES - changeBranch: checkout: cherryPick: copyPatch: @@ -2514,7 +2464,6 @@ YES - NSMenuItem PBRefMenuItem PBRefMenuItem PBRefMenuItem @@ -2581,10 +2530,6 @@ PBViewController NSViewController - - viewToolbar - NSToolbar - IBProjectSource PBViewController.h @@ -2885,7 +2830,7 @@ NSObject - + IBFrameworkSource AppKit.framework/Headers/NSToolbarItem.h @@ -3275,19 +3220,6 @@ AppKit.framework/Headers/NSTextView.h - - NSToolbar - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSToolbar.h - - - - NSToolbarItem - NSObject - - NSTreeController NSObjectController @@ -3390,17 +3322,8 @@ GitX.xcodeproj 3 - YES - - YES - AddBranchTemplate - NSQuickLookTemplate - - - YES - {25, 13} - {19, 11} - + NSQuickLookTemplate + {19, 11} diff --git a/PBGitWindowController.m b/PBGitWindowController.m index 48b178a..3d6c49b 100644 --- a/PBGitWindowController.m +++ b/PBGitWindowController.m @@ -76,8 +76,6 @@ [self setNextResponder: contentController]; [[self window] makeFirstResponder:[contentController firstResponder]]; - - [[self window] setToolbar:[contentController viewToolbar]]; [contentController updateView]; } diff --git a/PBViewController.h b/PBViewController.h index 4715c61..4d56efa 100644 --- a/PBViewController.h +++ b/PBViewController.h @@ -13,12 +13,9 @@ @interface PBViewController : NSViewController { __weak PBGitRepository *repository; __weak PBGitWindowController *superController; - - IBOutlet NSToolbar *viewToolbar; } @property (readonly) __weak PBGitRepository *repository; -@property (readonly) NSToolbar *viewToolbar; - (id)initWithRepository:(PBGitRepository *)theRepository superController:(PBGitWindowController *)controller; - (void) removeView; diff --git a/PBViewController.m b/PBViewController.m index 510b7a7..c1ee021 100644 --- a/PBViewController.m +++ b/PBViewController.m @@ -11,7 +11,7 @@ @implementation PBViewController -@synthesize repository, viewToolbar; +@synthesize repository; - (id)initWithRepository:(PBGitRepository *)theRepository superController:(PBGitWindowController *)controller { From 90f80f01b48c325cf9d223de8caf4cb2f6a9f1ef Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sat, 6 Mar 2010 19:57:24 -0700 Subject: [PATCH 54/90] Add a new cell class for the source view items The new cell handles: - showing contextual menus - drawing a badge for the checked out branch Needed to add the reference to the ref controller to the history controller. --- GitX.xcodeproj/project.pbxproj | 12 ++++ PBGitHistoryController.h | 3 + PBGitHistoryController.m | 2 +- PBGitHistoryView.xib | 14 +++- PBGitSidebarController.h | 2 + PBGitSidebarController.m | 34 ++++++++- PBGitSidebarView.xib | 22 +++--- PBSourceViewBadge.h | 19 ++++++ PBSourceViewBadge.m | 121 +++++++++++++++++++++++++++++++++ PBSourceViewCell.h | 19 ++++++ PBSourceViewCell.m | 55 +++++++++++++++ 11 files changed, 285 insertions(+), 18 deletions(-) create mode 100644 PBSourceViewBadge.h create mode 100644 PBSourceViewBadge.m create mode 100644 PBSourceViewCell.h create mode 100644 PBSourceViewCell.m diff --git a/GitX.xcodeproj/project.pbxproj b/GitX.xcodeproj/project.pbxproj index ecb9aa7..f14f9c1 100644 --- a/GitX.xcodeproj/project.pbxproj +++ b/GitX.xcodeproj/project.pbxproj @@ -50,6 +50,8 @@ D8083DC4111F90F300337480 /* PBCloneRepsitoryToSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = D8083DC3111F90F300337480 /* PBCloneRepsitoryToSheet.m */; }; D8083DCD111F918900337480 /* PBCloneRepsitoryToSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = D8083DCB111F918900337480 /* PBCloneRepsitoryToSheet.xib */; }; D8083E03111FA33700337480 /* PBCloneRepositoryPanel.m in Sources */ = {isa = PBXBuildFile; fileRef = D8083E02111FA33700337480 /* PBCloneRepositoryPanel.m */; }; + D828A40D1127B18700F09D11 /* PBSourceViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D828A40C1127B18700F09D11 /* PBSourceViewCell.m */; }; + D828A4111127B1C400F09D11 /* PBSourceViewBadge.m in Sources */ = {isa = PBXBuildFile; fileRef = D828A4101127B1C400F09D11 /* PBSourceViewBadge.m */; }; D8357535112640F100DE249D /* PBRemoteProgressSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = D8C1B77110E875CF009B7F8B /* PBRemoteProgressSheet.xib */; }; D854948610D5C01B0083B917 /* PBCreateBranchSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = D854948510D5C01B0083B917 /* PBCreateBranchSheet.m */; }; D85810551127476E007F254B /* StageView.png in Resources */ = {isa = PBXBuildFile; fileRef = D85810541127476E007F254B /* StageView.png */; }; @@ -248,6 +250,10 @@ D8083E01111FA33700337480 /* PBCloneRepositoryPanel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCloneRepositoryPanel.h; sourceTree = ""; }; D8083E02111FA33700337480 /* PBCloneRepositoryPanel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCloneRepositoryPanel.m; sourceTree = ""; }; D823487410CB382C00944BDE /* Terminal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Terminal.h; sourceTree = ""; }; + D828A40B1127B18700F09D11 /* PBSourceViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBSourceViewCell.h; sourceTree = ""; }; + D828A40C1127B18700F09D11 /* PBSourceViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBSourceViewCell.m; sourceTree = ""; }; + D828A40F1127B1C400F09D11 /* PBSourceViewBadge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBSourceViewBadge.h; sourceTree = ""; }; + D828A4101127B1C400F09D11 /* PBSourceViewBadge.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBSourceViewBadge.m; sourceTree = ""; }; D854948410D5C01B0083B917 /* PBCreateBranchSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCreateBranchSheet.h; sourceTree = ""; }; D854948510D5C01B0083B917 /* PBCreateBranchSheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCreateBranchSheet.m; sourceTree = ""; }; D854949310D5C3E20083B917 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/PBCreateBranchSheet.xib; sourceTree = ""; }; @@ -727,6 +733,10 @@ children = ( F58DB55710566D3500CFDF4A /* PBGitSidebarController.h */, F58DB55810566D3500CFDF4A /* PBGitSidebarController.m */, + D828A40B1127B18700F09D11 /* PBSourceViewCell.h */, + D828A40C1127B18700F09D11 /* PBSourceViewCell.m */, + D828A40F1127B1C400F09D11 /* PBSourceViewBadge.h */, + D828A4101127B1C400F09D11 /* PBSourceViewBadge.m */, D8FDDA58114335B0005647F6 /* Source View Items */, ); name = Sidebar; @@ -1119,6 +1129,8 @@ D8FDDA6F114335E8005647F6 /* PBGitSVStageItem.m in Sources */, D8FDDA70114335E8005647F6 /* PBGitSVTagItem.m in Sources */, D8A4BB6F11337D5C00E92D51 /* PBGitGradientBarView.m in Sources */, + D828A40D1127B18700F09D11 /* PBSourceViewCell.m in Sources */, + D828A4111127B1C400F09D11 /* PBSourceViewBadge.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/PBGitHistoryController.h b/PBGitHistoryController.h index 666ed79..1d059c3 100644 --- a/PBGitHistoryController.h +++ b/PBGitHistoryController.h @@ -14,8 +14,10 @@ @class PBGitSidebarController; @class PBGitGradientBarView; +@class PBRefController; @interface PBGitHistoryController : PBViewController { + IBOutlet PBRefController *refController; IBOutlet NSSearchField *searchField; IBOutlet NSArrayController* commitController; IBOutlet NSTreeController* treeController; @@ -38,6 +40,7 @@ @property (retain) PBGitCommit *webCommit, *rawCommit; @property (retain) PBGitTree* gitTree; @property (readonly) NSArrayController *commitController; +@property (readonly) PBRefController *refController; - (IBAction) setDetailedView: sender; - (IBAction) setRawView: sender; diff --git a/PBGitHistoryController.m b/PBGitHistoryController.m index 9100735..758b5aa 100644 --- a/PBGitHistoryController.m +++ b/PBGitHistoryController.m @@ -20,7 +20,7 @@ @implementation PBGitHistoryController -@synthesize selectedTab, webCommit, rawCommit, gitTree, commitController; +@synthesize selectedTab, webCommit, rawCommit, gitTree, commitController, refController; - (void)awakeFromNib { diff --git a/PBGitHistoryView.xib b/PBGitHistoryView.xib index 52f6874..81df53f 100644 --- a/PBGitHistoryView.xib +++ b/PBGitHistoryView.xib @@ -1643,6 +1643,14 @@ 328 + + + refController + + + + 329 + @@ -2263,7 +2271,7 @@ - 328 + 329 @@ -2366,6 +2374,7 @@ commitList fileBrowser historySplitView + refController scopeBarView searchField treeController @@ -2378,6 +2387,7 @@ NSTableView NSOutlineView PBCollapsibleSplitView + PBRefController PBGitGradientBarView NSSearchField NSTreeController @@ -2458,7 +2468,6 @@ pushDefaultRemoteForRef: pushToRemote: pushUpdatesToRemote: - rebaseActiveBranch: rebaseHeadBranch: showTagInfoSheet: @@ -2478,7 +2487,6 @@ PBRefMenuItem PBRefMenuItem PBRefMenuItem - PBRefMenuItem diff --git a/PBGitSidebarController.h b/PBGitSidebarController.h index 56d6935..c0c76e0 100644 --- a/PBGitSidebarController.h +++ b/PBGitSidebarController.h @@ -31,5 +31,7 @@ - (void) selectStage; - (void) selectCurrentBranch; +- (NSMenu *) menuForRow:(NSInteger)row; + @property(readonly) NSMutableArray *items; @end diff --git a/PBGitSidebarController.m b/PBGitSidebarController.m index d4b5d86..ce3d09a 100644 --- a/PBGitSidebarController.m +++ b/PBGitSidebarController.m @@ -10,6 +10,8 @@ #import "PBSourceViewItems.h" #import "PBGitHistoryController.h" #import "PBGitCommitController.h" +#import "PBRefController.h" +#import "PBSourceViewCell.h" #import "NSOutlineViewExt.h" @interface PBGitSidebarController () @@ -127,8 +129,10 @@ return [item isGroupItem]; } -- (void)outlineView:(NSOutlineView *)outlineView willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item +- (void)outlineView:(NSOutlineView *)outlineView willDisplayCell:(PBSourceViewCell *)cell forTableColumn:(NSTableColumn *)tableColumn item:(PBSourceViewItem *)item { + cell.isCheckedOut = [item.revSpecifier isEqualTo:[repository headRef]]; + [cell setImage:[item icon]]; } @@ -204,4 +208,32 @@ return [(PBSourceViewItem *)item title]; } + +#pragma mark Menus + +- (NSMenu *) menuForRow:(NSInteger)row +{ + PBSourceViewItem *viewItem = [sourceView itemAtRow:row]; + + PBGitRef *ref = nil; + + // create a ref for a remote because they don't store one + if ([self outlineView:sourceView isItemExpandable:viewItem] && (viewItem.parent == remotes)) + ref = [PBGitRef refFromString:[kGitXRemoteRefPrefix stringByAppendingString:[viewItem title]]]; + else + ref = [[viewItem revSpecifier] ref]; + + if (!ref) + return nil; + + NSArray *menuItems = [historyViewController.refController menuItemsForRef:ref]; + + NSMenu *menu = [[NSMenu alloc] init]; + [menu setAutoenablesItems:NO]; + for (NSMenuItem *item in menuItems) + [menu addItem:item]; + + return menu; +} + @end diff --git a/PBGitSidebarView.xib b/PBGitSidebarView.xib index e598b9a..067b02a 100644 --- a/PBGitSidebarView.xib +++ b/PBGitSidebarView.xib @@ -340,7 +340,7 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - PBIconAndTextCell + PBSourceViewCell com.apple.InterfaceBuilder.CocoaPlugin {{482, 590}, {153, 354}} com.apple.InterfaceBuilder.CocoaPlugin @@ -406,13 +406,17 @@ PBIconAndTextCell.h + + PBSourceViewCell + PBIconAndTextCell + + IBProjectSource + PBSourceViewCell.h + + PBViewController NSViewController - - viewToolbar - NSToolbar - IBProjectSource PBViewController.h @@ -889,14 +893,6 @@ AppKit.framework/Headers/NSTextFieldCell.h - - NSToolbar - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSToolbar.h - - NSView diff --git a/PBSourceViewBadge.h b/PBSourceViewBadge.h new file mode 100644 index 0000000..1754000 --- /dev/null +++ b/PBSourceViewBadge.h @@ -0,0 +1,19 @@ +// +// PBSourceViewBadge.h +// GitX +// +// Created by Nathan Kinsinger on 2/13/10. +// Copyright 2010 Nathan Kinsinger. All rights reserved. +// + +#import + + +@interface PBSourceViewBadge : NSObject { + +} + ++ (NSImage *) checkedOutBadgeForCell:(NSTextFieldCell *)cell; ++ (NSImage *) numericBadge:(NSInteger)number forCell:(NSTextFieldCell *)cell; + +@end diff --git a/PBSourceViewBadge.m b/PBSourceViewBadge.m new file mode 100644 index 0000000..8f00a06 --- /dev/null +++ b/PBSourceViewBadge.m @@ -0,0 +1,121 @@ +// +// PBSourceViewBadge.m +// GitX +// +// Created by Nathan Kinsinger on 2/13/10. +// Copyright 2010 Nathan Kinsinger. All rights reserved. +// + +#import "PBSourceViewBadge.h" +#import "PBSourceViewCell.h" + + +@implementation PBSourceViewBadge + + ++ (NSColor *) badgeHighlightColor +{ + return [NSColor colorWithCalibratedHue:0.612 saturation:0.275 brightness:0.735 alpha:1.000]; +} + + ++ (NSColor *) badgeBackgroundColor +{ + return [NSColor colorWithCalibratedWhite:0.6 alpha:1.00]; +} + + ++ (NSColor *) badgeColorForCell:(NSTextFieldCell *)cell +{ + if ([cell isHighlighted]) + return [NSColor whiteColor]; + + if ([[[cell controlView] window] isMainWindow]) + return [self badgeHighlightColor]; + + return [self badgeBackgroundColor]; +} + + ++ (NSColor *) badgeTextColorForCell:(NSTextFieldCell *)cell +{ + if (![cell isHighlighted]) + return [NSColor whiteColor]; + + if (![[[cell controlView] window] isKeyWindow]) + if ([[[cell controlView] window] isMainWindow]) + return [self badgeHighlightColor]; + else + return [self badgeBackgroundColor]; + + if ([[[cell controlView] window] firstResponder] == [cell controlView]) + return [self badgeHighlightColor]; + + return [self badgeBackgroundColor]; +} + + ++ (NSMutableDictionary *) badgeTextAttributes +{ + NSMutableDictionary *badgeTextAttributes = nil; + if (!badgeTextAttributes) { + NSMutableParagraphStyle *centerStyle = [[NSMutableParagraphStyle alloc] init]; + [centerStyle setAlignment:NSCenterTextAlignment]; + + badgeTextAttributes = [NSMutableDictionary dictionary]; + [badgeTextAttributes setObject:[NSFont fontWithName:@"Helvetica-Bold" size:[NSFont systemFontSize] - 2] forKey:NSFontAttributeName]; + [badgeTextAttributes setObject:centerStyle forKey:NSParagraphStyleAttributeName]; + } + + return badgeTextAttributes; +} + + + +#pragma mark - +#pragma mark badges + ++ (NSImage *) badge:(NSString *)badge forCell:(NSTextFieldCell *)cell +{ + NSColor *badgeColor = [self badgeColorForCell:cell]; + + NSColor *textColor = [self badgeTextColorForCell:cell]; + NSMutableDictionary *badgeTextAttributes = [self badgeTextAttributes]; + [badgeTextAttributes setObject:textColor forKey:NSForegroundColorAttributeName]; + NSAttributedString *badgeString = [[NSAttributedString alloc] initWithString:badge attributes:badgeTextAttributes]; + + float imageHeight = ceilf([badgeString size].height); + float radius = ceilf(imageHeight / 4) * 2; + float minWidth = ceilf(radius * 2.5); + + float imageWidth = ceilf([badgeString size].width + radius); + if (imageWidth < minWidth) + imageWidth = minWidth; + NSRect badgeRect = NSMakeRect(0, 0, imageWidth, imageHeight); + + NSBezierPath *badgePath = [NSBezierPath bezierPathWithRoundedRect:badgeRect xRadius:radius yRadius:radius]; + + NSImage *badgeImage = [[NSImage alloc] initWithSize:badgeRect.size]; + [badgeImage lockFocus]; + + [badgeColor set]; + [badgePath fill]; + + [badgeString drawInRect:badgeRect]; + + [badgeImage unlockFocus]; + + return badgeImage; +} + ++ (NSImage *) checkedOutBadgeForCell:(NSTextFieldCell *)cell +{ + return [self badge:@"✔" forCell:cell]; +} + ++ (NSImage *) numericBadge:(NSInteger)number forCell:(NSTextFieldCell *)cell +{ + return [self badge:[NSString stringWithFormat:@"%d", number] forCell:cell]; +} + +@end diff --git a/PBSourceViewCell.h b/PBSourceViewCell.h new file mode 100644 index 0000000..5b88392 --- /dev/null +++ b/PBSourceViewCell.h @@ -0,0 +1,19 @@ +// +// PBSourceViewCell.h +// GitX +// +// Created by Nathan Kinsinger on 1/7/10. +// Copyright 2010 Nathan Kinsinger. All rights reserved. +// + +#import +#import "PBIconAndTextCell.h" + + +@interface PBSourceViewCell : PBIconAndTextCell { + BOOL isCheckedOut; +} + +@property (assign) BOOL isCheckedOut; + +@end diff --git a/PBSourceViewCell.m b/PBSourceViewCell.m new file mode 100644 index 0000000..eb60bca --- /dev/null +++ b/PBSourceViewCell.m @@ -0,0 +1,55 @@ +// +// PBSourceViewCell.m +// GitX +// +// Created by Nathan Kinsinger on 1/7/10. +// Copyright 2010 Nathan Kinsinger. All rights reserved. +// + +#import "PBSourceViewCell.h" +#import "PBGitSidebarController.h" +#import "PBSourceViewBadge.h" + + + + +@implementation PBSourceViewCell + +@synthesize isCheckedOut; + +# pragma mark context menu delegate methods + +- (NSMenu *) menuForEvent:(NSEvent *)event inRect:(NSRect)rect ofView:(NSOutlineView *)view +{ + NSPoint point = [view convertPoint:[event locationInWindow] fromView:nil]; + NSInteger row = [view rowAtPoint:point]; + + PBGitSidebarController *controller = [view delegate]; + + return [controller menuForRow:row]; +} + + +#pragma mark drawing + +- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)outlineView +{ + if (isCheckedOut) { + NSImage *checkedOutImage = [PBSourceViewBadge checkedOutBadgeForCell:self]; + NSSize imageSize = [checkedOutImage size]; + NSRect imageFrame; + NSDivideRect(cellFrame, &imageFrame, &cellFrame, imageSize.width + 3, NSMaxXEdge); + imageFrame.size = imageSize; + + if ([outlineView isFlipped]) + imageFrame.origin.y += floor((cellFrame.size.height + imageFrame.size.height) / 2); + else + imageFrame.origin.y += ceil((cellFrame.size.height - imageFrame.size.height) / 2); + + [checkedOutImage compositeToPoint:imageFrame.origin operation:NSCompositeSourceOver]; + } + + [super drawWithFrame:cellFrame inView:outlineView]; +} + +@end From 2321ec8c47832b445c8064ac67b6ad8a616109e4 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sat, 13 Feb 2010 23:17:09 -0700 Subject: [PATCH 55/90] Add and delete refs from the source list view Observe the branches array and update the sidebar when refs are added or deleted. Sort new items based on the title. --- PBGitRepository.m | 42 ++++++++++++++++++-------------- PBGitSidebarController.m | 52 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 75 insertions(+), 19 deletions(-) diff --git a/PBGitRepository.m b/PBGitRepository.m index 63534d0..bd56838 100644 --- a/PBGitRepository.m +++ b/PBGitRepository.m @@ -385,33 +385,39 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; } // Returns either this object, or an existing, equal object -- (PBGitRevSpecifier*) addBranch: (PBGitRevSpecifier*) rev +- (PBGitRevSpecifier*) addBranch:(PBGitRevSpecifier*)branch { - if ([[rev parameters] count] == 0) - rev = [self headRef]; + if ([[branch parameters] count] == 0) + branch = [self headRef]; // First check if the branch doesn't exist already - for (PBGitRevSpecifier* r in branches) - if ([rev isEqualTo: r]) - return r; + for (PBGitRevSpecifier *rev in branches) + if ([branch isEqualTo: rev]) + return rev; - [self willChangeValueForKey:@"branches"]; - [branches addObject: rev]; - [self didChangeValueForKey:@"branches"]; - return rev; + NSIndexSet *newIndex = [NSIndexSet indexSetWithIndex:[branches count]]; + [self willChange:NSKeyValueChangeInsertion valuesAtIndexes:newIndex forKey:@"branches"]; + + [branches addObject:branch]; + + [self didChange:NSKeyValueChangeInsertion valuesAtIndexes:newIndex forKey:@"branches"]; + return branch; } -- (BOOL)removeBranch:(PBGitRevSpecifier *)rev +- (BOOL) removeBranch:(PBGitRevSpecifier *)branch { - for (PBGitRevSpecifier *r in branches) { - if ([rev isEqualTo:r]) { - [self willChangeValueForKey:@"branches"]; - [branches removeObject:r]; - [self didChangeValueForKey:@"branches"]; - return TRUE; + for (PBGitRevSpecifier *rev in branches) { + if ([branch isEqualTo:rev]) { + NSIndexSet *oldIndex = [NSIndexSet indexSetWithIndex:[branches indexOfObject:rev]]; + [self willChange:NSKeyValueChangeRemoval valuesAtIndexes:oldIndex forKey:@"branches"]; + + [branches removeObject:rev]; + + [self didChange:NSKeyValueChangeRemoval valuesAtIndexes:oldIndex forKey:@"branches"]; + return YES; } } - return FALSE; + return NO; } - (void) readCurrentBranch diff --git a/PBGitSidebarController.m b/PBGitSidebarController.m index ce3d09a..e25f4c4 100644 --- a/PBGitSidebarController.m +++ b/PBGitSidebarController.m @@ -18,6 +18,8 @@ - (void)populateList; - (void)addRevSpec:(PBGitRevSpecifier *)revSpec; +- (PBSourceViewItem *) itemForRev:(PBGitRevSpecifier *)rev; +- (void) removeRevSpec:(PBGitRevSpecifier *)rev; @end @implementation PBGitSidebarController @@ -42,13 +44,38 @@ commitViewController = [[PBGitCommitController alloc] initWithRepository:repository superController:superController]; [repository addObserver:self forKeyPath:@"currentBranch" options:0 context:@"currentBranchChange"]; + [repository addObserver:self forKeyPath:@"branches" options:(NSKeyValueObservingOptionOld | NSKeyValueObservingOptionNew) context:@"branchesModified"]; [self selectCurrentBranch]; } - (void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { - if ([@"currentBranchChange" isEqualTo:context]) + if ([@"currentBranchChange" isEqualToString:context]) { + [sourceView reloadData]; [self selectCurrentBranch]; + return; + } + + if ([@"branchesModified" isEqualToString:context]) { + NSInteger changeKind = [(NSNumber *)[change objectForKey:NSKeyValueChangeKindKey] intValue]; + + if (changeKind == NSKeyValueChangeInsertion) { + NSArray *newRevSpecs = [change objectForKey:NSKeyValueChangeNewKey]; + for (PBGitRevSpecifier *rev in newRevSpecs) { + [self addRevSpec:rev]; + PBSourceViewItem *item = [self itemForRev:rev]; + [sourceView PBExpandItem:item expandParents:YES]; + } + } + else if (changeKind == NSKeyValueChangeRemoval) { + NSArray *removedRevSpecs = [change objectForKey:NSKeyValueChangeOldKey]; + for (PBGitRevSpecifier *rev in removedRevSpecs) + [self removeRevSpec:rev]; + } + return; + } + + [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; } - (void) selectStage @@ -83,10 +110,20 @@ [sourceView selectRowIndexes:index byExtendingSelection:NO]; } +- (PBSourceViewItem *) itemForRev:(PBGitRevSpecifier *)rev +{ + PBSourceViewItem *foundItem = nil; + for (PBSourceViewItem *item in items) + if (foundItem = [item findRev:rev]) + return foundItem; + return nil; +} + - (void)addRevSpec:(PBGitRevSpecifier *)rev { if (![rev isSimpleRef]) { [others addChild:[PBSourceViewItem itemWithRevSpec:rev]]; + [sourceView reloadData]; return; } @@ -99,6 +136,19 @@ [tags addRev:rev toPath:[pathComponents subarrayWithRange:NSMakeRange(2, [pathComponents count] - 2)]]; else if ([[rev simpleRef] hasPrefix:@"refs/remotes/"]) [remotes addRev:rev toPath:[pathComponents subarrayWithRange:NSMakeRange(2, [pathComponents count] - 2)]]; + [sourceView reloadData]; +} + +- (void) removeRevSpec:(PBGitRevSpecifier *)rev +{ + PBSourceViewItem *item = [self itemForRev:rev]; + + if (!item) + return; + + PBSourceViewItem *parent = item.parent; + [parent removeChild:item]; + [sourceView reloadData]; } #pragma mark NSOutlineView delegate methods From 1b41171d9238b19044f86485e133a83f4075da0f Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Thu, 18 Feb 2010 18:29:01 -0700 Subject: [PATCH 56/90] Add a bottom content border/toolbar to the repository window MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - add an action menu for the selected ref in the source view - add Add Remote, Fetch, Pull and Push buttons to the bottom bar - Add Remote icon by Nathan Kinsinger - Fetch, Pull and Push icons are modified versions of André Berg's icons (from 4396081c07) made a bit smaller to fit in the UI better. - move the status message for both the history view and the commit/stage view - all PBViewControllers now have status and isBusy properties and can use those to put a message in the bottom bar when they are the active content controller of the window --- English.lproj/RepositoryWindow.xib | 291 +++++++++++++++++----- GitX.xcodeproj/project.pbxproj | 16 ++ Images/AddRemote.acorn | Bin 0 -> 5189 bytes Images/AddRemote.png | Bin 0 -> 3306 bytes Images/FetchTemplate.png | Bin 0 -> 210 bytes Images/PullTemplate.png | Bin 0 -> 215 bytes Images/PushTemplate.png | Bin 0 -> 217 bytes PBGitCommitController.h | 5 - PBGitCommitController.m | 10 +- PBGitCommitView.xib | 147 ++--------- PBGitHistoryController.m | 4 + PBGitHistoryView.xib | 97 ++------ PBGitSidebarController.h | 6 + PBGitSidebarController.m | 132 ++++++++-- PBGitSidebarView.xib | 375 ++++++++++++++++++++++++++++- PBGitWindowController.h | 4 + PBGitWindowController.m | 43 ++++ PBRefController.h | 1 + PBViewController.h | 5 + PBViewController.m | 2 + 20 files changed, 832 insertions(+), 306 deletions(-) create mode 100644 Images/AddRemote.acorn create mode 100644 Images/AddRemote.png create mode 100644 Images/FetchTemplate.png create mode 100644 Images/PullTemplate.png create mode 100644 Images/PushTemplate.png diff --git a/English.lproj/RepositoryWindow.xib b/English.lproj/RepositoryWindow.xib index 3376679..2d9e00a 100644 --- a/English.lproj/RepositoryWindow.xib +++ b/English.lproj/RepositoryWindow.xib @@ -12,7 +12,7 @@ YES - + YES @@ -45,7 +45,7 @@ 1886912512 GitX NSWindow - + A66F2540-5B64-4016-89F7-892563371FAF @@ -60,34 +60,13 @@ YES YES - NSToolbarCustomizeToolbarItem NSToolbarFlexibleSpaceItem NSToolbarSeparatorItem NSToolbarSpaceItem YES - - NSToolbarCustomizeToolbarItem - Customize - Customize - Customize Toolbar - - - NSImage - NSToolbarCustomizeToolbarItemImage - - - runToolbarCustomizationPalette: - {0, 0} - {0, 0} - YES - YES - -1 - YES - 0 - - + NSToolbarFlexibleSpaceItem Flexible Space @@ -110,17 +89,17 @@ 1048576 2147483647 - + NSImage NSMenuCheckmark - + NSImage NSMenuMixedState - + NSToolbarSeparatorItem Separator @@ -143,11 +122,11 @@ 1048576 2147483647 - - + + - + NSToolbarSpaceItem Space @@ -170,22 +149,20 @@ 1048576 2147483647 - - + + YES - - - - + + + YES - YES @@ -206,24 +183,86 @@ 272 - {184, 514} + {184, 483} NSView 274 - {{185, 0}, {705, 514}} + {{185, 0}, {705, 483}} NSView - {890, 514} + {{0, 31}, {890, 483}} YES 2 sourceSplitView + + + 292 + {{0, 1}, {200, 31}} + + NSView + + + + 293 + + YES + + + 1292 + + {{20, 7}, {16, 16}} + + 20746 + 100 + + + + 266 + {{41, 8}, {188, 14}} + + YES + + 67239488 + 4327424 + Label + + LucidaGrande + 11 + 3100 + + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + + + {{364, 0}, {246, 31}} + + NSView + {890, 514} @@ -232,6 +271,7 @@ {213, 129} {1.79769e+308, 1.79769e+308} GitX + 31 @@ -277,6 +317,30 @@ 357 + + + sourceListControlsView + + + + 395 + + + + progressIndicator + + + + 400 + + + + statusField + + + + 401 + @@ -311,7 +375,7 @@ YES - + Window @@ -322,6 +386,8 @@ YES + + @@ -352,35 +418,65 @@ 367 - + YES - - - - + + + 370 - - + + 372 - - + + 373 - - + + - 374 - - + 393 + + + Source List Controls View + + + 396 + + + YES + + + + + Status View + + + 397 + + + YES + + + + + + 398 + + + + + 399 + + @@ -404,7 +500,11 @@ 353.IBPluginDependency 367.IBEditorWindowLastContentRect 367.IBPluginDependency - 374.IBPluginDependency + 393.IBPluginDependency + 396.IBPluginDependency + 397.IBPluginDependency + 398.IBPluginDependency + 399.IBPluginDependency 5.IBPluginDependency 5.ImportedFromIB2 @@ -424,7 +524,11 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{621, 1213}, {616, 0}} + {{621, 1214}, {616, 0}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -447,7 +551,7 @@ - 374 + 401 @@ -479,14 +583,20 @@ YES contentSplitView + progressIndicator + sourceListControlsView sourceSplitView splitView + statusField YES NSView + NSProgressIndicator + NSView NSView NSSplitView + NSTextField @@ -505,6 +615,14 @@ YES + + NSActionCell + NSCell + + IBFrameworkSource + AppKit.framework/Headers/NSActionCell.h + + NSApplication NSResponder @@ -548,6 +666,30 @@ AppKit.framework/Headers/NSUserInterfaceItemSearching.h + + NSCell + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSCell.h + + + + NSControl + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSControl.h + + + + NSFormatter + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFormatter.h + + NSMenu NSObject @@ -577,10 +719,7 @@ NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSControl.h - + NSObject @@ -658,7 +797,7 @@ NSObject - + IBFrameworkSource AppKit.framework/Headers/NSToolbarItem.h @@ -887,6 +1026,14 @@ WebKit.framework/Headers/WebUIDelegate.h + + NSProgressIndicator + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSProgressIndicator.h + + NSResponder @@ -910,6 +1057,22 @@ AppKit.framework/Headers/NSSplitView.h + + NSTextField + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSTextField.h + + + + NSTextFieldCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSTextFieldCell.h + + NSToolbar NSObject @@ -921,7 +1084,7 @@ NSToolbarItem NSObject - + NSView diff --git a/GitX.xcodeproj/project.pbxproj b/GitX.xcodeproj/project.pbxproj index f14f9c1..fa3c9fd 100644 --- a/GitX.xcodeproj/project.pbxproj +++ b/GitX.xcodeproj/project.pbxproj @@ -52,6 +52,9 @@ D8083E03111FA33700337480 /* PBCloneRepositoryPanel.m in Sources */ = {isa = PBXBuildFile; fileRef = D8083E02111FA33700337480 /* PBCloneRepositoryPanel.m */; }; D828A40D1127B18700F09D11 /* PBSourceViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D828A40C1127B18700F09D11 /* PBSourceViewCell.m */; }; D828A4111127B1C400F09D11 /* PBSourceViewBadge.m in Sources */ = {isa = PBXBuildFile; fileRef = D828A4101127B1C400F09D11 /* PBSourceViewBadge.m */; }; + D828A5F21128AE7200F09D11 /* FetchTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = D828A5EF1128AE7200F09D11 /* FetchTemplate.png */; }; + D828A5F31128AE7200F09D11 /* PullTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = D828A5F01128AE7200F09D11 /* PullTemplate.png */; }; + D828A5F41128AE7200F09D11 /* PushTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = D828A5F11128AE7200F09D11 /* PushTemplate.png */; }; D8357535112640F100DE249D /* PBRemoteProgressSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = D8C1B77110E875CF009B7F8B /* PBRemoteProgressSheet.xib */; }; D854948610D5C01B0083B917 /* PBCreateBranchSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = D854948510D5C01B0083B917 /* PBCreateBranchSheet.m */; }; D85810551127476E007F254B /* StageView.png in Resources */ = {isa = PBXBuildFile; fileRef = D85810541127476E007F254B /* StageView.png */; }; @@ -71,6 +74,7 @@ D8FDDA6E114335E8005647F6 /* PBGitSVRemoteItem.m in Sources */ = {isa = PBXBuildFile; fileRef = D8FDDA65114335E8005647F6 /* PBGitSVRemoteItem.m */; }; D8FDDA6F114335E8005647F6 /* PBGitSVStageItem.m in Sources */ = {isa = PBXBuildFile; fileRef = D8FDDA67114335E8005647F6 /* PBGitSVStageItem.m */; }; D8FDDA70114335E8005647F6 /* PBGitSVTagItem.m in Sources */ = {isa = PBXBuildFile; fileRef = D8FDDA69114335E8005647F6 /* PBGitSVTagItem.m */; }; + D8FDDBF41143F318005647F6 /* AddRemote.png in Resources */ = {isa = PBXBuildFile; fileRef = D8FDDBF31143F318005647F6 /* AddRemote.png */; }; EB2A734A0FEE3F09006601CF /* PBCollapsibleSplitView.m in Sources */ = {isa = PBXBuildFile; fileRef = EB2A73490FEE3F09006601CF /* PBCollapsibleSplitView.m */; }; F50A411F0EBB874C00208746 /* mainSplitterBar.tiff in Resources */ = {isa = PBXBuildFile; fileRef = F50A411D0EBB874C00208746 /* mainSplitterBar.tiff */; }; F50A41200EBB874C00208746 /* mainSplitterDimple.tiff in Resources */ = {isa = PBXBuildFile; fileRef = F50A411E0EBB874C00208746 /* mainSplitterDimple.tiff */; }; @@ -254,6 +258,9 @@ D828A40C1127B18700F09D11 /* PBSourceViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBSourceViewCell.m; sourceTree = ""; }; D828A40F1127B1C400F09D11 /* PBSourceViewBadge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBSourceViewBadge.h; sourceTree = ""; }; D828A4101127B1C400F09D11 /* PBSourceViewBadge.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBSourceViewBadge.m; sourceTree = ""; }; + D828A5EF1128AE7200F09D11 /* FetchTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = FetchTemplate.png; path = Images/FetchTemplate.png; sourceTree = ""; }; + D828A5F01128AE7200F09D11 /* PullTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = PullTemplate.png; path = Images/PullTemplate.png; sourceTree = ""; }; + D828A5F11128AE7200F09D11 /* PushTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = PushTemplate.png; path = Images/PushTemplate.png; sourceTree = ""; }; D854948410D5C01B0083B917 /* PBCreateBranchSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCreateBranchSheet.h; sourceTree = ""; }; D854948510D5C01B0083B917 /* PBCreateBranchSheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCreateBranchSheet.m; sourceTree = ""; }; D854949310D5C3E20083B917 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/PBCreateBranchSheet.xib; sourceTree = ""; }; @@ -285,6 +292,7 @@ D8FDDA68114335E8005647F6 /* PBGitSVTagItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitSVTagItem.h; sourceTree = ""; }; D8FDDA69114335E8005647F6 /* PBGitSVTagItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitSVTagItem.m; sourceTree = ""; }; D8FDDA7311433634005647F6 /* PBSourceViewItems.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBSourceViewItems.h; sourceTree = ""; }; + D8FDDBF31143F318005647F6 /* AddRemote.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = AddRemote.png; path = Images/AddRemote.png; sourceTree = ""; }; EB2A73480FEE3F09006601CF /* PBCollapsibleSplitView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCollapsibleSplitView.h; sourceTree = ""; }; EB2A73490FEE3F09006601CF /* PBCollapsibleSplitView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCollapsibleSplitView.m; sourceTree = ""; }; F50A411D0EBB874C00208746 /* mainSplitterBar.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = mainSplitterBar.tiff; path = Images/mainSplitterBar.tiff; sourceTree = ""; }; @@ -507,6 +515,10 @@ D858108111274D28007F254B /* RemoteBranch.png */, D858108211274D28007F254B /* Tag.png */, D85810541127476E007F254B /* StageView.png */, + D8FDDBF31143F318005647F6 /* AddRemote.png */, + D828A5EF1128AE7200F09D11 /* FetchTemplate.png */, + D828A5F01128AE7200F09D11 /* PullTemplate.png */, + D828A5F11128AE7200F09D11 /* PushTemplate.png */, 3BC07F4A0ED5A5C5009A7768 /* HistoryViewTemplate.png */, 3BC07F4B0ED5A5C5009A7768 /* CommitViewTemplate.png */, F56ADDD70ED19F9E002AC78F /* AddBranchTemplate.png */, @@ -993,6 +1005,10 @@ D858108311274D28007F254B /* Branch.png in Resources */, D858108411274D28007F254B /* RemoteBranch.png in Resources */, D858108511274D28007F254B /* Tag.png in Resources */, + D828A5F21128AE7200F09D11 /* FetchTemplate.png in Resources */, + D828A5F31128AE7200F09D11 /* PullTemplate.png in Resources */, + D828A5F41128AE7200F09D11 /* PushTemplate.png in Resources */, + D8FDDBF41143F318005647F6 /* AddRemote.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Images/AddRemote.acorn b/Images/AddRemote.acorn new file mode 100644 index 0000000000000000000000000000000000000000..1ea4c95d25da18fdb6479bf121de9ae80adf0791 GIT binary patch literal 5189 zcmbVQ2Ut_tw%+HY0s+#fQbO-Ykq*+EQ~^P-U`P%S2}w+$h$w1AMQ2b{x+v%%;3!t? z4RIJ0vG<1KAUHaTqu7PFgI>gWckX-NJ^6C-pH=qy*V_B+Z?B|@_&kZ!!QnQ7;_w6_ ziL9ioLQz#yr_$(NUh!NJFO|v&60>uIgdABmCXgm#VhK+un2{moapOg74o{FVLnIca z^Y~a0Tgp!1umw46Njz^pmK-bQ38dkIbYZf>I8ewJic=!l`EYMN3mku_T>^lf<(h0J`2Av z%GZyA?I>ePSR_v%M5zE|3#8(>&;Zu-5AY>q?}6(5qIa1Rd-WJ#cr z0)M;STp!Hhix2|j)^e=43!918QhQHbPKpVDcq%4Ji$NB@PFwx zj)MYzS=SISwhjYksy(1yU;^Bq-2l%}0l1lUP=k!kTclDVP`r6bhW%gGJ;YEydjIZ* zm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=NFU?n){UtnWG(O7(F29Pr+Vkt~MeF)& z7awbA%w>I!xN?;kMOH4}vt-wjHLBQ=$XQ7uB`oRvElj4NvHzF#1~(`90N6Hrv}BO8yXO8TYvA$lHGj{ zI$!QevA-R%@!EdlyvlB|w_k5O z=KEOUzvis#@A=a{oU?wZ#jxR*&xpJryqKl$T>Z#fG)`_9)6ye8G(B|X%+?)J7mdf7;mqnh!vV=rER zQtH2P;M4G{3YA0iNlqr)w|sCNxkOE?C=+Zx=R3ohzq;73ReN7Y&&d9_URNF$B^Ef? zvK$JjfHCs*n)Thxj%^{vzAihm#;rd~E4cowZEXKG*OOwX^YUsrbF>%ukylutFFjbp zl%FgD&R7xD{63*8MmVQh>;L*4HS$hhD$+}+o4F{mgX8K{7uNW`f6d*M7d}b2)gwB~ z^9SA(HeUQJcR2LCQ*-!cd&%9w&=}vF-HoQ7i;8dtUb7uy%ZJ%T>p!W0Wb5fa{3GQe z0LD?C=m04@IywK1vP%p#dX)0y-V;SdfPAHU0SPWKpZH9ERog#~kESjNtuE!6+k4+U-q1&hTf1Fp?Q53?AbLMh!gpH#1t` TUIj1oU#+Uom*;=o8QcE{GJ4eS literal 0 HcmV?d00001 diff --git a/Images/AddRemote.png b/Images/AddRemote.png new file mode 100644 index 0000000000000000000000000000000000000000..b4f98bd440a97c0133940ea5acfbdd8f618060e0 GIT binary patch literal 3306 zcmVEWX+uL$Nkc;* zP;zf(X>4Tx0C)kNmUmQB*%pV-y*Itk5+Wca^cs2zAksTX6$DXM^`x7XQc?|s+0 z08spb1j2M!0f022SQPH-!CVp(%f$Br7!UytSOLJ{W@ZFO_(THK{JlMynW#v{v-a*T zfMmPdEWc1DbJqWVks>!kBnAKqMb$PuekK>?0+ds;#ThdH1j_W4DKdsJG8Ul;qO2n0 z#IJ1jr{*iW$(WZWsE0n`c;fQ!l&-AnmjxZO1uWyz`0VP>&nP`#itsL#`S=Q!g`M=rU9)45( zJ;-|dRq-b5&z?byo>|{)?5r=n76A4nTALlSzL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ZRcd@JAq3b&S zm)ZUWJU_oEy?Ogi$gKZx<@4J#$1#epuUoz|7ET9)gCoaGqBe7iqRcW>RV9uuoZe?= zrTFB_X@3(#lRe$%P%0fl(=`0t%%WI4&?X{xm&V6$4;yhOGG|%#H0#89VPRQ%{N$P6 z;dGMz-hQlQHn682fN7-B>~6v3i+w9ECSUnI9$p$6x;kR1jW*!F6PS5DCv3^PWNTX+ zR=#dvM=68jTxe_Mp{ix9uC9x_dk5t7%$#6wZGk|b`l1}inOe2JL?TgbQR>U8%jXmD z=;4Fp)8|oLGHZiSNHHew<}HGwGEkEaloA$oV>Ma}~XJTAU38TuY+^gZ$DyC7)gWxk<2N%5A4=HKiG26Ob)T{M^O(BFEl z&2@?QG3TU>-KqON{u66B>YB0mm~D*R%y)hFSG1ny`N*!5dUn(Mw$%^k9RHBVa^Z77 zqpk{rT?of-1HSNUM$sN2jD^QMn-AXO=JqZ*cxCe62=&=-rrYX89ytnh4}+(xpUXO@ GgeCxYE>Ic( literal 0 HcmV?d00001 diff --git a/Images/PullTemplate.png b/Images/PullTemplate.png new file mode 100644 index 0000000000000000000000000000000000000000..597136808411451c9f22169395fde6277abbeff9 GIT binary patch literal 215 zcmeAS@N?(olHy`uVBq!ia0vp^0zk~e!3HF=pW8M9Db50q$YKTtt|K7Kn3mgg1t{3* z>EaloA$m9HAa8>L&yr(|5=R3irV7d&43u#=YR%-SsCw+jgTe~DWM4f&TCHg literal 0 HcmV?d00001 diff --git a/Images/PushTemplate.png b/Images/PushTemplate.png new file mode 100644 index 0000000000000000000000000000000000000000..5f0ba6ddd867af5f1a3526d4ac089466657102d9 GIT binary patch literal 217 zcmeAS@N?(olHy`uVBq!ia0vp^0zk~e!3HF=pW8M9Db50q$YKTtt|K7Kn3mgg1t{3< z>EaloA$oMeMcxJl9+#EE23(5`CMj=hlD6oQelVAD@-#NPKO0WE7T1Pz1!eQbXU%SP zO0 NO - - - 292 - {{27, 8}, {305, 17}} - - YES - - 67239488 - 272630784 - Ready to commit - - - - 6 - System - controlColor - - 3 - MC42NjY2NjY2NjY3AA - - - - 6 - System - controlTextColor - - 3 - MAA - - - - 274 @@ -235,7 +203,10 @@ 6 System headerTextColor - + + 3 + MAA + @@ -248,9 +219,17 @@ 6 System controlBackgroundColor - + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + - 3 YES @@ -741,16 +720,6 @@ CommitViewSplitView - - - 1316 - - {{6, 8}, {16, 16}} - - 28938 - 16 - 100 - {852, 432} @@ -908,38 +877,6 @@ 213 - - - value: status - - - - - - value: status - value - status - 2 - - - 216 - - - - animate: busy - - - - - - animate: busy - animate - busy - 2 - - - 222 - webController @@ -1150,8 +1087,6 @@ YES - - @@ -1179,21 +1114,6 @@ Diff Controller - - 2 - - - YES - - - - Status label - - - 42 - - - 186 @@ -1378,11 +1298,6 @@ - - 217 - - - 247 @@ -1448,18 +1363,15 @@ 164.IBPluginDependency 186.CustomClassName 186.IBPluginDependency - 2.IBPluginDependency 206.IBPluginDependency 207.IBPluginDependency 208.IBPluginDependency 209.IBPluginDependency - 217.IBPluginDependency 247.IBPluginDependency 248.IBPluginDependency 278.IBPluginDependency 279.IBPluginDependency 308.IBPluginDependency - 42.IBPluginDependency 45.IBPluginDependency 46.IBPluginDependency 47.IBPluginDependency @@ -1509,9 +1421,6 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin PBFileChangesTableView com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -1664,10 +1573,6 @@ PBViewController NSViewController - - viewToolbar - NSToolbar - IBProjectSource PBViewController.h @@ -2189,14 +2094,6 @@ AppKit.framework/Headers/NSObjectController.h - - NSProgressIndicator - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSProgressIndicator.h - - NSResponder @@ -2257,14 +2154,6 @@ AppKit.framework/Headers/NSText.h - - NSTextField - NSControl - - IBFrameworkSource - AppKit.framework/Headers/NSTextField.h - - NSTextFieldCell NSActionCell @@ -2281,14 +2170,6 @@ AppKit.framework/Headers/NSTextView.h - - NSToolbar - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSToolbar.h - - NSUserDefaultsController NSController diff --git a/PBGitHistoryController.m b/PBGitHistoryController.m index 758b5aa..3157f3d 100644 --- a/PBGitHistoryController.m +++ b/PBGitHistoryController.m @@ -26,6 +26,7 @@ { self.selectedTab = [[NSUserDefaults standardUserDefaults] integerForKey:@"Repository Window Selected Tab Index"];; [commitController addObserver:self forKeyPath:@"selection" options:(NSKeyValueObservingOptionNew,NSKeyValueObservingOptionOld) context:@"commitChange"]; + [commitController addObserver:self forKeyPath:@"arrangedObjects.@count" options:NSKeyValueObservingOptionInitial context:@"updateCommitCount"]; [treeController addObserver:self forKeyPath:@"selection" options:0 context:@"treeChange"]; [repository addObserver:self forKeyPath:@"currentBranch" options:0 context:@"branchChange"]; NSSize cellSpacing = [commitList intercellSpacing]; @@ -103,6 +104,9 @@ commitController.sortDescriptors = [NSArray array]; [repository reloadRefs]; } + else if([(NSString *)context isEqualToString:@"updateCommitCount"]) { + self.status = [NSString stringWithFormat:@"%d commits loaded", [[commitController arrangedObjects] count]]; + } else { [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; } diff --git a/PBGitHistoryView.xib b/PBGitHistoryView.xib index 81df53f..6a67914 100644 --- a/PBGitHistoryView.xib +++ b/PBGitHistoryView.xib @@ -21,7 +21,7 @@ YES - + YES @@ -153,38 +153,6 @@ 2 - - - 292 - {{17, 5}, {305, 17}} - - YES - - 67239488 - 272630784 - Label - - - - 6 - System - controlColor - - 3 - MC42NjY2NjY2NjY3AA - - - - 6 - System - controlTextColor - - 3 - MAA - - - - 289 @@ -361,7 +329,10 @@ 6 System headerTextColor - + + 3 + MAA + @@ -374,9 +345,17 @@ 6 System controlBackgroundColor - + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + - 3 YES @@ -694,7 +673,12 @@ Details - + + 6 + System + controlColor + + @@ -1361,26 +1345,6 @@ 98 - - - displayPatternValue1: arrangedObjects.@count - - - - - - displayPatternValue1: arrangedObjects.@count - displayPatternValue1 - arrangedObjects.@count - - NSDisplayPattern - %{value1}@ commits loaded - - 2 - - - 106 - delegate @@ -2009,7 +1973,6 @@ YES - @@ -2029,15 +1992,6 @@ - - 47 - - - YES - - - - 48 @@ -2052,11 +2006,6 @@ - - 52 - - - 50 @@ -2153,12 +2102,10 @@ 4.IBPluginDependency 46.IBEditorWindowLastContentRect 46.IBPluginDependency - 47.IBPluginDependency 48.IBPluginDependency 49.IBPluginDependency 50.IBPluginDependency 51.IBPluginDependency - 52.IBPluginDependency 6.IBPluginDependency 7.IBPluginDependency 8.IBPluginDependency @@ -2251,8 +2198,6 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin diff --git a/PBGitSidebarController.h b/PBGitSidebarController.h index c0c76e0..ba4dd2f 100644 --- a/PBGitSidebarController.h +++ b/PBGitSidebarController.h @@ -16,6 +16,9 @@ @interface PBGitSidebarController : PBViewController { IBOutlet NSWindow *window; IBOutlet NSOutlineView *sourceView; + IBOutlet NSView *sourceListControlsView; + IBOutlet NSPopUpButton *actionButton; + IBOutlet NSSegmentedControl *remoteControls; NSMutableArray *items; @@ -33,5 +36,8 @@ - (NSMenu *) menuForRow:(NSInteger)row; +- (IBAction) fetchPullPushAction:(id)sender; + @property(readonly) NSMutableArray *items; +@property(readonly) NSView *sourceListControlsView; @end diff --git a/PBGitSidebarController.m b/PBGitSidebarController.m index e25f4c4..707cb5b 100644 --- a/PBGitSidebarController.m +++ b/PBGitSidebarController.m @@ -13,6 +13,7 @@ #import "PBRefController.h" #import "PBSourceViewCell.h" #import "NSOutlineViewExt.h" +#import "PBAddRemoteSheet.h" @interface PBGitSidebarController () @@ -20,10 +21,13 @@ - (void)addRevSpec:(PBGitRevSpecifier *)revSpec; - (PBSourceViewItem *) itemForRev:(PBGitRevSpecifier *)rev; - (void) removeRevSpec:(PBGitRevSpecifier *)rev; +- (void) updateActionMenu; +- (void) updateRemoteControls; @end @implementation PBGitSidebarController @synthesize items; +@synthesize sourceListControlsView; - (id)initWithRepository:(PBGitRepository *)theRepository superController:(PBGitWindowController *)controller { @@ -45,6 +49,9 @@ [repository addObserver:self forKeyPath:@"currentBranch" options:0 context:@"currentBranchChange"]; [repository addObserver:self forKeyPath:@"branches" options:(NSKeyValueObservingOptionOld | NSKeyValueObservingOptionNew) context:@"branchesModified"]; + + [self menuNeedsUpdate:[actionButton menu]]; + [self selectCurrentBranch]; } @@ -78,6 +85,14 @@ [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; } +- (PBSourceViewItem *) selectedItem +{ + NSInteger index = [sourceView selectedRow]; + PBSourceViewItem *item = [sourceView itemAtRow:index]; + + return item; +} + - (void) selectStage { NSIndexSet *index = [NSIndexSet indexSetWithIndex:[sourceView rowForItem:stage]]; @@ -161,16 +176,14 @@ if ([item revSpecifier]) { repository.currentBranch = [item revSpecifier]; [superController changeContentController:historyViewController]; - return; } - if (item == stage) + if (item == stage) { [superController changeContentController:commitViewController]; + } - /* ... */ - - - /* Handle Remotes */ + [self updateActionMenu]; + [self updateRemoteControls]; } #pragma mark NSOutlineView delegate methods @@ -261,29 +274,112 @@ #pragma mark Menus +- (void) updateActionMenu +{ + [actionButton setEnabled:([[self selectedItem] ref] != nil)]; +} + +- (void) addMenuItemsForRef:(PBGitRef *)ref toMenu:(NSMenu *)menu +{ + if (!ref) + return; + + for (NSMenuItem *menuItem in [historyViewController.refController menuItemsForRef:ref]) + [menu addItem:menuItem]; +} + +- (NSMenuItem *) actionIconItem +{ + NSMenuItem *actionIconItem = [[NSMenuItem alloc] initWithTitle:@"" action:NULL keyEquivalent:@""]; + NSImage *actionIcon = [NSImage imageNamed:@"NSActionTemplate"]; + [actionIcon setSize:NSMakeSize(12, 12)]; + [actionIconItem setImage:actionIcon]; + + return actionIconItem; +} + - (NSMenu *) menuForRow:(NSInteger)row { PBSourceViewItem *viewItem = [sourceView itemAtRow:row]; - PBGitRef *ref = nil; - - // create a ref for a remote because they don't store one - if ([self outlineView:sourceView isItemExpandable:viewItem] && (viewItem.parent == remotes)) - ref = [PBGitRef refFromString:[kGitXRemoteRefPrefix stringByAppendingString:[viewItem title]]]; - else - ref = [[viewItem revSpecifier] ref]; - + PBGitRef *ref = [viewItem ref]; if (!ref) return nil; - NSArray *menuItems = [historyViewController.refController menuItemsForRef:ref]; - NSMenu *menu = [[NSMenu alloc] init]; [menu setAutoenablesItems:NO]; - for (NSMenuItem *item in menuItems) - [menu addItem:item]; + [self addMenuItemsForRef:ref toMenu:menu]; return menu; } +// delegate of the action menu +- (void) menuNeedsUpdate:(NSMenu *)menu +{ + [actionButton removeAllItems]; + [menu addItem:[self actionIconItem]]; + + PBGitRef *ref = [[self selectedItem] ref]; + [self addMenuItemsForRef:ref toMenu:menu]; +} + + +#pragma mark Remote controls + +enum { + kAddRemoteSegment = 0, + kFetchSegment, + kPullSegment, + kPushSegment +}; + +- (void) updateRemoteControls +{ + BOOL hasRemote = NO; + + PBGitRef *ref = [[self selectedItem] ref]; + if ([ref isRemote] || ([ref isBranch] && [[repository remoteRefForBranch:ref error:NULL] remoteName])) + hasRemote = YES; + + [remoteControls setEnabled:hasRemote forSegment:kFetchSegment]; + [remoteControls setEnabled:hasRemote forSegment:kPullSegment]; + [remoteControls setEnabled:hasRemote forSegment:kPushSegment]; +} + +- (IBAction) fetchPullPushAction:(id)sender +{ + NSInteger selectedSegment = [sender selectedSegment]; + + if (selectedSegment == kAddRemoteSegment) { + [PBAddRemoteSheet beginAddRemoteSheetForRepository:repository]; + return; + } + + NSInteger index = [sourceView selectedRow]; + PBSourceViewItem *item = [sourceView itemAtRow:index]; + PBGitRef *ref = [[item revSpecifier] ref]; + + if (!ref && (item.parent == remotes)) + ref = [PBGitRef refFromString:[kGitXRemoteRefPrefix stringByAppendingString:[item title]]]; + + if (![ref isRemote] && ![ref isBranch]) + return; + + PBGitRef *remoteRef = [repository remoteRefForBranch:ref error:NULL]; + if (!remoteRef) + return; + + if (selectedSegment == kFetchSegment) + [repository beginFetchFromRemoteForRef:ref]; + else if (selectedSegment == kPullSegment) + [repository beginPullFromRemote:remoteRef forRef:ref]; + else if (selectedSegment == kPushSegment) { + if ([ref isRemote]) + [historyViewController.refController showConfirmPushRefSheet:nil remote:remoteRef]; + else if ([ref isBranch]) + [historyViewController.refController showConfirmPushRefSheet:ref remote:remoteRef]; + } +} + + @end diff --git a/PBGitSidebarView.xib b/PBGitSidebarView.xib index 067b02a..cdf65f9 100644 --- a/PBGitSidebarView.xib +++ b/PBGitSidebarView.xib @@ -12,6 +12,7 @@ YES + @@ -199,6 +200,163 @@ NSView + + + 268 + + YES + + + 268 + {{52, 2}, {141, 25}} + + YES + + 67239424 + 0 + + LucidaGrande + 13 + 16 + + + + YES + + 33 + + NSImage + AddRemote + + + Add remote + 0 + + + 33 + + NSImage + FetchTemplate + + + Fetch from default remote + 1 + 0 + + + 33 + + NSImage + PullTemplate + + Pull from default remote + 2 + 0 + + + 33 + + NSImage + PushTemplate + + Push to default remote + 3 + 0 + + + 1 + 2 + 2 + + + + + 268 + {{9, 2}, {35, 25}} + + YES + + -2076049856 + 134219776 + + LucidaGrande + 13 + 1044 + + + -2034220801 + 163 + + + 400 + 75 + + + YES + Branch Action Menu + + 1048576 + 2147483647 + 1 + + NSImage + NSActionTemplate + + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + _popUpItemAction: + + + YES + + OtherViews + + YES + + + + Item 2 + + 1048576 + 2147483647 + + + _popUpItemAction: + + + + + Item 3 + + 1048576 + 2147483647 + + + _popUpItemAction: + + + + YES + + + YES + 1 + YES + YES + 2 + + + + {200, 31} + + NSView + @@ -235,6 +393,46 @@ 37 + + + sourceListControlsView + + + + 45 + + + + actionButton + + + + 46 + + + + remoteControls + + + + 49 + + + + fetchPullPushAction: + + + + 50 + + + + delegate + + + + 51 + @@ -271,6 +469,7 @@ + Source List View 8 @@ -316,6 +515,75 @@ + + 38 + + + YES + + + + + Source List Controls View + + + 39 + + + YES + + + + + + 40 + + + YES + + + + + + 41 + + + YES + + + + + + + + 42 + + + + + 43 + + + + + 44 + + + + + 47 + + + YES + + + + + + 48 + + + @@ -330,6 +598,17 @@ 16.IBPluginDependency 36.IBEditorWindowLastContentRect 36.IBPluginDependency + 38.IBEditorWindowLastContentRect + 38.IBPluginDependency + 39.IBPluginDependency + 40.IBPluginDependency + 41.IBPluginDependency + 42.IBPluginDependency + 43.IBPluginDependency + 44.IBPluginDependency + 47.IBPluginDependency + 48.IBPluginDependency + 48.IBSegmentedControlInspectorSelectedSegmentMetadataKey 8.IBEditorWindowLastContentRect 8.IBPluginDependency 9.IBPluginDependency @@ -344,6 +623,17 @@ com.apple.InterfaceBuilder.CocoaPlugin {{482, 590}, {153, 354}} com.apple.InterfaceBuilder.CocoaPlugin + {{626, 507}, {200, 31}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{105, 545}, {153, 354}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -365,7 +655,7 @@ - 37 + 51 @@ -380,15 +670,25 @@ PBGitSidebarController PBViewController + + fetchPullPushAction: + id + YES YES + actionButton + remoteControls + sourceListControlsView sourceView window YES + NSPopUpButton + NSSegmentedControl + NSView NSOutlineView NSWindow @@ -476,6 +776,22 @@ AppKit.framework/Headers/NSUserInterfaceItemSearching.h + + NSButton + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSButton.h + + + + NSButtonCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSButtonCell.h + + NSCell NSObject @@ -508,6 +824,22 @@ AppKit.framework/Headers/NSMenu.h + + NSMenuItem + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItem.h + + + + NSMenuItemCell + NSButtonCell + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItemCell.h + + NSObject @@ -841,6 +1173,22 @@ NSTableView + + NSPopUpButton + NSButton + + IBFrameworkSource + AppKit.framework/Headers/NSPopUpButton.h + + + + NSPopUpButtonCell + NSMenuItemCell + + IBFrameworkSource + AppKit.framework/Headers/NSPopUpButtonCell.h + + NSResponder @@ -872,6 +1220,22 @@ AppKit.framework/Headers/NSScroller.h + + NSSegmentedCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSSegmentedCell.h + + + + NSSegmentedControl + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSSegmentedControl.h + + NSTableColumn NSObject @@ -902,10 +1266,7 @@ NSView - - IBFrameworkSource - AppKit.framework/Headers/NSMenuItem.h - + NSView @@ -972,5 +1333,9 @@ YES GitX.xcodeproj 3 + + NSActionTemplate + {15, 15} + diff --git a/PBGitWindowController.h b/PBGitWindowController.h index e31d9dc..223dc6d 100644 --- a/PBGitWindowController.h +++ b/PBGitWindowController.h @@ -17,10 +17,14 @@ PBViewController *contentController; PBGitSidebarController *sidebarController; + IBOutlet NSView *sourceListControlsView; IBOutlet NSSplitView *splitView; IBOutlet NSView *sourceSplitView; IBOutlet NSView *contentSplitView; + IBOutlet NSTextField *statusField; + IBOutlet NSProgressIndicator *progressIndicator; + PBViewController* viewController; } diff --git a/PBGitWindowController.m b/PBGitWindowController.m index 3d6c49b..71e279e 100644 --- a/PBGitWindowController.m +++ b/PBGitWindowController.m @@ -47,10 +47,16 @@ - (void) awakeFromNib { [[self window] setDelegate:self]; + [[self window] setAutorecalculatesContentBorderThickness:NO forEdge:NSMinYEdge]; + [[self window] setContentBorderThickness:31.0f forEdge:NSMinYEdge]; sidebarController = [[PBGitSidebarController alloc] initWithRepository:repository superController:self]; [[sidebarController view] setFrame:[sourceSplitView bounds]]; [sourceSplitView addSubview:[sidebarController view]]; + [sourceListControlsView addSubview:sidebarController.sourceListControlsView]; + + [[statusField cell] setBackgroundStyle:NSBackgroundStyleRaised]; + [progressIndicator setUsesThreadedAnimation:YES]; [self showWindow:nil]; } @@ -67,6 +73,9 @@ if (!controller || (contentController == controller)) return; + if (contentController) + [contentController removeObserver:self forKeyPath:@"status"]; + [self removeAllContentSubViews]; contentController = controller; @@ -77,6 +86,7 @@ [self setNextResponder: contentController]; [[self window] makeFirstResponder:[contentController firstResponder]]; [contentController updateView]; + [contentController addObserver:self forKeyPath:@"status" options:NSKeyValueObservingOptionInitial context:@"statusChange"]; } - (void) showCommitView:(id)sender @@ -135,6 +145,39 @@ [PBCloneRepsitoryToSheet beginCloneRepsitoryToSheetForRepository:repository]; } +- (void) updateStatus +{ + NSString *status = contentController.status; + BOOL isBusy = contentController.isBusy; + + if (!status) { + status = @""; + isBusy = NO; + } + + [statusField setStringValue:status]; + + if (isBusy) { + [progressIndicator startAnimation:self]; + [progressIndicator setHidden:NO]; + } + else { + [progressIndicator stopAnimation:self]; + [progressIndicator setHidden:YES]; + } +} + +- (void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context +{ + if ([(NSString *)context isEqualToString:@"statusChange"]) { + [self updateStatus]; + return; + } + + [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; +} + + #pragma mark - #pragma mark SplitView Delegates diff --git a/PBRefController.h b/PBRefController.h index 29ea030..3794d51 100644 --- a/PBRefController.h +++ b/PBRefController.h @@ -28,6 +28,7 @@ - (void) pushUpdatesToRemote:(PBRefMenuItem *)sender; - (void) pushDefaultRemoteForRef:(PBRefMenuItem *)sender; - (void) pushToRemote:(PBRefMenuItem *)sender; +- (void) showConfirmPushRefSheet:(PBGitRef *)ref remote:(PBGitRef *)remoteRef; - (void) checkout:(PBRefMenuItem *)sender; - (void) merge:(PBRefMenuItem *)sender; diff --git a/PBViewController.h b/PBViewController.h index 4d56efa..56dfbf1 100644 --- a/PBViewController.h +++ b/PBViewController.h @@ -13,9 +13,14 @@ @interface PBViewController : NSViewController { __weak PBGitRepository *repository; __weak PBGitWindowController *superController; + + NSString *status; + BOOL isBusy; } @property (readonly) __weak PBGitRepository *repository; +@property(copy) NSString *status; +@property(assign) BOOL isBusy; - (id)initWithRepository:(PBGitRepository *)theRepository superController:(PBGitWindowController *)controller; - (void) removeView; diff --git a/PBViewController.m b/PBViewController.m index c1ee021..901bbb3 100644 --- a/PBViewController.m +++ b/PBViewController.m @@ -12,6 +12,8 @@ @implementation PBViewController @synthesize repository; +@synthesize status; +@synthesize isBusy; - (id)initWithRepository:(PBGitRepository *)theRepository superController:(PBGitWindowController *)controller { From ad3ea443ca7af71078fc21925485719cd8191f75 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Tue, 23 Feb 2010 17:21:27 -0700 Subject: [PATCH 57/90] Add items to the History view's upper toolbar - add Create Branch and Create Tag buttons - icons are modified versions of Kim Does's icons (from ca7816b523) made a bit smaller to fit in the buttons better - add Merge, Cherry Pick, and Rebase buttons - icons by Nathan Kinsinger --- GitX.xcodeproj/project.pbxproj | 12 ++ Images/AddBranchTemplate.png | Bin 2883 -> 2845 bytes Images/AddLabelTemplate.png | Bin 2902 -> 2864 bytes Images/CherryPickTemplate.png | Bin 0 -> 200 bytes Images/MergeTemplate.png | Bin 0 -> 199 bytes Images/RebaseTemplate.png | Bin 0 -> 205 bytes PBGitHistoryController.h | 8 + PBGitHistoryController.m | 28 ++- PBGitHistoryView.xib | 382 ++++++++++++++++++++++++++++++++- 9 files changed, 425 insertions(+), 5 deletions(-) create mode 100644 Images/CherryPickTemplate.png create mode 100644 Images/MergeTemplate.png create mode 100644 Images/RebaseTemplate.png diff --git a/GitX.xcodeproj/project.pbxproj b/GitX.xcodeproj/project.pbxproj index fa3c9fd..e117e66 100644 --- a/GitX.xcodeproj/project.pbxproj +++ b/GitX.xcodeproj/project.pbxproj @@ -64,6 +64,9 @@ D85B939310E3D8B4007F3C28 /* PBCreateBranchSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = D85B939210E3D8B4007F3C28 /* PBCreateBranchSheet.xib */; }; D889EB3110E6BCBB00F08413 /* PBCreateTagSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = D889EB3010E6BCBB00F08413 /* PBCreateTagSheet.xib */; }; D8A4BB6F11337D5C00E92D51 /* PBGitGradientBarView.m in Sources */ = {isa = PBXBuildFile; fileRef = D8A4BB6E11337D5C00E92D51 /* PBGitGradientBarView.m */; }; + D8A4BD071134AD2900E92D51 /* CherryPickTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = D8A4BD041134AD2900E92D51 /* CherryPickTemplate.png */; }; + D8A4BD081134AD2900E92D51 /* MergeTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = D8A4BD051134AD2900E92D51 /* MergeTemplate.png */; }; + D8A4BD091134AD2900E92D51 /* RebaseTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = D8A4BD061134AD2900E92D51 /* RebaseTemplate.png */; }; D8E3B2B810DC9FB2001096A3 /* ScriptingBridge.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D8E3B2B710DC9FB2001096A3 /* ScriptingBridge.framework */; }; D8E3B34D10DCA958001096A3 /* PBCreateTagSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = D8E3B34C10DCA958001096A3 /* PBCreateTagSheet.m */; }; D8FDD9F711432A12005647F6 /* PBCloneRepositoryPanel.xib in Resources */ = {isa = PBXBuildFile; fileRef = D8FDD9F511432A12005647F6 /* PBCloneRepositoryPanel.xib */; }; @@ -271,6 +274,9 @@ D85B93F610E51279007F3C28 /* PBGitRefish.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitRefish.h; sourceTree = ""; }; D8A4BB6D11337D5C00E92D51 /* PBGitGradientBarView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitGradientBarView.h; sourceTree = ""; }; D8A4BB6E11337D5C00E92D51 /* PBGitGradientBarView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitGradientBarView.m; sourceTree = ""; }; + D8A4BD041134AD2900E92D51 /* CherryPickTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = CherryPickTemplate.png; path = Images/CherryPickTemplate.png; sourceTree = ""; }; + D8A4BD051134AD2900E92D51 /* MergeTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = MergeTemplate.png; path = Images/MergeTemplate.png; sourceTree = ""; }; + D8A4BD061134AD2900E92D51 /* RebaseTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = RebaseTemplate.png; path = Images/RebaseTemplate.png; sourceTree = ""; }; D8C1B77210E875CF009B7F8B /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/PBRemoteProgressSheet.xib; sourceTree = ""; }; D8E3B2B710DC9FB2001096A3 /* ScriptingBridge.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ScriptingBridge.framework; path = /System/Library/Frameworks/ScriptingBridge.framework; sourceTree = ""; }; D8E3B34B10DCA958001096A3 /* PBCreateTagSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCreateTagSheet.h; sourceTree = ""; }; @@ -520,6 +526,9 @@ D828A5F01128AE7200F09D11 /* PullTemplate.png */, D828A5F11128AE7200F09D11 /* PushTemplate.png */, 3BC07F4A0ED5A5C5009A7768 /* HistoryViewTemplate.png */, + D8A4BD041134AD2900E92D51 /* CherryPickTemplate.png */, + D8A4BD051134AD2900E92D51 /* MergeTemplate.png */, + D8A4BD061134AD2900E92D51 /* RebaseTemplate.png */, 3BC07F4B0ED5A5C5009A7768 /* CommitViewTemplate.png */, F56ADDD70ED19F9E002AC78F /* AddBranchTemplate.png */, F56ADDD80ED19F9E002AC78F /* AddLabelTemplate.png */, @@ -1009,6 +1018,9 @@ D828A5F31128AE7200F09D11 /* PullTemplate.png in Resources */, D828A5F41128AE7200F09D11 /* PushTemplate.png in Resources */, D8FDDBF41143F318005647F6 /* AddRemote.png in Resources */, + D8A4BD071134AD2900E92D51 /* CherryPickTemplate.png in Resources */, + D8A4BD081134AD2900E92D51 /* MergeTemplate.png in Resources */, + D8A4BD091134AD2900E92D51 /* RebaseTemplate.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Images/AddBranchTemplate.png b/Images/AddBranchTemplate.png index bd58596acd06e34e9e9ed7d9d06373b0cb9a8753..03161a083f991349ecea12f0012f75d6ed32acd7 100644 GIT binary patch literal 2845 zcmV+&3*z*NP)X+uL$Nkc;* zP;zf(X>4Tx0C)kNmUmQB*%pV-y*Itk5+Wca^cs2zAksTX6$DXM^`x7XQc?|s+0 z08spb1j2M!0f022SQPH-!CVp(%f$Br7!UytSOLJ{W@ZFO_(THK{JlMynW#v{v-a*T zfMmPdEWc1DbJqWVks>!kBnAKqMb$PuekK>?0+ds;#ThdH1j_W4DKdsJG8Ul;qO2n0 z#IJ1jr{*iW$(WZWsE0n`c;fQ!l&-AnmjxZO1uWyz`0VP>&nP`#itsL#`S=Q!g`M=rU9)45( zJ;-|dRq-b5&z?byo>|{)?5r=n76A4nTALlSzLiw~v~31J<>9PP?;rs31pu_(obw)r zY+jPY;tVGXi|p)da{-@gE-UCa`=5eu%D;v=_nFJ?`&K)q7e9d`Nfk3?MdhZarb|T3 z%nS~f&t(1g5dY)AIcd$w!z`Siz!&j_=v7hZlnI21XuE|xfmo0(WD10T)!}~_HYW!e zew}L+XmwuzeT6w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F} z0001PNkl91?FfR$iYlBLV| h=I=TH009600|5RWkoEY$lYamJ002ovPDHLkV1kXKV)6h0 diff --git a/Images/AddLabelTemplate.png b/Images/AddLabelTemplate.png index 58237113c20d4421d4fd637ac09aee3349d4a180..085e760015dcc5c08ee6932209c3771731147eb7 100644 GIT binary patch literal 2864 zcmV-03(xe4P)X+uL$Nkc;* zP;zf(X>4Tx0C)kNmUmQB*%pV-y*Itk5+Wca^cs2zAksTX6$DXM^`x7XQc?|s+0 z08spb1j2M!0f022SQPH-!CVp(%f$Br7!UytSOLJ{W@ZFO_(THK{JlMynW#v{v-a*T zfMmPdEWc1DbJqWVks>!kBnAKqMb$PuekK>?0+ds;#ThdH1j_W4DKdsJG8Ul;qO2n0 z#IJ1jr{*iW$(WZWsE0n`c;fQ!l&-AnmjxZO1uWyz`0VP>&nP`#itsL#`S=Q!g`M=rU9)45( zJ;-|dRq-b5&z?byo>|{)?5r=n76A4nTALlSzLiw~v~31J<>9PP?;rs31pu_(obw)r zY+jPY;tVGXi|p)da{-@gE-UCa`=5eu%D;v=_nFJ?`&K)q7e9d`Nfk3?MdhZarb|T3 z%nS~f&t(1g5dY)AIcd$w!z`Siz!&j_=v7hZlnI21XuE|xfmo0(WD10T)!}~_HYW!e zew}L+XmwuzeT6wtxJd`dZ#@7*BLgIEKY9Xv>st^p3dp{^Xswa2bB{85{^$B13tWnB z;Y>jyQ|9&zk7RNsqAVGs--K+z0uqo1bf5|}fi5rtEMN^BfHQCd-XH*kfJhJnmIE$G z0%<@5vOzxB0181d*a3EfYH$G5fqKvcPJ%XY23!PJzzuK<41h;K3WmW;Fah3yX$XSw z5EY_9s*o0>51B&N5F1(uc|$=^I1~fLLy3?Ol0f;;Ca4%HgQ}rJP(Ab`bQ-z{U4#0d z2hboi2K@njgb|nm(_szR0JebHusa+GN5aeCM0gdP2N%HG;Yzp`J`T6S7vUT504#-H z!jlL<$Or?`Mpy_N@kBz9SR?@vA#0H$qyni$nvf2p8@Y{0k#Xb$28W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>)hAvT~AmqS>Lr``i7kw zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z0001iNklEaloA-Z%zAYX$5kMrE}um8*iZXP#|ZS+{wsVV!Gx%b+wkIyaBpLX0>#>a5##T$mX zq7Bn8ovzNDSo*_0z~g?m`HjR^Gp9>GnIPa*u#`DL>`B;)G&{z)B6|jo1^+bPaW@Es u9|?B4>95PcKV$#a6T29SJUCT%Tw>3+uxa$)!}kd22nJ7AKbLh*2~7aUCr6+F literal 0 HcmV?d00001 diff --git a/Images/RebaseTemplate.png b/Images/RebaseTemplate.png new file mode 100644 index 0000000000000000000000000000000000000000..87d8390b37044ade715e0029c8f028294ab27343 GIT binary patch literal 205 zcmeAS@N?(olHy`uVBq!ia0vp^0w6XA8<1SE`<)7q;wABk(Zz-%v zG~(QuF!4f2?ei< literal 0 HcmV?d00001 diff --git a/PBGitHistoryController.h b/PBGitHistoryController.h index 1d059c3..2ace6c5 100644 --- a/PBGitHistoryController.h +++ b/PBGitHistoryController.h @@ -24,7 +24,12 @@ IBOutlet NSOutlineView* fileBrowser; IBOutlet NSTableView* commitList; IBOutlet PBCollapsibleSplitView *historySplitView; + IBOutlet PBGitGradientBarView *upperToolbarView; + IBOutlet NSButton *mergeButton; + IBOutlet NSButton *cherryPickButton; + IBOutlet NSButton *rebaseButton; + IBOutlet PBGitGradientBarView *scopeBarView; IBOutlet id webView; @@ -63,6 +68,9 @@ - (IBAction) createBranch:(id)sender; - (IBAction) createTag:(id)sender; - (IBAction) showAddRemoteSheet:(id)sender; +- (IBAction) merge:(id)sender; +- (IBAction) cherryPick:(id)sender; +- (IBAction) rebase:(id)sender; - (void) copyCommitInfo; diff --git a/PBGitHistoryController.m b/PBGitHistoryController.m index 3157f3d..79b77c3 100644 --- a/PBGitHistoryController.m +++ b/PBGitHistoryController.m @@ -80,7 +80,12 @@ case 0: self.webCommit = realCommit; break; case 1: self.gitTree = realCommit.tree; break; } -} + + BOOL isOnHeadBranch = [realCommit isOnHeadBranch]; + [mergeButton setEnabled:!isOnHeadBranch]; + [cherryPickButton setEnabled:!isOnHeadBranch]; + [rebaseButton setEnabled:!isOnHeadBranch]; +} - (void) setSelectedTab: (int) number @@ -379,4 +384,25 @@ [PBAddRemoteSheet beginAddRemoteSheetForRepository:self.repository]; } +- (IBAction) merge:(id)sender +{ + if (realCommit) + [repository mergeWithRefish:realCommit]; +} + +- (IBAction) cherryPick:(id)sender +{ + if (realCommit) + [repository cherryPickRefish:realCommit]; +} + +- (IBAction) rebase:(id)sender +{ + if (realCommit) { + PBGitRef *headRef = [[repository headRef] ref]; + [repository rebaseBranch:headRef onRefish:realCommit]; + } +} + + @end diff --git a/PBGitHistoryView.xib b/PBGitHistoryView.xib index 6a67914..56e35fd 100644 --- a/PBGitHistoryView.xib +++ b/PBGitHistoryView.xib @@ -21,7 +21,7 @@ YES - + YES @@ -217,6 +217,136 @@ 266 YES + + + 269 + + YES + + + 268 + {{110, 3}, {37, 25}} + + YES + + -2080244224 + 134217728 + Rebase + + + -2033958657 + 163 + + NSImage + RebaseTemplate + + + + 400 + 75 + + + + + 268 + {{65, 3}, {37, 25}} + + YES + + -2080244224 + 134217728 + Cherry Pick + + + -2033958657 + 163 + + NSImage + CherryPickTemplate + + + + 400 + 75 + + + + + 268 + {{20, 3}, {37, 25}} + + YES + + -2080244224 + 134217728 + Merge + + + -2033958657 + 163 + + NSImage + MergeTemplate + + + + 400 + 75 + + + + {{342, 0}, {167, 30}} + + NSView + + + + 268 + {{55, 3}, {37, 25}} + + YES + + -2080244224 + 134217728 + Create Tag + + + -2033958657 + 163 + + NSImage + AddLabelTemplate + + + + 400 + 75 + + + + + 268 + {{10, 3}, {37, 25}} + + YES + + -2080244224 + 134217728 + Create Branch + + + -2033958657 + 163 + + NSImage + AddBranchTemplate + + + + 400 + 75 + + 10 @@ -1615,6 +1745,70 @@ 329 + + + createTag: + + + + 334 + + + + createBranch: + + + + 335 + + + + merge: + + + + 349 + + + + cherryPick: + + + + 350 + + + + rebase: + + + + 351 + + + + mergeButton + + + + 352 + + + + cherryPickButton + + + + 353 + + + + rebaseButton + + + + 354 + @@ -2017,6 +2211,9 @@ YES + + + History Upper Toolbar @@ -2031,6 +2228,87 @@ + + 330 + + + YES + + + + + + 331 + + + + + 332 + + + YES + + + + + + 333 + + + + + 336 + + + YES + + + + + + + + 337 + + + YES + + + + + + 338 + + + + + 340 + + + YES + + + + + + 341 + + + + + 343 + + + YES + + + + + + 344 + + + @@ -2089,7 +2367,23 @@ 32.ImportedFromIB2 327.IBPluginDependency 33.IBPluginDependency + 330.IBAttributePlaceholdersKey + 330.IBPluginDependency + 331.IBPluginDependency + 332.IBAttributePlaceholdersKey + 332.IBPluginDependency + 333.IBPluginDependency + 336.IBPluginDependency + 337.IBAttributePlaceholdersKey + 337.IBPluginDependency + 338.IBPluginDependency 34.IBPluginDependency + 340.IBAttributePlaceholdersKey + 340.IBPluginDependency + 341.IBPluginDependency + 343.IBAttributePlaceholdersKey + 343.IBPluginDependency + 344.IBPluginDependency 35.CustomClassName 35.IBPluginDependency 35.ImportedFromIB2 @@ -2171,6 +2465,57 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + Create Branch + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + Create Tag + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + Merge + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + Cherry Pick + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + Rebase + + + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin PBGitRevisionCell com.apple.InterfaceBuilder.CocoaPlugin @@ -2216,7 +2561,7 @@ - 329 + 354 @@ -2282,10 +2627,13 @@ YES YES + cherryPick: createBranch: createTag: + merge: openFilesAction: openSelectedFile: + rebase: refresh: setDetailedView: setRawView: @@ -2309,16 +2657,22 @@ id id id + id + id + id YES YES + cherryPickButton commitController commitList fileBrowser historySplitView + mergeButton + rebaseButton refController scopeBarView searchField @@ -2328,10 +2682,13 @@ YES + NSButton NSArrayController NSTableView NSOutlineView PBCollapsibleSplitView + NSButton + NSButton PBRefController PBGitGradientBarView NSSearchField @@ -3275,8 +3632,25 @@ GitX.xcodeproj 3 - NSQuickLookTemplate - {19, 11} + YES + + YES + AddBranchTemplate + AddLabelTemplate + CherryPickTemplate + MergeTemplate + NSQuickLookTemplate + RebaseTemplate + + + YES + {20, 12} + {23, 12} + {18.5143, 12.3429} + {16.4571, 12.3429} + {19, 11} + {16.4571, 13.3714} + From 446dd540da26c2a8f892da5a3fd66764a3cc2987 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sun, 7 Mar 2010 12:07:39 -0700 Subject: [PATCH 58/90] Add Terminal, Reveal and Clone To to the toolbar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The clone icon is by André Berg (in 4396081c07) --- English.lproj/RepositoryWindow.xib | 213 +++++++++++++++++++- GitX.xcodeproj/project.pbxproj | 4 + Images/CloneRepositoryFireworksTemplate.png | Bin 0 -> 63567 bytes Images/CloneRepositoryTemplate.png | Bin 0 -> 268 bytes PBGitWindowController.h | 3 + PBGitWindowController.m | 6 + 6 files changed, 220 insertions(+), 6 deletions(-) create mode 100644 Images/CloneRepositoryFireworksTemplate.png create mode 100644 Images/CloneRepositoryTemplate.png diff --git a/English.lproj/RepositoryWindow.xib b/English.lproj/RepositoryWindow.xib index 2d9e00a..6145f41 100644 --- a/English.lproj/RepositoryWindow.xib +++ b/English.lproj/RepositoryWindow.xib @@ -50,7 +50,7 @@ A66F2540-5B64-4016-89F7-892563371FAF - NO + YES YES YES YES @@ -60,12 +60,99 @@ YES YES + 41FA1145-D953-446F-B6DF-0230885AB433 + 7A8FEE7B-B273-4AF3-8A22-53A9DAF786FA + FF15EAEC-D5AB-4C6F-9E13-4B62C6692BFC NSToolbarFlexibleSpaceItem NSToolbarSeparatorItem NSToolbarSpaceItem YES + + + 41FA1145-D953-446F-B6DF-0230885AB433 + + Terminal + Open in Terminal + + + + + + {0, 0} + {0, 0} + YES + YES + -1 + YES + 0 + + + + 7A8FEE7B-B273-4AF3-8A22-53A9DAF786FA + + Clone To + Clone Repository To + + + + 268 + {{38, 14}, {40, 25}} + + YES + + -2080244224 + 134217728 + Round Textured + + LucidaGrande + 13 + 1044 + + + -2033958657 + 163 + + NSImage + CloneRepositoryTemplate + + + + 400 + 75 + + + + + + {40, 25} + {40, 25} + YES + YES + 0 + YES + 0 + + + + FF15EAEC-D5AB-4C6F-9E13-4B62C6692BFC + + Reveal + Reveal in Finder + + + + + + {0, 0} + {0, 0} + YES + YES + -1 + YES + 0 + NSToolbarFlexibleSpaceItem @@ -157,12 +244,18 @@ YES + + + YES + + + YES @@ -268,7 +361,7 @@ {{0, 0}, {1440, 878}} - {213, 129} + {213, 185} {1.79769e+308, 1.79769e+308} GitX 31 @@ -341,6 +434,46 @@ 401 + + + terminalItem + + + + 404 + + + + finderItem + + + + 405 + + + + openInTerminal: + + + + 406 + + + + revealInFinder: + + + + 407 + + + + cloneTo: + + + + 414 + @@ -424,6 +557,9 @@ + + + @@ -478,6 +614,39 @@ + + 402 + + + + + 403 + + + + + 412 + + + YES + + + + + + 410 + + + YES + + + + + + 411 + + + @@ -505,15 +674,19 @@ 397.IBPluginDependency 398.IBPluginDependency 399.IBPluginDependency + 402.IBPluginDependency + 403.IBPluginDependency + 410.IBPluginDependency + 411.IBPluginDependency 5.IBPluginDependency 5.ImportedFromIB2 YES com.apple.InterfaceBuilder.CocoaPlugin - {{484, 718}, {890, 514}} + {{484, 662}, {890, 514}} com.apple.InterfaceBuilder.CocoaPlugin - {{484, 718}, {890, 514}} + {{484, 662}, {890, 514}} {{15, 196}, {850, 418}} @@ -524,7 +697,11 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{621, 1214}, {616, 0}} + {{621, 1007}, {616, 169}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -551,7 +728,7 @@ - 401 + 414 @@ -583,20 +760,24 @@ YES contentSplitView + finderItem progressIndicator sourceListControlsView sourceSplitView splitView statusField + terminalItem YES NSView + NSToolbarItem NSProgressIndicator NSView NSView NSSplitView NSTextField + NSToolbarItem @@ -666,6 +847,22 @@ AppKit.framework/Headers/NSUserInterfaceItemSearching.h + + NSButton + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSButton.h + + + + NSButtonCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSButtonCell.h + + NSCell NSObject @@ -1165,5 +1362,9 @@ YES ../GitX.xcodeproj 3 + + CloneRepositoryTemplate + {26, 15} + diff --git a/GitX.xcodeproj/project.pbxproj b/GitX.xcodeproj/project.pbxproj index e117e66..6965f59 100644 --- a/GitX.xcodeproj/project.pbxproj +++ b/GitX.xcodeproj/project.pbxproj @@ -55,6 +55,7 @@ D828A5F21128AE7200F09D11 /* FetchTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = D828A5EF1128AE7200F09D11 /* FetchTemplate.png */; }; D828A5F31128AE7200F09D11 /* PullTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = D828A5F01128AE7200F09D11 /* PullTemplate.png */; }; D828A5F41128AE7200F09D11 /* PushTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = D828A5F11128AE7200F09D11 /* PushTemplate.png */; }; + D828AEEC112F411100F09D11 /* CloneRepositoryTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = D828AEEB112F411100F09D11 /* CloneRepositoryTemplate.png */; }; D8357535112640F100DE249D /* PBRemoteProgressSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = D8C1B77110E875CF009B7F8B /* PBRemoteProgressSheet.xib */; }; D854948610D5C01B0083B917 /* PBCreateBranchSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = D854948510D5C01B0083B917 /* PBCreateBranchSheet.m */; }; D85810551127476E007F254B /* StageView.png in Resources */ = {isa = PBXBuildFile; fileRef = D85810541127476E007F254B /* StageView.png */; }; @@ -264,6 +265,7 @@ D828A5EF1128AE7200F09D11 /* FetchTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = FetchTemplate.png; path = Images/FetchTemplate.png; sourceTree = ""; }; D828A5F01128AE7200F09D11 /* PullTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = PullTemplate.png; path = Images/PullTemplate.png; sourceTree = ""; }; D828A5F11128AE7200F09D11 /* PushTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = PushTemplate.png; path = Images/PushTemplate.png; sourceTree = ""; }; + D828AEEB112F411100F09D11 /* CloneRepositoryTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = CloneRepositoryTemplate.png; path = Images/CloneRepositoryTemplate.png; sourceTree = ""; }; D854948410D5C01B0083B917 /* PBCreateBranchSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCreateBranchSheet.h; sourceTree = ""; }; D854948510D5C01B0083B917 /* PBCreateBranchSheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCreateBranchSheet.m; sourceTree = ""; }; D854949310D5C3E20083B917 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/PBCreateBranchSheet.xib; sourceTree = ""; }; @@ -525,6 +527,7 @@ D828A5EF1128AE7200F09D11 /* FetchTemplate.png */, D828A5F01128AE7200F09D11 /* PullTemplate.png */, D828A5F11128AE7200F09D11 /* PushTemplate.png */, + D828AEEB112F411100F09D11 /* CloneRepositoryTemplate.png */, 3BC07F4A0ED5A5C5009A7768 /* HistoryViewTemplate.png */, D8A4BD041134AD2900E92D51 /* CherryPickTemplate.png */, D8A4BD051134AD2900E92D51 /* MergeTemplate.png */, @@ -1021,6 +1024,7 @@ D8A4BD071134AD2900E92D51 /* CherryPickTemplate.png in Resources */, D8A4BD081134AD2900E92D51 /* MergeTemplate.png in Resources */, D8A4BD091134AD2900E92D51 /* RebaseTemplate.png in Resources */, + D828AEEC112F411100F09D11 /* CloneRepositoryTemplate.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Images/CloneRepositoryFireworksTemplate.png b/Images/CloneRepositoryFireworksTemplate.png new file mode 100644 index 0000000000000000000000000000000000000000..e6b5085ed82fd7988acec2ffdce0d30277f2662e GIT binary patch literal 63567 zcmbTdV~{94v^F|6_Sm*<+qP}nwr$(mW81cE+p}lBdCzxG)vdb!ZdcZNlJv@xba%Rv zN>(D|WyN5jFrfed0AMA=g%y7h^H<;@z<%|I!tTj0fH(y3)WXrk&Cb!v313Kw8SL+3{;wVS ze|AESCI-$HcDDG+7B(gTOboOP^t6oh^c-3DmruVo#`cb?YVO(B3k|UT_<#5n>;cjY z7)YG~(j0&libN@_2^eleivFo>b;(MN5u_<9N&*4^yfxha*YJGStB#Yy$BrkxC$85` zI)&#rD(>Dj%eeg{U#E``p3h&C|G8RWxpE+nEBxK9ev{%hR)V4*I}_i(aghIe|NpdK#2P&j}@00AKUiknoKanw!;AP`^nxBcuO;Jd4^{?RP6 zr1R%#>ql!xSDzr(qH%*8`uEw#ODr~lC=cc=n_5};RkoQE4xTS}M(y3U{gd(W;}0;< ztnqngAEfrI@uzc^9&Yv#j_Q3gCSIO@?o8;1d|}{ex3->sH`88GJG0#ab}L@1oi{YB zWT$3tU%=kqEWAG;d48K(FSyUL_sgr@%chK7=}FS?GX%H5+QxP$c3^`^msoyG?1LtH z`@l=a^gMxCr9_G${ZEkISlJ7M@b>K7W*FEpd!I*$H#o3+o8~}aPM(gOBd@fqK~kRg zi6_1sCGZ?Y@AHG>fE33Z6e*1uy7-FO`yo<)F?8MS(f5;RdE1`$5(Y;Avh1MNq&@9C z@$TA9?3T4yMIg3)g4>>?8E7weK1mmXR(x&V1z_g|TB-OjIAM>)M#e+~U8CoLL+1fU zPH999{eOJ>%)9l~|794Y7^sK9QMke7&Xv9OxzO-7(Cr;Uyt&tg&;2#PbD|KW6&Wjo zctmP$4C!T-_t$Vz1*QguhqD1-HF<{g_-l>DDV#9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pq5&J7cDs_1!DhXQ$V=68d4i*k(LpB~xDsD~|PHuKyPHrYD4mLJERyJN%4i08^ zJ^?l^0S+Fje>`YJ&>yyh9E?l^R3xSUk>SHTVHz_hCp!UFR##V77FSLdTL)8Cc7A?- zRyK~m!aOLL9o=o5^xc?k9BKa^+B>=T zOGhe+k6c2m|5^0!T>qWkSW@4~Smc2UKQlWUGbj5eHa>v|Fx)(v{~`U~MgJ+eyseSB ziTi&}&dw&l!7aeS_mAZNLG+L0Lacv*_zz(IM*Xik{ipr^U%-qE|HaGB*}>{>hsDT{ z)!53|+Sta)@qrop|C^bSp@504gSEbsh`F`CsWGdajj0gpzjywZ<@3|5w8QJ?K*=kAnMz>j~GR2s}#sj~GR2s}#ssYRL iRE_1%gcrTU-hhdSZ-*Vf#QinlS!Kq*#ibJVQ8upoSx*1IXtr@Q5sC zVBi)4Va7{$>;3=*WlCHlN`mv#O3D+9QW+dm@{>{(+%k(&%kzt}ixr%MP1rVFUI0`l z0aE8&l$uzQnV+W+l9`*zU~H&oXrO0gU|>1>jv*GkcPDS;Z7>jE{@cNN zqu%4j1C0q298?bJ1wDB+N9MWxQtmHHt}xtl{~tK1ESzbZ%87kS7jo_-6}C=UG11ES z57PyymOJ}|=b2f>DDrNS+{W{Go8Hftp{d@VZSU4Nsy`PK|9!SNVIt5r22WQ%mvv4F FO#nW Date: Sat, 13 Mar 2010 16:09:45 -0700 Subject: [PATCH 59/90] Set the minimum size of the window to 600x450 --- English.lproj/RepositoryWindow.xib | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/English.lproj/RepositoryWindow.xib b/English.lproj/RepositoryWindow.xib index 6145f41..1a8cb07 100644 --- a/English.lproj/RepositoryWindow.xib +++ b/English.lproj/RepositoryWindow.xib @@ -12,7 +12,7 @@ YES - + YES @@ -96,10 +96,9 @@ Clone Repository To - + 268 {{38, 14}, {40, 25}} - YES -2080244224 @@ -262,7 +261,7 @@ {1.79769e+308, 1.79769e+308} - {213, 107} + {600, 450} 274 @@ -361,7 +360,7 @@ {{0, 0}, {1440, 878}} - {213, 185} + {600, 528} {1.79769e+308, 1.79769e+308} GitX 31 @@ -678,6 +677,7 @@ 403.IBPluginDependency 410.IBPluginDependency 411.IBPluginDependency + 412.IBPluginDependency 5.IBPluginDependency 5.ImportedFromIB2 @@ -693,7 +693,7 @@ {3.40282e+38, 3.40282e+38} - {213, 107} + {600, 450} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -709,6 +709,7 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin From b557d6b5c6e675216d340d20833f39d0096b7ccc Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Thu, 18 Feb 2010 22:04:01 -0700 Subject: [PATCH 60/90] Clean up the commit header - make the "Gist it" button a Mac OS X style button - remove the default name from each field - move the author's gravatar and include the committer's - move the gravatar to the left of the author's name - add a gravatar for the committer - move the author and commiter info to it's own table to allow for putting the gravatar image in a center column - setGravatar() now uses the email address passed in --- html/views/history/history.css | 39 +++++++++++++--------------- html/views/history/history.js | 11 ++++---- html/views/history/index.html | 46 ++++++++++++++++++++-------------- 3 files changed, 51 insertions(+), 45 deletions(-) diff --git a/html/views/history/history.css b/html/views/history/history.css index 1bd9629..1bf0a20 100644 --- a/html/views/history/history.css +++ b/html/views/history/history.css @@ -5,10 +5,12 @@ body { #commit_header { width: 100%; font-size: 12px; + padding-left: 5px; + padding-right: 5px; } -#commit_header td { - padding-left: 5px; +#authorTable { + margin: -4px; } #rightcontent { @@ -20,33 +22,28 @@ body { float: left; } -a.servicebutton{ - display: block; +#gist { + -webkit-appearance: button; + font: 13px bold 'Lucida Grande'; width: 80px; - padding: 2px; - margin-bottom: 4px; - - border: 1px solid #3465a4; - background-color: #cce5ff; - color: #204a87; - - font-size: 65%; - text-decoration: none; - text-align: center; - - -webkit-border-radius: 2px; + height: 23px; + margin-right: 5px; } -#gravatar { - margin-left: 5px; - padding: 2px; - width: 60px; - height: 60px; +.gravatar { + padding: 0.1em; border: solid gray 1px; -webkit-border-radius: 2px; } +.gravatar img { + width: 2.9em; + height: 2.9em; + max-height: 60px; + max-width: 60px; +} + .property_name { width: 6em; color:#7F7F7F; diff --git a/html/views/history/history.js b/html/views/history/history.js index 6cd7540..f724a5c 100644 --- a/html/views/history/history.js +++ b/html/views/history/history.js @@ -136,7 +136,7 @@ var setGravatar = function(email, image) { } image.src = "http://www.gravatar.com/avatar/" + - hex_md5(commit.author_email.toLowerCase().replace(/ /g, "")) + "?d=wavatar&s=60"; + hex_md5(email.toLowerCase().replace(/ /g, "")) + "?d=wavatar&s=60"; } var selectCommit = function(a) { @@ -282,9 +282,8 @@ var enableFeature = function(feature, element) var enableFeatures = function() { enableFeature("gist", $("gist")) - if(commit) - setGravatar(commit.author_email, $("gravatar")); - enableFeature("gravatar", $("gravatar")) + enableFeature("gravatar", $("author_gravatar").parentNode) + enableFeature("gravatar", $("committer_gravatar").parentNode) } var loadCommitDetails = function(data) @@ -301,6 +300,8 @@ var loadCommitDetails = function(data) } $("authorID").innerHTML = formatEmail(commit.author_name, commit.author_email); + $("date").innerHTML = commit.author_date; + setGravatar(commit.author_email, $("author_gravatar")); if (commit.committer_name != commit.author_name) { $("committerID").parentNode.style.display = ""; @@ -308,12 +309,12 @@ var loadCommitDetails = function(data) $("committerDate").parentNode.style.display = ""; $("committerDate").innerHTML = commit.committer_date; + setGravatar(commit.committer_email, $("committer_gravatar")); } else { $("committerID").parentNode.style.display = "none"; $("committerDate").parentNode.style.display = "none"; } - $("date").innerHTML = commit.author_date; $("message").innerHTML = commit.message.replace(/\n/g,"
"); if (commit.diff.length < 200000) diff --git a/html/views/history/index.html b/html/views/history/index.html index 65117c3..81d4092 100644 --- a/html/views/history/index.html +++ b/html/views/history/index.html @@ -14,11 +14,8 @@
- - Gist it - +
-
@@ -26,24 +23,35 @@ - - - - - - - - - - - - - - + - + From 9a536fc92a83c2fba408ad6d98b281f449882bad Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Thu, 18 Feb 2010 23:05:04 -0700 Subject: [PATCH 61/90] Clean up the commit message - allow the commit message text to wrap - use Menlo on systems that have it --- html/css/diff.css | 2 +- html/views/history/history.css | 5 +++-- html/views/history/index.html | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/html/css/diff.css b/html/css/diff.css index ca46216..73087c3 100644 --- a/html/css/diff.css +++ b/html/css/diff.css @@ -14,7 +14,7 @@ .diff .file .diffContent { white-space: pre; - font-family: Monaco; + font-family: Menlo, Monaco; } .diff .file .diffcontent .lineno { diff --git a/html/views/history/history.css b/html/views/history/history.css index 1bf0a20..5effcb1 100644 --- a/html/views/history/history.css +++ b/html/views/history/history.css @@ -59,8 +59,9 @@ body { } #message { - font-family: Monaco; - font-size: 10px; + font-family: Menlo, Monaco; + white-space: pre-wrap; + padding-top: 10px; } #files { diff --git a/html/views/history/index.html b/html/views/history/index.html index 81d4092..11aec3f 100644 --- a/html/views/history/index.html +++ b/html/views/history/index.html @@ -64,7 +64,7 @@
-

+		
From 9689c430ef0d337c514095ca533a953365cc6b67 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Fri, 19 Feb 2010 06:42:24 -0700 Subject: [PATCH 62/90] Clean up the commit file list - remove the underline from file names (makes them easier to read) - add icons to replace the file modification buttons (icons by Nathan Kinsinger) --- html/images/added.acorn | Bin 0 -> 1701 bytes html/images/added.png | Bin 0 -> 292 bytes html/images/modified.acorn | Bin 0 -> 1920 bytes html/images/modified.png | Bin 0 -> 308 bytes html/images/removed.acorn | Bin 0 -> 1686 bytes html/images/removed.png | Bin 0 -> 275 bytes html/images/renamed.acorn | Bin 0 -> 1705 bytes html/images/renamed.png | Bin 0 -> 290 bytes html/views/history/history.css | 23 ++++++++++++++++++----- html/views/history/history.js | 24 ++++++++++++++---------- 10 files changed, 32 insertions(+), 15 deletions(-) create mode 100644 html/images/added.acorn create mode 100644 html/images/added.png create mode 100644 html/images/modified.acorn create mode 100644 html/images/modified.png create mode 100644 html/images/removed.acorn create mode 100644 html/images/removed.png create mode 100644 html/images/renamed.acorn create mode 100644 html/images/renamed.png diff --git a/html/images/added.acorn b/html/images/added.acorn new file mode 100644 index 0000000000000000000000000000000000000000..8a42ce6fd32b6c6cfe6f1c8b451ef9e0a72ddd4c GIT binary patch literal 1701 zcmb7ETWlLe6rJ_Xw$7{FJR4{Nj>|($-R4n3fYLa`Nt05?PP1te+bL$U9@_)!U9&rG za3hPNESC79LO>`@5bY;Il@N$OUg8t@;w6xfDis8(ged>zad+)T4(d;LwYzuco;i2! zxp!tcuQ7}F_x~h#L@e#t>8-18Xl&ZGTW)Tdm{3xAmXuq^O|mj>sD&KW`8+i(X6T8G z$x=$5s7%i!@}`ky8XYH`#8sl7A(q0<(%6j2bbee<8!-nQGBm@Che;6#!VofMWsMbU z54pG;4qUW8C1JP0)j2#N3&;6{Q_V|!d1gYSwU z){O6{+8)3+BgYRjkymJ`!L(Ox@CqF@<9oL7Sm>%5pRKVK*LHY6f(MwZx3faH7gq-$ zn}NYnv{@+O28)}NEL zE>k(^PRt^*?Z${w^Z%MHFt3A#$qEP2GXe}9*cDO649<<*G%+(wFIN$fLT;IwK(aHU z%oD9Z5rBJbTS#xl0dwI(Q$(3%nJnL$c5!2KbINsfM3gDRWM>VX6HP0IpdYA7Q{cO} z0SxNff(vT{W@>V#ZUjTRAR2LBR69E*20MP zKg_%9o^rVym4mm}A5?HV69lQz9&*99C!JpV`m6BB8Wc8IzTEo2k8SN8dphsBdv90w zJ@@*0{QK^^f8h+X7?dZbIgK45IhvIB%_(Dy=Sbdd_K=awo7A#s>UfT1+)Z+V7L#(v zHk7-?sK!Y`%@RFBLqz=BF z_qp+Xhokb|=Qq@+J8xbMw#_8|exd7J{5t#NpU)BcE*gD*eziZ~>o3Wu_224sdK>vx z5Br1X5c;959Rzr=t9yU1|3F}JY0@P5EK}VbU6)X@Bu^`0WnpPfasS;_Tsrvkp}zis z!NU&?Jv{u#qmLbV{OHKh;OG-$q49}hkSFx5@hlB9oi4Bx&&G~1O>^s#aFnqs?)foL zC1u5?;DE`Jl(BLuRFOlj{Ele_bC#r7!CI;eMAK=D@}-br>a^-fRH$6;n9J>if)xO1 zEe=MU%GGE;H*jdE|IYhJuyGnLQ)6RI2apkWk3Q4~ihq@yBQL$9DW z(OYOkI4z_-zlr8G@H_ZD`~m(Le}TWp*YFK|Q`#YQO1)B_^qj<{m!(ZulS-L9yBK;~| Ym;RJ)I5{Kaan5Gvdb0Al^_Kqn4;uRlJ^%m! literal 0 HcmV?d00001 diff --git a/html/images/added.png b/html/images/added.png new file mode 100644 index 0000000000000000000000000000000000000000..1c3e63cf8b3fb3e79bc90455033cd93eaa4083bc GIT binary patch literal 292 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a&k&H|6fVg?3oVGw3ym^DWND0t1& z#W6%fH2Kf}|Mtv08uy=g|N7pqIHU35enFR>k21o-hi~nEHUHVcD+Wy_8L{G1{~Y{~ zEEuqw+lOgpT1vu=!v_xtmivDGTC6sK#qOv=xZTA1))-?Mas z;Ez`NJ{&&AhK6d!j(2*L`X)06onBGU``j|1mBmB!OiGEYhuL0+-;A-0c6Qtsq@Oq3 z`^2Q#G?QgB=P`E)2ClRO3uTrMn;o(aeq2y8x7>W4MS~<`S9kTS`LPG<7+kqL7}Prb m4lD7g@NHvU)-YoUBg3?5LGFcHCvOG%kipZ{&t;ucLK6T|e`@{! literal 0 HcmV?d00001 diff --git a/html/images/modified.acorn b/html/images/modified.acorn new file mode 100644 index 0000000000000000000000000000000000000000..6ba865bddfa077e7253604d00c52b1d47d586c5f GIT binary patch literal 1920 zcmb7FU2GIp6uz@_XZibBTaer&N*ptbF8>18v@9vJw&P--z z!KK!}j_Zqt#Gr^RB8U&hNKG`pnCO!)2F0L}U}D0950V%XUrcx~dSB+EHRj%5fSWF%``o(9(L`bryA1Hz$Wk0RV;| zWZcT?$E*WjNmv>&teEb~hi1AuT7z93vj;nb%Bb-5@G#nr5LyK!xyC*KDGy z1rh3jnluHr`32|HDaLcE2V82}ioDY0oQn;ojp@b; zhQ_9~>()Q8VdH}j1viB@Km5qVQN>aqJ8{*m>j=rwq_8oBU?Bq3*smZ74a*X*QFEyHTvQf$cSu%4o0vPvu~Db%l6>^2)< zPUvns+Jy=L7j>f$)YHMzMuOf>f;*x@-SZ3bvuoeK-Xr`dUhXeLQ)bz%@tJUIFgz=u zx__6(;T7=9MI7qcvhxQY30t=T3ENv*E1vm(nDt(mNjFSyTN~Q>cl8(Z101^5RsGk! zu)9xww9SY8SQxO|J9gZO9rUnwdDxd<+8X?2kNI=mC-1Dy&s8AwX3dss_lnT-GD27D z8z6z58#Z=55!$(HZ0dkXjI1Ji7g9w+$`XT?$P$>TnB>hp?#}K0ZO@b4J$s+(75nz> zKhQt$^x)9oa3nf%a8!yxo}lgYBXmg7=!BB8v+@0ks(O``a5HO_%;UX~)sz+Qhx;*0 zQu?tmv6N1sH0@RM<|s)id26bqh^EsPwWmbg)aa5WQG)WY;~usf3U&aXem~H-mFKIS zSo@=$;rs6d#=&VA3^c=~Zp0KvBhjQ#J5#Ee*5K_6ZgyN$Oj)HN_ZFO(>1++Qb`&~UIDji~6|To2+=9bc#C=%827VF0j^Ds% z@dtPjU%}V$4SW;-!&P!sTobpBYv#6cA~(h*xg(s(y}-T7z0IBH7P+suZ@H`74ell% q=6CS@e3XyzQ#|3%@*naS_>cLE{G!VTLIL-0#~p`CpWDCuXa4~M&PSL4 literal 0 HcmV?d00001 diff --git a/html/images/modified.png b/html/images/modified.png new file mode 100644 index 0000000000000000000000000000000000000000..1fbf7f46782c698f55b2e274aa24ddb4b864fc51 GIT binary patch literal 308 zcmV-40n7f0P)o`$D)G5ig3=1hV@xVB(jUc^iZyrs-tCn&8P2Wg1G!Ikr2vh%0^_=PqSyK9CEF-JX=-O%^;4_?@NW`|^@s z#K2nXgI-4GZyv}n>&2=V*d5pu288r;ZJZ%KPFIS5zQ!8~4`%ZAygzvW0000UlK) literal 0 HcmV?d00001 diff --git a/html/images/removed.acorn b/html/images/removed.acorn new file mode 100644 index 0000000000000000000000000000000000000000..47be5c2d6861717f337e9237e663c57b60cd6401 GIT binary patch literal 1686 zcmb7E-EZ4e6u&pV-qQ7B?&rp6S(fs#b?KHCN`SGYH0|0!o2+%$E=@;v>)a$496Pd| zm8=Q^)yo4fLlaUdYmtV;3qpHBlaLVb4hT(ri7#ou!{86t3oql?$toA^Wxld~e9!Ox zj?eF$dzXqTH?45^7wi*=xMQckVOL{QbIWe2wQX!n&J=lCY9BS|@~Ezq3QV)+m|=2V zOXUonk&9H}S}s*I^ek7|D7ENPA66niZu4L|>o$0CmuG&@7M|d4&-{$XmR;N7y#Y5c*N5|mFwU+F zKsEz|l|(D9kVexo7%f=kBFnt_w_xL8+qN6y@|I56w*7HAvGfX4EOhA#c-!OhRLP=C zATC!d(487(WZO+~+4KF5jk(`J!(!P2(Q_E44!6YR5#6%%!W1=fT&va*@ls)l89=f# zF3(Z5#1Me{Y#V1c7XY)q-W-=_crI^kExWq0xjEswy5jPLZt#n`W>Hlw$DkjW!7|{x zx&aKz``Cqb05dZzu51TgbJ!u@S-rT8yA~F5nq=AgMfK2~rjQABgs8<_TSIQd&aEG# z>i;kwt@*0eYC?+MUw=@+?Mx8Fqdnw8Y+p9J`pwsqCsv`b(dq~7kN@1!*|lfyL;D`? z?s;T?;6SkV(Z}X5aFauMlB(0#aav$$sdrW$;Z}hb-DZ#Jg`&YslVwg7XwKavFR^l3 z>e_~Kw-{3`no{yq%dwbV(yX+!TY=TO$t@`Al%8Q{6qTB0TI$%g*x7BsIj=kW(JD8* zTnis?;|B&3Qpal>%K5#Y-io#i_uuJ-EpR(_^yb`3I1~t1B-DPlex2LKy4AeF=o<+A z)X@owB zXP$lT*z?Cv9FGpaFcKRbI|&Iw!|JcHNv^SZp0V=DlU!BZf}|Wt%$j>{1mwt=$q6`F z@-(9_pNZ9UkZPYJYRQom1}!HZZIxZmuFX+CTS z=}(jE^yZd{re>d0Pn!B|l9c8sICE(3@e2#MtzSy9%!o3caZ}^&v6UZed4f6>!Vh$< ze&h1q&+EdOv`^C)&G+??o_Z#_1{ma{Kvt; V@8g7DUI%)J!PC{xWt~$(69C4sY{mcp literal 0 HcmV?d00001 diff --git a/html/images/renamed.acorn b/html/images/renamed.acorn new file mode 100644 index 0000000000000000000000000000000000000000..8b0545f2a417feb957f35d0cfbaf8c7f04f3cbbb GIT binary patch literal 1705 zcmb7EUu+ab7@xhJh3j9o{}Ed}4#7}Ly|&h(K#O-RE!y7IZfUt*;hgTx-Hq(+UUugw z*QSYvW6WEveLoXn_1KTj-$Ezsz=$#i~FPa07N95OV+oEar~AQ**^ zQ7diCTf^XqSvtvDlZIoTUhM1c@bz^sz1}TXM&xhC#!x##s2W~`Y6OHt_zTdGAe7l2 z*T&%cR1nL?x0P%U;Omg%hndJL)R$qJN;Y_f=CbjYO*|G_%f=_lY{j)5-Y?+==2CN3 z2<`M@7wo31dnr;UEZ{1Oo0MdDK1&mC-xqD+xNX~2VP#V%!M43&B{KIWRXMu!K6o3# z%2Zreg~Z3ZwaD>Y$df~C@YbK3RQwY3q~)f`qv43jMwIwzWz4?#Up zlP17-ebruG7FQ%rd%h0{bA23~t1m%g7Db zw7Dvx{SV?P6bcb};PK*v1a4V^8fC)Uf{JZVGI{Z*+oSy#A*%z0n+^MaZ)|FA+4GRBDkejIHRCSnSXk6YqsRS9%kgQwjAtRGDsb$f`$qY%kC*(Dn zkIT(lQ11Dn8YeL|P4pBE89ANDDbpS#h~>%Vg)M0q3;g97dk6 zI9m+wbL0DZBC`L&s`|#xU3UlME4OZ3x$)>Q`r_9Q{@%?Wet)ZN1fh3Zhrga$40QMc zOEPMBRC>;AiLqJ7{(-j;`mM1Eba<|{?LfQ#V8`(6ut~CMrn;xPBBrECmKLMS!tA8t z_T9y-ANr&7`9N29&kMaT_8ordsD|P|KMUB*AjlY;hoxOj?xBh741uB~PqK z<#I<|ZYLD107%PmFybVzECrKYoxOo4FDJpqNq7XPsN4NWC`^PSak+l6sCtKQ5B z5=cjRbP>IWK1A2hs&Ga~dhUt)#RK9|aZn74T)Zrv4pE}EpEa4 za3}7;K^(#3cov_<=WqtUgRkL_@Mrid{2l%Q-@$+42NIGhrBXCBN1?jSMRa%kO hrH`e1(tYVK=^yD|>4CFnggnmu>^!d)e;Z%v;eThB3Wfjx literal 0 HcmV?d00001 diff --git a/html/images/renamed.png b/html/images/renamed.png new file mode 100644 index 0000000000000000000000000000000000000000..24b88ab4a2e7d808173afa17d3f897526cc03a2a GIT binary patch literal 290 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a&k&H|6fVg?3oVGw3ym^DWND0s!w z#W6%fw0DxBP?H0XtFW6*v%_Oan`X0Z-^41ouLt!lY~8DV!MK1;`iS-kvBLjeGo}W% zpD~#IWdGSsH4!czhiB=CPn)_rJ$HS|!{V3__tYEt2A7X)vfWv;&S{6yXVYmFzDL*g zDg0?(m@FXi " + new_mode)); } else if (name1 == "/dev/null") { - buttonType = "created"; + img.src = "../../images/added.png"; + img.title = "Added file"; + p.title = "Added file"; finalFile = name2; } else if (name2 == "/dev/null") { - buttonType = "deleted"; + img.src = "../../images/removed.png"; + img.title = "Removed file"; + p.title = "Removed file"; finalFile = name1; } else { - buttonType = "renamed"; + img.src = "../../images/renamed.png"; + img.title = "Renamed file"; + p.title = "Renamed file"; finalFile = name2; p.insertBefore(document.createTextNode(name1 + " -> "), link); } link.appendChild(document.createTextNode(finalFile)); - button.setAttribute("representedFile", finalFile); link.setAttribute("representedFile", finalFile); - button.setAttribute("class", "button " + buttonType); - button.appendChild(document.createTextNode(buttonType)); - $("files").appendChild(button); + p.insertBefore(img, link); $("files").appendChild(p); } From 0cd02c13db6c1dff74e411fc320c10a73618a818 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Thu, 18 Feb 2010 23:30:34 -0700 Subject: [PATCH 63/90] Stop the top of diffs in the stage view from being cut off --- html/views/commit/commit.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/views/commit/commit.css b/html/views/commit/commit.css index 931cfd2..8f97168 100644 --- a/html/views/commit/commit.css +++ b/html/views/commit/commit.css @@ -1,7 +1,7 @@ body { padding: 0px; margin: 0px; - margin-top: 20px; + margin-top: 30px; } #title { From 9c7aaf0760ff2d608752176a4de00eb51002d748 Mon Sep 17 00:00:00 2001 From: Andy Fowler Date: Wed, 16 Dec 2009 10:45:58 -0500 Subject: [PATCH 64/90] Fix typo in successful commit message --- PBGitIndex.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PBGitIndex.m b/PBGitIndex.m index bd9bd56..39ed3b4 100644 --- a/PBGitIndex.m +++ b/PBGitIndex.m @@ -202,7 +202,7 @@ NSString *PBGitIndexOperationFailed = @"PBGitIndexOperationFailed"; NSMutableDictionary *userInfo = [NSMutableDictionary dictionaryWithObject:[NSNumber numberWithBool:success] forKey:@"success"]; NSString *description; if (success) - description = [NSString stringWithFormat:@"Successfull created commit %@", commit]; + description = [NSString stringWithFormat:@"Successfully created commit %@", commit]; else description = [NSString stringWithFormat:@"Post-commit hook failed, but successfully created commit %@", commit]; From 9dc54b3316b8a553655232d10abe49f3bbf3f161 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Fri, 19 Feb 2010 14:17:45 -0700 Subject: [PATCH 65/90] Resize the Amend checkbox It was being clipped by one pixel --- PBGitCommitView.xib | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PBGitCommitView.xib b/PBGitCommitView.xib index dd0a92b..d25307b 100644 --- a/PBGitCommitView.xib +++ b/PBGitCommitView.xib @@ -21,7 +21,7 @@ YES - + YES @@ -504,7 +504,7 @@ 292 - {{-2, 9}, {65, 18}} + {{-2, 9}, {82, 18}} YES @@ -1389,7 +1389,7 @@ YES com.apple.InterfaceBuilder.CocoaPlugin - {{101, 477}, {852, 432}} + {{1183, 504}, {852, 432}} com.apple.InterfaceBuilder.CocoaPlugin From 4903145243fb7f01133612499cc5f39fd5472e9c Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Tue, 23 Feb 2010 17:24:46 -0700 Subject: [PATCH 66/90] Change the commit list font to be 12 pt More closely matches Mail.app's list view --- PBGitHistoryView.xib | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/PBGitHistoryView.xib b/PBGitHistoryView.xib index 56e35fd..5751bf7 100644 --- a/PBGitHistoryView.xib +++ b/PBGitHistoryView.xib @@ -21,7 +21,7 @@ YES - + YES @@ -439,7 +439,7 @@ YES SubjectColumn - 509 + 549 40 1000 @@ -469,7 +469,11 @@ 337772096 2048 Text Cell - + + LucidaGrande + 12 + 16 + 6 @@ -493,7 +497,7 @@ AuthorColumn - 190 + 129 40 1000 @@ -508,7 +512,7 @@ 337772096 2048 Text Cell - + @@ -519,7 +523,7 @@ DateColumn - 144 + 165 10 3.4028229999999999e+38 @@ -539,7 +543,7 @@ 337772096 2048 Text Cell - + @@ -550,7 +554,7 @@ SHAColumn - 64 + 30 10 3.4028229999999999e+38 @@ -565,7 +569,7 @@ 338820672 1024 Text Cell - + @@ -589,7 +593,7 @@ 17 - -683671552 + -1019215872 CommitView @@ -614,17 +618,17 @@ _doScroller: - 0.9494949494949495 + 0.87603305785123964 -2147483392 - {{0, 196}, {837, 15}} + {{0, 123}, {852, 15}} 1 _doScroller: - 0.21932109999999999 + 0.9988276670574443 From 865ff8995a243402637941c62b875b4152da8ee9 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Fri, 19 Feb 2010 21:57:32 -0700 Subject: [PATCH 67/90] Hide menu items in the File menu that are not used They are still there in case they are ever needed --- English.lproj/MainMenu.xib | 136 ++++++++++++++++++++----------------- 1 file changed, 73 insertions(+), 63 deletions(-) diff --git a/English.lproj/MainMenu.xib b/English.lproj/MainMenu.xib index 49d3d49..c35b2c1 100644 --- a/English.lproj/MainMenu.xib +++ b/English.lproj/MainMenu.xib @@ -12,7 +12,7 @@ YES - + YES @@ -299,6 +299,7 @@ + YES Save s 1048576 @@ -308,6 +309,7 @@ + YES Save As… S 1048576 @@ -317,6 +319,7 @@ + YES Revert to Saved 2147483647 @@ -327,6 +330,7 @@ YES YES + YES 1048576 @@ -336,6 +340,7 @@ + YES Page Setup… P 1048576 @@ -345,6 +350,7 @@ + YES Print… p 1048576 @@ -792,26 +798,17 @@ - Detailed View + Detail View 1 1572864 2147483647 - - - Raw View - 2 - 1572864 - 2147483647 - - - Tree View - 3 + 2 1572864 2147483647 @@ -1236,30 +1233,6 @@ 920 - - - setDetailedView: - - - - 923 - - - - setRawView: - - - - 924 - - - - setTreeView: - - - - 925 - refresh: @@ -1364,6 +1337,22 @@ 958 + + + setDetailedView: + + + + 962 + + + + setTreeView: + + + + 963 + @@ -1914,7 +1903,6 @@ - @@ -1950,11 +1938,6 @@ - - 851 - - - 852 @@ -2253,7 +2236,6 @@ 83.ImportedFromIB2 847.IBPluginDependency 848.IBPluginDependency - 851.IBPluginDependency 852.IBPluginDependency 909.IBPluginDependency 912.IBPluginDependency @@ -2403,13 +2385,13 @@ com.apple.InterfaceBuilder.CocoaPlugin - {{521, 736}, {420, 20}} + {{552, 706}, {420, 20}} com.apple.InterfaceBuilder.CocoaPlugin {{297, 739}, {329, 20}} com.apple.InterfaceBuilder.CocoaPlugin - {{759, 543}, {231, 193}} + {{790, 533}, {231, 173}} com.apple.InterfaceBuilder.CocoaPlugin {{499, 623}, {234, 113}} @@ -2461,7 +2443,6 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin {{668, 623}, {206, 113}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -2490,7 +2471,7 @@ - 958 + 963 @@ -2508,7 +2489,6 @@ showAboutPanel: showCloneRepository: showHelp: - showRepositoryListWindow: YES @@ -2518,7 +2498,6 @@ id id id - id @@ -2570,6 +2549,13 @@ + + NSOutlineView + + IBProjectSource + NSOutlineViewExt.h + + PBCollapsibleSplitView PBNiceSplitView @@ -2727,6 +2713,7 @@ YES createBranch: + createTag: openFilesAction: openSelectedFile: refresh: @@ -2751,6 +2738,7 @@ id id id + id @@ -2761,6 +2749,7 @@ commitList fileBrowser historySplitView + refController searchField treeController webView @@ -2771,6 +2760,7 @@ NSTableView NSOutlineView PBCollapsibleSplitView + PBRefController NSSearchField NSTreeController id @@ -2844,8 +2834,29 @@ - contentView - NSView + YES + + YES + contentSplitView + finderItem + progressIndicator + sourceListControlsView + sourceSplitView + splitView + statusField + terminalItem + + + YES + NSView + NSToolbarItem + NSProgressIndicator + NSView + NSView + NSSplitView + NSTextField + NSToolbarItem + IBProjectSource @@ -2913,7 +2924,6 @@ YES YES - changeBranch: checkout: cherryPick: copyPatch: @@ -2932,7 +2942,6 @@ YES - NSMenuItem PBRefMenuItem PBRefMenuItem PBRefMenuItem @@ -3003,10 +3012,6 @@ PBViewController NSViewController - - viewToolbar - NSToolbar - IBProjectSource PBViewController.h @@ -3404,7 +3409,7 @@ NSObject - + IBFrameworkSource AppKit.framework/Headers/NSToolbarItem.h @@ -3654,6 +3659,14 @@ AppKit.framework/Headers/NSPopUpButton.h + + NSProgressIndicator + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSProgressIndicator.h + + NSResponder @@ -3715,12 +3728,9 @@ - NSToolbar + NSToolbarItem NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSToolbar.h - + NSTreeController From 388818b0450a9212bf152947951b14e8d6992d5d Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Fri, 19 Feb 2010 22:01:50 -0700 Subject: [PATCH 68/90] Make the accept drop window a document modal sheet - don't do anything if the ref is dropped on the old commit - clean up the message - allow it to be suppressed --- PBGitDefaults.h | 2 ++ PBGitDefaults.m | 11 ++++++ PBRefController.m | 86 +++++++++++++++++++++++++++++++++++------------ 3 files changed, 78 insertions(+), 21 deletions(-) diff --git a/PBGitDefaults.h b/PBGitDefaults.h index b463dd6..f56709d 100644 --- a/PBGitDefaults.h +++ b/PBGitDefaults.h @@ -23,5 +23,7 @@ + (void) setShouldCheckoutBranch:(BOOL)shouldCheckout; + (NSString *) recentCloneDestination; + (void) setRecentCloneDestination:(NSString *)path; ++ (BOOL) suppressAcceptDropRef; ++ (void) setSuppressAcceptDropRef:(BOOL)suppress; @end diff --git a/PBGitDefaults.m b/PBGitDefaults.m index 1cadd14..66e3422 100644 --- a/PBGitDefaults.m +++ b/PBGitDefaults.m @@ -19,6 +19,7 @@ #define kShowOpenPanelOnLaunch @"PBShowOpenPanelOnLaunch" #define kShouldCheckoutBranch @"PBShouldCheckoutBranch" #define kRecentCloneDestination @"PBRecentCloneDestination" +#define kSuppressAcceptDropRef @"PBSuppressAcceptDropRef" @implementation PBGitDefaults @@ -106,4 +107,14 @@ [[NSUserDefaults standardUserDefaults] setObject:path forKey:kRecentCloneDestination]; } ++ (BOOL) suppressAcceptDropRef +{ + return [[NSUserDefaults standardUserDefaults] boolForKey:kSuppressAcceptDropRef]; +} + ++ (void) setSuppressAcceptDropRef:(BOOL)suppress +{ + return [[NSUserDefaults standardUserDefaults] setBool:suppress forKey:kSuppressAcceptDropRef]; +} + @end diff --git a/PBRefController.m b/PBRefController.m index adb4630..af51b10 100644 --- a/PBRefController.m +++ b/PBRefController.m @@ -11,6 +11,7 @@ #import "PBRefMenuItem.h" #import "PBCreateBranchSheet.h" #import "PBCreateTagSheet.h" +#import "PBGitDefaults.h" @implementation PBRefController @@ -317,6 +318,25 @@ return NSDragOperationNone; } +- (void) dropRef:(NSDictionary *)dropInfo +{ + PBGitRef *ref = [dropInfo objectForKey:@"dragRef"]; + PBGitCommit *oldCommit = [dropInfo objectForKey:@"oldCommit"]; + PBGitCommit *dropCommit = [dropInfo objectForKey:@"dropCommit"]; + if (!ref || ! oldCommit || !dropCommit) + return; + + int retValue = 1; + [historyController.repository outputForArguments:[NSArray arrayWithObjects:@"update-ref", @"-mUpdate from GitX", [ref ref], [dropCommit realSha], NULL] retValue:&retValue]; + if (retValue) + return; + + [dropCommit addRef:ref]; + [oldCommit removeRef:ref]; + + [commitController rearrangeObjects]; +} + - (BOOL)tableView:(NSTableView *)aTableView acceptDrop:(id )info row:(NSInteger)row @@ -332,31 +352,55 @@ NSArray *numbers = [NSKeyedUnarchiver unarchiveObjectWithData:data]; int oldRow = [[numbers objectAtIndex:0] intValue]; + if (oldRow == row) + return NO; + int oldRefIndex = [[numbers objectAtIndex:1] intValue]; - PBGitCommit *oldCommit = [[commitController arrangedObjects] objectAtIndex: oldRow]; + PBGitCommit *oldCommit = [[commitController arrangedObjects] objectAtIndex:oldRow]; PBGitRef *ref = [[oldCommit refs] objectAtIndex:oldRefIndex]; - + PBGitCommit *dropCommit = [[commitController arrangedObjects] objectAtIndex:row]; - - int a = [[NSAlert alertWithMessageText:@"Change branch" - defaultButton:@"Change" - alternateButton:@"Cancel" - otherButton:nil - informativeTextWithFormat:@"Do you want to change branch\n\n\t'%@'\n\n to point to commit\n\n\t'%@'", [ref shortName], [dropCommit subject]] runModal]; - if (a != NSAlertDefaultReturn) - return NO; - - int retValue = 1; - [historyController.repository outputForArguments:[NSArray arrayWithObjects:@"update-ref", @"-mUpdate from GitX", [ref ref], [dropCommit realSha], NULL] retValue:&retValue]; - if (retValue) - return NO; - - [dropCommit addRef:ref]; - [oldCommit removeRef:ref]; - - [commitController rearrangeObjects]; - [aTableView needsToDrawRect:[aTableView rectOfRow:oldRow]]; + + NSDictionary *dropInfo = [NSDictionary dictionaryWithObjectsAndKeys: + ref, @"dragRef", + oldCommit, @"oldCommit", + dropCommit, @"dropCommit", + nil]; + + if ([PBGitDefaults suppressAcceptDropRef]) { + [self dropRef:dropInfo]; + return YES; + } + + NSString *subject = [dropCommit subject]; + if ([subject length] > 99) + subject = [[subject substringToIndex:99] stringByAppendingString:@"…"]; + NSString *infoText = [NSString stringWithFormat:@"Move the %@ to point to the commit: %@", [ref refishType], subject]; + + NSAlert *alert = [NSAlert alertWithMessageText:[NSString stringWithFormat:@"Move %@: %@", [ref refishType], [ref shortName]] + defaultButton:@"Move" + alternateButton:@"Cancel" + otherButton:nil + informativeTextWithFormat:infoText]; + [alert setShowsSuppressionButton:YES]; + + [alert beginSheetModalForWindow:[historyController.repository.windowController window] + modalDelegate:self + didEndSelector:@selector(acceptDropInfoAlertDidEnd:returnCode:contextInfo:) + contextInfo:dropInfo]; + return YES; } +- (void) acceptDropInfoAlertDidEnd:(NSAlert *)alert returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo +{ + [[alert window] orderOut:nil]; + + if (returnCode == NSAlertDefaultReturn) + [self dropRef:contextInfo]; + + if ([[alert suppressionButton] state] == NSOnState) + [PBGitDefaults setSuppressAcceptDropRef:YES]; +} + @end From 6427fd90fc470b8ec089f63a3f1326e0018c443e Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sun, 7 Mar 2010 12:14:49 -0700 Subject: [PATCH 69/90] Reopen the stage view if that was the last view open --- PBGitDefaults.h | 2 ++ PBGitDefaults.m | 12 ++++++++++++ PBGitSidebarController.m | 8 +++++++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/PBGitDefaults.h b/PBGitDefaults.h index f56709d..16ff6f9 100644 --- a/PBGitDefaults.h +++ b/PBGitDefaults.h @@ -25,5 +25,7 @@ + (void) setRecentCloneDestination:(NSString *)path; + (BOOL) suppressAcceptDropRef; + (void) setSuppressAcceptDropRef:(BOOL)suppress; ++ (BOOL) showStageView; ++ (void) setShowStageView:(BOOL)suppress; @end diff --git a/PBGitDefaults.m b/PBGitDefaults.m index 66e3422..fe459f4 100644 --- a/PBGitDefaults.m +++ b/PBGitDefaults.m @@ -20,6 +20,7 @@ #define kShouldCheckoutBranch @"PBShouldCheckoutBranch" #define kRecentCloneDestination @"PBRecentCloneDestination" #define kSuppressAcceptDropRef @"PBSuppressAcceptDropRef" +#define kShowStageView @"PBShowStageView" @implementation PBGitDefaults @@ -117,4 +118,15 @@ return [[NSUserDefaults standardUserDefaults] setBool:suppress forKey:kSuppressAcceptDropRef]; } ++ (BOOL) showStageView +{ + return [[NSUserDefaults standardUserDefaults] boolForKey:kShowStageView]; +} + ++ (void) setShowStageView:(BOOL)suppress +{ + return [[NSUserDefaults standardUserDefaults] setBool:suppress forKey:kShowStageView]; +} + + @end diff --git a/PBGitSidebarController.m b/PBGitSidebarController.m index 707cb5b..5bd1b0f 100644 --- a/PBGitSidebarController.m +++ b/PBGitSidebarController.m @@ -14,6 +14,7 @@ #import "PBSourceViewCell.h" #import "NSOutlineViewExt.h" #import "PBAddRemoteSheet.h" +#import "PBGitDefaults.h" @interface PBGitSidebarController () @@ -52,7 +53,10 @@ [self menuNeedsUpdate:[actionButton menu]]; - [self selectCurrentBranch]; + if ([PBGitDefaults showStageView]) + [self selectStage]; + else + [self selectCurrentBranch]; } - (void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context @@ -176,10 +180,12 @@ if ([item revSpecifier]) { repository.currentBranch = [item revSpecifier]; [superController changeContentController:historyViewController]; + [PBGitDefaults setShowStageView:NO]; } if (item == stage) { [superController changeContentController:commitViewController]; + [PBGitDefaults setShowStageView:YES]; } [self updateActionMenu]; From 2b0c2b200a6287fb530c1aad3793bb931de9f38a Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Fri, 5 Mar 2010 18:54:51 -0700 Subject: [PATCH 70/90] Retry loadCommit() script when it fails Fixes a problem when opening a number of repos at once where the commit information does not show up. Get a webKit error "TypeError: Result of expression 'commit' [undefined] is not an object." For some reason the callWebScriptMethod:withArguments: method returns nil (even after the webView:didFinishLoadForFrame: delegate is called) when the app is busy. Seems like the web view is not really ready yet and so it never actually calls loadCommit(). If we get nil (normally should get WebUndefined) then try changeContentTo: again after a little delay. This stops the loadCommitDetails() script from running before the commit object is created. --- PBWebHistoryController.m | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/PBWebHistoryController.m b/PBWebHistoryController.m index 13d1cfe..98de77b 100644 --- a/PBWebHistoryController.m +++ b/PBWebHistoryController.m @@ -46,10 +46,15 @@ [[self script] callWebScriptMethod:@"reload" withArguments: nil]; return; } - currentSha = [content realSha]; NSArray *arguments = [NSArray arrayWithObjects:content, [[[historyController repository] headRef] simpleRef], nil]; - [[self script] callWebScriptMethod:@"loadCommit" withArguments: arguments]; + id scriptResult = [[self script] callWebScriptMethod:@"loadCommit" withArguments: arguments]; + if (!scriptResult) { + // the web view is not really ready for scripting??? + [self performSelector:_cmd withObject:content afterDelay:0.05]; + return; + } + currentSha = [content realSha]; // Now we load the extended details. We used to do this in a separate thread, // but this caused some funny behaviour because NSTask's and NSThread's don't really From f2a395d42390b7d9fd910014d8478da447c18475 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Fri, 19 Feb 2010 22:02:45 -0700 Subject: [PATCH 71/90] Add Reopen all repositories from last session Store all the open documents when the app closes and then open them when the app starts again. Defaults to NO, so that there is no change to the existing behavior. --- ApplicationController.m | 64 ++- English.lproj/Preferences.xib | 793 +++++++++++++++++++++++++++++++--- PBGitDefaults.h | 4 + PBGitDefaults.m | 23 + 4 files changed, 810 insertions(+), 74 deletions(-) diff --git a/ApplicationController.m b/ApplicationController.m index 650c9b9..ddf66c2 100644 --- a/ApplicationController.m +++ b/ApplicationController.m @@ -66,32 +66,47 @@ { [self registerServices]; + BOOL hasOpenedDocuments = NO; + NSArray *launchedDocuments = [[[PBRepositoryDocumentController sharedDocumentController] documents] copy]; + // Only try to open a default document if there are no documents open already. // For example, the application might have been launched by double-clicking a .git repository, // or by dragging a folder to the app icon - if ([[[PBRepositoryDocumentController sharedDocumentController] documents] count]) - return; + if ([launchedDocuments count]) + hasOpenedDocuments = YES; + + // open any documents that were open the last time the app quit + if ([PBGitDefaults openPreviousDocumentsOnLaunch]) { + for (NSString *path in [PBGitDefaults previousDocumentPaths]) { + NSURL *url = [NSURL fileURLWithPath:path isDirectory:YES]; + NSError *error = nil; + if (url && [[PBRepositoryDocumentController sharedDocumentController] openDocumentWithContentsOfURL:url display:YES error:&error]) + hasOpenedDocuments = YES; + } + } + + // Try to find the current directory, to open that as a repository + if ([PBGitDefaults openCurDirOnLaunch] && !hasOpenedDocuments) { + NSString *curPath = [[[NSProcessInfo processInfo] environment] objectForKey:@"PWD"]; + NSURL *url = nil; + if (curPath) + url = [NSURL fileURLWithPath:curPath]; + // Try to open the found URL + NSError *error = nil; + if (url && [[PBRepositoryDocumentController sharedDocumentController] openDocumentWithContentsOfURL:url display:YES error:&error]) + hasOpenedDocuments = YES; + } + + // to bring the launched documents to the front + for (PBGitRepository *document in launchedDocuments) + [document showWindows]; if (![[NSApplication sharedApplication] isActive]) return; - NSURL *url = nil; - - // Try to find the current directory, to open that as a repository - if ([PBGitDefaults openCurDirOnLaunch]) { - NSString *curPath = [[[NSProcessInfo processInfo] environment] objectForKey:@"PWD"]; - if (curPath) - url = [NSURL fileURLWithPath:curPath]; - } - - // Try to open the found URL - NSError *error = nil; - if (url && [[PBRepositoryDocumentController sharedDocumentController] openDocumentWithContentsOfURL:url display:YES error:&error]) - return; - // The current directory was not enabled or could not be opened (most likely it’s not a git repository). // show an open panel for the user to select a repository to view - if ([PBGitDefaults showOpenPanelOnLaunch]) + if ([PBGitDefaults showOpenPanelOnLaunch] && !hasOpenedDocuments) [[PBRepositoryDocumentController sharedDocumentController] openDocument:self]; } @@ -333,6 +348,21 @@ return reply; } +- (void)applicationWillTerminate:(NSNotification *)aNotification +{ + [PBGitDefaults removePreviousDocumentPaths]; + + if ([PBGitDefaults openPreviousDocumentsOnLaunch]) { + NSArray *documents = [[PBRepositoryDocumentController sharedDocumentController] documents]; + if ([documents count] > 0) { + NSMutableArray *paths = [NSMutableArray array]; + for (PBGitRepository *repository in documents) + [paths addObject:[repository workingDirectory]]; + + [PBGitDefaults setPreviousDocumentPaths:paths]; + } + } +} /** Implementation of dealloc, to release the retained variables. diff --git a/English.lproj/Preferences.xib b/English.lproj/Preferences.xib index 465f1e1..d2d20f7 100644 --- a/English.lproj/Preferences.xib +++ b/English.lproj/Preferences.xib @@ -1,26 +1,29 @@ - + 1050 - 9J61 - 677 - 949.46 - 353.00 + 10C540 + 759 + 1038.25 + 458.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 759 + YES - - + + YES - com.apple.InterfaceBuilderKit com.apple.InterfaceBuilder.CocoaPlugin YES - + YES @@ -46,7 +49,7 @@ 268 - {{17, 54}, {99, 17}} + {{17, 74}, {99, 17}} YES @@ -55,7 +58,7 @@ Git Executable: LucidaGrande - 1.300000e+01 + 13 1044 @@ -65,7 +68,7 @@ controlColor 3 - MC42NjY2NjY2OQA + MC42NjY2NjY2NjY3AA @@ -84,13 +87,13 @@ 268 YES - + YES Apple URL pasteboard type NSFilenamesPboardType - {{121, 50}, {179, 22}} + {{121, 70}, {179, 22}} YES @@ -98,7 +101,7 @@ 163840 LucidaGrande - 1.100000e+01 + 11 3100 @@ -112,7 +115,7 @@ 268 - {{118, 0}, {192, 42}} + {{118, 20}, {192, 42}} YES @@ -128,7 +131,7 @@ 268 - {{306, 54}, {54, 14}} + {{306, 74}, {54, 14}} YES @@ -153,7 +156,7 @@ 268 - {{18, 103}, {203, 18}} + {{18, 150}, {203, 18}} YES @@ -177,16 +180,38 @@ 25 + + + 268 + {{18, 100}, {279, 18}} + + YES + + -2080244224 + 0 + Reopen all repositories from last session + + + 1211912703 + 2 + + + + + 200 + 25 + + 268 - {{18, 78}, {207, 18}} + {{18, 125}, {207, 18}} YES -2080244224 0 - U2hvdyAiT3BlbiIgcGFuZWwgb24gbGF1bmNoA + Show "Open" panel on launch 1211912703 @@ -200,7 +225,7 @@ - {400, 139} + {400, 186} NSView @@ -364,7 +389,7 @@ YES - + YES dateFormat_10_0 dateStyle @@ -374,7 +399,7 @@ YES %m/%d/%y - + @@ -450,7 +475,7 @@ YES - PBShowOpenPanelOnLaunch + PBOpenPreviousDocumentsOnLaunch YES @@ -468,7 +493,7 @@ -2080244224 0 - RW5hYmxlICdHaXN0IGl0Jw + Enable 'Gist it' 1211912703 @@ -749,7 +774,7 @@ values.gitExecutable YES - + YES NSAllowsEditingMultipleValuesSelection NSNullPlaceholder @@ -903,34 +928,48 @@ 121 + + + value: values.PBOpenPreviousDocumentsOnLaunch + + + + + + value: values.PBOpenPreviousDocumentsOnLaunch + value + values.PBOpenPreviousDocumentsOnLaunch + 2 + + + 125 + YES 0 - - YES - + -2 - - RmlsZSdzIE93bmVyA + + File's Owner -1 - + First Responder -3 - + Application @@ -944,8 +983,9 @@ + - + General @@ -960,7 +1000,7 @@ - + Updates @@ -1090,12 +1130,12 @@ 26 - + 28 - + 42 @@ -1151,7 +1191,7 @@ YES - + Open Panel Accessory @@ -1192,7 +1232,7 @@ - + Integration @@ -1279,14 +1319,26 @@ + + 122 + + + YES + + + + + + 123 + + + YES - + YES - -1.IBPluginDependency - -2.IBPluginDependency -3.IBPluginDependency 1.IBEditorWindowLastContentRect 1.IBPluginDependency @@ -1302,6 +1354,8 @@ 118.IBPluginDependency 119.IBPluginDependency 12.IBPluginDependency + 122.IBPluginDependency + 123.IBPluginDependency 13.IBPluginDependency 14.IBPluginDependency 15.IBEditorWindowLastContentRect @@ -1316,7 +1370,7 @@ 23.IBPluginDependency 24.IBPluginDependency 25.IBPluginDependency - 26.IBPluginDependency + 28.IBPluginDependency 4.IBEditorWindowLastContentRect 4.IBPluginDependency 4.IBUserGuides @@ -1346,15 +1400,13 @@ YES com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilderKit - com.apple.InterfaceBuilderKit - {{477, 551}, {400, 139}} + {{845, 698}, {400, 186}} com.apple.InterfaceBuilder.CocoaPlugin YES - 1.210000e+02 + 121 0 @@ -1371,6 +1423,8 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin {{514, 459}, {106, 71}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -1390,7 +1444,7 @@ YES - 4.200000e+01 + 42 0 @@ -1420,9 +1474,7 @@ YES - - YES - + YES @@ -1430,15 +1482,13 @@ YES - - YES - + YES - 121 + 125 @@ -1456,7 +1506,7 @@ DBPrefsWindowController YES - + YES checkGitValidity: resetGitPath: @@ -1471,7 +1521,7 @@ YES - + YES badGitPathIcon generalPrefsView @@ -1526,9 +1576,638 @@ + + YES + + NSActionCell + NSCell + + IBFrameworkSource + AppKit.framework/Headers/NSActionCell.h + + + + NSApplication + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSApplication.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSApplicationScripting.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSColorPanel.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSHelpManager.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSPageLayout.h + + + + NSApplication + + IBFrameworkSource + AppKit.framework/Headers/NSUserInterfaceItemSearching.h + + + + NSButton + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSButton.h + + + + NSButtonCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSButtonCell.h + + + + NSCell + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSCell.h + + + + NSControl + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSControl.h + + + + NSController + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSController.h + + + + NSDateFormatter + NSFormatter + + IBFrameworkSource + Foundation.framework/Headers/NSDateFormatter.h + + + + NSFormatter + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFormatter.h + + + + NSImageView + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSImageView.h + + + + NSMenu + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenu.h + + + + NSMenuItem + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItem.h + + + + NSMenuItemCell + NSButtonCell + + IBFrameworkSource + AppKit.framework/Headers/NSMenuItemCell.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSAccessibility.h + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDictionaryController.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSDragging.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontManager.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSFontPanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSKeyValueBinding.h + + + + NSObject + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSNibLoading.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSOutlineView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSPasteboard.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSSavePanel.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableView.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSToolbarItem.h + + + + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSView.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSError.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFileManager.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueObserving.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyedArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObject.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObjectScripting.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSPortCoder.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSRunLoop.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptClassDescription.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptObjectSpecifiers.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSScriptWhoseTests.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSThread.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURL.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLConnection.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLDownload.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUAppcast.h + + + + NSObject + + IBFrameworkSource + Sparkle.framework/Headers/SUUpdater.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebDownload.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebEditingDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebFrameLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebJavaPlugIn.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPlugin.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPluginContainer.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebPolicyDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebResourceLoadDelegate.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebScriptObject.h + + + + NSObject + + IBFrameworkSource + WebKit.framework/Headers/WebUIDelegate.h + + + + NSPathCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSPathCell.h + + + + NSPathControl + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSPathControl.h + + + + NSPopUpButton + NSButton + + IBFrameworkSource + AppKit.framework/Headers/NSPopUpButton.h + + + + NSPopUpButtonCell + NSMenuItemCell + + IBFrameworkSource + AppKit.framework/Headers/NSPopUpButtonCell.h + + + + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSInterfaceStyle.h + + + + NSResponder + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSResponder.h + + + + NSTextField + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSTextField.h + + + + NSTextFieldCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSTextFieldCell.h + + + + NSUserDefaultsController + NSController + + IBFrameworkSource + AppKit.framework/Headers/NSUserDefaultsController.h + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSClipView.h + + + + NSView + + + + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSRulerView.h + + + + NSView + NSResponder + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSDrawer.h + + + + NSWindow + NSResponder + + IBFrameworkSource + AppKit.framework/Headers/NSWindow.h + + + + NSWindow + + IBFrameworkSource + AppKit.framework/Headers/NSWindowScripting.h + + + + NSWindowController + NSResponder + + showWindow: + id + + + IBFrameworkSource + AppKit.framework/Headers/NSWindowController.h + + + + SUUpdater + NSObject + + checkForUpdates: + id + + + delegate + id + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES ../GitX.xcodeproj 3 + + NSStopProgressFreestandingTemplate + {83, 83} + diff --git a/PBGitDefaults.h b/PBGitDefaults.h index 16ff6f9..22c8c9a 100644 --- a/PBGitDefaults.h +++ b/PBGitDefaults.h @@ -27,5 +27,9 @@ + (void) setSuppressAcceptDropRef:(BOOL)suppress; + (BOOL) showStageView; + (void) setShowStageView:(BOOL)suppress; ++ (BOOL) openPreviousDocumentsOnLaunch; ++ (void) setPreviousDocumentPaths:(NSArray *)documentPaths; ++ (NSArray *) previousDocumentPaths; ++ (void) removePreviousDocumentPaths; @end diff --git a/PBGitDefaults.m b/PBGitDefaults.m index fe459f4..3409437 100644 --- a/PBGitDefaults.m +++ b/PBGitDefaults.m @@ -21,6 +21,8 @@ #define kRecentCloneDestination @"PBRecentCloneDestination" #define kSuppressAcceptDropRef @"PBSuppressAcceptDropRef" #define kShowStageView @"PBShowStageView" +#define kOpenPreviousDocumentsOnLaunch @"PBOpenPreviousDocumentsOnLaunch" +#define kPreviousDocumentPaths @"PBPreviousDocumentPaths" @implementation PBGitDefaults @@ -45,6 +47,8 @@ forKey:kShowOpenPanelOnLaunch]; [defaultValues setObject:[NSNumber numberWithBool:YES] forKey:kShouldCheckoutBranch]; + [defaultValues setObject:[NSNumber numberWithBool:NO] + forKey:kOpenPreviousDocumentsOnLaunch]; [[NSUserDefaults standardUserDefaults] registerDefaults:defaultValues]; } @@ -128,5 +132,24 @@ return [[NSUserDefaults standardUserDefaults] setBool:suppress forKey:kShowStageView]; } ++ (BOOL) openPreviousDocumentsOnLaunch +{ + return [[NSUserDefaults standardUserDefaults] boolForKey:kOpenPreviousDocumentsOnLaunch]; +} + ++ (void) setPreviousDocumentPaths:(NSArray *)documentPaths +{ + [[NSUserDefaults standardUserDefaults] setObject:documentPaths forKey:kPreviousDocumentPaths]; +} + ++ (NSArray *) previousDocumentPaths +{ + return [[NSUserDefaults standardUserDefaults] arrayForKey:kPreviousDocumentPaths]; +} + ++ (void) removePreviousDocumentPaths +{ + [[NSUserDefaults standardUserDefaults] removeObjectForKey:kPreviousDocumentPaths]; +} @end From 27d4b2212297c7355dc8b5d1a3b8da21d8d9bff8 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Fri, 19 Feb 2010 17:56:27 -0700 Subject: [PATCH 72/90] Add preferences for the column guide in the commit message --- English.lproj/Preferences.xib | 234 +++++++++++++++++++++++++++++----- PBCommitMessageView.m | 24 ++-- PBGitDefaults.h | 1 + PBGitDefaults.m | 8 ++ 4 files changed, 221 insertions(+), 46 deletions(-) diff --git a/English.lproj/Preferences.xib b/English.lproj/Preferences.xib index d2d20f7..e90280b 100644 --- a/English.lproj/Preferences.xib +++ b/English.lproj/Preferences.xib @@ -13,9 +13,8 @@ YES - - + YES @@ -46,22 +45,55 @@ 268 YES - + 268 - {{17, 74}, {99, 17}} + {{248, 100}, {41, 22}} YES - - 68288064 + + -1804468671 272630784 - Git Executable: + LucidaGrande 13 1044 - + + YES + + 6 + System + textBackgroundColor + + 3 + MQA + + + + 6 + System + textColor + + 3 + MAA + + + + + + + 268 + {{121, 102}, {122, 17}} + + YES + + 68288064 + 272630784 + Display at column: + + 6 System @@ -75,13 +107,53 @@ 6 System controlTextColor - - 3 - MAA - + + + + 268 + {{18, 125}, {273, 18}} + + YES + + -2080244224 + 0 + Show column guide in commit message + + + 1211912703 + 2 + + NSImage + NSSwitch + + + NSSwitch + + + + 200 + 25 + + + + + 268 + {{17, 74}, {99, 17}} + + YES + + 68288064 + 272630784 + Git Executable: + + + + + + 268 @@ -167,13 +239,8 @@ 1211912703 2 - - NSImage - NSSwitch - - - NSSwitch - + + 200 @@ -183,7 +250,7 @@ 268 - {{18, 100}, {279, 18}} + {{18, 175}, {279, 18}} YES @@ -194,7 +261,7 @@ 1211912703 2 - + @@ -205,7 +272,7 @@ 268 - {{18, 125}, {207, 18}} + {{18, 200}, {207, 18}} YES @@ -216,7 +283,7 @@ 1211912703 2 - + @@ -225,7 +292,7 @@ - {400, 186} + {400, 236} NSView @@ -239,6 +306,7 @@ 268 {{39, 45}, {82, 14}} + YES 68288064 @@ -255,6 +323,7 @@ 268 {{18, 103}, {260, 18}} + YES -2080244224 @@ -264,7 +333,7 @@ 1211912703 2 - + @@ -275,8 +344,9 @@ 268 - {{130, 78}, {100, 22}} + {{130, 78}, {102, 22}} + YES -2076049856 @@ -364,6 +434,7 @@ 268 {{39, 80}, {89, 17}} + YES 68288064 @@ -380,6 +451,7 @@ 268 {{130, 45}, {251, 14}} + YES 68288064 @@ -417,6 +489,7 @@ 268 {{128, 13}, {96, 28}} + YES 67239424 @@ -435,6 +508,7 @@ {400, 139} + NSView @@ -456,7 +530,7 @@ 1211912703 2 - + @@ -475,7 +549,8 @@ YES - PBOpenPreviousDocumentsOnLaunch + PBCommitMessageViewHasVerticalLine + PBCommitMessageViewVerticalLineLength YES @@ -498,7 +573,7 @@ 1211912703 2 - + @@ -520,7 +595,7 @@ 1211912703 2 - + @@ -542,7 +617,7 @@ 1211912703 2 - + @@ -564,7 +639,7 @@ 1211912703 2 - + @@ -944,6 +1019,38 @@ 125 + + + value: values.PBCommitMessageViewHasVerticalLine + + + + + + value: values.PBCommitMessageViewHasVerticalLine + value + values.PBCommitMessageViewHasVerticalLine + 2 + + + 133 + + + + value: values.PBCommitMessageViewVerticalLineLength + + + + + + value: values.PBCommitMessageViewVerticalLineLength + value + values.PBCommitMessageViewVerticalLineLength + 2 + + + 135 + @@ -984,6 +1091,9 @@ + + + General @@ -1333,6 +1443,48 @@ + + 126 + + + YES + + + + + + 127 + + + + + 128 + + + YES + + + + + + 129 + + + + + 130 + + + YES + + + + + + 131 + + + @@ -1356,7 +1508,13 @@ 12.IBPluginDependency 122.IBPluginDependency 123.IBPluginDependency + 126.IBPluginDependency + 127.IBPluginDependency + 128.IBPluginDependency + 129.IBPluginDependency 13.IBPluginDependency + 130.IBPluginDependency + 131.IBPluginDependency 14.IBPluginDependency 15.IBEditorWindowLastContentRect 15.IBPluginDependency @@ -1400,7 +1558,7 @@ YES com.apple.InterfaceBuilder.CocoaPlugin - {{845, 698}, {400, 186}} + {{845, 648}, {400, 236}} com.apple.InterfaceBuilder.CocoaPlugin YES @@ -1425,7 +1583,13 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{514, 459}, {106, 71}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{443, 712}, {103, 71}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -1488,7 +1652,7 @@ - 125 + 135 diff --git a/PBCommitMessageView.m b/PBCommitMessageView.m index 02714c0..ad18ed7 100644 --- a/PBCommitMessageView.m +++ b/PBCommitMessageView.m @@ -19,18 +19,20 @@ // draw a vertical line after the given size (used as an indicator // for the first line of the commit message) - float characterWidth = [@" " sizeWithAttributes:[self typingAttributes]].width; - float lineWidth = characterWidth * [PBGitDefaults commitMessageViewVerticalLineLength]; + if ([PBGitDefaults commitMessageViewHasVerticalLine]) { + float characterWidth = [@" " sizeWithAttributes:[self typingAttributes]].width; + float lineWidth = characterWidth * [PBGitDefaults commitMessageViewVerticalLineLength]; - [[NSColor lightGrayColor] set]; - // This depends upon the fact that NSTextView always redraws complete lines. - float padding = [[self textContainer] lineFragmentPadding]; - NSRect line; - line.origin.x = padding + aRect.origin.x + lineWidth; - line.origin.y = aRect.origin.y; - line.size.width = 1; - line.size.height = aRect.size.height; - NSRectFill(line); + [[NSColor lightGrayColor] set]; + // This depends upon the fact that NSTextView always redraws complete lines. + float padding = [[self textContainer] lineFragmentPadding]; + NSRect line; + line.origin.x = padding + aRect.origin.x + lineWidth; + line.origin.y = aRect.origin.y; + line.size.width = 1; + line.size.height = aRect.size.height; + NSRectFill(line); + } [self setBackgroundColor:nil]; [super drawRect:aRect]; diff --git a/PBGitDefaults.h b/PBGitDefaults.h index 22c8c9a..f54a9f5 100644 --- a/PBGitDefaults.h +++ b/PBGitDefaults.h @@ -12,6 +12,7 @@ } + (int) commitMessageViewVerticalLineLength; ++ (BOOL) commitMessageViewHasVerticalLine; + (BOOL) isGistEnabled; + (BOOL) isGravatarEnabled; + (BOOL) confirmPublicGists; diff --git a/PBGitDefaults.m b/PBGitDefaults.m index 3409437..58111ca 100644 --- a/PBGitDefaults.m +++ b/PBGitDefaults.m @@ -10,6 +10,7 @@ #define kDefaultVerticalLineLength 50 #define kCommitMessageViewVerticalLineLength @"PBCommitMessageViewVerticalLineLength" +#define kCommitMessageViewHasVerticalLine @"PBCommitMessageViewHasVerticalLine" #define kEnableGist @"PBEnableGist" #define kEnableGravatar @"PBEnableGravatar" #define kConfirmPublicGists @"PBConfirmPublicGists" @@ -31,6 +32,8 @@ NSMutableDictionary *defaultValues = [NSMutableDictionary dictionary]; [defaultValues setObject:[NSNumber numberWithInt:kDefaultVerticalLineLength] forKey:kCommitMessageViewVerticalLineLength]; + [defaultValues setObject:[NSNumber numberWithBool:YES] + forKey:kCommitMessageViewHasVerticalLine]; [defaultValues setObject:[NSNumber numberWithBool:YES] forKey:kEnableGist]; [defaultValues setObject:[NSNumber numberWithBool:YES] @@ -57,6 +60,11 @@ return [[NSUserDefaults standardUserDefaults] integerForKey:kCommitMessageViewVerticalLineLength]; } ++ (BOOL) commitMessageViewHasVerticalLine +{ + return [[NSUserDefaults standardUserDefaults] boolForKey:kCommitMessageViewHasVerticalLine]; +} + + (BOOL) isGistEnabled { return [[NSUserDefaults standardUserDefaults] boolForKey:kEnableGist]; From ca846bc6eb40240fab0e17bce0e26dbc3ffb981a Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Fri, 19 Feb 2010 18:20:47 -0700 Subject: [PATCH 73/90] Have the preferences window remember the last view --- DBPrefsWindowController.h | 1 + DBPrefsWindowController.m | 18 +++++++++++++++--- PBPrefsWindowController.m | 18 ++++++++++++++++++ 3 files changed, 34 insertions(+), 3 deletions(-) diff --git a/DBPrefsWindowController.h b/DBPrefsWindowController.h index cc208de..5cb711e 100644 --- a/DBPrefsWindowController.h +++ b/DBPrefsWindowController.h @@ -71,5 +71,6 @@ - (void)crossFadeView:(NSView *)oldView withView:(NSView *)newView; - (NSRect)frameForView:(NSView *)view; +- (NSString *)defaultViewIdentifier; @end diff --git a/DBPrefsWindowController.m b/DBPrefsWindowController.m index 3988a99..58b4d6b 100644 --- a/DBPrefsWindowController.m +++ b/DBPrefsWindowController.m @@ -211,9 +211,9 @@ static DBPrefsWindowController *_sharedPrefsWindowController = nil; [toolbar release]; } - NSString *firstIdentifier = [toolbarIdentifiers objectAtIndex:0]; - [[[self window] toolbar] setSelectedItemIdentifier:firstIdentifier]; - [self displayViewForIdentifier:firstIdentifier animate:NO]; + NSString *identifier = [self defaultViewIdentifier]; + [[[self window] toolbar] setSelectedItemIdentifier:identifier]; + [self displayViewForIdentifier:identifier animate:NO]; [[self window] center]; @@ -406,4 +406,16 @@ static DBPrefsWindowController *_sharedPrefsWindowController = nil; +#pragma mark - +#pragma mark Default View + + +- (NSString *)defaultViewIdentifier +{ + return [toolbarIdentifiers objectAtIndex:0]; +} + + + + @end diff --git a/PBPrefsWindowController.m b/PBPrefsWindowController.m index 254adc4..418f5f0 100644 --- a/PBPrefsWindowController.m +++ b/PBPrefsWindowController.m @@ -9,6 +9,8 @@ #import "PBPrefsWindowController.h" #import "PBGitRepository.h" +#define kPreferenceViewIdentifier @"PBGitXPreferenceViewIdentifier" + @implementation PBPrefsWindowController # pragma mark DBPrefsWindowController overrides @@ -23,6 +25,22 @@ [self addView:updatesPrefsView label:@"Updates"]; } +- (void)displayViewForIdentifier:(NSString *)identifier animate:(BOOL)animate +{ + [super displayViewForIdentifier:identifier animate:animate]; + + [[NSUserDefaults standardUserDefaults] setObject:identifier forKey:kPreferenceViewIdentifier]; +} + +- (NSString *)defaultViewIdentifier +{ + NSString *identifier = [[NSUserDefaults standardUserDefaults] objectForKey:kPreferenceViewIdentifier]; + if (identifier) + return identifier; + + return [super defaultViewIdentifier]; +} + #pragma mark - #pragma mark Delegate methods From 4a9abd2d8c357ebbb2c5aafee9f86456b9c91d8f Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Thu, 25 Feb 2010 21:16:38 -0700 Subject: [PATCH 74/90] Fix drawing ref labels on the next tableview column If there are a large number of refs pointing to a commit, then they may be drawn on top of or behind the other columns. This will not show any labels that don't fit. --- PBGitRevisionCell.m | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/PBGitRevisionCell.m b/PBGitRevisionCell.m index 6b0dfd2..0a129f1 100644 --- a/PBGitRevisionCell.m +++ b/PBGitRevisionCell.m @@ -149,8 +149,8 @@ static const int ref_spacing = 2; NSRect lastRect = rect; - lastRect.origin.x = round(lastRect.origin.x) - 0.5; - lastRect.origin.y = round(lastRect.origin.y) - 0.5; + lastRect.origin.x = round(lastRect.origin.x) + 0.5; + lastRect.origin.y = round(lastRect.origin.y) + 0.5; for (PBGitRef *ref in self.objectValue.refs) { NSMutableDictionary* attributes = [self attributesForRefLabelSelected:NO]; @@ -161,9 +161,11 @@ newRect.size.height = textSize.height; newRect.origin.y = rect.origin.y + (rect.size.height - newRect.size.height) / 2; - [array addObject:[NSValue valueWithRect:newRect]]; - lastRect = newRect; - lastRect.origin.x += (int)lastRect.size.width + ref_spacing; + if (NSContainsRect(rect, newRect)) { + [array addObject:[NSValue valueWithRect:newRect]]; + lastRect = newRect; + lastRect.origin.x += (int)lastRect.size.width + ref_spacing; + } } return array; From dc56af4aa683e11c975ecb1febfec873216d8b34 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Fri, 26 Feb 2010 10:26:01 -0700 Subject: [PATCH 75/90] CLIProxy: use the newly created NSURL for the workingDirectory NSURL's don't play nice with NSDistantObject, use the newly created NSURL instead of the NSDistantObject proxy. This fixes problems with rev specifiers created using the gitx tool crashing GitX the second time they are viewed because the NSConnection to the tool has been closed. --- PBCLIProxy.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PBCLIProxy.m b/PBCLIProxy.m index 83507d2..416c917 100644 --- a/PBCLIProxy.m +++ b/PBCLIProxy.m @@ -56,7 +56,7 @@ [document.windowController showCommitView:self]; else { PBGitRevSpecifier* rev = [[PBGitRevSpecifier alloc] initWithParameters:arguments]; - rev.workingDirectory = repositoryPath; + rev.workingDirectory = url; document.currentBranch = [document addBranch: rev]; [document.windowController showHistoryView:self]; } From c19d2c80582359211ec0bacede1262abd48130bc Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Sat, 27 Feb 2010 10:06:25 -0700 Subject: [PATCH 76/90] Add Diff to contextual menus - added to menus for refs, commits, and files - show a message when there are no changes --- PBDiffWindowController.h | 5 ++++- PBDiffWindowController.m | 30 ++++++++++++++++++++++++++++++ PBGitHistoryController.m | 16 +++++++++++++++- PBRefController.h | 1 + PBRefController.m | 14 ++++++++++++++ PBRefMenuItem.m | 7 +++++++ PBWebDiffController.m | 5 ++++- html/views/diff/diffWindow.css | 14 ++++++++++++++ html/views/diff/diffWindow.js | 8 ++++++++ html/views/diff/index.html | 6 ++++++ 10 files changed, 103 insertions(+), 3 deletions(-) create mode 100644 html/views/diff/diffWindow.css create mode 100644 html/views/diff/diffWindow.js diff --git a/PBDiffWindowController.h b/PBDiffWindowController.h index 6cb1baf..b8dba7e 100644 --- a/PBDiffWindowController.h +++ b/PBDiffWindowController.h @@ -8,11 +8,14 @@ #import +@class PBGitCommit; @interface PBDiffWindowController : NSWindowController { NSString *diff; } -- initWithDiff:(NSString *)diff; ++ (void) showDiffWindowWithFiles:(NSArray *)filePaths fromCommit:(PBGitCommit *)startCommit diffCommit:(PBGitCommit *)diffCommit; +- (id) initWithDiff:(NSString *)diff; + @property (readonly) NSString *diff; @end diff --git a/PBDiffWindowController.m b/PBDiffWindowController.m index cd5dcc5..496c850 100644 --- a/PBDiffWindowController.m +++ b/PBDiffWindowController.m @@ -7,6 +7,8 @@ // #import "PBDiffWindowController.h" +#import "PBGitRepository.h" +#import "PBGitCommit.h" @implementation PBDiffWindowController @@ -21,4 +23,32 @@ return self; } + ++ (void) showDiffWindowWithFiles:(NSArray *)filePaths fromCommit:(PBGitCommit *)startCommit diffCommit:(PBGitCommit *)diffCommit +{ + if (!startCommit) + return; + + if (!diffCommit) + diffCommit = [startCommit.repository headCommit]; + + NSString *commitSelector = [NSString stringWithFormat:@"%@..%@", [startCommit realSha], [diffCommit realSha]]; + NSMutableArray *arguments = [NSMutableArray arrayWithObjects:@"diff", commitSelector, nil]; + if (filePaths) { + [arguments addObject:@"--"]; + [arguments addObjectsFromArray:filePaths]; + } + + int retValue; + NSString *diff = [startCommit.repository outputInWorkdirForArguments:arguments retValue:&retValue]; + if (retValue) { + NSLog(@"diff failed with retValue: %d for command: '%@' output: '%@'", retValue, [arguments componentsJoinedByString:@" "], diff); + return; + } + + PBDiffWindowController *diffController = [[PBDiffWindowController alloc] initWithDiff:[diff copy]]; + [diffController showWindow:nil]; +} + + @end diff --git a/PBGitHistoryController.m b/PBGitHistoryController.m index 79b77c3..8fc914e 100644 --- a/PBGitHistoryController.m +++ b/PBGitHistoryController.m @@ -16,6 +16,7 @@ #import "PBAddRemoteSheet.h" #import "PBGitSidebarController.h" #import "PBGitGradientBarView.h" +#import "PBDiffWindowController.h" #define QLPreviewPanel NSClassFromString(@"QLPreviewPanel") @@ -294,6 +295,10 @@ [repository checkoutFiles:files fromRefish:realCommit]; } +- (void) diffFilesAction:(id)sender +{ + [PBDiffWindowController showDiffWindowWithFiles:[sender representedObject] fromCommit:realCommit diffCommit:nil]; +} - (NSMenu *)contextMenuForTreeView { @@ -315,6 +320,15 @@ NSMenuItem *historyItem = [[NSMenuItem alloc] initWithTitle:multiple? @"Show history of files" : @"Show history of file" action:@selector(showCommitsFromTree:) keyEquivalent:@""]; + + PBGitRef *headRef = [[repository headRef] ref]; + NSString *headRefName = [headRef shortName]; + NSString *diffTitle = [NSString stringWithFormat:@"Diff %@ with %@", multiple ? @"files" : @"file", headRefName]; + BOOL isHead = [[realCommit realSha] isEqualToString:[repository headSHA]]; + NSMenuItem *diffItem = [[NSMenuItem alloc] initWithTitle:diffTitle + action:isHead ? nil : @selector(diffFilesAction:) + keyEquivalent:@""]; + NSMenuItem *checkoutItem = [[NSMenuItem alloc] initWithTitle:multiple ? @"Checkout files" : @"Checkout file" action:@selector(checkoutFiles:) keyEquivalent:@""]; @@ -325,7 +339,7 @@ action:@selector(openFilesAction:) keyEquivalent:@""]; - NSArray *menuItems = [NSArray arrayWithObjects:historyItem, checkoutItem, finderItem, openFilesItem, nil]; + NSArray *menuItems = [NSArray arrayWithObjects:historyItem, diffItem, checkoutItem, finderItem, openFilesItem, nil]; for (NSMenuItem *item in menuItems) { [item setTarget:self]; [item setRepresentedObject:filePaths]; diff --git a/PBRefController.h b/PBRefController.h index 3794d51..76e5cd8 100644 --- a/PBRefController.h +++ b/PBRefController.h @@ -37,6 +37,7 @@ - (void) createBranch:(PBRefMenuItem *)sender; - (void) copySHA:(PBRefMenuItem *)sender; - (void) copyPatch:(PBRefMenuItem *)sender; +- (void) diffWithHEAD:(PBRefMenuItem *)sender; - (void) createTag:(PBRefMenuItem *)sender; - (void) showTagInfoSheet:(PBRefMenuItem *)sender; diff --git a/PBRefController.m b/PBRefController.m index af51b10..ebddf1a 100644 --- a/PBRefController.m +++ b/PBRefController.m @@ -12,6 +12,7 @@ #import "PBCreateBranchSheet.h" #import "PBCreateTagSheet.h" #import "PBGitDefaults.h" +#import "PBDiffWindowController.h" @implementation PBRefController @@ -204,6 +205,19 @@ } +#pragma mark Diff + +- (void) diffWithHEAD:(PBRefMenuItem *)sender +{ + PBGitCommit *commit = nil; + if ([[sender refish] refishType] == kGitXCommitType) + commit = (PBGitCommit *)[sender refish]; + else + commit = [historyController.repository commitForRef:[sender refish]]; + + [PBDiffWindowController showDiffWindowWithFiles:nil fromCommit:commit diffCommit:nil]; +} + #pragma mark Tags - (void) createTag:(PBRefMenuItem *)sender diff --git a/PBRefMenuItem.m b/PBRefMenuItem.m index 532636e..8a571d5 100644 --- a/PBRefMenuItem.m +++ b/PBRefMenuItem.m @@ -66,6 +66,10 @@ // view tag info if ([ref isTag]) [items addObject:[PBRefMenuItem itemWithTitle:@"View tag info…" action:@selector(showTagInfoSheet:) enabled:YES]]; + + // Diff + NSString *diffTitle = [NSString stringWithFormat:@"Diff with %@", headRefName]; + [items addObject:[PBRefMenuItem itemWithTitle:diffTitle action:@selector(diffWithHEAD:) enabled:!isHead]]; [items addObject:[PBRefMenuItem separatorItem]]; // merge ref @@ -141,6 +145,7 @@ NSString *headBranchName = [[[commit.repository headRef] ref] shortName]; BOOL isOnHeadBranch = [commit isOnHeadBranch]; + BOOL isHead = [[commit realSha] isEqualToString:[commit.repository headSHA]]; [items addObject:[PBRefMenuItem itemWithTitle:@"Checkout Commit" action:@selector(checkout:) enabled:YES]]; [items addObject:[PBRefMenuItem separatorItem]]; @@ -151,6 +156,8 @@ [items addObject:[PBRefMenuItem itemWithTitle:@"Copy SHA" action:@selector(copySHA:) enabled:YES]]; [items addObject:[PBRefMenuItem itemWithTitle:@"Copy Patch" action:@selector(copyPatch:) enabled:YES]]; + NSString *diffTitle = [NSString stringWithFormat:@"Diff with %@", headBranchName]; + [items addObject:[PBRefMenuItem itemWithTitle:diffTitle action:@selector(diffWithHEAD:) enabled:!isHead]]; [items addObject:[PBRefMenuItem separatorItem]]; // merge commit diff --git a/PBWebDiffController.m b/PBWebDiffController.m index a537bd0..0e820b3 100644 --- a/PBWebDiffController.m +++ b/PBWebDiffController.m @@ -35,7 +35,10 @@ return; id script = [view windowScriptObject]; - [script callWebScriptMethod:@"showDiff" withArguments: [NSArray arrayWithObject:diff]]; + if ([diff length] == 0) + [script callWebScriptMethod:@"setMessage" withArguments:[NSArray arrayWithObject:@"There are no differences"]]; + else + [script callWebScriptMethod:@"showDiff" withArguments:[NSArray arrayWithObject:diff]]; } @end diff --git a/html/views/diff/diffWindow.css b/html/views/diff/diffWindow.css new file mode 100644 index 0000000..e9a5122 --- /dev/null +++ b/html/views/diff/diffWindow.css @@ -0,0 +1,14 @@ +#message { + margin-left: 20px; + margin-right: 20px; + margin-top: 40px; + text-align: center; + font-size: 200%; + padding: 20px; + width: auto; + + background-color: #B4D7FF; + border: 2px solid #45A1FE; + + -webkit-border-radius: 10px; +} \ No newline at end of file diff --git a/html/views/diff/diffWindow.js b/html/views/diff/diffWindow.js new file mode 100644 index 0000000..6cef3d7 --- /dev/null +++ b/html/views/diff/diffWindow.js @@ -0,0 +1,8 @@ +// for diffs shown in the PBDiffWindow + +var setMessage = function(message) { + $("message").style.display = ""; + $("message").innerHTML = message.escapeHTML(); + $("diff").style.display = "none"; +} + diff --git a/html/views/diff/index.html b/html/views/diff/index.html index f437056..dc4e6f3 100644 --- a/html/views/diff/index.html +++ b/html/views/diff/index.html @@ -7,6 +7,9 @@ + + +
Author:Pieter de Bie
Date:Pieter de Bie
Committer:Pieter de Bie
Commit Date:Pieter de Bie + + + + + + + + + + + + + + + + + + +
Author:
Date:
Commiter:
Date:
+
Subject:Pieter de Bie
Refs: