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 add846a..518c734 100644 --- a/ApplicationController.m +++ b/ApplicationController.m @@ -17,6 +17,7 @@ #import "PBNSURLPathUserDefaultsTransfomer.h" #import "PBGitDefaults.h" #import "Sparkle/SUUpdater.h" +#import "PBCloneRepositoryPanel.h" @implementation ApplicationController @synthesize cliProxy; @@ -28,8 +29,9 @@ #endif if(self = [super init]) { - if(![[NSBundle bundleWithPath:@"/System/Library/PrivateFrameworks/QuickLookUI.framework"] load]) - NSLog(@"Could not load QuickLook"); + if(![[NSBundle bundleWithPath:@"/System/Library/Frameworks/Quartz.framework/Frameworks/QuickLookUI.framework"] load]) + if(![[NSBundle bundleWithPath:@"/System/Library/PrivateFrameworks/QuickLookUI.framework"] load]) + NSLog(@"Could not load QuickLook"); self.cliProxy = [PBCLIProxy new]; } @@ -67,32 +69,47 @@ [[SUUpdater sharedUpdater] setSendsSystemProfile:YES]; [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]; } @@ -120,6 +137,14 @@ [NSApp orderFrontStandardAboutPanelWithOptions:dict]; } +- (IBAction) showCloneRepository:(id)sender +{ + if (!cloneRepositoryPanel) + cloneRepositoryPanel = [PBCloneRepositoryPanel panel]; + + [cloneRepositoryPanel showWindow:self]; +} + - (IBAction)installCliTool:(id)sender; { BOOL success = NO; @@ -326,6 +351,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/CWQuickLook.h b/CWQuickLook.h index df1de9c..21d0315 100644 --- a/CWQuickLook.h +++ b/CWQuickLook.h @@ -1,5 +1,12 @@ @interface QLPreviewPanel : NSPanel + (id)sharedPreviewPanel; + +// part of the public QL API ++ (BOOL)sharedPreviewPanelExists; +- (void)reloadData; +- (void)setDataSource:(id)source; + +// the private QL API + (id)_previewPanel; + (BOOL)isSharedPreviewPanelLoaded; - (id)initWithContentRect:(struct _NSRect)fp8 styleMask:(unsigned int)fp24 backing:(unsigned int)fp28 defer:(BOOL)fp32; 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/English.lproj/MainMenu.xib b/English.lproj/MainMenu.xib index 8dbbc74..bec5dd0 100644 --- a/English.lproj/MainMenu.xib +++ b/English.lproj/MainMenu.xib @@ -1,14 +1,17 @@ - + 1050 - 9G55 - 677 - 949.43 - 353.00 + 10C540 + 762 + 1038.25 + 458.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 762 + YES - YES @@ -16,7 +19,7 @@ YES - + YES @@ -80,7 +83,7 @@ - RW5hYmxlIFRlcm1pbmFsIFVzYWdl4oCmA + Enable Terminal Usage… 1048576 2147483647 @@ -89,7 +92,7 @@ - UHJlZmVyZW5jZXPigKY + Preferences… , 1048576 2147483647 @@ -98,7 +101,7 @@ - Q2hlY2sgZm9yIFVwZGF0ZXPigKY + Check for Updates… 2147483647 @@ -213,7 +216,7 @@ YES - TmV34oCmA + New… n 1048576 2147483647 @@ -222,13 +225,21 @@ - T3BlbuKApg + Open… o 1048576 2147483647 + + + Clone… + + 2147483647 + + + Open Recent @@ -277,8 +288,17 @@ + + + Clone To… + + 2147483647 + + + + YES Save s 1048576 @@ -288,7 +308,8 @@ - U2F2ZSBBc+KApg + YES + Save As… S 1048576 2147483647 @@ -297,6 +318,7 @@ + YES Revert to Saved 2147483647 @@ -307,6 +329,7 @@ YES YES + YES 1048576 @@ -316,7 +339,8 @@ - UGFnZSBTZXR1cOKApg + YES + Page Setup… P 1048576 2147483647 @@ -325,7 +349,8 @@ - UHJpbnTigKY + YES + Print… p 1048576 2147483647 @@ -452,7 +477,7 @@ YES - RmluZOKApg + Find… f 1048576 2147483647 @@ -517,7 +542,7 @@ YES - U2hvdyBTcGVsbGluZ+KApg + Show Spelling… : 1048576 2147483647 @@ -632,6 +657,74 @@ + + + Repository + + 2147483647 + + + submenuAction: + + Repository + + YES + + + Create Tag + t + 1048576 + 2147483647 + + + + + + Create Branch + b + 1048576 + 2147483647 + + + + + + Add Remote + r + 1572864 + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + + + + Open in Terminal + + 2147483647 + + + + + + Reveal in Finder + + 2147483647 + + + + + + View @@ -656,7 +749,7 @@ - Q3VzdG9taXplIFRvb2xiYXLigKY + Customize Toolbar… 1048576 2147483647 @@ -704,26 +797,17 @@ - Detailed View + Detail View 1 1572864 2147483647 - - - Raw View - 2 - 1572864 - 2147483647 - - - Tree View - 3 + 2 1572864 2147483647 @@ -1148,30 +1232,6 @@ 920 - - - setDetailedView: - - - - 923 - - - - setRawView: - - - - 924 - - - - setTreeView: - - - - 925 - refresh: @@ -1220,34 +1280,104 @@ 934 + + + createBranch: + + + + 941 + + + + openInTerminal: + + + + 944 + + + + revealInFinder: + + + + 948 + + + + createTag: + + + + 950 + + + + showAddRemoteSheet: + + + + 953 + + + + cloneTo: + + + + 955 + + + + showCloneRepository: + + + + 958 + + + + setDetailedView: + + + + 962 + + + + setTreeView: + + + + 963 + YES 0 - - YES - + -2 - - RmlsZSdzIE93bmVyA + + File's Owner -1 - + First Responder -3 - + Application @@ -1261,8 +1391,9 @@ + - + MainMenu @@ -1384,6 +1515,8 @@ + + @@ -1769,7 +1902,6 @@ - @@ -1792,7 +1924,7 @@ 205 - + ApplicationController @@ -1805,11 +1937,6 @@ - - 851 - - - 852 @@ -1818,7 +1945,7 @@ 908 - + 909 @@ -1828,7 +1955,7 @@ 912 - + 915 @@ -1843,7 +1970,7 @@ 918 - + 919 @@ -1865,14 +1992,75 @@ + + 936 + + + YES + + + + + + 937 + + + YES + + + + + + + + + + + 938 + + + + + 942 + + + + + 943 + + + + + 947 + + + + + 949 + + + + + 951 + + + + + 954 + + + + + 956 + + + YES - + YES - -1.IBPluginDependency - -2.IBPluginDependency -3.IBPluginDependency -3.ImportedFromIB2 103.IBPluginDependency @@ -1886,6 +2074,7 @@ 112.ImportedFromIB2 124.IBPluginDependency 124.ImportedFromIB2 + 125.IBEditorWindowLastContentRect 125.IBPluginDependency 125.ImportedFromIB2 126.IBPluginDependency @@ -1920,6 +2109,7 @@ 157.ImportedFromIB2 158.IBPluginDependency 158.ImportedFromIB2 + 159.IBEditorWindowLastContentRect 159.IBPluginDependency 159.ImportedFromIB2 160.IBPluginDependency @@ -1950,6 +2140,7 @@ 174.ImportedFromIB2 184.IBPluginDependency 184.ImportedFromIB2 + 185.IBEditorWindowLastContentRect 185.IBPluginDependency 185.ImportedFromIB2 187.IBPluginDependency @@ -1960,12 +2151,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 +2167,7 @@ 219.ImportedFromIB2 224.IBPluginDependency 224.ImportedFromIB2 + 225.IBEditorWindowLastContentRect 225.IBPluginDependency 225.ImportedFromIB2 227.IBPluginDependency @@ -2043,191 +2235,201 @@ 83.ImportedFromIB2 847.IBPluginDependency 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 + 947.IBPluginDependency + 949.IBPluginDependency + 951.IBPluginDependency + 954.IBPluginDependency + 956.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 - + + {{552, 706}, {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}} + + {{790, 533}, {231, 173}} 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, 493}, {196, 243}} 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 @@ -2240,15 +2442,21 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + {{668, 623}, {206, 113}} + 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 @@ -2256,15 +2464,13 @@ YES - - YES - + YES - 934 + 963 @@ -2274,12 +2480,13 @@ NSObject YES - + YES installCliTool: openPreferencesWindow: - showAboutPanel: saveAction: + showAboutPanel: + showCloneRepository: showHelp: @@ -2289,11 +2496,12 @@ id id id + id YES - + YES firstResponder window @@ -2322,7 +2530,7 @@ NSObject YES - + YES setDetailedView: setRawView: @@ -2341,14 +2549,52 @@ - PBGitCommitController - PBViewController + NSOutlineView + + IBProjectSource + NSOutlineViewExt.h + + + + PBCollapsibleSplitView + PBNiceSplitView + + IBProjectSource + PBCollapsibleSplitView.h + + + + PBCommitList + NSTableView + + YES + + YES + controller + webController + webView + + + YES + PBGitHistoryController + PBWebHistoryController + WebView + + + + IBProjectSource + PBCommitList.h + + + + PBCreateBranchSheet + NSWindowController YES - + YES - commit: - refresh: + closeCreateBranchSheet: + createBranch: YES @@ -2358,9 +2604,86 @@ YES - + + YES + branchNameField + errorMessageField + startRefish + + + YES + NSTextField + NSTextField + id + + + + IBProjectSource + 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 + + YES + + YES + commit: + refresh: + signOff: + + + YES + id + id + id + + + + YES + YES cachedFilesController + commitButton commitMessageView indexController unstagedFilesController @@ -2369,10 +2692,11 @@ YES NSArrayController + NSButton NSTextView - id + PBGitIndexController NSArrayController - id + PBWebChangesController @@ -2385,14 +2709,20 @@ PBViewController YES - + YES + createBranch: + createTag: + openFilesAction: openSelectedFile: refresh: setDetailedView: setRawView: setTreeView: - toggleQuickView: + showAddRemoteSheet: + showCommitsFromTree: + showInFinderAction: + toggleQLPreviewPanel: YES @@ -2402,15 +2732,23 @@ id id id + id + id + id + id + id + id YES - + YES commitController commitList fileBrowser + historySplitView + refController searchField treeController webView @@ -2420,6 +2758,8 @@ NSArrayController NSTableView NSOutlineView + PBCollapsibleSplitView + PBRefController NSSearchField NSTreeController id @@ -2430,13 +2770,56 @@ 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 + cloneTo: + openInTerminal: + revealInFinder: showCommitView: showHistoryView: @@ -2444,11 +2827,35 @@ YES id id + id + id + id - contentView - NSView + YES + + YES + contentSplitView + finderItem + progressIndicator + sourceListControlsView + sourceSplitView + splitView + statusField + terminalItem + + + YES + NSView + NSToolbarItem + NSProgressIndicator + NSView + NSView + NSSplitView + NSTextField + NSToolbarItem + IBProjectSource @@ -2460,7 +2867,7 @@ NSWindowController YES - + YES openSelectedFile: refresh: @@ -2481,7 +2888,7 @@ YES - + YES commitController commitList @@ -2501,6 +2908,90 @@ + + PBNiceSplitView + NSSplitView + + IBProjectSource + PBNiceSplitView.h + + + + PBRefController + NSObject + + YES + + YES + checkout: + cherryPick: + copyPatch: + copySHA: + createBranch: + createTag: + fetchRemote: + merge: + pullRemote: + pushDefaultRemoteForRef: + pushToRemote: + pushUpdatesToRemote: + rebaseActiveBranch: + rebaseHeadBranch: + showTagInfoSheet: + + + YES + PBRefMenuItem + PBRefMenuItem + PBRefMenuItem + PBRefMenuItem + PBRefMenuItem + PBRefMenuItem + PBRefMenuItem + PBRefMenuItem + PBRefMenuItem + PBRefMenuItem + 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 @@ -2520,15 +3011,78 @@ PBViewController NSViewController - - viewToolbar - NSToolbar - IBProjectSource 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 + + + + PBWebHistoryController + PBWebController + + YES + + YES + contextMenuDelegate + historyController + + + YES + id + PBGitHistoryController + + + + IBProjectSource + PBWebHistoryController.h + + YES @@ -2553,9 +3107,798 @@ + + 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 + + + + NSProgressIndicator + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSProgressIndicator.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 + + + + NSToolbarItem + NSObject + + + + 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 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES ../GitX.xcodeproj 3 + + YES + + YES + NSMenuCheckmark + NSMenuMixedState + + + YES + {9, 8} + {7, 2} + + 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/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/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/English.lproj/PBCreateBranchSheet.xib b/English.lproj/PBCreateBranchSheet.xib new file mode 100644 index 0000000..e3abaf8 --- /dev/null +++ b/English.lproj/PBCreateBranchSheet.xib @@ -0,0 +1,1104 @@ + + + + 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 + + + + + + 268 + {{122, 58}, {129, 18}} + + YES + + -2080244224 + 0 + Checkout branch + + + 1211912703 + 2 + + NSImage + NSSwitch + + + NSSwitch + + + + 200 + 25 + + + + {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 + + + + value: shouldCheckoutBranch + + + + + + value: shouldCheckoutBranch + value + shouldCheckoutBranch + 2 + + + 59 + + + + + 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 + + + + + 56 + + + YES + + + + + + 57 + + + + + + + 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 + 56.IBPluginDependency + 57.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 + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + YES + + + YES + + + + + YES + + + YES + + + + 59 + + + + YES + + PBCreateBranchSheet + NSWindowController + + YES + + YES + closeCreateBranchSheet: + createBranch: + + + YES + id + id + + + + YES + + YES + branchNameField + errorMessageField + startRefish + + + YES + NSTextField + NSTextField + id + + + + 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 + + + + 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/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/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/English.lproj/Preferences.xib b/English.lproj/Preferences.xib index 465f1e1..e90280b 100644 --- a/English.lproj/Preferences.xib +++ b/English.lproj/Preferences.xib @@ -1,26 +1,28 @@ - + 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 @@ -43,54 +45,127 @@ 268 YES - + 268 - {{17, 54}, {99, 17}} + {{248, 100}, {41, 22}} YES - - 68288064 + + -1804468671 272630784 - Git Executable: + LucidaGrande - 1.300000e+01 + 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 controlColor 3 - MC42NjY2NjY2OQA + MC42NjY2NjY2NjY3AA 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 YES - + YES Apple URL pasteboard type NSFilenamesPboardType - {{121, 50}, {179, 22}} + {{121, 70}, {179, 22}} YES @@ -98,7 +173,7 @@ 163840 LucidaGrande - 1.100000e+01 + 11 3100 @@ -112,7 +187,7 @@ 268 - {{118, 0}, {192, 42}} + {{118, 20}, {192, 42}} YES @@ -128,7 +203,7 @@ 268 - {{306, 54}, {54, 14}} + {{306, 74}, {54, 14}} YES @@ -153,7 +228,7 @@ 268 - {{18, 103}, {203, 18}} + {{18, 150}, {203, 18}} YES @@ -164,13 +239,30 @@ 1211912703 2 - - NSImage - NSSwitch - - - NSSwitch - + + + + + 200 + 25 + + + + + 268 + {{18, 175}, {279, 18}} + + YES + + -2080244224 + 0 + Reopen all repositories from last session + + + 1211912703 + 2 + + 200 @@ -180,18 +272,18 @@ 268 - {{18, 78}, {207, 18}} + {{18, 200}, {207, 18}} YES -2080244224 0 - U2hvdyAiT3BlbiIgcGFuZWwgb24gbGF1bmNoA + Show "Open" panel on launch 1211912703 2 - + @@ -200,7 +292,7 @@ - {400, 139} + {400, 236} NSView @@ -214,6 +306,7 @@ 268 {{39, 45}, {82, 14}} + YES 68288064 @@ -230,6 +323,7 @@ 268 {{18, 103}, {260, 18}} + YES -2080244224 @@ -239,7 +333,7 @@ 1211912703 2 - + @@ -250,8 +344,9 @@ 268 - {{130, 78}, {100, 22}} + {{130, 78}, {102, 22}} + YES -2076049856 @@ -339,6 +434,7 @@ 268 {{39, 80}, {89, 17}} + YES 68288064 @@ -355,6 +451,7 @@ 268 {{130, 45}, {251, 14}} + YES 68288064 @@ -364,7 +461,7 @@ YES - + YES dateFormat_10_0 dateStyle @@ -374,7 +471,7 @@ YES %m/%d/%y - + @@ -392,6 +489,7 @@ 268 {{128, 13}, {96, 28}} + YES 67239424 @@ -410,6 +508,7 @@ {400, 139} + NSView @@ -431,7 +530,7 @@ 1211912703 2 - + @@ -450,7 +549,8 @@ YES - PBShowOpenPanelOnLaunch + PBCommitMessageViewHasVerticalLine + PBCommitMessageViewVerticalLineLength YES @@ -468,12 +568,12 @@ -2080244224 0 - RW5hYmxlICdHaXN0IGl0Jw + Enable 'Gist it' 1211912703 2 - + @@ -495,7 +595,7 @@ 1211912703 2 - + @@ -517,7 +617,7 @@ 1211912703 2 - + @@ -539,7 +639,7 @@ 1211912703 2 - + @@ -749,7 +849,7 @@ values.gitExecutable YES - + YES NSAllowsEditingMultipleValuesSelection NSNullPlaceholder @@ -903,34 +1003,80 @@ 121 + + + value: values.PBOpenPreviousDocumentsOnLaunch + + + + + + value: values.PBOpenPreviousDocumentsOnLaunch + value + values.PBOpenPreviousDocumentsOnLaunch + 2 + + + 125 + + + + value: values.PBCommitMessageViewHasVerticalLine + + + + + + value: values.PBCommitMessageViewHasVerticalLine + value + values.PBCommitMessageViewHasVerticalLine + 2 + + + 133 + + + + value: values.PBCommitMessageViewVerticalLineLength + + + + + + value: values.PBCommitMessageViewVerticalLineLength + value + values.PBCommitMessageViewVerticalLineLength + 2 + + + 135 + YES 0 - - YES - + -2 - - RmlsZSdzIE93bmVyA + + File's Owner -1 - + First Responder -3 - + Application @@ -944,8 +1090,12 @@ + + + + - + General @@ -960,7 +1110,7 @@ - + Updates @@ -1090,12 +1240,12 @@ 26 - + 28 - + 42 @@ -1151,7 +1301,7 @@ YES - + Open Panel Accessory @@ -1192,7 +1342,7 @@ - + Integration @@ -1279,14 +1429,68 @@ + + 122 + + + YES + + + + + + 123 + + + + + 126 + + + YES + + + + + + 127 + + + + + 128 + + + YES + + + + + + 129 + + + + + 130 + + + YES + + + + + + 131 + + + YES - + YES - -1.IBPluginDependency - -2.IBPluginDependency -3.IBPluginDependency 1.IBEditorWindowLastContentRect 1.IBPluginDependency @@ -1302,7 +1506,15 @@ 118.IBPluginDependency 119.IBPluginDependency 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 @@ -1316,7 +1528,7 @@ 23.IBPluginDependency 24.IBPluginDependency 25.IBPluginDependency - 26.IBPluginDependency + 28.IBPluginDependency 4.IBEditorWindowLastContentRect 4.IBPluginDependency 4.IBUserGuides @@ -1346,15 +1558,13 @@ YES com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilderKit - com.apple.InterfaceBuilderKit - {{477, 551}, {400, 139}} + {{845, 648}, {400, 236}} com.apple.InterfaceBuilder.CocoaPlugin YES - 1.210000e+02 + 121 0 @@ -1371,7 +1581,15 @@ 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 + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{443, 712}, {103, 71}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -1390,7 +1608,7 @@ YES - 4.200000e+01 + 42 0 @@ -1420,9 +1638,7 @@ YES - - YES - + YES @@ -1430,15 +1646,13 @@ YES - - YES - + YES - 121 + 135 @@ -1456,7 +1670,7 @@ DBPrefsWindowController YES - + YES checkGitValidity: resetGitPath: @@ -1471,7 +1685,7 @@ YES - + YES badGitPathIcon generalPrefsView @@ -1526,9 +1740,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/English.lproj/RepositoryWindow.xib b/English.lproj/RepositoryWindow.xib index 003254b..fd8c769 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,382 @@ 15 2 - {{4, 386}, {850, 418}} + {{4, 290}, {890, 514}} 1886912512 GitX NSWindow - - {3.40282e+38, 3.40282e+38} - {213, 107} + + + A66F2540-5B64-4016-89F7-892563371FAF + + + YES + YES + YES + YES + 1 + 1 + + YES + + YES + 41FA1145-D953-446F-B6DF-0230885AB433 + 7A8FEE7B-B273-4AF3-8A22-53A9DAF786FA + B15C57F2-985F-4446-9A29-34C76DBA9042 + 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 + + + + B15C57F2-985F-4446-9A29-34C76DBA9042 + + Refresh + Refresh + + + + 268 + {{8, 14}, {32, 25}} + + + YES + + -2080244224 + 134217728 + Round Textured + + + -2033958657 + 163 + + NSImage + NSRefreshTemplate + + + + 400 + 75 + + + + + + {20, 25} + {32, 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 + + 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} + {600, 450} 274 - {850, 418} + + YES + + + 274 + + YES + + + 272 + {184, 483} + + NSView + + + + 274 + {{185, 0}, {705, 483}} + + NSView + + + {{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} {{0, 0}, {1440, 878}} - {213, 129} - {3.40282e+38, 3.40282e+38} + {600, 528} + {1.79769e+308, 1.79769e+308} GitX + 31 YES - - - contentView - - - - 245 - window @@ -76,34 +425,136 @@ 292 + + + delegate + + + + 354 + + + + sourceSplitView + + + + 355 + + + + contentSplitView + + + + 356 + + + + splitView + + + + 357 + + + + sourceListControlsView + + + + 395 + + + + progressIndicator + + + + 400 + + + + statusField + + + + 401 + + + + terminalItem + + + + 404 + + + + finderItem + + + + 405 + + + + openInTerminal: + + + + 406 + + + + revealInFinder: + + + + 407 + + + + cloneTo: + + + + 414 + + + + refresh: + + + + 419 + YES 0 - - YES - + -2 - - RmlsZSdzIE93bmVyA + + File's Owner -1 - + First Responder -3 - + Application @@ -112,8 +563,9 @@ YES + - + Window @@ -121,19 +573,168 @@ YES + + + + + 351 + + + YES + + + + + + + 353 + + + YES + + + Source SplitView + + + 352 + + + Content SplitView + + + 367 + + + YES + + + + + + + + + + + + 370 + + + + + 372 + + + + + 373 + + + + + 393 + + + Source List Controls View + + + 396 + + + YES + + + + + Status View + + + 397 + + + YES + + + + + + 398 + + + + + 399 + + + + + 402 + + + + + 403 + + + + + 412 + + + YES + + + + + + 410 + + + YES + + + + + + 411 + + + + + 415 + + + YES + + + + + + 416 + + + YES + + + + + + 417 + + + YES - + YES - -1.IBPluginDependency - -2.IBPluginDependency -3.IBPluginDependency 3.IBEditorWindowLastContentRect + 3.IBPluginDependency 3.IBWindowTemplateEditedContentRect 3.ImportedFromIB2 3.NSWindowTemplate.visibleAtLaunch @@ -142,32 +743,65 @@ 3.windowTemplate.hasMinSize 3.windowTemplate.maxSize 3.windowTemplate.minSize + 351.IBPluginDependency + 352.IBPluginDependency + 353.IBPluginDependency + 367.IBEditorWindowLastContentRect + 367.IBPluginDependency + 393.IBPluginDependency + 396.IBPluginDependency + 397.IBPluginDependency + 398.IBPluginDependency + 399.IBPluginDependency + 402.IBPluginDependency + 403.IBPluginDependency + 410.IBPluginDependency + 411.IBPluginDependency + 412.IBPluginDependency + 415.IBPluginDependency + 416.IBPluginDependency + 417.IBPluginDependency 5.IBPluginDependency 5.ImportedFromIB2 YES com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilderKit - com.apple.InterfaceBuilderKit - {{1047, 395}, {850, 418}} - {{1047, 395}, {850, 418}} - - + {{210, 655}, {890, 514}} + com.apple.InterfaceBuilder.CocoaPlugin + {{210, 655}, {890, 514}} + + {{15, 196}, {850, 418}} - + {3.40282e+38, 3.40282e+38} - {213, 107} + {600, 450} com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{347, 1169}, {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 + 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 @@ -175,15 +809,13 @@ YES - - YES - + YES - 350 + 419 @@ -193,8 +825,12 @@ NSWindowController YES - + YES + cloneTo: + openInTerminal: + refresh: + revealInFinder: showCommitView: showHistoryView: @@ -202,11 +838,36 @@ YES id id + id + id + id + id - contentView - NSView + YES + + YES + contentSplitView + finderItem + progressIndicator + sourceListControlsView + sourceSplitView + splitView + statusField + terminalItem + + + YES + NSView + NSToolbarItem + NSProgressIndicator + NSView + NSView + NSSplitView + NSTextField + NSToolbarItem + IBProjectSource @@ -222,9 +883,586 @@ + + 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 + + + + NSSplitView + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSSplitView.h + + + + NSTextField + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSTextField.h + + + + NSTextFieldCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSTextFieldCell.h + + + + NSToolbar + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSToolbar.h + + + + NSToolbarItem + NSObject + + + + 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 + + YES + + YES + CloneRepositoryTemplate + NSRefreshTemplate + + + YES + {26, 15} + {10, 12} + + diff --git a/GitX.xcodeproj/project.pbxproj b/GitX.xcodeproj/project.pbxproj index feb0c77..8467246 100644 --- a/GitX.xcodeproj/project.pbxproj +++ b/GitX.xcodeproj/project.pbxproj @@ -44,6 +44,44 @@ 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 */; }; + 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 */; }; + 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 */; }; + D828AEEC112F411100F09D11 /* CloneRepositoryTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = D828AEEB112F411100F09D11 /* CloneRepositoryTemplate.png */; }; + D8295D2A1130A1DC00C838E8 /* PBGitHistoryList.m in Sources */ = {isa = PBXBuildFile; fileRef = D8295D291130A1DC00C838E8 /* PBGitHistoryList.m */; }; + D8295DE01130E43900C838E8 /* PBGitHistoryGrapher.m in Sources */ = {isa = PBXBuildFile; fileRef = D8295DDF1130E43900C838E8 /* PBGitHistoryGrapher.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 */; }; + 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 */; }; + D8E105471157C18200FC28A4 /* PBQLTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = D8E105461157C18200FC28A4 /* PBQLTextView.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 */; }; + 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 */; }; + 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 */; }; @@ -65,6 +103,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 */; }; F567CC64106E6BC80059BB9D /* PBGitRepository.m in Sources */ = {isa = PBXBuildFile; fileRef = F5945E160E02B0C200706420 /* PBGitRepository.m */; }; F567CC65106E6BC90059BB9D /* PBGitBinary.m in Sources */ = {isa = PBXBuildFile; fileRef = F53C4DF60E97FC630022AD59 /* PBGitBinary.m */; }; F567CC66106E6BC90059BB9D /* PBGitConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = 93FCCBA80EA8AF450061B02B /* PBGitConfig.m */; }; @@ -102,6 +141,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 */; }; @@ -209,6 +251,66 @@ 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 = ""; }; + 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 = ""; }; + 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 = ""; }; + 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 = ""; }; + D8295D281130A1DC00C838E8 /* PBGitHistoryList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitHistoryList.h; sourceTree = ""; }; + D8295D291130A1DC00C838E8 /* PBGitHistoryList.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitHistoryList.m; sourceTree = ""; }; + D8295DDE1130E43900C838E8 /* PBGitHistoryGrapher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitHistoryGrapher.h; sourceTree = ""; }; + D8295DDF1130E43900C838E8 /* PBGitHistoryGrapher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitHistoryGrapher.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 = ""; }; + 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 = ""; }; + 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 = ""; }; + D8E105451157C18200FC28A4 /* PBQLTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBQLTextView.h; sourceTree = ""; }; + D8E105461157C18200FC28A4 /* PBQLTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBQLTextView.m; 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 = ""; }; + 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 = ""; }; + 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 = ""; }; @@ -244,6 +346,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 = ""; }; F567CC39106E6B910059BB9D /* GitXTesting.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = GitXTesting.framework; sourceTree = BUILT_PRODUCTS_DIR; }; F567CC3A106E6B910059BB9D /* GitXTesting-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "GitXTesting-Info.plist"; sourceTree = ""; }; F569AE920F2CBD7C00C2FFA7 /* Credits.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = Credits.html; sourceTree = ""; }; @@ -263,6 +367,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 = ""; }; @@ -325,6 +434,7 @@ F580E6AE0E733276009E2D3F /* Sparkle.framework in Frameworks */, F5E4DBFB0EAB58D90013FAFC /* SystemConfiguration.framework in Frameworks */, F5C580E50EDA250900995434 /* libgit2.a in Frameworks */, + D8E3B2B810DC9FB2001096A3 /* ScriptingBridge.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -380,6 +490,7 @@ 77C82804067257F0000B614F /* CoreData.framework */, 29B97325FDCFA39411CA2CEA /* Foundation.framework */, 29B97324FDCFA39411CA2CEA /* AppKit.framework */, + D8E3B2B710DC9FB2001096A3 /* ScriptingBridge.framework */, ); name = "Other Frameworks"; sourceTree = ""; @@ -419,7 +530,19 @@ 29B97315FDCFA39411CA2CEA /* Other Sources */ = { isa = PBXGroup; children = ( + D858108011274D28007F254B /* Branch.png */, + D858108111274D28007F254B /* RemoteBranch.png */, + D858108211274D28007F254B /* Tag.png */, + D85810541127476E007F254B /* StageView.png */, + D8FDDBF31143F318005647F6 /* AddRemote.png */, + D828A5EF1128AE7200F09D11 /* FetchTemplate.png */, + D828A5F01128AE7200F09D11 /* PullTemplate.png */, + D828A5F11128AE7200F09D11 /* PushTemplate.png */, + D828AEEB112F411100F09D11 /* CloneRepositoryTemplate.png */, 3BC07F4A0ED5A5C5009A7768 /* HistoryViewTemplate.png */, + D8A4BD041134AD2900E92D51 /* CherryPickTemplate.png */, + D8A4BD051134AD2900E92D51 /* MergeTemplate.png */, + D8A4BD061134AD2900E92D51 /* RebaseTemplate.png */, 3BC07F4B0ED5A5C5009A7768 /* CommitViewTemplate.png */, F56ADDD70ED19F9E002AC78F /* AddBranchTemplate.png */, F56ADDD80ED19F9E002AC78F /* AddLabelTemplate.png */, @@ -447,8 +570,15 @@ F5E424100EA3E4D60046E362 /* PBDiffWindow.xib */, F52BCE020E84208300AA3741 /* PBGitHistoryView.xib */, F59116E50E843BB50072CCB1 /* PBGitCommitView.xib */, + D85B939210E3D8B4007F3C28 /* PBCreateBranchSheet.xib */, + D889EB3010E6BCBB00F08413 /* PBCreateTagSheet.xib */, + D8C1B77110E875CF009B7F8B /* PBRemoteProgressSheet.xib */, + D8083C45111F136400337480 /* PBAddRemoteSheet.xib */, + D8083DCB111F918900337480 /* PBCloneRepsitoryToSheet.xib */, + D8FDD9F511432A12005647F6 /* PBCloneRepositoryPanel.xib */, 47DBDB680E94EF6500671A1E /* Preferences.xib */, F569AE920F2CBD7C00C2FFA7 /* Credits.html */, + F58DB55F10566E3900CFDF4A /* PBGitSidebarView.xib */, ); name = Resources; sourceTree = ""; @@ -489,6 +619,49 @@ name = cli; sourceTree = ""; }; + D82F435F111B9C6D00A25A39 /* Sheets */ = { + isa = PBXGroup; + children = ( + D854948410D5C01B0083B917 /* PBCreateBranchSheet.h */, + D854948510D5C01B0083B917 /* PBCreateBranchSheet.m */, + D8E3B34B10DCA958001096A3 /* PBCreateTagSheet.h */, + D8E3B34C10DCA958001096A3 /* PBCreateTagSheet.m */, + D8083A2D111E045300337480 /* PBRemoteProgressSheet.h */, + D8083A42111E045D00337480 /* PBRemoteProgressSheet.m */, + D8083C42111F106800337480 /* PBAddRemoteSheet.h */, + D8083C43111F106800337480 /* PBAddRemoteSheet.m */, + D8083DC2111F90F300337480 /* PBCloneRepsitoryToSheet.h */, + D8083DC3111F90F300337480 /* PBCloneRepsitoryToSheet.m */, + D8083E01111FA33700337480 /* PBCloneRepositoryPanel.h */, + D8083E02111FA33700337480 /* PBCloneRepositoryPanel.m */, + ); + 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 = ( @@ -517,9 +690,11 @@ F57CC3850E05DDC1000472E2 /* Controllers */ = { isa = PBXGroup; children = ( + F58DB55610566D1F00CFDF4A /* Sidebar */, F5B161BB0EAB6E0C005A1DE1 /* Diff */, F5EF8C880E9D498F0050906B /* History */, F5E927F90E883EF600056E75 /* Commit */, + D82F435F111B9C6D00A25A39 /* Sheets */, 77C8280B06725ACE000B614F /* ApplicationController.h */, 77C8280C06725ACE000B614F /* ApplicationController.m */, 93CB42C00EAB7B2200530609 /* PBGitDefaults.h */, @@ -560,6 +735,8 @@ F53EE3590E06BBA00022B925 /* CWQuickLook.h */, F51308590E0740F2000C8BCD /* PBQLOutlineView.h */, F513085A0E0740F2000C8BCD /* PBQLOutlineView.m */, + D8E105451157C18200FC28A4 /* PBQLTextView.h */, + D8E105461157C18200FC28A4 /* PBQLTextView.m */, 91B103CA0E898EC300C84364 /* PBIconAndTextCell.h */, 91B103CB0E898EC300C84364 /* PBIconAndTextCell.m */, F5140DC70E8A8EB20091E9F3 /* RoundedRectangle.h */, @@ -572,6 +749,11 @@ EB2A73490FEE3F09006601CF /* PBCollapsibleSplitView.m */, F5FC41F20EBCBD4300191D80 /* PBGitXProtocol.h */, F5FC41F30EBCBD4300191D80 /* PBGitXProtocol.m */, + D823487410CB382C00944BDE /* Terminal.h */, + F567B88B1057FA9F000DB976 /* NSOutlineViewExt.h */, + F567B88C1057FA9F000DB976 /* NSOutlineViewExt.m */, + D8A4BB6D11337D5C00E92D51 /* PBGitGradientBarView.h */, + D8A4BB6E11337D5C00E92D51 /* PBGitGradientBarView.m */, ); name = Aux; sourceTree = ""; @@ -584,6 +766,20 @@ name = SpeedTest; sourceTree = ""; }; + F58DB55610566D1F00CFDF4A /* Sidebar */ = { + isa = PBXGroup; + 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; + sourceTree = ""; + }; F59F1DD2105C4FDE00115F88 /* Index */ = { isa = PBXGroup; children = ( @@ -628,12 +824,17 @@ F5AD56770E79B78100EDAAFE /* PBCommitList.h */, F5AD56780E79B78100EDAAFE /* PBCommitList.m */, F5C6F6750E65FE2B00478D97 /* Graphing */, + D85B93F610E51279007F3C28 /* PBGitRefish.h */, F56524EE0E02D45200F03B52 /* PBGitCommit.h */, F56524EF0E02D45200F03B52 /* PBGitCommit.m */, F5C007730E731B48007B84B2 /* PBGitRef.h */, F5C007740E731B48007B84B2 /* PBGitRef.m */, + D8295D281130A1DC00C838E8 /* PBGitHistoryList.h */, + D8295D291130A1DC00C838E8 /* PBGitHistoryList.m */, F5FF4E160E0829C20006317A /* PBGitRevList.h */, F5FF4E170E0829C20006317A /* PBGitRevList.mm */, + D8295DDE1130E43900C838E8 /* PBGitHistoryGrapher.h */, + D8295DDF1130E43900C838E8 /* PBGitHistoryGrapher.m */, F53FF2030E7ABB5300389171 /* PBGitRevSpecifier.h */, F53FF2040E7ABB5300389171 /* PBGitRevSpecifier.m */, F56174550E058893001DCD79 /* PBGitTree.h */, @@ -823,6 +1024,26 @@ 47DBDBB10E94F6CA00671A1E /* Updates.png in Resources */, F569AE930F2CBD7C00C2FFA7 /* Credits.html in Resources */, F5F7D0651062E7940072C81C /* UpdateKey.pem in Resources */, + F58DB56010566E3900CFDF4A /* PBGitSidebarView.xib in Resources */, + D85B939310E3D8B4007F3C28 /* PBCreateBranchSheet.xib in Resources */, + D889EB3110E6BCBB00F08413 /* PBCreateTagSheet.xib in Resources */, + D8357535112640F100DE249D /* PBRemoteProgressSheet.xib in Resources */, + D8083C47111F136400337480 /* PBAddRemoteSheet.xib in Resources */, + D8083DCD111F918900337480 /* PBCloneRepsitoryToSheet.xib in Resources */, + D8FDD9F711432A12005647F6 /* PBCloneRepositoryPanel.xib in Resources */, + F58DB56010566E3900CFDF4A /* PBGitSidebarView.xib in Resources */, + D85810551127476E007F254B /* StageView.png in Resources */, + 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 */, + D8A4BD071134AD2900E92D51 /* CherryPickTemplate.png in Resources */, + D8A4BD081134AD2900E92D51 /* MergeTemplate.png in Resources */, + D8A4BD091134AD2900E92D51 /* RebaseTemplate.png in Resources */, + D828AEEC112F411100F09D11 /* CloneRepositoryTemplate.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -942,6 +1163,28 @@ F562C8870FE1766C000EC528 /* NSString_RegEx.m in Sources */, EB2A734A0FEE3F09006601CF /* PBCollapsibleSplitView.m in Sources */, F59F1DD5105C4FF300115F88 /* PBGitIndex.m in Sources */, + D854948610D5C01B0083B917 /* PBCreateBranchSheet.m in Sources */, + D8E3B34D10DCA958001096A3 /* PBCreateTagSheet.m in Sources */, + D8083A43111E045D00337480 /* PBRemoteProgressSheet.m in Sources */, + D8083C44111F106800337480 /* PBAddRemoteSheet.m in Sources */, + D8083DC4111F90F300337480 /* PBCloneRepsitoryToSheet.m in Sources */, + D8083E03111FA33700337480 /* PBCloneRepositoryPanel.m in Sources */, + F58DB55910566D3500CFDF4A /* PBGitSidebarController.m in Sources */, + F58DB5E8105671B600CFDF4A /* PBSourceViewItem.m in Sources */, + F567B88D1057FA9F000DB976 /* NSOutlineViewExt.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 */, + D8A4BB6F11337D5C00E92D51 /* PBGitGradientBarView.m in Sources */, + D828A40D1127B18700F09D11 /* PBSourceViewCell.m in Sources */, + D828A4111127B1C400F09D11 /* PBSourceViewBadge.m in Sources */, + D8295D2A1130A1DC00C838E8 /* PBGitHistoryList.m in Sources */, + D8295DE01130E43900C838E8 /* PBGitHistoryGrapher.m in Sources */, + D8E105471157C18200FC28A4 /* PBQLTextView.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1034,6 +1277,54 @@ name = RepositoryWindow.xib; sourceTree = ""; }; + D8083C45111F136400337480 /* PBAddRemoteSheet.xib */ = { + isa = PBXVariantGroup; + children = ( + D8083C46111F136400337480 /* English */, + ); + name = PBAddRemoteSheet.xib; + sourceTree = ""; + }; + D8083DCB111F918900337480 /* PBCloneRepsitoryToSheet.xib */ = { + isa = PBXVariantGroup; + children = ( + D8083DCC111F918900337480 /* English */, + ); + name = PBCloneRepsitoryToSheet.xib; + sourceTree = ""; + }; + D85B939210E3D8B4007F3C28 /* PBCreateBranchSheet.xib */ = { + isa = PBXVariantGroup; + children = ( + D854949310D5C3E20083B917 /* English */, + ); + name = PBCreateBranchSheet.xib; + sourceTree = ""; + }; + D889EB3010E6BCBB00F08413 /* PBCreateTagSheet.xib */ = { + isa = PBXVariantGroup; + children = ( + D8E3B38110DD4E2C001096A3 /* English */, + ); + name = PBCreateTagSheet.xib; + sourceTree = ""; + }; + D8C1B77110E875CF009B7F8B /* PBRemoteProgressSheet.xib */ = { + isa = PBXVariantGroup; + children = ( + D8C1B77210E875CF009B7F8B /* English */, + ); + 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/Images/AddBranchTemplate.png b/Images/AddBranchTemplate.png index bd58596..03161a0 100644 Binary files a/Images/AddBranchTemplate.png and b/Images/AddBranchTemplate.png differ diff --git a/Images/AddLabelTemplate.png b/Images/AddLabelTemplate.png index 5823711..085e760 100644 Binary files a/Images/AddLabelTemplate.png and b/Images/AddLabelTemplate.png differ diff --git a/Images/AddRemote.acorn b/Images/AddRemote.acorn new file mode 100644 index 0000000..1ea4c95 Binary files /dev/null and b/Images/AddRemote.acorn differ diff --git a/Images/AddRemote.png b/Images/AddRemote.png new file mode 100644 index 0000000..b4f98bd Binary files /dev/null and b/Images/AddRemote.png differ diff --git a/Images/Branch.acorn b/Images/Branch.acorn new file mode 100644 index 0000000..6e6498d Binary files /dev/null and b/Images/Branch.acorn differ diff --git a/Images/Branch.png b/Images/Branch.png new file mode 100644 index 0000000..ad2c242 Binary files /dev/null and b/Images/Branch.png differ diff --git a/Images/CherryPickTemplate.png b/Images/CherryPickTemplate.png new file mode 100644 index 0000000..7a49968 Binary files /dev/null and b/Images/CherryPickTemplate.png differ diff --git a/Images/CloneRepositoryFireworksTemplate.png b/Images/CloneRepositoryFireworksTemplate.png new file mode 100644 index 0000000..e6b5085 Binary files /dev/null and b/Images/CloneRepositoryFireworksTemplate.png differ diff --git a/Images/CloneRepositoryTemplate.png b/Images/CloneRepositoryTemplate.png new file mode 100644 index 0000000..fe61ae1 Binary files /dev/null and b/Images/CloneRepositoryTemplate.png differ diff --git a/Images/FetchTemplate.png b/Images/FetchTemplate.png new file mode 100644 index 0000000..3e9d4e9 Binary files /dev/null and b/Images/FetchTemplate.png differ diff --git a/Images/MergeTemplate.png b/Images/MergeTemplate.png new file mode 100644 index 0000000..f3d24c9 Binary files /dev/null and b/Images/MergeTemplate.png differ diff --git a/Images/PullTemplate.png b/Images/PullTemplate.png new file mode 100644 index 0000000..5971368 Binary files /dev/null and b/Images/PullTemplate.png differ diff --git a/Images/PushTemplate.png b/Images/PushTemplate.png new file mode 100644 index 0000000..5f0ba6d Binary files /dev/null and b/Images/PushTemplate.png differ diff --git a/Images/RebaseTemplate.png b/Images/RebaseTemplate.png new file mode 100644 index 0000000..87d8390 Binary files /dev/null and b/Images/RebaseTemplate.png differ diff --git a/Images/RemoteBranch.acorn b/Images/RemoteBranch.acorn new file mode 100644 index 0000000..8921318 Binary files /dev/null and b/Images/RemoteBranch.acorn differ diff --git a/Images/RemoteBranch.png b/Images/RemoteBranch.png new file mode 100644 index 0000000..a0c7a06 Binary files /dev/null and b/Images/RemoteBranch.png differ diff --git a/Images/StageView.png b/Images/StageView.png new file mode 100644 index 0000000..36ff764 Binary files /dev/null and b/Images/StageView.png differ diff --git a/Images/Tag.acorn b/Images/Tag.acorn new file mode 100644 index 0000000..1364597 Binary files /dev/null and b/Images/Tag.acorn differ diff --git a/Images/Tag.png b/Images/Tag.png new file mode 100644 index 0000000..4d72ca6 Binary files /dev/null and b/Images/Tag.png differ diff --git a/Images/branch.tiff b/Images/branch.tiff new file mode 100644 index 0000000..dc35b5b Binary files /dev/null and b/Images/branch.tiff differ diff --git a/Images/folder.tiff b/Images/folder.tiff new file mode 100644 index 0000000..c6a7b14 Binary files /dev/null and b/Images/folder.tiff differ diff --git a/Images/remote.tiff b/Images/remote.tiff new file mode 100644 index 0000000..24f81d4 Binary files /dev/null and b/Images/remote.tiff differ diff --git a/Images/tag.tiff b/Images/tag.tiff new file mode 100644 index 0000000..0532a45 Binary files /dev/null and b/Images/tag.tiff differ 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 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/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/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]; } 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/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/PBCommitList.m b/PBCommitList.m index 9f76422..e2f6f23 100644 --- a/PBCommitList.m +++ b/PBCommitList.m @@ -28,12 +28,15 @@ return; } - if ([character isEqualToString:@" "]) - { - if ([event modifierFlags] & NSShiftKeyMask) - [webView scrollPageUp: self]; + if ([character isEqualToString:@" "]) { + if (controller.selectedCommitDetailsIndex == 0) { + if ([event modifierFlags] & NSShiftKeyMask) + [webView scrollPageUp:self]; + else + [webView scrollPageDown:self]; + } else - [webView scrollPageDown: self]; + [controller toggleQLPreviewPanel:self]; } else if ([character rangeOfCharacterFromSet:[NSCharacterSet characterSetWithCharactersInString:@"jkcv"]].location == 0) [webController sendKey: character]; @@ -61,8 +64,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/PBCommitMessageView.m b/PBCommitMessageView.m index 02714c0..c9c8c43 100644 --- a/PBCommitMessageView.m +++ b/PBCommitMessageView.m @@ -13,28 +13,24 @@ - (void)drawRect:(NSRect)aRect { - NSColor *originalColor = [self backgroundColor]; - [originalColor set]; - NSRectFill(aRect); + [super drawRect:aRect]; // 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); - - [self setBackgroundColor:nil]; - [super drawRect:aRect]; - [self setBackgroundColor:originalColor]; + [[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); + } } @end diff --git a/PBCreateBranchSheet.h b/PBCreateBranchSheet.h new file mode 100644 index 0000000..b364e01 --- /dev/null +++ b/PBCreateBranchSheet.h @@ -0,0 +1,41 @@ +// +// 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; + + BOOL shouldCheckoutBranch; + + 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) BOOL shouldCheckoutBranch; + +@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..ebd2643 --- /dev/null +++ b/PBCreateBranchSheet.m @@ -0,0 +1,97 @@ +// +// 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 "PBGitDefaults.h" +#import "PBGitCommit.h" +#import "PBGitRef.h" + +@interface PBCreateBranchSheet () + +- (void) beginCreateBranchSheetAtRefish:(id )ref inRepository:(PBGitRepository *)repo; + +@end + + +@implementation PBCreateBranchSheet + + +@synthesize repository; +@synthesize startRefish; + +@synthesize shouldCheckoutBranch; + +@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:@""]; + self.shouldCheckoutBranch = [PBGitDefaults shouldCheckoutBranch]; + + [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:[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]; + return; + } + + [self closeCreateBranchSheet:self]; + + [self.repository createBranch:name atRefish:self.startRefish]; + + [PBGitDefaults setShouldCheckoutBranch:self.shouldCheckoutBranch]; + + if (self.shouldCheckoutBranch) + [self.repository checkoutRefish:ref]; +} + + +- (IBAction) closeCreateBranchSheet:(id)sender +{ + [NSApp endSheet:[self window]]; + [[self window] orderOut:self]; +} + + + +@end 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/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/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; } diff --git a/PBGitCommit.h b/PBGitCommit.h index 9a7832e..3e361e9 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; @@ -21,6 +26,7 @@ NSString* details; NSString *_patch; NSArray* parents; + NSString *realSHA; int timestamp; char sign; @@ -28,12 +34,21 @@ 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; +- (NSString *) shortName; +- (NSString *) refishType; @property (readonly) git_oid *sha; @property (copy) NSString* subject; diff --git a/PBGitCommit.m b/PBGitCommit.m index 9ebe3b5..a9b3b15 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; @@ -50,6 +54,11 @@ 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; @@ -60,10 +69,32 @@ - (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; + + return [repository isOnSameBranch:otherSHA asSHA:mySHA]; +} + +- (BOOL) isOnHeadBranch +{ + return [self isOnSameBranchAs:[repository headCommit]]; } // FIXME: Remove this method once it's unused. @@ -104,6 +135,18 @@ [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]]; @@ -128,4 +171,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/PBGitCommitController.h b/PBGitCommitController.h index f29f884..0b39f05 100644 --- a/PBGitCommitController.h +++ b/PBGitCommitController.h @@ -19,17 +19,13 @@ IBOutlet NSTextView *commitMessageView; IBOutlet NSArrayController *unstagedFilesController; IBOutlet NSArrayController *cachedFilesController; + IBOutlet NSButton *commitButton; IBOutlet PBGitIndexController *indexController; IBOutlet PBWebChangesController *webController; - - NSString *status; - BOOL busy; } -@property(copy) NSString *status; @property(readonly) PBGitIndex *index; -@property(assign) BOOL busy; - (IBAction) refresh:(id) sender; - (IBAction) commit:(id) sender; diff --git a/PBGitCommitController.m b/PBGitCommitController.m index 6a77348..37f5773 100644 --- a/PBGitCommitController.m +++ b/PBGitCommitController.m @@ -24,7 +24,7 @@ @implementation PBGitCommitController -@synthesize status, index, busy; +@synthesize index; - (id)initWithRepository:(PBGitRepository *)theRepository superController:(PBGitWindowController *)controller { @@ -93,7 +93,7 @@ - (void) refresh:(id) sender { - self.busy = YES; + self.isBusy = YES; self.status = @"Refreshing index…"; [index refresh]; @@ -127,7 +127,7 @@ [cachedFilesController setSelectionIndexes:[NSIndexSet indexSet]]; [unstagedFilesController setSelectionIndexes:[NSIndexSet indexSet]]; - self.busy = YES; + self.isBusy = YES; [commitMessageView setEditable:NO]; [index commitWithMessage:commitMessage]; @@ -137,7 +137,7 @@ # pragma mark PBGitIndex Notification handling - (void)refreshFinished:(NSNotification *)notification { - self.busy = NO; + self.isBusy = NO; self.status = @"Index refresh finished"; } @@ -155,7 +155,7 @@ - (void)commitFailed:(NSNotification *)notification { - self.busy = NO; + self.isBusy = NO; NSString *reason = [[notification userInfo] objectForKey:@"description"]; self.status = [@"Commit failed: " stringByAppendingString:reason]; [commitMessageView setEditable:YES]; @@ -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 09804ef..96cec64 100644 --- a/PBGitCommitView.xib +++ b/PBGitCommitView.xib @@ -1,25 +1,36 @@ - + 1050 - 9L31a - 677 - 949.54 - 353.00 + 10C540 + 762 + 1038.25 + 458.00 + + YES + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.WebKitIBPlugin + + + YES + 762 + 762 + + YES - - + YES - com.apple.WebKitIBPlugin - com.apple.InterfaceBuilderKit com.apple.InterfaceBuilder.CocoaPlugin + com.apple.WebKitIBPlugin YES - + YES @@ -42,42 +53,6 @@ 274 YES - - - 292 - {{27, 7}, {305, 17}} - - YES - - 67239488 - 272630784 - Ready to commit - - LucidaGrande - 1.300000e+01 - 1044 - - - - 6 - System - controlColor - - 3 - MC42NjY2NjY2OQA - - - - 6 - System - controlTextColor - - 3 - MAA - - - - 274 @@ -88,7 +63,7 @@ 274 YES - + YES Apple HTML pasteboard type Apple PDF pasteboard type @@ -107,7 +82,7 @@ public.url-name - {852, 173} + {852, 181} @@ -116,7 +91,7 @@ YES - + YES WebKitDefaultFixedFontSize WebKitDefaultFontSize @@ -124,9 +99,9 @@ YES - - - + + + @@ -161,7 +136,7 @@ 4352 - {189, 194} + {189, 221} YES @@ -172,16 +147,16 @@ 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 @@ -197,7 +172,10 @@ 6 System headerTextColor - + + 3 + MAA + @@ -210,17 +188,25 @@ 6 System controlBackgroundColor - + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + - 3 YES - 3.000000e+00 - 2.000000e+00 + 3 + 2 6 @@ -231,15 +217,18 @@ MC41AA - 1.500000e+01 + 15 -566231040 + + 4 15 0 YES + 0 - {{1, 1}, {189, 194}} + {{1, 1}, {189, 221}} @@ -253,7 +242,7 @@ _doScroller: - 9.933775e-01 + 0.99337750000000002 @@ -263,10 +252,10 @@ 1 _doScroller: - 9.947090e-01 + 0.99470899999999995 - {{-1, -1}, {191, 196}} + {{-1, -1}, {191, 223}} 562 @@ -276,11 +265,11 @@ QSAAAEEgAABBiAAAQYgAAA - {190, 200} + {190, 227} - {190, 215} + {190, 242} {0, 0} @@ -325,7 +314,11 @@ 67239424 134217728 Commit - + + LucidaGrande + 13 + 1044 + -2038284033 301990017 @@ -350,7 +343,7 @@ 2322 YES - + YES Apple HTML pasteboard type Apple PDF pasteboard type @@ -369,9 +362,10 @@ NeXT font pasteboard type NeXT ruler pasteboard type WebURLsWithTitlesPboardType + public.url - {427, 14} + {427, 41} @@ -389,16 +383,17 @@ - 4.270000e+02 + 427 1 - 11235 + 3971 + 0 + - YES - + YES NSBackgroundColor NSColor @@ -419,10 +414,10 @@ - + YES - + YES NSColor NSUnderline @@ -433,7 +428,7 @@ 1 MCAwIDEAA - + @@ -444,7 +439,7 @@ - {{1, 1}, {427, 157}} + {{1, 1}, {427, 184}} @@ -462,21 +457,21 @@ _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}} + {{0, 36}, {429, 186}} 530 @@ -487,7 +482,7 @@ 292 - {{-2, 9}, {65, 18}} + {{-2, 9}, {82, 18}} YES @@ -532,11 +527,11 @@ - {429, 200} + {429, 227} - {{199, 0}, {429, 215}} + {{199, 0}, {429, 242}} {0, 0} @@ -579,7 +574,7 @@ 4352 - {214, 194} + {214, 221} 1 YES @@ -591,12 +586,12 @@ YES - 2.110000e+02 - 1.000000e+01 - 3.402823e+38 + 211 + 10 + 3.4028229999999999e+38 - 75628032 - 0 + 75628096 + 2048 @@ -617,19 +612,22 @@ - 3.000000e+00 - 2.000000e+00 + 3 + 2 - 1.500000e+01 + 15 -566231040 + + 4 15 0 YES + 0 - {{1, 1}, {214, 194}} + {{1, 1}, {214, 221}} @@ -643,7 +641,7 @@ _doScroller: - 9.951923e-01 + 0.99519230000000003 @@ -653,10 +651,10 @@ 1 _doScroller: - 9.003322e-01 + 0.90033220000000003 - {{0, -1}, {216, 196}} + {{0, -1}, {216, 223}} 562 @@ -666,11 +664,11 @@ QSAAAEEgAABBiAAAQYgAAA - {215, 200} + {215, 227} - {{637, 0}, {215, 215}} + {{637, 0}, {215, 242}} {0, 0} @@ -691,25 +689,15 @@ NO - {{0, 182}, {852, 215}} + {{0, 190}, {852, 242}} YES - {{0, 35}, {852, 397}} + {852, 432} CommitViewSplitView - - - 1316 - - {{6, 7}, {16, 16}} - - 28938 - 1.600000e+01 - 1.000000e+02 - {852, 432} @@ -748,133 +736,6 @@ PBWebChangesController - - - F94591D2-A188-4B08-A8B2-8C8CEC03CB14 - - - YES - YES - YES - YES - 1 - 1 - - YES - - YES - 1E431E79-1591-49E7-9E17-49497CA4622A - NSToolbarSeparatorItem - - - 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 - - Separator - - - - - - {12, 5} - {12, 1000} - YES - YES - -1 - YES - 0 - - YES - YES - - - 1048576 - 2147483647 - - NSImage - NSMenuCheckmark - - - NSImage - NSMenuMixedState - - - - - - - YES - - - - - YES - - - - - YES - - PBGitIndexController @@ -994,46 +855,6 @@ 213 - - - value: status - - - - - - value: status - value - status - 2 - - - 216 - - - - animate: busy - - - - - - animate: busy - animate - busy - 2 - - - 222 - - - - viewToolbar - - - - 241 - webController @@ -1202,34 +1023,40 @@ 283 + + + commitButton + + + + 307 + YES 0 - - YES - + -2 - - RmlsZSdzIE93bmVyA + + File's Owner -1 - + First Responder -3 - + Application @@ -1237,50 +1064,33 @@ YES - - - + 77 - + 81 - + Unstaged Files 86 - + Cached Files 96 - + Diff Controller - - 2 - - - YES - - - - Status label - - - 42 - - - 186 @@ -1465,50 +1275,6 @@ - - 217 - - - - - 225 - - - YES - - - - - Commit Toolbar - - - 226 - - - YES - - - - - - 227 - - - - - 239 - - - YES - - - - - - 240 - - - 247 @@ -1526,7 +1292,7 @@ 254 - + 278 @@ -1546,17 +1312,19 @@ 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 @@ -1566,20 +1334,15 @@ 163.IBPluginDependency 164.IBPluginDependency 186.CustomClassName - 2.IBPluginDependency - 217.IBPluginDependency - 225.IBEditorWindowLastContentRect - 225.IBPluginDependency - 225.editorWindowContentRectSynchronizationRect - 227.IBPluginDependency - 239.IBPluginDependency - 240.IBPluginDependency + 186.IBPluginDependency + 206.IBPluginDependency + 207.IBPluginDependency + 208.IBPluginDependency + 209.IBPluginDependency 247.IBPluginDependency 248.IBPluginDependency - 254.IBPluginDependency 278.IBPluginDependency 279.IBPluginDependency - 42.IBPluginDependency 45.IBPluginDependency 46.IBPluginDependency 47.IBPluginDependency @@ -1590,21 +1353,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}} + {{1091, 655}, {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 @@ -1616,11 +1381,6 @@ PBNiceSplitView com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{295, 587}, {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 @@ -1645,9 +1405,7 @@ YES - - YES - + YES @@ -1655,15 +1413,13 @@ YES - - YES - + YES - 283 + 311 @@ -1689,7 +1445,7 @@ PBViewController YES - + YES commit: refresh: @@ -1704,9 +1460,10 @@ YES - + YES cachedFilesController + commitButton commitMessageView indexController unstagedFilesController @@ -1715,6 +1472,7 @@ YES NSArrayController + NSButton NSTextView PBGitIndexController NSArrayController @@ -1731,7 +1489,7 @@ NSObject YES - + YES rowClicked: tableClicked: @@ -1744,7 +1502,7 @@ YES - + YES commitController stagedFilesController @@ -1785,9 +1543,9 @@ PBViewController NSViewController - - viewToolbar - NSToolbar + + refresh: + id IBProjectSource @@ -1799,7 +1557,7 @@ PBWebController YES - + YES cachedFilesController controller @@ -1824,7 +1582,7 @@ NSObject YES - + YES repository view @@ -1841,9 +1599,658 @@ + + 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 + + + + 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 + + + + NSTextFieldCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSTextFieldCell.h + + + + NSTextView + NSText + + IBFrameworkSource + AppKit.framework/Headers/NSTextView.h + + + + 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 + + NSSwitch + {15, 15} + 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/PBGitDefaults.h b/PBGitDefaults.h index fec2430..c7c494a 100644 --- a/PBGitDefaults.h +++ b/PBGitDefaults.h @@ -12,6 +12,7 @@ } + (int) commitMessageViewVerticalLineLength; ++ (BOOL) commitMessageViewHasVerticalLine; + (BOOL) isGistEnabled; + (BOOL) isGravatarEnabled; + (BOOL) confirmPublicGists; @@ -19,5 +20,19 @@ + (BOOL)showWhitespaceDifferences; + (BOOL)openCurDirOnLaunch; + (BOOL)showOpenPanelOnLaunch; ++ (BOOL) shouldCheckoutBranch; ++ (void) setShouldCheckoutBranch:(BOOL)shouldCheckout; ++ (NSString *) recentCloneDestination; ++ (void) setRecentCloneDestination:(NSString *)path; ++ (BOOL) suppressAcceptDropRef; ++ (void) setSuppressAcceptDropRef:(BOOL)suppress; ++ (BOOL) showStageView; ++ (void) setShowStageView:(BOOL)suppress; ++ (BOOL) openPreviousDocumentsOnLaunch; ++ (void) setPreviousDocumentPaths:(NSArray *)documentPaths; ++ (NSArray *) previousDocumentPaths; ++ (void) removePreviousDocumentPaths; ++ (NSInteger) branchFilter; ++ (void) setBranchFilter:(NSInteger)state; @end diff --git a/PBGitDefaults.m b/PBGitDefaults.m index dc9cfd1..0e042a5 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" @@ -17,6 +18,13 @@ #define kShowWhitespaceDifferences @"PBShowWhitespaceDifferences" #define kOpenCurDirOnLaunch @"PBOpenCurDirOnLaunch" #define kShowOpenPanelOnLaunch @"PBShowOpenPanelOnLaunch" +#define kShouldCheckoutBranch @"PBShouldCheckoutBranch" +#define kRecentCloneDestination @"PBRecentCloneDestination" +#define kSuppressAcceptDropRef @"PBSuppressAcceptDropRef" +#define kShowStageView @"PBShowStageView" +#define kOpenPreviousDocumentsOnLaunch @"PBOpenPreviousDocumentsOnLaunch" +#define kPreviousDocumentPaths @"PBPreviousDocumentPaths" +#define kBranchFilterState @"PBBranchFilter" @implementation PBGitDefaults @@ -25,6 +33,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] @@ -39,6 +49,10 @@ forKey:kOpenCurDirOnLaunch]; [defaultValues setObject:[NSNumber numberWithBool:YES] forKey:kShowOpenPanelOnLaunch]; + [defaultValues setObject:[NSNumber numberWithBool:YES] + forKey:kShouldCheckoutBranch]; + [defaultValues setObject:[NSNumber numberWithBool:NO] + forKey:kOpenPreviousDocumentsOnLaunch]; [[NSUserDefaults standardUserDefaults] registerDefaults:defaultValues]; } @@ -47,6 +61,11 @@ return [[NSUserDefaults standardUserDefaults] integerForKey:kCommitMessageViewVerticalLineLength]; } ++ (BOOL) commitMessageViewHasVerticalLine +{ + return [[NSUserDefaults standardUserDefaults] boolForKey:kCommitMessageViewHasVerticalLine]; +} + + (BOOL) isGistEnabled { return [[NSUserDefaults standardUserDefaults] boolForKey:kEnableGist]; @@ -82,4 +101,73 @@ return [[NSUserDefaults standardUserDefaults] boolForKey:kShowOpenPanelOnLaunch]; } ++ (BOOL) shouldCheckoutBranch +{ + return [[NSUserDefaults standardUserDefaults] boolForKey:kShouldCheckoutBranch]; +} + ++ (void) setShouldCheckoutBranch:(BOOL)shouldCheckout +{ + [[NSUserDefaults standardUserDefaults] setBool:shouldCheckout forKey:kShouldCheckoutBranch]; +} + ++ (NSString *) recentCloneDestination +{ + return [[NSUserDefaults standardUserDefaults] stringForKey:kRecentCloneDestination]; +} + ++ (void) setRecentCloneDestination:(NSString *)path +{ + [[NSUserDefaults standardUserDefaults] setObject:path forKey:kRecentCloneDestination]; +} + ++ (BOOL) suppressAcceptDropRef +{ + return [[NSUserDefaults standardUserDefaults] boolForKey:kSuppressAcceptDropRef]; +} + ++ (void) setSuppressAcceptDropRef:(BOOL)suppress +{ + 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]; +} + ++ (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]; +} ++ (NSInteger) branchFilter +{ + return [[NSUserDefaults standardUserDefaults] integerForKey:kBranchFilterState]; +} + ++ (void) setBranchFilter:(NSInteger)state +{ + [[NSUserDefaults standardUserDefaults] setInteger:state forKey:kBranchFilterState]; +} + @end 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 fadb6cd..e96b87a 100644 --- a/PBGitHistoryController.h +++ b/PBGitHistoryController.h @@ -12,35 +12,54 @@ #import "PBViewController.h" #import "PBCollapsibleSplitView.h" +@class PBGitSidebarController; +@class PBGitGradientBarView; +@class PBRefController; +@class QLPreviewPanel; + @interface PBGitHistoryController : PBViewController { + IBOutlet PBRefController *refController; IBOutlet NSSearchField *searchField; IBOutlet NSArrayController* commitController; IBOutlet NSTreeController* treeController; IBOutlet NSOutlineView* fileBrowser; + NSArray *currentFileBrowserSelectionPath; IBOutlet NSTableView* commitList; IBOutlet PBCollapsibleSplitView *historySplitView; + QLPreviewPanel* previewPanel; + + IBOutlet PBGitGradientBarView *upperToolbarView; + IBOutlet NSButton *mergeButton; + IBOutlet NSButton *cherryPickButton; + IBOutlet NSButton *rebaseButton; + + IBOutlet PBGitGradientBarView *scopeBarView; + IBOutlet NSButton *allBranchesFilterItem; + IBOutlet NSButton *localRemoteBranchesFilterItem; + IBOutlet NSButton *selectedBranchFilterItem; IBOutlet id webView; - int selectedTab; + int selectedCommitDetailsIndex; + BOOL forceSelectionUpdate; - PBGitTree* gitTree; - PBGitCommit* webCommit; - PBGitCommit* rawCommit; - PBGitCommit* realCommit; + PBGitTree *gitTree; + PBGitCommit *webCommit; + PBGitCommit *selectedCommit; } -@property (assign) int selectedTab; -@property (retain) PBGitCommit *webCommit, *rawCommit; +@property (assign) int selectedCommitDetailsIndex; +@property (retain) PBGitCommit *webCommit; @property (retain) PBGitTree* gitTree; @property (readonly) NSArrayController *commitController; +@property (readonly) PBRefController *refController; -- (IBAction) setDetailedView: sender; -- (IBAction) setRawView: sender; -- (IBAction) setTreeView: sender; +- (IBAction) setDetailedView:(id)sender; +- (IBAction) setTreeView:(id)sender; +- (IBAction) setBranchFilter:(id)sender; - (void) selectCommit: (NSString*) commit; - (IBAction) refresh: sender; -- (IBAction) toggleQuickView: sender; +- (IBAction) toggleQLPreviewPanel:(id)sender; - (IBAction) openSelectedFile: sender; - (void) updateQuicklookForce: (BOOL) force; @@ -51,6 +70,14 @@ - (void)showInFinderAction:(id)sender; - (void)openFilesAction:(id)sender; +// Repository Methods +- (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; - (BOOL) hasNonlinearPath; diff --git a/PBGitHistoryController.m b/PBGitHistoryController.m index b4a5d66..e9559c8 100644 --- a/PBGitHistoryController.m +++ b/PBGitHistoryController.m @@ -11,18 +11,47 @@ #import "PBGitGrapher.h" #import "PBGitRevisionCell.h" #import "PBCommitList.h" +#import "PBCreateBranchSheet.h" +#import "PBCreateTagSheet.h" +#import "PBAddRemoteSheet.h" +#import "PBGitSidebarController.h" +#import "PBGitGradientBarView.h" +#import "PBDiffWindowController.h" +#import "PBGitDefaults.h" +#import "PBGitRevList.h" #define QLPreviewPanel NSClassFromString(@"QLPreviewPanel") +#define kHistorySelectedDetailIndexKey @"PBHistorySelectedDetailIndex" +#define kHistoryDetailViewIndex 0 +#define kHistoryTreeViewIndex 1 + +@interface PBGitHistoryController () + +- (void) updateBranchFilterMatrix; +- (void) restoreFileBrowserSelection; +- (void) saveFileBrowserSelection; + +@end + + @implementation PBGitHistoryController -@synthesize selectedTab, webCommit, rawCommit, gitTree, commitController; +@synthesize selectedCommitDetailsIndex, webCommit, gitTree, commitController, refController; - (void)awakeFromNib { - self.selectedTab = [[NSUserDefaults standardUserDefaults] integerForKey:@"Repository Window Selected Tab Index"];; - [commitController addObserver:self forKeyPath:@"selection" options:(NSKeyValueObservingOptionNew,NSKeyValueObservingOptionOld) context:@"commitChange"]; + self.selectedCommitDetailsIndex = [[NSUserDefaults standardUserDefaults] integerForKey:kHistorySelectedDetailIndexKey]; + + [commitController addObserver:self forKeyPath:@"selection" options:0 context:@"commitChange"]; + [commitController addObserver:self forKeyPath:@"arrangedObjects.@count" options:NSKeyValueObservingOptionInitial context:@"updateCommitCount"]; [treeController addObserver:self forKeyPath:@"selection" options:0 context:@"treeChange"]; + + [repository.revisionList addObserver:self forKeyPath:@"isUpdating" options:0 context:@"revisionListUpdating"]; + [repository.revisionList addObserver:self forKeyPath:@"updatedGraph" options:0 context:@"revisionListUpdatedGraph"]; [repository addObserver:self forKeyPath:@"currentBranch" options:0 context:@"branchChange"]; + [repository addObserver:self forKeyPath:@"refs" options:0 context:@"updateRefs"]; + + forceSelectionUpdate = YES; NSSize cellSpacing = [commitList intercellSpacing]; cellSpacing.height = 0; [commitList setIntercellSpacing:cellSpacing]; @@ -41,59 +70,177 @@ [[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]; + [self updateBranchFilterMatrix]; + [super awakeFromNib]; } - (void) updateKeys { - NSArray* selection = [commitController selectedObjects]; - // Remove any references in the QLPanel //[[QLPreviewPanel sharedPreviewPanel] setURLs:[NSArray array] currentIndex:0 preservingDisplayState:YES]; // We have to do this manually, as NSTreeController leaks memory? //[treeController setSelectionIndexPaths:[NSArray array]]; - - if ([selection count] > 0) - realCommit = [selection objectAtIndex:0]; - else - realCommit = nil; - - self.webCommit = nil; - self.rawCommit = nil; - self.gitTree = nil; - - switch (self.selectedTab) { - case 0: self.webCommit = realCommit; break; - case 1: self.gitTree = realCommit.tree; break; + + selectedCommit = [[commitController selectedObjects] lastObject]; + + if (self.selectedCommitDetailsIndex == kHistoryTreeViewIndex) { + self.gitTree = selectedCommit.tree; + [self restoreFileBrowserSelection]; } -} + else // kHistoryDetailViewIndex + self.webCommit = selectedCommit; + BOOL isOnHeadBranch = [selectedCommit isOnHeadBranch]; + [mergeButton setEnabled:!isOnHeadBranch]; + [cherryPickButton setEnabled:!isOnHeadBranch]; + [rebaseButton setEnabled:!isOnHeadBranch]; +} -- (void) setSelectedTab: (int) number +- (void) updateBranchFilterMatrix { - selectedTab = number; - [[NSUserDefaults standardUserDefaults] setInteger:selectedTab forKey:@"Repository Window Selected Tab Index"]; + if ([repository.currentBranch isSimpleRef]) { + [allBranchesFilterItem setEnabled:YES]; + [localRemoteBranchesFilterItem setEnabled:YES]; + + NSInteger filter = repository.currentBranchFilter; + [allBranchesFilterItem setState:(filter == kGitXAllBranchesFilter)]; + [localRemoteBranchesFilterItem setState:(filter == kGitXLocalRemoteBranchesFilter)]; + [selectedBranchFilterItem setState:(filter == kGitXSelectedBranchFilter)]; + } + else { + [allBranchesFilterItem setState:NO]; + [localRemoteBranchesFilterItem setState:NO]; + + [allBranchesFilterItem setEnabled:NO]; + [localRemoteBranchesFilterItem setEnabled:NO]; + + [selectedBranchFilterItem setState:YES]; + } + + [selectedBranchFilterItem setTitle:[repository.currentBranch title]]; + [selectedBranchFilterItem sizeToFit]; + + [localRemoteBranchesFilterItem setTitle:[[repository.currentBranch ref] isRemote] ? @"Remote" : @"Local"]; +} + +- (PBGitCommit *) firstCommit +{ + NSArray *arrangedObjects = [commitController arrangedObjects]; + if ([arrangedObjects count] > 0) + return [arrangedObjects objectAtIndex:0]; + + return nil; +} + +- (void) setSelectedCommitDetailsIndex:(int)detailsIndex +{ + if (selectedCommitDetailsIndex == detailsIndex) + return; + + selectedCommitDetailsIndex = detailsIndex; + [[NSUserDefaults standardUserDefaults] setInteger:selectedCommitDetailsIndex forKey:kHistorySelectedDetailIndexKey]; + forceSelectionUpdate = YES; [self updateKeys]; } +- (void) updateStatus +{ + self.isBusy = repository.revisionList.isUpdating; + self.status = [NSString stringWithFormat:@"%d commits loaded", [[commitController arrangedObjects] count]]; +} + +- (void) restoreFileBrowserSelection +{ + if (self.selectedCommitDetailsIndex != kHistoryTreeViewIndex) + return; + + NSArray *children = [treeController content]; + if ([children count] == 0) + return; + + NSIndexPath *path = [[NSIndexPath alloc] init]; + if ([currentFileBrowserSelectionPath count] == 0) + path = [path indexPathByAddingIndex:0]; + else { + for (NSString *pathComponent in currentFileBrowserSelectionPath) { + PBGitTree *child = nil; + NSUInteger childIndex = 0; + for (child in children) { + if ([child.path isEqualToString:pathComponent]) { + path = [path indexPathByAddingIndex:childIndex]; + children = child.children; + break; + } + childIndex++; + } + if (!child) + return; + } + } + + [treeController setSelectionIndexPath:path]; +} + +- (void) saveFileBrowserSelection +{ + NSArray *objects = [treeController selectedObjects]; + NSArray *content = [treeController content]; + + if ([objects count] && [content count]) { + PBGitTree *treeItem = [objects objectAtIndex:0]; + currentFileBrowserSelectionPath = [treeItem.fullPath componentsSeparatedByString:@"/"]; + } +} + - (void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { if ([(NSString *)context isEqualToString: @"commitChange"]) { [self updateKeys]; + [self restoreFileBrowserSelection]; return; } - else if ([(NSString *)context isEqualToString: @"treeChange"]) { + + if ([(NSString *)context isEqualToString: @"treeChange"]) { [self updateQuicklookForce: NO]; + [self saveFileBrowserSelection]; + return; } - else if([(NSString *)context isEqualToString:@"branchChange"]) { + + if([(NSString *)context isEqualToString:@"branchChange"]) { // Reset the sorting - commitController.sortDescriptors = [NSArray array]; + if ([[commitController sortDescriptors] count]) + [commitController setSortDescriptors:[NSArray array]]; + [self updateBranchFilterMatrix]; + return; } - else { - [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; + + if([(NSString *)context isEqualToString:@"updateRefs"]) { + [commitController rearrangeObjects]; + return; } + + if([(NSString *)context isEqualToString:@"updateCommitCount"] || [(NSString *)context isEqualToString:@"revisionListUpdating"]) { + [self updateStatus]; + return; + } + + if([(NSString *)context isEqualToString:@"revisionListUpdatedGraph"]) { + if ([repository.currentBranch isSimpleRef]) + [self selectCommit:[repository shaForRef:[repository.currentBranch ref]]]; + else + [self selectCommit:[[self firstCommit] realSha]]; + return; + } + + [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; } - (IBAction) openSelectedFile: sender @@ -106,14 +253,24 @@ [[NSWorkspace sharedWorkspace] openTempFile:name]; } -- (IBAction) setDetailedView: sender { - self.selectedTab = 0; +- (IBAction) setDetailedView:(id)sender +{ + self.selectedCommitDetailsIndex = kHistoryDetailViewIndex; + forceSelectionUpdate = YES; } -- (IBAction) setRawView: sender { - self.selectedTab = 1; + +- (IBAction) setTreeView:(id)sender +{ + self.selectedCommitDetailsIndex = kHistoryTreeViewIndex; + forceSelectionUpdate = YES; } -- (IBAction) setTreeView: sender { - self.selectedTab = 2; + +- (IBAction) setBranchFilter:(id)sender +{ + repository.currentBranchFilter = [sender tag]; + [PBGitDefaults setBranchFilter:repository.currentBranchFilter]; + [self updateBranchFilterMatrix]; + forceSelectionUpdate = YES; } - (void)keyDown:(NSEvent*)event @@ -137,47 +294,59 @@ } -- (IBAction) toggleQuickView: sender +- (IBAction) toggleQLPreviewPanel:(id)sender { - id panel = [QLPreviewPanel sharedPreviewPanel]; - if ([panel isOpen]) { - [panel closePanel]; - } else { - [[QLPreviewPanel sharedPreviewPanel] makeKeyAndOrderFrontWithEffect:1]; - [self updateQuicklookForce: YES]; + if ([[QLPreviewPanel sharedPreviewPanel] respondsToSelector:@selector(setDataSource:)]) { + // Public QL API + if ([QLPreviewPanel sharedPreviewPanelExists] && [[QLPreviewPanel sharedPreviewPanel] isVisible]) + [[QLPreviewPanel sharedPreviewPanel] orderOut:nil]; + else + [[QLPreviewPanel sharedPreviewPanel] makeKeyAndOrderFront:nil]; + } + else { + // Private QL API (10.5 only) + if ([[QLPreviewPanel sharedPreviewPanel] isOpen]) + [[QLPreviewPanel sharedPreviewPanel] closePanel]; + else { + [[QLPreviewPanel sharedPreviewPanel] makeKeyAndOrderFrontWithEffect:1]; + [self updateQuicklookForce:YES]; + } } } -- (void) updateQuicklookForce: (BOOL) force +- (void) updateQuicklookForce:(BOOL)force { if (!force && ![[QLPreviewPanel sharedPreviewPanel] isOpen]) return; - - NSArray* selectedFiles = [treeController selectedObjects]; - - if ([selectedFiles count] == 0) - return; - - NSMutableArray* fileNames = [NSMutableArray array]; - for (PBGitTree* tree in selectedFiles) { - NSString* s = [tree tmpFileNameForContents]; - if (s) - [fileNames addObject:[NSURL fileURLWithPath: s]]; + + if ([[QLPreviewPanel sharedPreviewPanel] respondsToSelector:@selector(setDataSource:)]) { + // Public QL API + [previewPanel reloadData]; + } + else { + // Private QL API (10.5 only) + NSArray *selectedFiles = [treeController selectedObjects]; + + NSMutableArray *fileNames = [NSMutableArray array]; + for (PBGitTree *tree in selectedFiles) { + NSString *filePath = [tree tmpFileNameForContents]; + if (filePath) + [fileNames addObject:[NSURL fileURLWithPath:filePath]]; + } + + if ([fileNames count]) + [[QLPreviewPanel sharedPreviewPanel] setURLs:fileNames currentIndex:0 preservingDisplayState:YES]; } - - [[QLPreviewPanel sharedPreviewPanel] setURLs:fileNames currentIndex:0 preservingDisplayState:YES]; - } - (IBAction) refresh: sender { - [repository reloadRefs]; - [repository.revisionList reload]; + [repository forceUpdateRevisions]; } - (void) updateView { - [self refresh:nil]; + [self updateKeys]; } - (void)viewLoaded @@ -192,13 +361,46 @@ return commitList; } -- (void) selectCommit: (NSString*) commit +- (void) scrollSelectionToTopOfViewFrom:(NSInteger)oldIndex { - NSPredicate* selection = [NSPredicate predicateWithFormat:@"realSha == %@", commit]; - NSArray* selectedCommits = [repository.revisionList.commits filteredArrayUsingPredicate:selection]; - [commitController setSelectedObjects: selectedCommits]; - int index = [[commitController selectionIndexes] firstIndex]; - [commitList scrollRowToVisible: index]; + if (oldIndex == NSIntegerMax) + oldIndex = 0; + + NSInteger newIndex = [[commitController selectionIndexes] firstIndex]; + + if (newIndex > oldIndex) { + NSInteger visibleRows = floorf([[commitList superview] bounds].size.height / [commitList rowHeight]); + newIndex += visibleRows - 1; + if (newIndex >= [[commitController content] count]) + newIndex = [[commitController content] count] - 1; + } + + [commitList scrollRowToVisible:newIndex]; +} + +- (NSArray *) selectedObjectsForSHA:(NSString *)commitSHA +{ + NSPredicate *selection = [NSPredicate predicateWithFormat:@"realSha == %@", commitSHA]; + NSArray *selectedCommits = [[commitController content] filteredArrayUsingPredicate:selection]; + + if (([selectedCommits count] == 0) && [self firstCommit]) + selectedCommits = [NSArray arrayWithObject:[self firstCommit]]; + + return selectedCommits; +} + +- (void) selectCommit:(NSString *)commitSHA +{ + if (!forceSelectionUpdate && [[selectedCommit realSha] isEqualToString:commitSHA]) + return; + + NSInteger oldIndex = [[commitController selectionIndexes] firstIndex]; + + NSArray *selectedCommits = [self selectedObjectsForSHA:commitSHA]; + [commitController setSelectedObjects:selectedCommits]; + + if (repository.currentBranchFilter != kGitXSelectedBranchFilter) + [self scrollSelectionToTopOfViewFrom:oldIndex]; } - (BOOL) hasNonlinearPath @@ -274,6 +476,19 @@ } } +- (void) checkoutFiles:(id)sender +{ + NSMutableArray *files = [NSMutableArray array]; + for (NSString *filePath in [sender representedObject]) + [files addObject:[filePath stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]]; + + [repository checkoutFiles:files fromRefish:selectedCommit]; +} + +- (void) diffFilesAction:(id)sender +{ + [PBDiffWindowController showDiffWindowWithFiles:[sender representedObject] fromCommit:selectedCommit diffCommit:nil]; +} - (NSMenu *)contextMenuForTreeView { @@ -287,10 +502,26 @@ - (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:@""]; + keyEquivalent:@""]; + + PBGitRef *headRef = [[repository headRef] ref]; + NSString *headRefName = [headRef shortName]; + NSString *diffTitle = [NSString stringWithFormat:@"Diff %@ with %@", multiple ? @"files" : @"file", headRefName]; + BOOL isHead = [[selectedCommit 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:@""]; NSMenuItem *finderItem = [[NSMenuItem alloc] initWithTitle:@"Show in Finder" action:@selector(showInFinderAction:) keyEquivalent:@""]; @@ -298,10 +529,10 @@ action:@selector(openFilesAction:) keyEquivalent:@""]; - NSArray *menuItems = [NSArray arrayWithObjects:historyItem, finderItem, openFilesItem, nil]; + NSArray *menuItems = [NSArray arrayWithObjects:historyItem, diffItem, checkoutItem, finderItem, openFilesItem, nil]; for (NSMenuItem *item in menuItems) { [item setTarget:self]; - [item setRepresentedObject:paths]; + [item setRepresentedObject:filePaths]; } return menuItems; @@ -331,4 +562,130 @@ return [sender frame].size.height; } + +#pragma mark Repository Methods + +- (IBAction) createBranch:(id)sender +{ + PBGitRef *currentRef = [repository.currentBranch ref]; + + if (!selectedCommit || [selectedCommit hasRef:currentRef]) + [PBCreateBranchSheet beginCreateBranchSheetAtRefish:currentRef inRepository:self.repository]; + else + [PBCreateBranchSheet beginCreateBranchSheetAtRefish:selectedCommit inRepository:self.repository]; +} + +- (IBAction) createTag:(id)sender +{ + if (!selectedCommit) + [PBCreateTagSheet beginCreateTagSheetAtRefish:[repository.currentBranch ref] inRepository:repository]; + else + [PBCreateTagSheet beginCreateTagSheetAtRefish:selectedCommit inRepository:repository]; +} + +- (IBAction) showAddRemoteSheet:(id)sender +{ + [PBAddRemoteSheet beginAddRemoteSheetForRepository:self.repository]; +} + +- (IBAction) merge:(id)sender +{ + if (selectedCommit) + [repository mergeWithRefish:selectedCommit]; +} + +- (IBAction) cherryPick:(id)sender +{ + if (selectedCommit) + [repository cherryPickRefish:selectedCommit]; +} + +- (IBAction) rebase:(id)sender +{ + if (selectedCommit) { + PBGitRef *headRef = [[repository headRef] ref]; + [repository rebaseBranch:headRef onRefish:selectedCommit]; + } +} + +#pragma mark - +#pragma mark Quick Look Public API support + +@protocol QLPreviewItem; + +#pragma mark (QLPreviewPanelController) + +- (BOOL) acceptsPreviewPanelControl:(id)panel +{ + return YES; +} + +- (void)beginPreviewPanelControl:(id)panel +{ + // This document is now responsible of the preview panel + // It is allowed to set the delegate, data source and refresh panel. + previewPanel = panel; + [previewPanel setDelegate:self]; + [previewPanel setDataSource:self]; +} + +- (void)endPreviewPanelControl:(id)panel +{ + // This document loses its responsisibility on the preview panel + // Until the next call to -beginPreviewPanelControl: it must not + // change the panel's delegate, data source or refresh it. + previewPanel = nil; +} + +#pragma mark + +- (NSInteger)numberOfPreviewItemsInPreviewPanel:(id)panel +{ + return [[fileBrowser selectedRowIndexes] count]; +} + +- (id )previewPanel:(id)panel previewItemAtIndex:(NSInteger)index +{ + PBGitTree *treeItem = (PBGitTree *)[[treeController selectedObjects] objectAtIndex:index]; + NSURL *previewURL = [NSURL fileURLWithPath:[treeItem tmpFileNameForContents]]; + + return ()previewURL; +} + +#pragma mark + +- (BOOL)previewPanel:(id)panel handleEvent:(NSEvent *)event +{ + // redirect all key down events to the table view + if ([event type] == NSKeyDown) { + [fileBrowser keyDown:event]; + return YES; + } + return NO; +} + +// This delegate method provides the rect on screen from which the panel will zoom. +- (NSRect)previewPanel:(id)panel sourceFrameOnScreenForPreviewItem:(id )item +{ + NSInteger index = [fileBrowser rowForItem:[[treeController selectedNodes] objectAtIndex:0]]; + if (index == NSNotFound) { + return NSZeroRect; + } + + NSRect iconRect = [fileBrowser frameOfCellAtColumn:0 row:index]; + + // check that the icon rect is visible on screen + NSRect visibleRect = [fileBrowser visibleRect]; + + if (!NSIntersectsRect(visibleRect, iconRect)) { + return NSZeroRect; + } + + // convert icon rect to screen coordinates + iconRect = [fileBrowser convertRectToBase:iconRect]; + iconRect.origin = [[fileBrowser window] convertBaseToScreen:iconRect.origin]; + + return iconRect; +} + @end diff --git a/PBGitHistoryGrapher.h b/PBGitHistoryGrapher.h new file mode 100644 index 0000000..adb0ee2 --- /dev/null +++ b/PBGitHistoryGrapher.h @@ -0,0 +1,26 @@ +// +// PBGitHistoryGrapher.h +// GitX +// +// Created by Nathan Kinsinger on 2/20/10. +// Copyright 2010 Nathan Kinsinger. All rights reserved. +// + +#import + + +@class PBGitGrapher; + + +@interface PBGitHistoryGrapher : NSObject { + id delegate; + + NSMutableSet *searchSHAs; + PBGitGrapher *grapher; + BOOL viewAllBranches; +} + +- (id) initWithBaseCommits:(NSSet *)commits viewAllBranches:(BOOL)viewAll delegate:(id)theDelegate; +- (void) graphCommits:(NSArray *)revList; + +@end diff --git a/PBGitHistoryGrapher.m b/PBGitHistoryGrapher.m new file mode 100644 index 0000000..76bbd70 --- /dev/null +++ b/PBGitHistoryGrapher.m @@ -0,0 +1,56 @@ +// +// PBGitHistoryGrapher.m +// GitX +// +// Created by Nathan Kinsinger on 2/20/10. +// Copyright 2010 Nathan Kinsinger. All rights reserved. +// + +#import "PBGitHistoryGrapher.h" +#import "PBGitGrapher.h" + + +@implementation PBGitHistoryGrapher + + +- (id) initWithBaseCommits:(NSSet *)commits viewAllBranches:(BOOL)viewAll delegate:(id)theDelegate +{ + delegate = theDelegate; + searchSHAs = [NSMutableSet setWithSet:commits]; + grapher = [[PBGitGrapher alloc] initWithRepository:nil]; + viewAllBranches = viewAll; + + return self; +} + + +- (void) graphCommits:(NSArray *)revList +{ + if (!revList || [revList count] == 0) + return; + + NSMutableArray *commits = [NSMutableArray array]; + NSInteger counter = 0; + + for (PBGitCommit *commit in revList) { + NSString *commitSHA = [commit realSha]; + if (viewAllBranches || [searchSHAs containsObject:commitSHA]) { + [grapher decorateCommit:commit]; + [commits addObject:commit]; + if (!viewAllBranches) { + [searchSHAs removeObject:commitSHA]; + [searchSHAs addObjectsFromArray:commit.parents]; + } + } + if (++counter % 2000 == 0) { + [delegate performSelectorOnMainThread:@selector(addCommitsFromArray:) withObject:[commits copy] waitUntilDone:NO]; + commits = [NSMutableArray array]; + } + } + + [delegate performSelectorOnMainThread:@selector(addCommitsFromArray:) withObject:commits waitUntilDone:YES]; + [delegate performSelectorOnMainThread:@selector(finishedGraphing) withObject:nil waitUntilDone:NO]; +} + + +@end diff --git a/PBGitHistoryList.h b/PBGitHistoryList.h new file mode 100644 index 0000000..c3e3a0b --- /dev/null +++ b/PBGitHistoryList.h @@ -0,0 +1,53 @@ +// +// PBGitHistoryList.h +// GitX +// +// Created by Nathan Kinsinger on 2/20/10. +// Copyright 2010 Nathan Kinsinger. All rights reserved. +// + +#import + + +@class PBGitRepository; +@class PBGitRevSpecifier; +@class PBGitRef; +@class PBGitRevList; +@class PBGitHistoryGrapher; + +@interface PBGitHistoryList : NSObject { + PBGitRepository *repository; + + PBGitRevList *projectRevList; + PBGitRevList *currentRevList; + + NSString *lastSHA; + NSSet *lastRefSHAs; + NSInteger lastBranchFilter; + PBGitRef *lastRemoteRef; + BOOL resetCommits; + BOOL shouldReloadProjectHistory; + NSDate *updatedGraph; + + PBGitHistoryGrapher *grapher; + NSOperationQueue *graphQueue; + NSInvocationOperation *lastOperation; + + NSMutableArray *commits; + BOOL isUpdating; +} + +- (id) initWithRepository:(PBGitRepository *)repo; +- (void) forceUpdate; +- (void) updateHistory; + +- (void) addCommitsFromArray:(NSArray *)array; + + +@property (retain) PBGitRevList *projectRevList; +@property (retain) NSMutableArray *commits; +@property (readonly) NSArray *projectCommits; +@property (assign) BOOL isUpdating; +@property (retain) NSDate *updatedGraph; + +@end diff --git a/PBGitHistoryList.m b/PBGitHistoryList.m new file mode 100644 index 0000000..89142a9 --- /dev/null +++ b/PBGitHistoryList.m @@ -0,0 +1,379 @@ +// +// PBGitHistoryList.m +// GitX +// +// Created by Nathan Kinsinger on 2/20/10. +// Copyright 2010 Nathan Kinsinger. All rights reserved. +// + +#import "PBGitHistoryList.h" +#import "PBGitRepository.h" +#import "PBGitRevList.h" +#import "PBGitGrapher.h" +#import "PBGitHistoryGrapher.h" + + + +@interface PBGitHistoryList () + +- (void) resetGraphing; + +- (PBGitHistoryGrapher *) grapher; +- (NSInvocationOperation *) operationForCommits:(NSArray *)newCommits; + +- (void) updateProjectHistoryForRev:(PBGitRevSpecifier *)rev; +- (void) updateHistoryForRev:(PBGitRevSpecifier *)rev; + +@end + + + + +@implementation PBGitHistoryList + + +@synthesize projectRevList; +@synthesize commits; +@synthesize isUpdating; +@synthesize updatedGraph; +@dynamic projectCommits; + + + +#pragma mark - +#pragma mark Public + +- (id) initWithRepository:(PBGitRepository *)repo +{ + commits = [NSMutableArray array]; + repository = repo; + lastBranchFilter = -1; + [repository addObserver:self forKeyPath:@"currentBranch" options:0 context:@"currentBranch"]; + [repository addObserver:self forKeyPath:@"currentBranchFilter" options:0 context:@"currentBranch"]; + [repository addObserver:self forKeyPath:@"hasChanged" options:0 context:@"repositoryHasChanged"]; + + shouldReloadProjectHistory = YES; + projectRevList = [[PBGitRevList alloc] initWithRepository:repository rev:[PBGitRevSpecifier allBranchesRevSpec] shouldGraph:NO]; + + return self; +} + + +- (void) forceUpdate +{ + if ([repository.currentBranch isSimpleRef]) + shouldReloadProjectHistory = YES; + + [self updateHistory]; +} + + +- (void) updateHistory +{ + PBGitRevSpecifier *rev = repository.currentBranch; + if (!rev) + return; + + if ([rev isSimpleRef]) + [self updateProjectHistoryForRev:rev]; + else + [self updateHistoryForRev:rev]; +} + + +- (NSArray *) projectCommits +{ + return [projectRevList.commits copy]; +} + + + +#pragma mark - +#pragma mark History Grapher delegate methods + +- (void) addCommitsFromArray:(NSArray *)array +{ + if (!array || [array count] == 0) + return; + if (resetCommits) { + self.commits = [NSMutableArray array]; + resetCommits = NO; + } + + NSRange range = NSMakeRange([commits count], [array count]); + NSIndexSet *indexes = [NSIndexSet indexSetWithIndexesInRange:range]; + + [self willChange:NSKeyValueChangeInsertion valuesAtIndexes:indexes forKey:@"commits"]; + [commits addObjectsFromArray:array]; + [self didChange:NSKeyValueChangeInsertion valuesAtIndexes:indexes forKey:@"commits"]; +} + + +- (void) finishedGraphing +{ + if (!currentRevList.isParsing && ([[graphQueue operations] count] == 0)) { + self.isUpdating = NO; + [self performSelector:@selector(setUpdatedGraph:) withObject:[NSDate date] afterDelay:0]; + } +} + + + +#pragma mark - +#pragma mark Private + +- (void) resetGraphing +{ + resetCommits = YES; + self.isUpdating = YES; + + [graphQueue setSuspended:YES]; + if (graphQueue) + [graphQueue removeObserver:self forKeyPath:@"operations"]; + graphQueue = [[NSOperationQueue alloc] init]; + [graphQueue addObserver:self forKeyPath:@"operations" options:0 context:@"operations"]; + lastOperation = nil; + + grapher = [self grapher]; +} + + +- (NSInvocationOperation *) operationForCommits:(NSArray *)newCommits +{ + NSInvocationOperation *graphOperation = [[NSInvocationOperation alloc] initWithTarget:grapher selector:@selector(graphCommits:) object:newCommits]; + if (lastOperation) + [graphOperation addDependency:lastOperation]; + lastOperation = graphOperation; + + return graphOperation; +} + + +- (NSSet *) baseCommitsForLocalRefs +{ + NSMutableSet *baseCommitSHAs = [NSMutableSet set]; + NSDictionary *refs = repository.refs; + + for (NSString *sha in refs) + for (PBGitRef *ref in [refs objectForKey:sha]) + if ([ref isBranch] || [ref isTag]) + [baseCommitSHAs addObject:sha]; + + return baseCommitSHAs; +} + + +- (NSSet *) baseCommitsForRemoteRefs +{ + NSMutableSet *baseCommitSHAs = [NSMutableSet set]; + NSDictionary *refs = repository.refs; + + PBGitRef *remoteRef = [[repository.currentBranch ref] remoteRef]; + + for (NSString *sha in refs) + for (PBGitRef *ref in [refs objectForKey:sha]) + if ([remoteRef isEqualToRef:[ref remoteRef]]) + [baseCommitSHAs addObject:sha]; + + return baseCommitSHAs; +} + + +- (NSSet *) baseCommits +{ + if ((repository.currentBranchFilter == kGitXSelectedBranchFilter) || (repository.currentBranchFilter == kGitXAllBranchesFilter)) { + if (lastSHA) + return [NSMutableSet setWithObject:lastSHA]; + else if ([repository.currentBranch isSimpleRef]) { + PBGitRef *currentRef = [repository.currentBranch ref]; + NSString *sha = [repository shaForRef:currentRef]; + if (sha) + return [NSMutableSet setWithObject:sha]; + } + } + else if (repository.currentBranchFilter == kGitXLocalRemoteBranchesFilter) { + if ([[repository.currentBranch ref] isRemote]) + return [self baseCommitsForRemoteRefs]; + else + return [self baseCommitsForLocalRefs]; + } + + return [NSMutableSet set]; +} + + +- (PBGitHistoryGrapher *) grapher +{ + BOOL viewAllBranches = (repository.currentBranchFilter == kGitXAllBranchesFilter); + + return [[PBGitHistoryGrapher alloc] initWithBaseCommits:[self baseCommits] viewAllBranches:viewAllBranches delegate:self]; +} + + +- (void) setCurrentRevList:(PBGitRevList *)parser +{ + if (currentRevList == parser) + return; + + if (currentRevList) { + [currentRevList removeObserver:self forKeyPath:@"commits"]; + [currentRevList removeObserver:self forKeyPath:@"isParsing"]; + } + + currentRevList = parser; + + [currentRevList addObserver:self forKeyPath:@"commits" options:NSKeyValueObservingOptionNew context:@"commitsUpdated"]; + [currentRevList addObserver:self forKeyPath:@"isParsing" options:0 context:@"revListParsing"]; +} + + +- (BOOL) isAllBranchesOnlyUpdate +{ + return (lastBranchFilter == kGitXAllBranchesFilter) && (repository.currentBranchFilter == kGitXAllBranchesFilter); +} + + +- (BOOL) isLocalRemoteOnlyUpdate:(PBGitRevSpecifier *)rev +{ + if ((lastBranchFilter == kGitXLocalRemoteBranchesFilter) && (repository.currentBranchFilter == kGitXLocalRemoteBranchesFilter)) { + if (!lastRemoteRef && ![[rev ref] isRemote]) + return YES; + + if ([lastRemoteRef isEqualToRef:[[rev ref] remoteRef]]) + return YES; + } + + return NO; +} + + +- (BOOL) selectedBranchNeedsNewGraph:(PBGitRevSpecifier *)rev +{ + if (![rev isSimpleRef]) + return YES; + + if ([self isAllBranchesOnlyUpdate] || [self isLocalRemoteOnlyUpdate:rev]) { + lastRemoteRef = [[rev ref] remoteRef]; + lastSHA = nil; + self.isUpdating = NO; + self.updatedGraph = [NSDate date]; + return NO; + } + + NSString *revSHA = [repository shaForRef:[rev ref]]; + if ([revSHA isEqualToString:lastSHA] && (lastBranchFilter == repository.currentBranchFilter)) + return NO; + + lastBranchFilter = repository.currentBranchFilter; + lastRemoteRef = [[rev ref] remoteRef]; + lastSHA = revSHA; + + return YES; +} + + +- (BOOL) haveRefsBeenModified +{ + [repository reloadRefs]; + + NSMutableSet *currentRefSHAs = [NSMutableSet setWithArray:[repository.refs allKeys]]; + [currentRefSHAs minusSet:lastRefSHAs]; + lastRefSHAs = [NSSet setWithArray:[repository.refs allKeys]]; + + return [currentRefSHAs count] != 0; +} + + +#pragma mark updating history + +- (void) updateProjectHistoryForRev:(PBGitRevSpecifier *)rev +{ + [self setCurrentRevList:projectRevList]; + + if ([self haveRefsBeenModified]) + shouldReloadProjectHistory = YES; + + if (![self selectedBranchNeedsNewGraph:rev] && !shouldReloadProjectHistory) + return; + + [self resetGraphing]; + + if (shouldReloadProjectHistory) { + shouldReloadProjectHistory = NO; + lastBranchFilter = -1; + lastRemoteRef = nil; + lastSHA = nil; + [projectRevList loadRevisons]; + return; + } + + [graphQueue addOperation:[self operationForCommits:projectRevList.commits]]; +} + + +- (void) updateHistoryForRev:(PBGitRevSpecifier *)rev +{ + PBGitRevList *otherRevListParser = [[PBGitRevList alloc] initWithRepository:repository rev:rev shouldGraph:YES]; + + [self setCurrentRevList:otherRevListParser]; + [self resetGraphing]; + lastBranchFilter = -1; + lastRemoteRef = nil; + lastSHA = nil; + + [otherRevListParser loadRevisons]; +} + + + +#pragma mark - +#pragma mark Key Value Observing + +- (void) removeObservers +{ + [repository removeObserver:self forKeyPath:@"currentBranch"]; + [repository removeObserver:self forKeyPath:@"hasChanged"]; + + if (currentRevList) { + [currentRevList removeObserver:self forKeyPath:@"commits"]; + [currentRevList removeObserver:self forKeyPath:@"isParsing"]; + } + + if (graphQueue) + [graphQueue removeObserver:self forKeyPath:@"operations"]; +} + + +- (void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context +{ + if ([@"currentBranch" isEqualToString:context]) { + [self updateHistory]; + return; + } + + if ([@"repositoryHasChanged" isEqualToString:context]) { + [self forceUpdate]; + return; + } + + if ([@"commitsUpdated" isEqualToString:context]) { + NSInteger changeKind = [(NSNumber *)[change objectForKey:NSKeyValueChangeKindKey] intValue]; + if (changeKind == NSKeyValueChangeInsertion) { + NSArray *newCommits = [change objectForKey:NSKeyValueChangeNewKey]; + if ([repository.currentBranch isSimpleRef]) + [graphQueue addOperation:[self operationForCommits:newCommits]]; + else + [self addCommitsFromArray:newCommits]; + } + return; + } + + if ([@"revListParsing" isEqualToString:context] || [@"operations" isEqualToString:context]) { + [self finishedGraphing]; + return; + } + + [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; +} + +@end diff --git a/PBGitHistoryView.xib b/PBGitHistoryView.xib index 6ce7f60..8641614 100644 --- a/PBGitHistoryView.xib +++ b/PBGitHistoryView.xib @@ -3,7 +3,7 @@ 1050 10C540 - 740 + 762 1038.25 458.00 @@ -15,13 +15,13 @@ YES - 740 - 740 + 762 + 762 YES - + YES @@ -53,14 +53,12 @@ YES path contents - selectedTab + selectedCommitDetailsIndex textContents PBGitTree - YES YES - YES children leaf @@ -90,12 +88,9 @@ dateString arran realSha - strForSearchField - strForSearchAll PBGitCommit - YES YES YES YES @@ -105,1144 +100,191 @@ - 274 + 4370 YES - + - 293 - {{376, 6}, {71, 25}} - - YES - - -2080244224 - 0 - - LucidaGrande - 13 - 1044 - - - - YES - - 32 - - NSImage - DetailViewTemplate - - - Detailed View - YES - 2 - - - - NSImage - NSPathTemplate - - - Tree View - 9 - 2 - - - 2 - - - - - 274 + 266 YES - - - 4370 - - YES - - - 2304 - - YES - - - 256 - {852, 194} - - YES - - - 256 - {852, 17} - - - - - - -2147483392 - {{-26, 0}, {16, 17}} - - - - YES - - SubjectColumn - 442 - 40 - 1000 - - 75628096 - 2048 - Subject - - LucidaGrande - 11 - 3100 - - - 3 - MC4zMzMzMzI5OQA - - - 6 - System - headerTextColor - - 3 - MAA - - - - - 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 - - 3 - MQA - - - - - - 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 - MC41AA - - - 17 - -683671552 - - - CommitView - 5 - 15 - 0 - YES - 0 - - - {{0, 17}, {852, 194}} - - - - - 2 - - - - -2147483392 - {{837, 17}, {15, 179}} - - - _doScroller: - 0.92268041237113407 - - - - -2147483392 - {{0, 196}, {837, 15}} - - YES - 1 - - _doScroller: - 0.92709466811751906 - - - - 2304 - - YES - - - {852, 17} - - - - - 4 - - - - {852, 211} - - - 688 - - - - - - QSAAAEEgAABBmAAAQZgAAA - - - - 18 - {{0, 212}, {852, 186}} - - - YES - - 1 - - - 274 - - YES - - - 274 - - 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 - - - {{1, 0}, {851, 186}} - - - - - - - - YES - - YES - WebKitDefaultFixedFontSize - WebKitDefaultFontSize - WebKitMinimumFontSize - - - YES - - - - - - - YES - YES - - - {852, 186} - - - Details - - 6 - System - controlColor - - - - - - Item 2 - - - 256 - - YES - - - 274 - - YES - - - 276 - - YES - - - 2304 - - YES - - - 256 - {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 - - - {208, 188} - - - 18 - - - - QSAAAEEgAABBmAAAQZgAAA - - - - 274 - - YES - - - 2304 - - 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 - - - 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 - - - - 543 - 1 - - - 11233 - 0 - - - - YES - - YES - NSBackgroundColor - NSColor - - - YES - - 6 - System - selectedTextBackgroundColor - - - - 6 - System - selectedTextColor - - - - - - - YES - - YES - NSColor - NSUnderline - - - YES - - 1 - MCAwIDEAA - - - - - - - 6 - {1186, 1e+07} - {0, 0} - - - - {{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}, {643, 188}} - - - 18 - - - - - - {852, 188} - - YES - 2 - - - {852, 186} - - Tree - - - - - - - 6 - YES - YES - - YES - - - - - {{0, 35}, {852, 398}} - - 2 - HistoryViewSplitView - - - - 292 - {{17, 7}, {305, 17}} - - YES - - 67239488 - 272630784 - Label - - - - - - - - - 289 - {{795, 6}, {37, 25}} - - YES - - -2080244224 - 134217728 - Textured Button - - - -2033958657 - 163 - - NSImage - NSQuickLookTemplate - - - - 400 - 75 - - - - {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 - - - YES - YES - YES - YES - 1 - 1 - - YES - - YES - 1E431E79-1591-49E7-9E17-49497CA4622A - 7FFB691C-2D2F-49A9-997F-AE1AE8BFF3F1 - 86360841-A2B1-4802-845A-AE424521FE99 - 99C2C9EB-AE16-42A9-BE52-46CE903E9AF9 - NSToolbarFlexibleSpaceItem - NSToolbarSeparatorItem - - - YES - - - 1E431E79-1591-49E7-9E17-49497CA4622A - - View - View selector - - - - 268 - {{0, 14}, {87, 25}} - - - 3 + + + 289 + {{805, 3}, {37, 25}} + YES - - 67239424 + + -2080244224 + 134217728 + QuickLook + + LucidaGrande + 13 + 1044 + + + -2033958657 + 163 + + NSImage + NSQuickLookTemplate + + + + 400 + 75 + + + + + 292 + {{267, 3}, {71, 25}} + + YES + + -2080244224 0 - + YES - 40 + 32 NSImage - HistoryViewTemplate + DetailViewTemplate - History View - 0 + Detailed View + YES + 2 - 40 NSImage - CommitViewTemplate + NSPathTemplate - Commit View - YES - 0 + Tree View + 9 + 2 - 1 2 - - - - {87, 25} - {87, 25} - YES - YES - 3 - YES - 0 - - - - 7FFB691C-2D2F-49A9-997F-AE1AE8BFF3F1 - - Search - - Search Field - - - - - 265 - {{0, 14}, {183, 22}} - - - YES - - 343014976 - 268436480 - - All - - 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}} - - + {{206, 3}, {37, 25}} + YES - + -2080244224 134217728 - + Rebase - - -2033434369 + + -2033958657 163 - + + NSImage + RebaseTemplate + + + + 400 + 75 + + + + + 268 + {{161, 3}, {37, 25}} + + YES + + -2080244224 + 134217728 + Cherry Pick + + + -2033958657 + 163 + + NSImage + CherryPickTemplate + + + + 400 + 75 + + + + + 268 + {{116, 3}, {37, 25}} + + YES + + -2080244224 + 134217728 + Merge + + + -2033958657 + 163 + + NSImage + MergeTemplate + + + + 400 + 75 + + + + + 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 @@ -1252,184 +294,951 @@ 75 - - - - {40, 25} - {40, 25} - YES - YES - 0 - YES - 0 - - - - 99C2C9EB-AE16-42A9-BE52-46CE903E9AF9 - - Branch - Branch - - - - 268 - {{0, 14}, {134, 26}} - - - YES - - -2076049856 - 2048 + + + 10 + {{0, -2}, {852, 5}} + + {0, 0} + + 67239424 + 0 + Box - - 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: - - + + 6 + System + textBackgroundColor + + 3 + MQA - 1 - YES - YES - 2 + + 3 + MCAwLjgwMDAwMDAxMTkAA + - - - - - {134, 25} - {134, 26} - YES - YES - 0 - YES - 0 - - - NSToolbarFlexibleSpaceItem - - Flexible Space - - - - - - {1, 5} - {20000, 32} - YES - YES - -1 - YES - 0 - - YES - YES - - - 1048576 - 2147483647 - - + 3 + 2 + 0 + NO - - NSToolbarSeparatorItem - - Separator - - - - - - {12, 5} - {12, 1000} - YES - YES - -1 - YES - 0 - - YES - YES - - - 1048576 - 2147483647 - - + {{0, 402}, {852, 30}} + + PBGitGradientBarView + + + + 4370 + + YES + + + 274 + + YES + + + 10 + {{0, 143}, {852, 5}} + + {0, 0} + + 67239424 + 0 + Box + + + + 3 + MCAwLjgwMDAwMDAxMTkAA + + + 3 + 2 + 0 + NO + + + + 4370 + + YES + + + 2304 + + YES + + + 4352 + {852, 129} + + YES + + + 256 + {852, 17} + + + + + + -2147483392 + {{-26, 0}, {16, 17}} + + + + YES + + SubjectColumn + 549 + 40 + 1000 + + 75628096 + 2048 + Subject + + LucidaGrande + 11 + 3100 + + + 3 + MC4zMzMzMzI5OQA + + + 6 + System + headerTextColor + + 3 + MAA + + + + + 337772096 + 2048 + Text Cell + + LucidaGrande + 12 + 16 + + + + 6 + System + controlBackgroundColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + + + 3 + YES + + + + AuthorColumn + 129 + 40 + 1000 + + 75628096 + 2048 + Author + + + + + + 337772096 + 2048 + Text Cell + + + + + + 3 + YES + + + + DateColumn + 165 + 10 + 3.4028229999999999e+38 + + 75628096 + 2048 + Date + + + 6 + System + headerColor + + + + + + 337772096 + 2048 + Text Cell + + + + + + 3 + YES + + + + SHAColumn + 30 + 10 + 3.4028229999999999e+38 + + 75628096 + 2048 + SHA + + + + + + 338820672 + 1024 + Text Cell + + + + + + 3 + YES + + YES + + + 3 + 2 + + + 6 + System + gridColor + + 3 + MC41AA + + + 17 + -750780416 + + + CommitView + 5 + 15 + 0 + YES + 0 + + + {{0, 17}, {852, 129}} + + + + + 2 + + + + -2147483392 + {{837, 17}, {15, 179}} + + + _doScroller: + 0.87603305785123964 + + + + -2147483392 + {{0, 123}, {852, 15}} + + 1 + + _doScroller: + 0.9988276670574443 + + + + 2304 + + YES + + + {852, 17} + + + + + 4 + + + + {852, 146} + + + 560 + + + + + + QSAAAEEgAABBmAAAQZgAAA + + + + 266 + + YES + + + 268 + {{49, 2}, {57, 17}} + + 1 + YES + + 67239424 + 134348800 + Remote + + LucidaGrande-Bold + 11 + 16 + + + -1232846593 + 173 + + + 400 + 75 + + + + + 265 + {{662, 2}, {180, 19}} + + YES + + 343014976 + 268567552 + + 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 + + + + + 268 + {{114, 2}, {103, 17}} + + 2 + YES + + 67239424 + 131072 + Selected Branch + + + -1232846593 + 173 + + + 400 + 75 + + + + + 268 + {{11, 2}, {30, 17}} + + YES + + 67239424 + 134348800 + All + + + -1232846593 + 173 + + + 400 + 75 + + + + {{0, 146}, {852, 24}} + + PBGitGradientBarView + + + {852, 170} + + NSView + + + + 274 + + YES + + + 18 + {852, 232} + + + 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 + + + {{1, 0}, {851, 233}} + + + + + + + + YES + + YES + WebKitDefaultFixedFontSize + WebKitDefaultFontSize + WebKitMinimumFontSize + + + YES + + + + + + + YES + YES + + + {852, 232} + + Details + + 6 + System + controlColor + + + + + + Item 2 + + + 4352 + + YES + + + 4370 + + YES + + + 4372 + + YES + + + 2304 + + YES + + + 4368 + {191, 232} + + 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, 232}} + + + + + 4 + + + + 256 + {{192, 1}, {15, 232}} + + + _doScroller: + 0.9948186 + + + + -2147483392 + {{-100, -100}, {502, 15}} + + 1 + + _doScroller: + 0.0045045049999999998 + 0.99801189999999995 + + + {208, 234} + + + 18 + + + + QSAAAEEgAABBmAAAQZgAAA + + + + 4370 + + YES + + + 2304 + + YES + + + 2322 + {545, 120} + + + + + + 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 + + + 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 + + + + + + + 7 + {1186, 1e+07} + {0, 0} + + + + {{1, 1}, {628, 232}} + + + + + + {4, -5} + 1 + + 4 + + + + 256 + {{629, 1}, {15, 217}} + + + _doScroller: + 0.030031680000000002 + + + + -2147483392 + {{-100, -100}, {87, 18}} + + 1 + + _doScroller: + 1 + 0.94565220000000005 + + + {{209, 0}, {645, 234}} + + + 18 + + + + + + {{-1, -1}, {854, 234}} + + YES + 2 + + + {852, 232} + + + Tree + + + + + + + 6 + YES + YES + + YES + + + + + {{0, 171}, {852, 232}} + + NSView + {852, 403} + + 2 + HistoryViewSplitView - - YES - - - - - - - - - YES - - - - - - - - - YES - + {852, 432} + + NSView + + + PBRefController @@ -1547,25 +1356,17 @@ 62 - - - toggleQuickView: - - - - 66 - - selectedIndex: selectedTab + selectedIndex: selectedCommitDetailsIndex - selectedIndex: selectedTab + selectedIndex: selectedCommitDetailsIndex selectedIndex - selectedTab + selectedCommitDetailsIndex 2 @@ -1573,15 +1374,15 @@ - selectedIndex: selectedTab + selectedIndex: selectedCommitDetailsIndex - selectedIndex: selectedTab + selectedIndex: selectedCommitDetailsIndex selectedIndex - selectedTab + selectedCommitDetailsIndex 2 @@ -1691,26 +1492,6 @@ 98 - - - displayPatternValue1: arrangedObjects.@count - - - - - - displayPatternValue1: arrangedObjects.@count - displayPatternValue1 - arrangedObjects.@count - - NSDisplayPattern - %{value1}@ commits loaded - - 2 - - - 106 - delegate @@ -1751,22 +1532,6 @@ 112 - - - viewToolbar - - - - 160 - - - - searchField - - - - 185 - controller @@ -1807,46 +1572,6 @@ 235 - - - performClick: - - - - 248 - - - - newBranchSheet - - - - 249 - - - - newBranchName - - - - 250 - - - - closeSheet: - - - - 252 - - - - saveSheet: - - - - 253 - contextMenuDelegate @@ -1863,30 +1588,6 @@ 260 - - - addRef: - - - - 264 - - - - branchPopUp - - - - 268 - - - - errorMessage - - - - 274 - historySplitView @@ -1943,43 +1644,14 @@ predicate: filterPredicate - + - - + + predicate: filterPredicate predicate filterPredicate - - YES - - YES - NSDisplayName - NSPredicateFormat - - - YES - All - subject contains[c] $value or author contains[c] $value or dateString contains[c] $value or realSha contains $value - - - 2 - - - 349 - - - - predicate2: filterPredicate - - - - - - predicate2: filterPredicate - predicate2 - filterPredicate YES @@ -1993,22 +1665,21 @@ subject contains[c] $value - 2 - 350 + 301 - predicate3: filterPredicate - + predicate2: filterPredicate + - - + + - predicate3: filterPredicate - predicate3 + predicate2: filterPredicate + predicate2 filterPredicate YES @@ -2023,22 +1694,22 @@ author contains[c] $value - + 2 - 351 + 304 - predicate4: filterPredicate - + predicate3: filterPredicate + - - + + - predicate4: filterPredicate - predicate4 + predicate3: filterPredicate + predicate3 filterPredicate YES @@ -2050,44 +1721,190 @@ YES SHA - realSha contains $value + realSha contains[c] $value - + 2 + 308 + + + + searchField + + + + 315 + + + + upperToolbarView + + + + 326 + + + + scopeBarView + + + + 328 + + + + refController + + + + 329 + + + + createTag: + + + + 334 + + + + createBranch: + + + + 335 + + + + merge: + + + + 349 + + + + cherryPick: + + + + 350 + + + + rebase: + + + + 351 + + + + mergeButton + + + 352 + + + cherryPickButton + + + + 353 + + + + rebaseButton + + + + 354 + + + + allBranchesFilterItem + + + + 381 + + + + selectedBranchFilterItem + + + + 383 + + + + setBranchFilter: + + + + 384 + + + + setBranchFilter: + + + + 386 + + + + setBranchFilter: + + + + 391 + + + + localRemoteBranchesFilterItem + + + + 393 + + + + toggleQLPreviewPanel: + + + + 395 + + + + controller + + + + 396 + - predicate5: filterPredicate - - + enabled: selectedCommitDetailsIndex + + - - - predicate5: filterPredicate - predicate5 - filterPredicate - - YES - - YES - NSDisplayName - NSPredicateFormat - - - YES - Date - dateString contains $value - - - + + + enabled: selectedCommitDetailsIndex + enabled + selectedCommitDetailsIndex 2 - 353 + 398 @@ -2139,43 +1956,156 @@ 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 @@ -2185,6 +2115,31 @@ + Tree Tab + + + 6 + + + YES + + + + Details Tab + + + 20 + + + YES + + + + + + 21 + + 8 @@ -2200,55 +2155,38 @@ YES - + - - 10 - - - YES - - - - - - 11 YES - - + + + File Contents Scroll View - 12 - - - - - 13 - - - - - 14 - - - - - 15 - + 10 + YES - + + + + + File List Scroll View + + + 17 + @@ -2257,8 +2195,12 @@ - 17 - + 15 + + + YES + + @@ -2276,27 +2218,185 @@ - 20 - + 14 + + + + + 13 + + + + + 12 + + + + + 311 + YES - + + + + - + + Commits Scope Bar - 21 - - - - - 47 - + 297 + YES - + + + + + + 298 + + + + + 316 + + + YES + + + + + + + + + History Upper Toolbar + + + 317 + + + + + 327 + + + + + 330 + + + YES + + + + + + 331 + + + + + 332 + + + YES + + + + + + 333 + + + + + 355 + + + YES + + + + + + 356 + + + + + 359 + + + YES + + + + + + 360 + + + + + 387 + + + YES + + + + + + 388 + + + + + 337 + + + YES + + + + + + 338 + + + + + 340 + + + YES + + + + + + 341 + + + + + 343 + + + YES + + + + + + 344 + + 48 @@ -2305,7 +2405,12 @@ YES - + + + + 51 + + 49 @@ -2314,363 +2419,13 @@ YES - + 50 - - 51 - - - - - 52 - - - - - 231 - - - - - 236 - - - YES - - - - - - 237 - - - YES - - - - - - - - - - 238 - - - YES - - - - - - 239 - - - YES - - - - - - 240 - - - YES - - - - - - 242 - - - YES - - - - - - 243 - - - - - 245 - - - - - 246 - - - - - 247 - - - - - 3 - - - 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 - - - - - 223 - - - YES - - - - - - 263 - - - YES - - - - - - 261 - - - YES - - - - - - 262 - - - - - 224 - - - YES - - - - - - 225 - - - - - 117 - - - YES - - - - - - 118 - - - - - 114 - - - YES - - - - - - 119 - - - YES - - - - - - 120 - - - YES - - - - - - 121 - - - YES - - - - - - - - 124 - - - - - 123 - - - - - 122 - - - - - 272 - - - YES - - - - - - 273 - - - - - 287 - - - YES - - - - - - 288 - - - @@ -2680,22 +2435,8 @@ -3.IBPluginDependency 10.IBPluginDependency 11.IBPluginDependency - 113.IBEditorWindowLastContentRect - 113.IBPluginDependency - 113.editorWindowContentRectSynchronizationRect - 114.IBPluginDependency - 116.IBPluginDependency - 117.IBPluginDependency - 118.IBPluginDependency - 119.IBPluginDependency + 12.CustomClassName 12.IBPluginDependency - 120.IBPluginDependency - 121.IBEditorWindowLastContentRect - 121.IBPluginDependency - 121.editorWindowContentRectSynchronizationRect - 122.IBPluginDependency - 123.IBPluginDependency - 124.IBPluginDependency 13.IBPluginDependency 14.IBPluginDependency 15.CustomClassName @@ -2711,30 +2452,6 @@ 20.IBPluginDependency 21.IBAttributePlaceholdersKey 21.IBPluginDependency - 223.IBPluginDependency - 224.IBPluginDependency - 225.IBPluginDependency - 236.IBEditorWindowLastContentRect - 236.IBPluginDependency - 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 - 263.IBPluginDependency 27.CustomClassName 27.IBPluginDependency 27.IBViewIntegration.shadowBlurRadius @@ -2742,43 +2459,72 @@ 27.IBViewIntegration.shadowOffsetHeight 27.IBViewIntegration.shadowOffsetWidth 27.ImportedFromIB2 - 272.IBPluginDependency - 273.IBPluginDependency 28.IBPluginDependency 28.IBShouldRemoveOnLegacySave 287.IBPluginDependency 288.IBPluginDependency 29.IBPluginDependency 29.IBShouldRemoveOnLegacySave + 297.IBPluginDependency + 298.IBPluginDependency 3.IBPluginDependency 3.ImportedFromIB2 30.CustomClassName 30.IBPluginDependency 30.IBShouldRemoveOnLegacySave + 309.IBPluginDependency 31.IBPluginDependency 31.ImportedFromIB2 + 310.IBPluginDependency + 311.IBPluginDependency + 316.IBPluginDependency + 317.IBPluginDependency 32.IBPluginDependency 32.ImportedFromIB2 + 327.IBPluginDependency 33.IBPluginDependency + 330.IBAttributePlaceholdersKey + 330.IBPluginDependency + 331.IBPluginDependency + 332.IBAttributePlaceholdersKey + 332.IBPluginDependency + 333.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 + 355.IBAttributePlaceholdersKey + 355.IBPluginDependency + 356.IBPluginDependency + 359.IBAttributePlaceholdersKey + 359.IBPluginDependency 36.IBPluginDependency 36.ImportedFromIB2 + 360.IBPluginDependency 38.IBPluginDependency + 387.IBAttributePlaceholdersKey + 387.IBPluginDependency + 388.IBPluginDependency 39.IBPluginDependency 39.ImportedFromIB2 4.IBAttributePlaceholdersKey 4.IBPluginDependency 46.IBEditorWindowLastContentRect 46.IBPluginDependency - 47.IBPluginDependency 48.IBPluginDependency + 49.IBAttributePlaceholdersKey 49.IBPluginDependency 50.IBPluginDependency 51.IBPluginDependency - 52.IBPluginDependency 6.IBPluginDependency 7.IBPluginDependency 8.IBPluginDependency @@ -2789,21 +2535,7 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{312, 366}, {616, 227}} - 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 - com.apple.InterfaceBuilder.CocoaPlugin - {{725, 616}, {134, 63}} - com.apple.InterfaceBuilder.CocoaPlugin - {{848, 458}, {116, 63}} - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin + PBQLTextView com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -2826,37 +2558,6 @@ com.apple.WebKitIBPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - {{504, 612}, {346, 102}} - com.apple.InterfaceBuilder.CocoaPlugin - {{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 - - ToolTip - - Create Branch - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin PBCommitList com.apple.InterfaceBuilder.CocoaPlugin @@ -2865,31 +2566,117 @@ 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 + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + 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 + + 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 + + ToolTip + + ToolTip + + View commits from all branches + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + View commits from the selected branch only + + + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + View commits from only local or remote branches + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin YES @@ -2899,11 +2686,17 @@ com.apple.InterfaceBuilder.CocoaPlugin - {{139, 135}, {852, 432}} - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin + {{463, 486}, {852, 432}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + Quick Look + + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -2929,11 +2722,18 @@ - 353 + 398 YES + + NSOutlineView + + IBProjectSource + NSOutlineViewExt.h + + PBCollapsibleSplitView PBNiceSplitView @@ -2965,6 +2765,22 @@ PBCommitList.h + + PBGitGradientBarView + NSView + + IBProjectSource + PBGitGradientBarView.h + + + + PBGitGradientBarView + NSView + + IBUserSource + + + PBGitHistoryController PBViewController @@ -2972,15 +2788,21 @@ YES YES + cherryPick: + createBranch: + createTag: + merge: openFilesAction: openSelectedFile: + rebase: refresh: + setBranchFilter: setDetailedView: - setRawView: setTreeView: + showAddRemoteSheet: showCommitsFromTree: showInFinderAction: - toggleQuickView: + toggleQLPreviewPanel: YES @@ -2993,28 +2815,52 @@ id id id + id + id + id + id + id + id YES YES + allBranchesFilterItem + cherryPickButton commitController commitList fileBrowser historySplitView + localRemoteBranchesFilterItem + mergeButton + rebaseButton + refController + scopeBarView searchField + selectedBranchFilterItem treeController + upperToolbarView webView YES + NSButton + NSButton NSArrayController NSTableView NSOutlineView PBCollapsibleSplitView + NSButton + NSButton + NSButton + PBRefController + PBGitGradientBarView NSSearchField + NSButton NSTreeController + PBGitGradientBarView id @@ -3072,6 +2918,18 @@ PBQLOutlineView.h + + PBQLTextView + NSTextView + + controller + PBGitHistoryController + + + IBProjectSource + PBQLTextView.h + + PBRefController NSObject @@ -3079,17 +2937,39 @@ YES YES - addRef: - changeBranch: - closeSheet: - saveSheet: + checkout: + cherryPick: + copyPatch: + copySHA: + createBranch: + createTag: + diffWithHEAD: + fetchRemote: + merge: + pullRemote: + pushDefaultRemoteForRef: + pushToRemote: + pushUpdatesToRemote: + rebaseHeadBranch: + showTagInfoSheet: YES - id - NSMenuItem - id - id + PBRefMenuItem + PBRefMenuItem + PBRefMenuItem + PBRefMenuItem + PBRefMenuItem + PBRefMenuItem + PBRefMenuItem + PBRefMenuItem + PBRefMenuItem + PBRefMenuItem + PBRefMenuItem + PBRefMenuItem + PBRefMenuItem + PBRefMenuItem + PBRefMenuItem @@ -3099,20 +2979,14 @@ branchPopUp commitController commitList - errorMessage historyController - newBranchName - newBranchSheet YES NSPopUpButton NSArrayController PBCommitList - NSTextField PBGitHistoryController - NSTextField - NSWindow @@ -3120,6 +2994,18 @@ PBRefController.h + + PBRefMenuItem + NSMenuItem + + refish + id + + + IBProjectSource + PBRefMenuItem.h + + PBUnsortableTableHeader NSTableHeaderView @@ -3135,9 +3021,9 @@ PBViewController NSViewController - - viewToolbar - NSToolbar + + refresh: + id IBProjectSource @@ -3212,21 +3098,21 @@ NSApplication NSResponder - + IBFrameworkSource AppKit.framework/Headers/NSApplication.h NSApplication - + IBFrameworkSource AppKit.framework/Headers/NSApplicationScripting.h NSApplication - + IBFrameworkSource AppKit.framework/Headers/NSColorPanel.h @@ -3260,6 +3146,14 @@ AppKit.framework/Headers/NSArrayController.h + + NSBox + NSView + + IBFrameworkSource + AppKit.framework/Headers/NSBox.h + + NSButton NSControl @@ -3287,7 +3181,7 @@ NSControl NSView - + IBFrameworkSource AppKit.framework/Headers/NSControl.h @@ -3319,7 +3213,7 @@ NSMenu NSObject - + IBFrameworkSource AppKit.framework/Headers/NSMenu.h @@ -3327,19 +3221,11 @@ NSMenuItem NSObject - + IBFrameworkSource AppKit.framework/Headers/NSMenuItem.h - - NSMenuItemCell - NSButtonCell - - IBFrameworkSource - AppKit.framework/Headers/NSMenuItemCell.h - - NSObject @@ -3349,19 +3235,19 @@ NSObject - + NSObject - + NSObject - + NSObject - + NSObject @@ -3400,7 +3286,7 @@ NSObject - + NSObject @@ -3411,7 +3297,7 @@ NSObject - + IBFrameworkSource AppKit.framework/Headers/NSOutlineView.h @@ -3432,21 +3318,21 @@ NSObject - + IBFrameworkSource AppKit.framework/Headers/NSTableView.h NSObject - + IBFrameworkSource AppKit.framework/Headers/NSToolbarItem.h NSObject - + IBFrameworkSource AppKit.framework/Headers/NSView.h @@ -3679,7 +3565,7 @@ NSOutlineView NSTableView - + NSPopUpButton @@ -3689,14 +3575,6 @@ AppKit.framework/Headers/NSPopUpButton.h - - NSPopUpButtonCell - NSMenuItemCell - - IBFrameworkSource - AppKit.framework/Headers/NSPopUpButtonCell.h - - NSResponder @@ -3803,7 +3681,7 @@ NSTableView NSControl - + NSText @@ -3837,19 +3715,6 @@ AppKit.framework/Headers/NSTextView.h - - NSToolbar - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSToolbar.h - - - - NSToolbarItem - NSObject - - NSTreeController NSObjectController @@ -3867,7 +3732,7 @@ NSView - + NSView @@ -3879,7 +3744,7 @@ NSView NSResponder - + NSViewController @@ -3893,28 +3758,6 @@ 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 - - WebView NSView @@ -3957,6 +3800,7 @@ 0 + IBCocoaFramework com.apple.InterfaceBuilder.CocoaPlugin.macosx @@ -3972,5 +3816,30 @@ YES GitX.xcodeproj 3 + + YES + + YES + AddBranchTemplate + AddLabelTemplate + CherryPickTemplate + DetailViewTemplate + MergeTemplate + NSPathTemplate + NSQuickLookTemplate + RebaseTemplate + + + YES + {20, 12} + {23, 12} + {18.5143, 12.3429} + {17, 17} + {16.4571, 12.3429} + {16, 9} + {19, 11} + {16.4571, 13.3714} + + 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]; 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 diff --git a/PBGitRef.h b/PBGitRef.h index 578b56e..80bae6e 100644 --- a/PBGitRef.h +++ b/PBGitRef.h @@ -7,14 +7,43 @@ // #import +#import "PBGitRefish.h" -@interface PBGitRef : NSObject { +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 { NSString* ref; } -- (NSString*) shortName; -- (NSString*) type; +// +- (NSString *) refishName; +- (NSString *) shortName; +- (NSString *) refishType; + +- (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..c9ab938 100644 --- a/PBGitRef.m +++ b/PBGitRef.m @@ -9,27 +9,99 @@ #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/"; + + @implementation PBGitRef @synthesize ref; -- (NSString*) shortName + +- (NSString *) tagName { - if ([self type]) - return [ref substringFromIndex:[[self type] length] + 7]; - return ref; + if (![self isTag]) + return nil; + + return [self shortName]; } -- (NSString*) type +- (NSString *) branchName { - if ([ref hasPrefix:@"refs/heads"]) + 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 ([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:[kGitXRemoteRefPrefix stringByAppendingString:[self remoteName]]]; +} + + (PBGitRef*) refFromString: (NSString*) s { return [[PBGitRef alloc] initWithString:s]; @@ -50,4 +122,32 @@ 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 diff --git a/PBGitRepository.h b/PBGitRepository.h index 93c38c9..4ef3dac 100644 --- a/PBGitRepository.h +++ b/PBGitRepository.h @@ -7,26 +7,49 @@ // #import -#import "PBGitRevList.h" +#import "PBGitHistoryList.h" #import "PBGitRevSpecifier.h" #import "PBGitConfig.h" +#import "PBGitRefish.h" extern NSString* PBGitRepositoryErrorDomain; +enum branchFilterTypes { + kGitXAllBranchesFilter = 0, + kGitXLocalRemoteBranchesFilter, + kGitXSelectedBranchFilter +}; @class PBGitWindowController; +@class PBGitCommit; @interface PBGitRepository : NSDocument { - PBGitRevList* revisionList; + PBGitHistoryList* revisionList; PBGitConfig *config; BOOL hasChanged; NSMutableArray *branches; PBGitRevSpecifier *currentBranch; + NSInteger currentBranchFilter; NSMutableDictionary *refs; 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; +- (void) beginPushRef:(PBGitRef *)ref toRemote:(PBGitRef *)remoteRef; +- (BOOL) checkoutRefish:(id )ref; +- (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) deleteRemote:(PBGitRef *)ref; +- (BOOL) deleteRef:(PBGitRef *)ref; + - (NSFileHandle*) handleForCommand:(NSString*) cmd; - (NSFileHandle*) handleForArguments:(NSArray*) args; - (NSFileHandle *) handleInWorkDirForArguments:(NSArray *)args; @@ -44,13 +67,29 @@ extern NSString* PBGitRepositoryErrorDomain; - (BOOL)executeHook:(NSString *)name withArgs:(NSArray*) arguments output:(NSString **)output; - (NSString *)workingDirectory; +- (NSString *) projectName; - (NSString *)gitIgnoreFilename; - (BOOL)isBareRepository; -- (BOOL) reloadRefs; +- (void) reloadRefs; - (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) isOnSameBranch:(NSString *)baseSHA asSHA:(NSString *)testSHA; +- (BOOL) isSHAOnHeadBranch:(NSString *)testSHA; +- (BOOL) isRefOnHeadBranch:(PBGitRef *)testRef; +- (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; @@ -64,12 +103,14 @@ extern NSString* PBGitRepositoryErrorDomain; - (id) initWithURL: (NSURL*) path; - (void) setup; +- (void) forceUpdateRevisions; @property (assign) BOOL hasChanged; @property (readonly) PBGitWindowController *windowController; @property (readonly) PBGitConfig *config; -@property (retain) PBGitRevList* revisionList; +@property (retain) PBGitHistoryList *revisionList; @property (assign) NSMutableArray* branches; @property (assign) PBGitRevSpecifier *currentBranch; +@property (assign) NSInteger currentBranchFilter; @property (retain) NSMutableDictionary* refs; @end diff --git a/PBGitRepository.m b/PBGitRepository.m index 821cd2a..efc5600 100644 --- a/PBGitRepository.m +++ b/PBGitRepository.m @@ -15,12 +15,16 @@ #import "PBEasyPipe.h" #import "PBGitRef.h" #import "PBGitRevSpecifier.h" +#import "PBRemoteProgressSheet.h" +#import "PBGitRevList.h" +#import "PBGitDefaults.h" NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; @implementation PBGitRepository @synthesize revisionList, branches, currentBranch, refs, hasChanged, config; +@synthesize currentBranchFilter; - (BOOL)readFromData:(NSData *)data ofType:(NSString *)typeName error:(NSError **)outError { @@ -112,16 +116,16 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; [self setFileURL:gitDirURL]; [self setup]; - [self readCurrentBranch]; return YES; } - (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]; + currentBranchFilter = [PBGitDefaults branchFilter]; + revisionList = [[PBGitHistoryList alloc] initWithRepository:self]; } - (id) initWithURL: (NSURL*) path @@ -149,22 +153,34 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; return self; } +- (void) forceUpdateRevisions +{ + [revisionList forceUpdate]; +} + +- (BOOL)isDocumentEdited +{ + return NO; +} + // 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 @@ -215,47 +231,40 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; [refs setObject:[NSMutableArray arrayWithObject:ref] forKey:sha]; } -// reloadRefs: reload all refs in the repository, like in readRefs -// To stay compatible, this does not remove a ref from the branches list -// even after it has been deleted. -// returns YES when a ref was changed -- (BOOL) reloadRefs +- (void) reloadRefs { _headRef = nil; - BOOL ret = NO; refs = [NSMutableDictionary dictionary]; + NSMutableArray *oldBranches = [branches mutableCopy]; - NSString* output = [PBEasyPipe outputForCommand:[PBGitBinary path] - withArgs:[NSArray arrayWithObjects:@"for-each-ref", @"--format=%(refname) %(objecttype) %(objectname)" - " %(*objectname)", @"refs", nil] - inDir: self.fileURL.path]; - NSArray* lines = [output componentsSeparatedByString:@"\n"]; + NSArray *arguments = [NSArray arrayWithObjects:@"for-each-ref", @"--format=%(refname) %(objecttype) %(objectname) %(*objectname)", @"refs", nil]; + NSString *output = [self outputForArguments:arguments]; + NSArray *lines = [output componentsSeparatedByString:@"\n"]; - for (NSString* line in lines) { + for (NSString *line in lines) { // If its an empty line, skip it (e.g. with empty repositories) if ([line length] == 0) continue; - NSArray* components = [line componentsSeparatedByString:@" "]; + NSArray *components = [line componentsSeparatedByString:@" "]; - // First do the ref matching. If this ref is new, add it to our ref list PBGitRef *newRef = [PBGitRef refFromString:[components objectAtIndex:0]]; - PBGitRevSpecifier* revSpec = [[PBGitRevSpecifier alloc] initWithRef:newRef]; - if ([self addBranch:revSpec] != revSpec) - ret = YES; + PBGitRevSpecifier *revSpec = [[PBGitRevSpecifier alloc] initWithRef:newRef]; - // Also add this ref to the refs list + [self addBranch:revSpec]; [self addRef:newRef fromParameters:components]; + [oldBranches removeObject:revSpec]; } - // Add an "All branches" option in the branches list - [self addBranch:[PBGitRevSpecifier allBranchesRevSpec]]; - [self addBranch:[PBGitRevSpecifier localBranchesRevSpec]]; + for (PBGitRevSpecifier *branch in oldBranches) + if ([branch isSimpleRef] && ![branch isEqual:[self headRef]]) + [self removeBranch:branch]; + + [self willChangeValueForKey:@"refs"]; + [self didChangeValueForKey:@"refs"]; [[[self windowController] window] setTitle:[self displayName]]; - - return ret; } - (void) lazyReload @@ -263,8 +272,7 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; if (!hasChanged) return; - [self reloadRefs]; - [self.revisionList reload]; + [self.revisionList updateHistory]; hasChanged = NO; } @@ -281,35 +289,157 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; return _headRef; } - -// Returns either this object, or an existing, equal object -- (PBGitRevSpecifier*) addBranch: (PBGitRevSpecifier*) rev + +- (NSString *) headSHA { - if ([[rev parameters] count] == 0) - rev = [self headRef]; - - // First check if the branch doesn't exist already - for (PBGitRevSpecifier* r in branches) - if ([rev isEqualTo: r]) - return r; - - [self willChangeValueForKey:@"branches"]; - [branches addObject: rev]; - [self didChangeValueForKey:@"branches"]; - return rev; + return [self shaForRef:[[self headRef] ref]]; } -- (BOOL)removeBranch:(PBGitRevSpecifier *)rev +- (PBGitCommit *) headCommit { - for (PBGitRevSpecifier *r in branches) { - if ([rev isEqualTo:r]) { - [self willChangeValueForKey:@"branches"]; - [branches removeObject:r]; - [self didChangeValueForKey:@"branches"]; - return TRUE; + 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 = revisionList.projectCommits; + + for (PBGitCommit *commit in revList) + if ([[commit realSha] isEqualToString:sha]) + return commit; + + return nil; +} + +- (BOOL) isOnSameBranch:(NSString *)branchSHA asSHA:(NSString *)testSHA +{ + if (!branchSHA || !testSHA) + return NO; + + if ([testSHA isEqualToString:branchSHA]) + return YES; + + NSArray *revList = revisionList.projectCommits; + + NSMutableSet *searchSHAs = [NSMutableSet setWithObject:branchSHA]; + + for (PBGitCommit *commit in revList) { + NSString *commitSHA = [commit realSha]; + if ([searchSHAs containsObject:commitSHA]) { + if ([testSHA isEqualToString:commitSHA]) + return YES; + [searchSHAs removeObject:commitSHA]; + [searchSHAs addObjectsFromArray:commit.parents]; + } + else if ([testSHA isEqualToString:commitSHA]) + return NO; + } + + return NO; +} + +- (BOOL) isSHAOnHeadBranch:(NSString *)testSHA +{ + if (!testSHA) + return NO; + + NSString *headSHA = [self headSHA]; + + if ([testSHA isEqualToString:headSHA]) + return YES; + + return [self isOnSameBranch:headSHA asSHA:testSHA]; +} + +- (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*)branch +{ + if ([[branch parameters] count] == 0) + branch = [self headRef]; + + // First check if the branch doesn't exist already + for (PBGitRevSpecifier *rev in branches) + if ([branch isEqual: rev]) + 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 *)branch +{ + for (PBGitRevSpecifier *rev in branches) { + if ([branch isEqual: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 @@ -325,7 +455,404 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; return [PBGitBinary path]; 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 + +- (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]; + + 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"]; + + 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]; +} + +- (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]; +} + +- (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; + 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) 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) 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) 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) 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) + 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; +} + +- (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; +} + +- (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]; + 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 - (int) returnValueForCommand:(NSString *)cmd { diff --git a/PBGitRevList.h b/PBGitRevList.h index 42bc82a..7370711 100644 --- a/PBGitRevList.h +++ b/PBGitRevList.h @@ -9,17 +9,24 @@ #import @class PBGitRepository; +@class PBGitRevSpecifier; @interface PBGitRevList : NSObject { - NSArray* commits; + NSMutableArray *commits; + PBGitRepository *repository; - NSString* lastSha; + PBGitRevSpecifier *currentRev; + BOOL isGraphing; + + NSThread *parseThread; + BOOL isParsing; + BOOL resetCommits; } -- initWithRepository:(PBGitRepository *)repo; -- (void) readCommitsForce: (BOOL) force; -- (void) reload; +- (id) initWithRepository:(PBGitRepository *)repo rev:(PBGitRevSpecifier *)rev shouldGraph:(BOOL)graph; +- (void) loadRevisons; -@property(retain) NSArray* commits; +@property (retain) NSMutableArray *commits; +@property (readonly) BOOL isParsing; @end diff --git a/PBGitRevList.mm b/PBGitRevList.mm index ca3704f..e0374ec 100644 --- a/PBGitRevList.mm +++ b/PBGitRevList.mm @@ -20,59 +20,81 @@ using namespace std; + +@interface PBGitRevList () + +@property (assign) BOOL isParsing; + +@end + + +#define kRevListThreadKey @"thread" +#define kRevListRevisionsKey @"revisions" + + @implementation PBGitRevList @synthesize commits; -- (id)initWithRepository:(PBGitRepository *)repo +@synthesize isParsing; + + +- (id) initWithRepository:(PBGitRepository *)repo rev:(PBGitRevSpecifier *)rev shouldGraph:(BOOL)graph { repository = repo; - [repository addObserver:self forKeyPath:@"currentBranch" options:0 context:nil]; + isGraphing = graph; + currentRev = [rev copy]; return self; } -- (void) reload + +- (void) loadRevisons { - [self readCommitsForce: YES]; + [parseThread cancel]; + + parseThread = [[NSThread alloc] initWithTarget:self selector:@selector(walkRevisionListWithSpecifier:) object:currentRev]; + self.isParsing = YES; + resetCommits = YES; + [parseThread start]; } -- (void) readCommitsForce: (BOOL) force -{ - // We use refparse to get the commit sha that we will parse. That way, - // we can check if the current branch is the same as the previous one - // and in that case we don't have to reload the revision list. - // If no branch is selected, don't do anything - if (![repository currentBranch]) +- (void) finishedParsing +{ + self.isParsing = NO; +} + + +- (void) updateCommits:(NSDictionary *)update +{ + if ([update objectForKey:kRevListThreadKey] != parseThread) return; - PBGitRevSpecifier* newRev = [repository currentBranch]; - NSString* newSha = nil; + NSArray *revisions = [update objectForKey:kRevListRevisionsKey]; + if (!revisions || [revisions count] == 0) + return; - if (!force && newRev && [newRev isSimpleRef]) { - newSha = [repository parseReference:[newRev simpleRef]]; - if ([newSha isEqualToString:lastSha]) - return; + if (resetCommits) { + self.commits = [NSMutableArray array]; + resetCommits = NO; } - lastSha = newSha; - NSThread * commitThread = [[NSThread alloc] initWithTarget: self selector: @selector(walkRevisionListWithSpecifier:) object:newRev]; - [commitThread start]; + NSRange range = NSMakeRange([commits count], [revisions count]); + NSIndexSet *indexes = [NSIndexSet indexSetWithIndexesInRange:range]; + + [self willChange:NSKeyValueChangeInsertion valuesAtIndexes:indexes forKey:@"commits"]; + [commits addObjectsFromArray:revisions]; + [self didChange:NSKeyValueChangeInsertion valuesAtIndexes:indexes forKey:@"commits"]; } -- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object - change:(NSDictionary *)change context:(void *)context -{ - if (object == repository) - [self readCommitsForce: NO]; -} -- (void) walkRevisionListWithSpecifier: (PBGitRevSpecifier*) rev +- (void) walkRevisionListWithSpecifier:(PBGitRevSpecifier*)rev { NSDate *start = [NSDate date]; - NSMutableArray* revisions = [NSMutableArray array]; - PBGitGrapher* g = [[PBGitGrapher alloc] initWithRepository: repository]; + NSMutableArray *revisions = [NSMutableArray array]; + PBGitGrapher *g = [[PBGitGrapher alloc] initWithRepository:repository]; std::map encodingMap; + NSThread *currentThread = [NSThread currentThread]; NSString *formatString = @"--pretty=format:%H\01%e\01%an\01%s\01%P\01%at"; BOOL showSign = [rev hasLeftRight]; @@ -90,7 +112,7 @@ using namespace std; NSString *directory = rev.workingDirectory ? rev.workingDirectory.path : repository.fileURL.path; NSTask *task = [PBEasyPipe taskForCommand:[PBGitBinary path] withArgs:arguments inDir:directory]; [task launch]; - NSFileHandle* handle = [task.standardOutput fileHandleForReading]; + NSFileHandle *handle = [task.standardOutput fileHandleForReading]; int fd = [handle fileDescriptor]; __gnu_cxx::stdio_filebuf buf(fd, std::ios::in); @@ -108,8 +130,15 @@ using namespace std; if (sha[1] == 'i') // Matches 'Final output' { num = 0; - [self performSelectorOnMainThread:@selector(setCommits:) withObject:revisions waitUntilDone:NO]; - g = [[PBGitGrapher alloc] initWithRepository: repository]; + if ([currentThread isCancelled]) + break; + + NSDictionary *update = [NSDictionary dictionaryWithObjectsAndKeys:currentThread, kRevListThreadKey, revisions, kRevListRevisionsKey, nil]; + [self performSelectorOnMainThread:@selector(updateCommits:) withObject:update waitUntilDone:NO]; + revisions = [NSMutableArray array]; + + if (isGraphing) + g = [[PBGitGrapher alloc] initWithRepository:repository]; revisions = [NSMutableArray array]; // If the length is < 40, then there are no commits.. quit now @@ -164,7 +193,6 @@ using namespace std; int time; stream >> time; - [newCommit setSubject:[NSString stringWithCString:subject.c_str() encoding:encoding]]; [newCommit setAuthor:[NSString stringWithCString:author.c_str() encoding:encoding]]; [newCommit setTimestamp:time]; @@ -185,16 +213,32 @@ using namespace std; cout << "Error" << endl; [revisions addObject: newCommit]; - [g decorateCommit: newCommit]; + if (isGraphing) + [g decorateCommit:newCommit]; - if (++num % 1000 == 0) - [self performSelectorOnMainThread:@selector(setCommits:) withObject:revisions waitUntilDone:NO]; + if (++num % 1000 == 0) { + if ([currentThread isCancelled]) + break; + NSDictionary *update = [NSDictionary dictionaryWithObjectsAndKeys:currentThread, kRevListThreadKey, revisions, kRevListRevisionsKey, nil]; + [self performSelectorOnMainThread:@selector(updateCommits:) withObject:update waitUntilDone:NO]; + revisions = [NSMutableArray array]; + } } - NSTimeInterval duration = [[NSDate date] timeIntervalSinceDate:start]; - NSLog(@"Loaded %i commits in %f seconds", num, duration); - // Make sure the commits are stored before exiting. - [self performSelectorOnMainThread:@selector(setCommits:) withObject:revisions waitUntilDone:YES]; + if (![currentThread isCancelled]) { + NSTimeInterval duration = [[NSDate date] timeIntervalSinceDate:start]; + NSLog(@"Loaded %i commits in %f seconds", num, duration); + + // Make sure the commits are stored before exiting. + NSDictionary *update = [NSDictionary dictionaryWithObjectsAndKeys:currentThread, kRevListThreadKey, revisions, kRevListRevisionsKey, nil]; + [self performSelectorOnMainThread:@selector(updateCommits:) withObject:update waitUntilDone:YES]; + + [self performSelectorOnMainThread:@selector(finishedParsing) withObject:nil waitUntilDone:NO]; + } + else { + NSLog(@"[%@ %s] thread has been canceled", [self class], _cmd); + } + [task waitUntilExit]; } diff --git a/PBGitRevSpecifier.h b/PBGitRevSpecifier.h index 0461908..4e13175 100644 --- a/PBGitRevSpecifier.h +++ b/PBGitRevSpecifier.h @@ -9,21 +9,25 @@ #import #import -@interface PBGitRevSpecifier : NSObject { +@interface PBGitRevSpecifier : NSObject { NSString *description; NSArray *parameters; NSURL *workingDirectory; + BOOL isSimpleRef; } - (id) initWithParameters:(NSArray*) params; - (id) initWithRef: (PBGitRef*) ref; -- (BOOL) isSimpleRef; - (NSString*) simpleRef; +- (PBGitRef *) ref; - (BOOL) hasPathLimiter; - (BOOL) hasLeftRight; +- (NSString *) title; -- (BOOL) isEqualTo: (PBGitRevSpecifier*) other; +- (BOOL) isEqual: (PBGitRevSpecifier*) other; +- (BOOL) isAllBranchesRev; +- (BOOL) isLocalBranchesRev; + (PBGitRevSpecifier *)allBranchesRevSpec; + (PBGitRevSpecifier *)localBranchesRevSpec; @@ -31,5 +35,6 @@ @property(retain) NSString *description; @property(readonly) NSArray *parameters; @property(retain) NSURL *workingDirectory; +@property(readonly) BOOL isSimpleRef; @end diff --git a/PBGitRevSpecifier.m b/PBGitRevSpecifier.m index 0fe9093..9e2b785 100644 --- a/PBGitRevSpecifier.m +++ b/PBGitRevSpecifier.m @@ -12,44 +12,56 @@ @implementation PBGitRevSpecifier @synthesize parameters, description, workingDirectory; +@synthesize isSimpleRef; -- (id) initWithParameters:(NSArray*) params + +// internal designated init +- (id) initWithParameters:(NSArray *)params description:(NSString *)descrip { parameters = params; - description = nil; + description = descrip; + + if (([parameters count] > 1) || ([parameters count] == 0)) + isSimpleRef = NO; + else { + NSString *param = [parameters objectAtIndex:0]; + if ([param hasPrefix:@"-"] || + [param rangeOfCharacterFromSet:[NSCharacterSet characterSetWithCharactersInString:@"^@{}~:"]].location != NSNotFound || + [param rangeOfString:@".."].location != NSNotFound) + isSimpleRef = NO; + else + isSimpleRef = YES; + } + return self; } -- (id) initWithRef: (PBGitRef*) ref +- (id) initWithParameters:(NSArray *)params { - parameters = [NSArray arrayWithObject: ref.ref]; - description = ref.shortName; + [self initWithParameters:params description:nil]; + return self; +} + +- (id) initWithRef:(PBGitRef *)ref +{ + [self initWithParameters:[NSArray arrayWithObject:ref.ref] description:ref.shortName]; return self; } - (id) initWithCoder:(NSCoder *)coder { - parameters = [coder decodeObjectForKey:@"Parameters"]; - description = [coder decodeObjectForKey:@"Description"]; + [self initWithParameters:[coder decodeObjectForKey:@"Parameters"] description:[coder decodeObjectForKey:@"Description"]]; return self; } + (PBGitRevSpecifier *)allBranchesRevSpec { - id revspec = [[PBGitRevSpecifier alloc] initWithParameters:[NSArray arrayWithObject:@"--all"]]; - [revspec setDescription:@"All branches"]; - return revspec; + return [[PBGitRevSpecifier alloc] initWithParameters:[NSArray arrayWithObject:@"--all"] description:@"All branches"]; } + (PBGitRevSpecifier *)localBranchesRevSpec { - id revspec = [[PBGitRevSpecifier alloc] initWithParameters:[NSArray arrayWithObject:@"--branches"]]; - [revspec setDescription:@"Local branches"]; - return revspec; -} -- (BOOL) isSimpleRef -{ - return ([parameters count] == 1 && ![[parameters objectAtIndex:0] hasPrefix:@"-"]); + return [[PBGitRevSpecifier alloc] initWithParameters:[NSArray arrayWithObject:@"--branches"] description:@"Local branches"]; } - (NSString*) simpleRef @@ -59,12 +71,42 @@ return [parameters objectAtIndex:0]; } -- (NSString*) description +- (PBGitRef *) ref { - if (description) - return description; + if (![self isSimpleRef]) + return nil; + + return [PBGitRef refFromString:[self simpleRef]]; +} + +- (NSString *) description +{ + if (!description) + description = [parameters componentsJoinedByString:@" "]; + + return description; +} + +- (NSString *) title +{ + NSString *title = nil; - return [parameters componentsJoinedByString:@" "]; + 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; @@ -82,17 +124,34 @@ return YES; return NO; } - -- (BOOL) isEqualTo: (PBGitRevSpecifier*) other + +- (BOOL) isEqual:(PBGitRevSpecifier *)other { if ([self isSimpleRef] ^ [other isSimpleRef]) return NO; if ([self isSimpleRef]) - return [[[self parameters] objectAtIndex: 0] isEqualToString: [other.parameters objectAtIndex: 0]]; + return [[[self parameters] objectAtIndex:0] isEqualToString:[other.parameters objectAtIndex:0]]; - return ([[parameters componentsJoinedByString:@" "] isEqualToString: [other.parameters componentsJoinedByString:@" "]] && - (!description || [description isEqualToString:other.description])); + return [self.description isEqualToString:other.description]; +} + +- (NSUInteger) hash +{ + if ([self isSimpleRef]) + return [[[self parameters] objectAtIndex:0] hash]; + + return [self.description hash]; +} + +- (BOOL) isAllBranchesRev +{ + return [self isEqual:[PBGitRevSpecifier allBranchesRevSpec]]; +} + +- (BOOL) isLocalBranchesRev +{ + return [self isEqual:[PBGitRevSpecifier localBranchesRevSpec]]; } - (void) encodeWithCoder:(NSCoder *)coder @@ -100,4 +159,14 @@ [coder encodeObject:description forKey:@"Description"]; [coder encodeObject:parameters forKey:@"Parameters"]; } + +- (id)copyWithZone:(NSZone *)zone +{ + PBGitRevSpecifier *copy = [[[self class] allocWithZone:zone] initWithParameters:[self.parameters copy]]; + copy.description = [self.description copy]; + copy.workingDirectory = [self.workingDirectory copy]; + + return copy; +} + @end diff --git a/PBGitRevisionCell.m b/PBGitRevisionCell.m index 98f978b..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; @@ -283,20 +285,22 @@ if (!contextMenuDelegate) return [self menu]; - int i = [self indexAtX:[view convertPointFromBase:[event locationInWindow]].x]; - if (i < 0) - return [self menu]; + int i = [self indexAtX:[view convertPointFromBase:[event locationInWindow]].x - rect.origin.x]; - 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 commit:[self objectValue]]; NSMenu *menu = [[NSMenu alloc] init]; + [menu setAutoenablesItems:NO]; for (NSMenuItem *item in items) [menu addItem:item]; return menu; - - return [self menu]; } @end 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 new file mode 100644 index 0000000..ba4dd2f --- /dev/null +++ b/PBGitSidebarController.h @@ -0,0 +1,43 @@ +// +// PBGitSidebar.h +// GitX +// +// Created by Pieter de Bie on 9/8/09. +// Copyright 2009 __MyCompanyName__. All rights reserved. +// + +#import +#import "PBViewController.h" + +@class PBSourceViewItem; +@class PBGitHistoryController; +@class PBGitCommitController; + +@interface PBGitSidebarController : PBViewController { + IBOutlet NSWindow *window; + IBOutlet NSOutlineView *sourceView; + IBOutlet NSView *sourceListControlsView; + IBOutlet NSPopUpButton *actionButton; + IBOutlet NSSegmentedControl *remoteControls; + + NSMutableArray *items; + + /* Specific things */ + PBSourceViewItem *stage; + + PBSourceViewItem *branches, *remotes, *tags, *others; + + PBGitHistoryController *historyViewController; + PBGitCommitController *commitViewController; +} + +- (void) selectStage; +- (void) selectCurrentBranch; + +- (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 new file mode 100644 index 0000000..4da2d8c --- /dev/null +++ b/PBGitSidebarController.m @@ -0,0 +1,395 @@ +// +// PBGitSidebar.m +// GitX +// +// Created by Pieter de Bie on 9/8/09. +// Copyright 2009 __MyCompanyName__. All rights reserved. +// + +#import "PBGitSidebarController.h" +#import "PBSourceViewItems.h" +#import "PBGitHistoryController.h" +#import "PBGitCommitController.h" +#import "PBRefController.h" +#import "PBSourceViewCell.h" +#import "NSOutlineViewExt.h" +#import "PBAddRemoteSheet.h" +#import "PBGitDefaults.h" + +@interface PBGitSidebarController () + +- (void)populateList; +- (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 +{ + self = [super initWithRepository:theRepository superController:controller]; + [sourceView setDelegate:self]; + items = [NSMutableArray array]; + + return self; +} + +- (void)awakeFromNib +{ + [super awakeFromNib]; + 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"]; + [repository addObserver:self forKeyPath:@"branches" options:(NSKeyValueObservingOptionOld | NSKeyValueObservingOptionNew) context:@"branchesModified"]; + + [self menuNeedsUpdate:[actionButton menu]]; + + if ([PBGitDefaults showStageView]) + [self selectStage]; + else + [self selectCurrentBranch]; +} + +- (void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)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]; +} + +- (PBSourceViewItem *) selectedItem +{ + NSInteger index = [sourceView selectedRow]; + PBSourceViewItem *item = [sourceView itemAtRow:index]; + + return item; +} + +- (void) selectStage +{ + NSIndexSet *index = [NSIndexSet indexSetWithIndex:[sourceView rowForItem:stage]]; + [sourceView selectRowIndexes:index byExtendingSelection:NO]; +} + +- (void) selectCurrentBranch +{ + PBGitRevSpecifier *rev = repository.currentBranch; + if (!rev) { + [repository reloadRefs]; + [repository readCurrentBranch]; + return; + } + + PBSourceViewItem *item = nil; + for (PBSourceViewItem *it in items) + if (item = [it findRev:rev]) + break; + + if (!item) { + [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]; + NSIndexSet *index = [NSIndexSet indexSetWithIndex:[sourceView rowForItem:item]]; + + [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; + } + + 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)]]; + [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 + +- (void)outlineViewSelectionDidChange:(NSNotification *)notification +{ + NSInteger index = [sourceView selectedRow]; + PBSourceViewItem *item = [sourceView itemAtRow:index]; + + if ([item revSpecifier]) { + if (![repository.currentBranch isEqual:[item revSpecifier]]) + repository.currentBranch = [item revSpecifier]; + [superController changeContentController:historyViewController]; + [PBGitDefaults setShowStageView:NO]; + } + + if (item == stage) { + [superController changeContentController:commitViewController]; + [PBGitDefaults setShowStageView:YES]; + } + + [self updateActionMenu]; + [self updateRemoteControls]; +} + +#pragma mark NSOutlineView delegate methods +- (BOOL)outlineView:(NSOutlineView *)outlineView isGroupItem:(id)item +{ + return [item isGroupItem]; +} + +- (void)outlineView:(NSOutlineView *)outlineView willDisplayCell:(PBSourceViewCell *)cell forTableColumn:(NSTableColumn *)tableColumn item:(PBSourceViewItem *)item +{ + cell.isCheckedOut = [item.revSpecifier isEqual:[repository headRef]]; + + [cell setImage:[item icon]]; +} + +- (BOOL)outlineView:(NSOutlineView *)outlineView shouldSelectItem:(id)item +{ + return ![item isGroupItem]; +} + +// +// 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]; +} + +- (void)populateList +{ + PBSourceViewItem *project = [PBSourceViewItem groupItemWithTitle:[repository projectName]]; + project.isUncollapsible = YES; + + stage = [PBGitSVStageItem stageItem]; + [project addChild:stage]; + + branches = [PBSourceViewItem groupItemWithTitle:@"Branches"]; + remotes = [PBSourceViewItem groupItemWithTitle:@"Remotes"]; + tags = [PBSourceViewItem groupItemWithTitle:@"Tags"]; + others = [PBSourceViewItem groupItemWithTitle:@"Other"]; + + for (PBGitRevSpecifier *rev in repository.branches) + [self addRevSpec:rev]; + + [items addObject:project]; + [items addObject:branches]; + [items addObject:remotes]; + [items addObject:tags]; + [items addObject:others]; + + [sourceView reloadData]; + [sourceView expandItem:project]; + [sourceView expandItem:branches expandChildren:YES]; + [sourceView expandItem:remotes]; + + [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]; +} + + +#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 = [viewItem ref]; + if (!ref) + return nil; + + NSMenu *menu = [[NSMenu alloc] init]; + [menu setAutoenablesItems:NO]; + [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 new file mode 100644 index 0000000..cdf65f9 --- /dev/null +++ b/PBGitSidebarView.xib @@ -0,0 +1,1341 @@ + + + + 1050 + 10C540 + 759 + 1038.25 + 458.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 759 + + + YES + + + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + YES + + YES + + + YES + + + + YES + + PBGitSidebarController + + + FirstResponder + + + NSApplication + + + + 274 + + YES + + + 4370 + + YES + + + 2304 + + YES + + + 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 + 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} + + + 528 + + + + QSAAAEEgAABBoAAAQaAAAA + + + {153, 354} + + 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 + + + + + YES + + + sourceView + + + + 26 + + + + dataSource + + + + 34 + + + + delegate + + + + 35 + + + + view + + + + 37 + + + + sourceListControlsView + + + + 45 + + + + actionButton + + + + 46 + + + + remoteControls + + + + 49 + + + + fetchPullPushAction: + + + + 50 + + + + delegate + + + + 51 + + + + + YES + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 36 + + + YES + + + + Source List View + + + 8 + + + YES + + + + + + + + 11 + + + YES + + + + + + 10 + + + + + 9 + + + + + 13 + + + YES + + + + + + 16 + + + + + 38 + + + YES + + + + + Source List Controls View + + + 39 + + + YES + + + + + + 40 + + + YES + + + + + + 41 + + + YES + + + + + + + + 42 + + + + + 43 + + + + + 44 + + + + + 47 + + + YES + + + + + + 48 + + + + + + + YES + + YES + -3.IBPluginDependency + 10.IBPluginDependency + 11.IBPluginDependency + 13.IBPluginDependency + 16.CustomClassName + 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 + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + PBSourceViewCell + 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 + + + + YES + + + YES + + + + + YES + + + YES + + + + 51 + + + + YES + + NSOutlineView + + IBProjectSource + NSOutlineViewExt.h + + + + PBGitSidebarController + PBViewController + + fetchPullPushAction: + id + + + YES + + YES + actionButton + remoteControls + sourceListControlsView + sourceView + window + + + YES + NSPopUpButton + NSSegmentedControl + NSView + NSOutlineView + NSWindow + + + + IBProjectSource + PBGitSidebarController.h + + + + PBIconAndTextCell + NSTextFieldCell + + IBProjectSource + PBIconAndTextCell.h + + + + PBSourceViewCell + PBIconAndTextCell + + IBProjectSource + PBSourceViewCell.h + + + + PBViewController + NSViewController + + IBProjectSource + PBViewController.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 + + + + 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 + + + + 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 + + + + NSSegmentedCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSSegmentedCell.h + + + + NSSegmentedControl + NSControl + + IBFrameworkSource + AppKit.framework/Headers/NSSegmentedControl.h + + + + NSTableColumn + NSObject + + IBFrameworkSource + AppKit.framework/Headers/NSTableColumn.h + + + + NSTableView + NSControl + + + + NSTextFieldCell + NSActionCell + + IBFrameworkSource + AppKit.framework/Headers/NSTextFieldCell.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 + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + GitX.xcodeproj + 3 + + NSActionTemplate + {15, 15} + + + diff --git a/PBGitTree.m b/PBGitTree.m index c8003d1..12c70a0 100644 --- a/PBGitTree.m +++ b/PBGitTree.m @@ -216,6 +216,9 @@ NSString* p = [handle readLine]; while (p.length > 0) { + if ([p isEqualToString:@"\r"]) + break; + BOOL isLeaf = ([p characterAtIndex:p.length - 1] != '/'); if (!isLeaf) p = [p substringToIndex:p.length -1]; diff --git a/PBGitWindowController.h b/PBGitWindowController.h index ae2298b..1d9cac8 100644 --- a/PBGitWindowController.h +++ b/PBGitWindowController.h @@ -9,29 +9,42 @@ #import #import "PBGitRepository.h" -@class PBViewController; +@class PBViewController, PBGitSidebarController; + @interface PBGitWindowController : NSWindowController { __weak PBGitRepository* repository; - int selectedViewIndex; - IBOutlet NSView* contentView; - PBViewController *historyViewController; - PBViewController *commitViewController; + PBViewController *contentController; + + PBGitSidebarController *sidebarController; + IBOutlet NSView *sourceListControlsView; + IBOutlet NSSplitView *splitView; + IBOutlet NSView *sourceSplitView; + IBOutlet NSView *contentSplitView; + + IBOutlet NSTextField *statusField; + IBOutlet NSProgressIndicator *progressIndicator; PBViewController* viewController; + + IBOutlet NSToolbarItem *terminalItem; + IBOutlet NSToolbarItem *finderItem; } @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; - (IBAction) showCommitView:(id)sender; - (IBAction) showHistoryView:(id)sender; +- (IBAction) revealInFinder:(id)sender; +- (IBAction) openInTerminal:(id)sender; +- (IBAction) cloneTo:(id)sender; +- (IBAction) refresh:(id)sender; @end diff --git a/PBGitWindowController.m b/PBGitWindowController.m index 8a338ce..55b34b4 100644 --- a/PBGitWindowController.m +++ b/PBGitWindowController.m @@ -9,25 +9,21 @@ #import "PBGitWindowController.h" #import "PBGitHistoryController.h" #import "PBGitCommitController.h" +#import "Terminal.h" +#import "PBCloneRepsitoryToSheet.h" +#import "PBGitSidebarController.h" @implementation PBGitWindowController -@synthesize repository, viewController, selectedViewIndex; +@synthesize repository; - (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; return self; } @@ -35,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 @@ -49,82 +44,65 @@ 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"]; - - BOOL justLoaded = NO; - switch (whichViewTag) - { - case 0: - if (!historyViewController) { - historyViewController = [[PBGitHistoryController alloc] initWithRepository:repository superController:self]; - justLoaded = YES; - } - viewController = historyViewController; - break; - case 1: - if (!commitViewController) { - commitViewController = [[PBGitCommitController alloc] initWithRepository:repository superController:self]; - justLoaded = YES; - } - viewController = commitViewController; - break; - } - - // make sure we automatically resize the controller's view to the current window size - [[viewController view] setFrame: [contentView bounds]]; - if (justLoaded) - [viewController viewLoaded]; - else - [viewController updateView]; - - //// 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]; + [[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]; + + NSImage *finderImage = [[NSWorkspace sharedWorkspace] iconForFileType:NSFileTypeForHFSTypeCode(kFinderIcon)]; + [finderItem setImage:finderImage]; + + NSImage *terminalImage = [[NSWorkspace sharedWorkspace] iconForFile:@"/Applications/Utilities/Terminal.app/"]; + [terminalItem setImage:terminalImage]; + + [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; + + if (contentController) + [contentController removeObserver:self forKeyPath:@"status"]; + + [self removeAllContentSubViews]; + + contentController = controller; + + [[contentController view] setFrame:[contentSplitView bounds]]; + [contentSplitView addSubview:[contentController view]]; + + [self setNextResponder: contentController]; + [[self window] makeFirstResponder:[contentController firstResponder]]; + [contentController updateView]; + [contentController addObserver:self forKeyPath:@"status" options:NSKeyValueObservingOptionInitial context:@"statusChange"]; } - (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 @@ -141,23 +119,121 @@ [[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]; +} + +- (IBAction) revealInFinder:(id)sender +{ + [[NSWorkspace sharedWorkspace] openFile:[repository workingDirectory]]; +} + +- (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]; +} + +- (IBAction) cloneTo:(id)sender +{ + [PBCloneRepsitoryToSheet beginCloneRepsitoryToSheetForRepository:repository]; +} + +- (IBAction) refresh:(id)sender +{ + [contentController refresh:self]; +} + +- (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 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 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 diff --git a/PBQLOutlineView.m b/PBQLOutlineView.m index 459d908..05f9790 100644 --- a/PBQLOutlineView.m +++ b/PBQLOutlineView.m @@ -28,7 +28,7 @@ - (void) keyDown: (NSEvent *) event { if ([[event characters] isEqualToString:@" "]) { - [controller toggleQuickView:self]; + [controller toggleQLPreviewPanel:self]; return; } @@ -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]; diff --git a/PBQLTextView.h b/PBQLTextView.h new file mode 100644 index 0000000..715e74e --- /dev/null +++ b/PBQLTextView.h @@ -0,0 +1,19 @@ +// +// PBQLTextView.h +// GitX +// +// Created by Nathan Kinsinger on 3/22/10. +// Copyright 2010 Nathan Kinsinger. All rights reserved. +// + +#import + + +@class PBGitHistoryController; + + +@interface PBQLTextView : NSTextView { + IBOutlet PBGitHistoryController *controller; +} + +@end diff --git a/PBQLTextView.m b/PBQLTextView.m new file mode 100644 index 0000000..fccb3ad --- /dev/null +++ b/PBQLTextView.m @@ -0,0 +1,25 @@ +// +// PBQLTextView.m +// GitX +// +// Created by Nathan Kinsinger on 3/22/10. +// Copyright 2010 Nathan Kinsinger. All rights reserved. +// + +#import "PBQLTextView.h" +#import "PBGitHistoryController.h" + + +@implementation PBQLTextView + +- (void) keyDown: (NSEvent *) event +{ + if ([[event characters] isEqualToString:@" "]) { + [controller toggleQLPreviewPanel:self]; + return; + } + + [super keyDown:event]; +} + +@end 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..76e5cd8 100644 --- a/PBRefController.h +++ b/PBRefController.h @@ -13,26 +13,36 @@ #import "PBGitCommit.h" #import "PBRefContextDelegate.h" +@class PBRefMenuItem; + @interface PBRefController : NSObject { IBOutlet __weak PBGitHistoryController *historyController; 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) fetchRemote:(PBRefMenuItem *)sender; +- (void) pullRemote:(PBRefMenuItem *)sender; +- (void) pushUpdatesToRemote:(PBRefMenuItem *)sender; +- (void) pushDefaultRemoteForRef:(PBRefMenuItem *)sender; +- (void) pushToRemote:(PBRefMenuItem *)sender; +- (void) showConfirmPushRefSheet:(PBGitRef *)ref remote:(PBGitRef *)remoteRef; -- (NSArray *) menuItemsForRef:(PBGitRef *)ref commit:(PBGitCommit *)commit; +- (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; +- (void) diffWithHEAD:(PBRefMenuItem *)sender; +- (void) createTag:(PBRefMenuItem *)sender; +- (void) showTagInfoSheet:(PBRefMenuItem *)sender; + +- (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 31c5590..d3b183b 100644 --- a/PBRefController.m +++ b/PBRefController.m @@ -9,82 +9,272 @@ #import "PBRefController.h" #import "PBGitRevisionCell.h" #import "PBRefMenuItem.h" +#import "PBCreateBranchSheet.h" +#import "PBCreateTagSheet.h" +#import "PBGitDefaults.h" +#import "PBDiffWindowController.h" @implementation PBRefController - (void)awakeFromNib { [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"]) { - [self updateBranchMenu]; - } - else if ([(NSString *)context isEqualToString:@"currentBranchChange"]) { - [self selectCurrentBranch]; - } - else { - [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; - } } -- (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]; - 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 +#pragma mark Fetch - if(choice) { - int ret = 1; - [historyController.repository outputForArguments:[NSArray arrayWithObjects:@"update-ref", @"-d", [[sender 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]]; - [commitController rearrangeObjects]; - } -} - -- (void) checkoutRef:(PBRefMenuItem *)sender +- (void) fetchRemote:(PBRefMenuItem *)sender { - int ret = 1; - [historyController.repository outputInWorkdirForArguments:[NSArray arrayWithObjects:@"checkout", [[sender ref] 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?"]; + id refish = [sender refish]; + if ([refish refishType] == kGitXCommitType) return; + + [historyController.repository beginFetchFromRemoteForRef:refish]; +} + + +#pragma mark Pull + +- (void) pullRemote:(PBRefMenuItem *)sender +{ + id refish = [sender refish]; + [historyController.repository beginPullFromRemote:nil forRef:refish]; +} + + +#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]; } - [historyController.repository reloadRefs]; - [commitController rearrangeObjects]; } -- (void) tagInfo:(PBRefMenuItem *)sender +- (void) pushUpdatesToRemote:(PBRefMenuItem *)sender { - NSString *message = [NSString stringWithFormat:@"Info for tag: %@", [[sender ref] shortName]]; + PBGitRef *remoteRef = [(PBGitRef *)[sender refish] remoteRef]; - int ret = 1; - NSString *info = [historyController.repository outputInWorkdirForArguments:[NSArray arrayWithObjects:@"tag", @"-n50", @"-l", [[sender ref] shortName], nil] retValue: &ret]; - - if (!ret) { - [[historyController.repository windowController] showMessageSheet:message infoText:info]; - } - return; + [self showConfirmPushRefSheet:nil remote:remoteRef]; } -- (NSArray *) menuItemsForRef:(PBGitRef *)ref commit:(PBGitCommit *)commit +- (void) pushDefaultRemoteForRef:(PBRefMenuItem *)sender { - return [PBRefMenuItem defaultMenuItemsForRef:ref commit:commit target:self]; + 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 +{ + id refish = [sender refish]; + [historyController.repository mergeWithRefish:refish]; +} + + +#pragma mark Checkout + +- (void) checkout:(PBRefMenuItem *)sender +{ + id refish = [sender refish]; + [historyController.repository checkoutRefish:refish]; +} + + +#pragma mark Cherry Pick + +- (void) cherryPick:(PBRefMenuItem *)sender +{ + id refish = [sender refish]; + [historyController.repository cherryPickRefish:refish]; +} + + +#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 +{ + id refish = [sender refish]; + [PBCreateBranchSheet beginCreateBranchSheetAtRefish:refish inRepository:historyController.repository]; +} + + +#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]; +} + + +#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 +{ + 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]; + } +} + + +#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) { + PBGitRef *ref = (PBGitRef *)contextInfo; + [historyController.repository deleteRef:ref]; + } +} + + + +#pragma mark Contextual menus + +- (NSArray *) menuItemsForRef:(PBGitRef *)ref +{ + 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 @@ -92,12 +282,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; @@ -124,6 +316,23 @@ 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]; +} + - (BOOL)tableView:(NSTableView *)aTableView acceptDrop:(id )info row:(NSInteger)row @@ -139,190 +348,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; } -# pragma mark Add ref methods --(void)addRef:(id)sender +- (void) acceptDropInfoAlertDidEnd:(NSAlert *)alert returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo { - [errorMessage setStringValue:@""]; - [NSApp beginSheet:newBranchSheet - modalForWindow:[[historyController view] window] - modalDelegate:NULL - didEndSelector:NULL - contextInfo:NULL]; -} + [[alert window] orderOut:nil]; --(void)saveSheet:(id) sender -{ - NSString *branchName = [@"refs/heads/" stringByAppendingString:[newBranchName stringValue]]; - - if ([[commitController selectedObjects] count] == 0) - return; + if (returnCode == NSAlertDefaultReturn) + [self dropRef:contextInfo]; - 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 -{ - 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]]; + if ([[alert suppressionButton] state] == NSOnState) + [PBGitDefaults setSuppressAcceptDropRef:YES]; } @end 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..8a571d5 100644 --- a/PBRefMenuItem.m +++ b/PBRefMenuItem.m @@ -10,37 +10,175 @@ @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]; + NSString *headRefName = [headRef shortName]; + BOOL isHead = [ref isEqualToRef:headRef]; + BOOL isOnHeadBranch = isHead ? YES : [repo isRefOnHeadBranch:ref]; + + 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]); + + if (!isRemote) { + // checkout ref + NSString *checkoutTitle = [@"Checkout " stringByAppendingString:targetRefName]; + [items addObject:[PBRefMenuItem itemWithTitle:checkoutTitle action:@selector(checkout:) enabled:!isHead]]; + [items addObject:[PBRefMenuItem separatorItem]]; + + // 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(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 + 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]]; + + [items addObject:[PBRefMenuItem separatorItem]]; + } + + // fetch + 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]]; + + // 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]; + [items addObject:[PBRefMenuItem itemWithTitle:deleteTitle action:@selector(showDeleteRefSheet:) 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]; + + 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]]; + + [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]]; + [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 + 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]]; + + // 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]; + } + + return items; +} + + @end 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 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/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 diff --git a/PBSourceViewItem.h b/PBSourceViewItem.h new file mode 100644 index 0000000..399f8e7 --- /dev/null +++ b/PBSourceViewItem.h @@ -0,0 +1,46 @@ +// +// PBSourceViewItem.h +// GitX +// +// Created by Pieter de Bie on 9/8/09. +// Copyright 2009 __MyCompanyName__. All rights reserved. +// + +#import + +@class PBGitRevSpecifier; +@class PBGitRef; + +@interface PBSourceViewItem : NSObject { + NSMutableArray *children; + + NSString *title; + PBGitRevSpecifier *revSpecifier; + PBSourceViewItem *parent; + + BOOL isGroupItem; + BOOL isUncollapsible; +} + ++ (id)groupItemWithTitle:(NSString *)title; ++ (id)itemWithRevSpec:(PBGitRevSpecifier *)revSpecifier; ++ (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"] +// to the 'local' branch thing +- (void)addRev:(PBGitRevSpecifier *)revSpecifier toPath:(NSArray *)path; +- (PBSourceViewItem *)findRev:(PBGitRevSpecifier *)rev; + +- (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 new file mode 100644 index 0000000..5e81501 --- /dev/null +++ b/PBSourceViewItem.m @@ -0,0 +1,138 @@ +// +// PBSourceViewItem.m +// GitX +// +// Created by Pieter de Bie on 9/8/09. +// Copyright 2009 __MyCompanyName__. All rights reserved. +// + +#import "PBSourceViewItem.h" +#import "PBSourceViewItems.h" +#import "PBGitRef.h" + +@implementation PBSourceViewItem +@synthesize parent, title, isGroupItem, children, revSpecifier, isUncollapsible; +@dynamic icon; + +- (id)init +{ + if (!(self = [super init])) + return nil; + + children = [NSMutableArray array]; + return self; +} + ++ (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 +{ + PBGitRef *ref = [revSpecifier ref]; + + if ([ref isTag]) + return [PBGitSVTagItem tagItemWithRevSpec:revSpecifier]; + else if ([ref isBranch]) + return [PBGitSVBranchItem branchItemWithRevSpec:revSpecifier]; + else if ([ref isRemoteBranch]) + return [PBGitSVRemoteBranchItem remoteBranchItemWithRevSpec:revSpecifier]; + + 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 +{ + 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) { + if ([firstTitle isEqualToString:[[theRevSpecifier ref] remoteName]]) + node = [PBGitSVRemoteItem remoteItemWithTitle:firstTitle]; + else + node = [PBGitSVFolderItem folderItemWithTitle:firstTitle]; + [self addChild:node]; + } + + [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; +} + +- (NSImage *) icon +{ + return nil; +} + +- (NSString *)title +{ + if (title) + return title; + + return [[revSpecifier description] lastPathComponent]; +} + +- (NSString *) stringValue +{ + return self.title; +} + +- (PBGitRef *) ref +{ + if (self.revSpecifier) + return [self.revSpecifier ref]; + + 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 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 diff --git a/PBViewController.h b/PBViewController.h index 5d70dd2..9c15d69 100644 --- a/PBViewController.h +++ b/PBViewController.h @@ -14,11 +14,13 @@ __weak PBGitRepository *repository; __weak PBGitWindowController *superController; - IBOutlet NSToolbar *viewToolbar; + NSString *status; + BOOL isBusy; } @property (readonly) __weak PBGitRepository *repository; -@property (readonly) NSToolbar *viewToolbar; +@property(copy) NSString *status; +@property(assign) BOOL isBusy; - (id)initWithRepository:(PBGitRepository *)theRepository superController:(PBGitWindowController *)controller; @@ -36,5 +38,6 @@ - (void)viewLoaded; - (NSResponder *)firstResponder; +- (IBAction) refresh:(id)sender; @end diff --git a/PBViewController.m b/PBViewController.m index 4956237..35c943a 100644 --- a/PBViewController.m +++ b/PBViewController.m @@ -11,7 +11,9 @@ @implementation PBViewController -@synthesize repository, viewToolbar; +@synthesize repository; +@synthesize status; +@synthesize isBusy; - (id)initWithRepository:(PBGitRepository *)theRepository superController:(PBGitWindowController *)controller { @@ -45,6 +47,10 @@ { } +- (IBAction) refresh: sender +{ +} + - (void)viewLoaded { } 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 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/PBWebHistoryController.m b/PBWebHistoryController.m index 1934b73..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 @@ -115,7 +120,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; 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 + 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/images/added.acorn b/html/images/added.acorn new file mode 100644 index 0000000..8a42ce6 Binary files /dev/null and b/html/images/added.acorn differ diff --git a/html/images/added.png b/html/images/added.png new file mode 100644 index 0000000..1c3e63c Binary files /dev/null and b/html/images/added.png differ diff --git a/html/images/modified.acorn b/html/images/modified.acorn new file mode 100644 index 0000000..6ba865b Binary files /dev/null and b/html/images/modified.acorn differ diff --git a/html/images/modified.png b/html/images/modified.png new file mode 100644 index 0000000..1fbf7f4 Binary files /dev/null and b/html/images/modified.png differ diff --git a/html/images/removed.acorn b/html/images/removed.acorn new file mode 100644 index 0000000..47be5c2 Binary files /dev/null and b/html/images/removed.acorn differ diff --git a/html/images/removed.png b/html/images/removed.png new file mode 100644 index 0000000..bf13f9e Binary files /dev/null and b/html/images/removed.png differ diff --git a/html/images/renamed.acorn b/html/images/renamed.acorn new file mode 100644 index 0000000..8b0545f Binary files /dev/null and b/html/images/renamed.acorn differ diff --git a/html/images/renamed.png b/html/images/renamed.png new file mode 100644 index 0000000..24b88ab Binary files /dev/null and b/html/images/renamed.png differ diff --git a/html/views/commit/commit.css b/html/views/commit/commit.css index 550e642..9bd8157 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 { 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); 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 @@ + + +