merging krasnyk/stashes branch to soundevolution/svn
Merge branch 'refs/heads/stashes' into testing Conflicts: GitX.xcodeproj/project.pbxproj PBGitHistoryView.xib PBGitSidebarView.xib
@@ -1,5 +1,6 @@
|
||||
build
|
||||
build/revision
|
||||
._*
|
||||
*.xcodeproj/
|
||||
!*.xcodeproj/project.pbxproj
|
||||
Nightly.app.zip
|
||||
|
||||
@@ -32,7 +32,8 @@
|
||||
- (IBAction)installCliTool:(id)sender;
|
||||
|
||||
- (IBAction)saveAction:sender;
|
||||
- (IBAction) showHelp:(id) sender;
|
||||
- (IBAction)showHelp:(id)sender;
|
||||
- (IBAction)reportAProblem:(id)sender;
|
||||
|
||||
- (IBAction) showCloneRepository:(id)sender;
|
||||
- (IBAction)showCloneRepository:(id)sender;
|
||||
@end
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
- (void)applicationDidFinishLaunching:(NSNotification*)notification
|
||||
{
|
||||
[[SUUpdater sharedUpdater] setSendsSystemProfile:YES];
|
||||
[[SUUpdater sharedUpdater] setDelegate:self];
|
||||
|
||||
// Make sure Git's SSH password requests get forwarded to our little UI tool:
|
||||
setenv( "SSH_ASKPASS", [[[NSBundle mainBundle] pathForResource: @"gitx_askpasswd" ofType: @""] UTF8String], 1 );
|
||||
@@ -196,11 +197,6 @@
|
||||
former cannot be found), the system's temporary directory.
|
||||
*/
|
||||
|
||||
- (IBAction) showHelp:(id) sender
|
||||
{
|
||||
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://gitx.frim.nl/user_manual.html"]];
|
||||
}
|
||||
|
||||
- (NSString *)applicationSupportFolder {
|
||||
|
||||
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES);
|
||||
@@ -380,4 +376,44 @@
|
||||
[managedObjectModel release], managedObjectModel = nil;
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark Sparkle delegate methods
|
||||
|
||||
- (NSArray *)feedParametersForUpdater:(SUUpdater *)updater sendingSystemProfile:(BOOL)sendingProfile
|
||||
{
|
||||
NSArray *keys = [NSArray arrayWithObjects:@"key", @"displayKey", @"value", @"displayValue", nil];
|
||||
NSMutableArray *feedParameters = [NSMutableArray array];
|
||||
|
||||
// only add parameters if the profile is being sent this time
|
||||
if (sendingProfile) {
|
||||
NSString *CFBundleGitVersion = [[[NSBundle mainBundle] infoDictionary] valueForKey:@"CFBundleGitVersion"];
|
||||
if (CFBundleGitVersion)
|
||||
[feedParameters addObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"CFBundleGitVersion", @"Full Version", CFBundleGitVersion, CFBundleGitVersion, nil]
|
||||
forKeys:keys]];
|
||||
|
||||
NSString *gitVersion = [PBGitBinary version];
|
||||
if (gitVersion)
|
||||
[feedParameters addObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"gitVersion", @"git Version", gitVersion, gitVersion, nil]
|
||||
forKeys:keys]];
|
||||
}
|
||||
|
||||
return feedParameters;
|
||||
}
|
||||
|
||||
|
||||
#pragma mark Help menu
|
||||
|
||||
- (IBAction)showHelp:(id)sender
|
||||
{
|
||||
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://gitx.frim.nl/user_manual.html"]];
|
||||
}
|
||||
|
||||
- (IBAction)reportAProblem:(id)sender
|
||||
{
|
||||
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://gitx.lighthouseapp.com/tickets"]];
|
||||
}
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@@ -7,22 +7,30 @@
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "PBGitRepository.h"
|
||||
|
||||
@interface PBCommand : NSObject {
|
||||
PBGitRepository *repository;
|
||||
|
||||
// for the user to see what it triggers
|
||||
NSString *displayName;
|
||||
// shown during command execution
|
||||
NSString *commandTitle;
|
||||
NSString *commandDescription;
|
||||
|
||||
NSArray *parameters;
|
||||
NSMutableArray *parameters;
|
||||
BOOL canBeFired;
|
||||
}
|
||||
@property (nonatomic) BOOL canBeFired;
|
||||
@property (nonatomic, retain, readonly) PBGitRepository *repository;
|
||||
@property (nonatomic, retain) NSString *commandTitle;
|
||||
@property (nonatomic, retain) NSString *commandDescription;
|
||||
@property (nonatomic, copy) NSString *displayName;
|
||||
@property (nonatomic, retain, readonly) NSArray *parameters;
|
||||
|
||||
- (id) initWithDisplayName:(NSString *) aDisplayName parameters:(NSArray *) params;
|
||||
- (id) initWithDisplayName:(NSString *) aDisplayName parameters:(NSArray *) params repository:(PBGitRepository *) repo;
|
||||
|
||||
- (void) invoke;
|
||||
|
||||
- (NSArray *) allParameters;
|
||||
- (void) appendParameters:(NSArray *) params;
|
||||
@end
|
||||
|
||||
@@ -7,29 +7,41 @@
|
||||
//
|
||||
|
||||
#import "PBCommand.h"
|
||||
#import "PBRemoteProgressSheet.h"
|
||||
|
||||
@interface PBCommand()
|
||||
@property (nonatomic, retain) PBGitRepository *repository;
|
||||
@end
|
||||
|
||||
@implementation PBCommand
|
||||
@synthesize displayName;
|
||||
@synthesize parameters;
|
||||
@synthesize commandDescription;
|
||||
@synthesize commandTitle;
|
||||
@synthesize repository;
|
||||
@synthesize canBeFired;
|
||||
|
||||
- (id) initWithDisplayName:(NSString *) aDisplayName parameters:(NSArray *) params {
|
||||
return [self initWithDisplayName:aDisplayName parameters:params repository:nil];
|
||||
}
|
||||
|
||||
- (id) initWithDisplayName:(NSString *) aDisplayName parameters:(NSArray *) params repository:(PBGitRepository *) repo {
|
||||
self = [super init];
|
||||
if (self != nil) {
|
||||
self.displayName = aDisplayName;
|
||||
parameters = [params retain];
|
||||
parameters = [[NSMutableArray alloc] initWithArray:params];
|
||||
|
||||
// default values
|
||||
self.commandTitle = @"";
|
||||
self.commandDescription = @"";
|
||||
self.repository = repo;
|
||||
self.canBeFired = YES;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
- (void) dealloc {
|
||||
[repository release];
|
||||
[commandDescription release];
|
||||
[commandTitle release];
|
||||
[parameters release];
|
||||
@@ -37,8 +49,16 @@
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (NSArray *) allParameters {
|
||||
return parameters;
|
||||
}
|
||||
|
||||
- (void) appendParameters:(NSArray *) params {
|
||||
[parameters addObjectsFromArray:params];
|
||||
}
|
||||
|
||||
- (void) invoke {
|
||||
NSLog(@"Warning: Empty/abstrac command has been fired!");
|
||||
[PBRemoteProgressSheet beginRemoteProgressSheetForArguments:[self allParameters] title:self.commandTitle description:self.commandDescription inRepository:self.repository];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// PBCommandWithParameter.h
|
||||
// GitX
|
||||
//
|
||||
// Created by Tomasz Krasnyk on 10-11-06.
|
||||
// Copyright 2010 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "PBCommand.h"
|
||||
|
||||
|
||||
@interface PBCommandWithParameter : PBCommand {
|
||||
PBCommand *command;
|
||||
NSString *parameterName;
|
||||
NSString *parameterDisplayName;
|
||||
}
|
||||
@property (nonatomic, retain, readonly) PBCommand *command;
|
||||
@property (nonatomic, retain, readonly) NSString *parameterName;
|
||||
@property (nonatomic, retain, readonly) NSString *parameterDisplayName;
|
||||
|
||||
- initWithCommand:(PBCommand *) command parameterName:(NSString *) param parameterDisplayName:(NSString *) paramDisplayName;
|
||||
@end
|
||||
@@ -0,0 +1,40 @@
|
||||
//
|
||||
// PBCommandWithParameter.m
|
||||
// GitX
|
||||
//
|
||||
// Created by Tomasz Krasnyk on 10-11-06.
|
||||
// Copyright 2010 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#import "PBCommandWithParameter.h"
|
||||
#import "PBArgumentPickerController.h"
|
||||
|
||||
|
||||
@implementation PBCommandWithParameter
|
||||
@synthesize command;
|
||||
@synthesize parameterName;
|
||||
@synthesize parameterDisplayName;
|
||||
|
||||
- initWithCommand:(PBCommand *) aCommand parameterName:(NSString *) param parameterDisplayName:(NSString *) paramDisplayName {
|
||||
if (self = [super initWithDisplayName:[aCommand displayName] parameters:nil repository:[aCommand repository]]) {
|
||||
command = [aCommand retain];
|
||||
parameterName = [param retain];
|
||||
parameterDisplayName = [paramDisplayName retain];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void) dealloc {
|
||||
[command release];
|
||||
[parameterName release];
|
||||
[parameterDisplayName release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
||||
- (void) invoke {
|
||||
PBArgumentPickerController *controller = [[PBArgumentPickerController alloc] initWithCommandWithParameter:self];
|
||||
[NSApp beginSheet:[controller window] modalForWindow:[command.repository.windowController window] modalDelegate:controller didEndSelector:nil contextInfo:NULL];
|
||||
[controller release];
|
||||
}
|
||||
@end
|
||||
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// PBOpenDocumentCommand.h
|
||||
// GitX
|
||||
//
|
||||
// Created by Tomasz Krasnyk on 10-11-07.
|
||||
// Copyright 2010 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "PBCommand.h"
|
||||
|
||||
@interface PBOpenDocumentCommand : PBCommand {
|
||||
NSURL *documentURL;
|
||||
}
|
||||
|
||||
- (id) initWithDocumentAbsolutePath:(NSString *) path;
|
||||
@end
|
||||
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// PBOpenDocumentCommand.m
|
||||
// GitX
|
||||
//
|
||||
// Created by Tomasz Krasnyk on 10-11-07.
|
||||
// Copyright 2010 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#import "PBOpenDocumentCommand.h"
|
||||
#import "PBRepositoryDocumentController.h"
|
||||
#import "PBGitRepository.h"
|
||||
|
||||
@implementation PBOpenDocumentCommand
|
||||
|
||||
- (id) initWithDocumentAbsolutePath:(NSString *) path {
|
||||
if (self = [super initWithDisplayName:@"Open" parameters:nil repository:nil]) {
|
||||
documentURL = [[NSURL alloc] initWithString:path];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void) invoke {
|
||||
[[PBRepositoryDocumentController sharedDocumentController] documentForLocation:documentURL];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// PBRemoteCommandFactory.h
|
||||
// GitX
|
||||
//
|
||||
// Created by Tomasz Krasnyk on 10-11-07.
|
||||
// Copyright 2010 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "PBCommandFactory.h"
|
||||
|
||||
|
||||
@interface PBRemoteCommandFactory : NSObject<PBCommandFactory> {
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,68 @@
|
||||
//
|
||||
// PBRemoteCommandFactory.m
|
||||
// GitX
|
||||
//
|
||||
// Created by Tomasz Krasnyk on 10-11-07.
|
||||
// Copyright 2010 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#import "PBRemoteCommandFactory.h"
|
||||
#import "PBOpenDocumentCommand.h"
|
||||
#import "PBGitSubmodule.h"
|
||||
#import "PBRevealWithFinderCommand.h"
|
||||
|
||||
|
||||
@implementation PBRemoteCommandFactory
|
||||
|
||||
+ (NSArray *) commandsForSubmodule:(PBGitSubmodule *) submodule inRepository:(PBGitRepository *) repository {
|
||||
NSMutableArray *commands = [[NSMutableArray alloc] init];
|
||||
|
||||
NSString *repoPath = [repository workingDirectory];
|
||||
NSString *path = [repoPath stringByAppendingPathComponent:[submodule path]];
|
||||
NSString *submodulePath = [submodule path];
|
||||
|
||||
if ([submodule submoduleState] == PBGitSubmoduleStateNotInitialized) {
|
||||
NSArray *params = [NSArray arrayWithObjects:@"submodule", @"init", submodulePath, nil];
|
||||
PBCommand *initCmd = [[PBCommand alloc] initWithDisplayName:@"Init" parameters:params repository:repository];
|
||||
initCmd.commandTitle = initCmd.displayName;
|
||||
initCmd.commandDescription = [NSString stringWithFormat:@"Initializing submodule %@", submodulePath];
|
||||
[commands addObject:initCmd];
|
||||
}
|
||||
|
||||
// update
|
||||
NSArray *params = [NSArray arrayWithObjects:@"submodule", @"update", submodulePath, nil];
|
||||
PBCommand *updateCmd = [[PBCommand alloc] initWithDisplayName:@"Update" parameters:params repository:repository];
|
||||
updateCmd.commandTitle = updateCmd.displayName;
|
||||
updateCmd.commandDescription = [NSString stringWithFormat:@"Updating submodule %@", submodulePath];
|
||||
[commands addObject:updateCmd];
|
||||
|
||||
if ([[submodule submodules] count] > 0) {
|
||||
// update recursively
|
||||
NSArray *recursiveUpdate = [NSArray arrayWithObjects:@"submodule", @"update", @"--recursive", submodulePath, nil];
|
||||
PBCommand *updateRecursively = [[PBCommand alloc] initWithDisplayName:@"Update recursively" parameters:recursiveUpdate repository:repository];
|
||||
updateRecursively.commandTitle = updateRecursively.displayName;
|
||||
updateRecursively.commandDescription = [NSString stringWithFormat:@"Updating submodule %@ (recursively)", submodulePath];
|
||||
[commands addObject:updateRecursively];
|
||||
}
|
||||
|
||||
if ([submodule submoduleState] != PBGitSubmoduleStateNotInitialized) {
|
||||
// open
|
||||
PBOpenDocumentCommand *command = [[PBOpenDocumentCommand alloc] initWithDocumentAbsolutePath:path];
|
||||
command.commandTitle = command.displayName;
|
||||
command.commandDescription = @"Opening document";
|
||||
[commands addObject:command];
|
||||
|
||||
[commands addObject:[[PBRevealWithFinderCommand alloc] initWithDocumentAbsolutePath:path]];
|
||||
}
|
||||
|
||||
return commands;
|
||||
}
|
||||
|
||||
+ (NSArray *) commandsForObject:(NSObject *) object repository:(PBGitRepository *) repository {
|
||||
if ([object isKindOfClass:[PBGitSubmodule class]]) {
|
||||
return [PBRemoteCommandFactory commandsForSubmodule:(id)object inRepository:repository];
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// PBRevealWithFinder.h
|
||||
// GitX
|
||||
//
|
||||
// Created by Tomasz Krasnyk on 10-11-27.
|
||||
// Copyright 2010 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "PBOpenDocumentCommand.h"
|
||||
|
||||
@interface PBRevealWithFinderCommand : PBOpenDocumentCommand {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// PBRevealWithFinder.m
|
||||
// GitX
|
||||
//
|
||||
// Created by Tomasz Krasnyk on 10-11-27.
|
||||
// Copyright 2010 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#import "PBRevealWithFinderCommand.h"
|
||||
|
||||
|
||||
@implementation PBRevealWithFinderCommand
|
||||
|
||||
- (id) initWithDocumentAbsolutePath:(NSString *) path {
|
||||
if (!path) {
|
||||
[self autorelease];
|
||||
return nil;
|
||||
}
|
||||
|
||||
if (self = [super initWithDisplayName:@"Reveal in Finder" parameters:nil repository:nil]) {
|
||||
documentURL = [[NSURL alloc] initWithString:path];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void) invoke {
|
||||
NSWorkspace *ws = [NSWorkspace sharedWorkspace];
|
||||
[ws selectFile:[documentURL absoluteString] inFileViewerRootedAtPath:nil];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,19 +0,0 @@
|
||||
//
|
||||
// PBStashCommand.h
|
||||
// GitX
|
||||
//
|
||||
// Created by Tomasz Krasnyk on 10-11-06.
|
||||
// Copyright 2010 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "PBCommand.h"
|
||||
#import "PBGitRepository.h"
|
||||
|
||||
@interface PBStashCommand : PBCommand {
|
||||
PBGitRepository *repository;
|
||||
NSArray *arguments;
|
||||
}
|
||||
|
||||
- initWithDisplayName:(NSString *) aDisplayName arguments:(NSArray *) args repository:(PBGitRepository *) repo;
|
||||
@end
|
||||
@@ -1,44 +0,0 @@
|
||||
//
|
||||
// PBStashCommand.m
|
||||
// GitX
|
||||
//
|
||||
// Created by Tomasz Krasnyk on 10-11-06.
|
||||
// Copyright 2010 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#import "PBStashCommand.h"
|
||||
#import "PBRemoteProgressSheet.h"
|
||||
|
||||
@interface PBStashCommand()
|
||||
@property (nonatomic, retain) PBGitRepository *repository;
|
||||
@property (nonatomic, retain) NSArray *arguments;
|
||||
@end
|
||||
|
||||
|
||||
@implementation PBStashCommand
|
||||
@synthesize repository;
|
||||
@synthesize arguments;
|
||||
|
||||
- initWithDisplayName:(NSString *) aDisplayName arguments:(NSArray *) args repository:(PBGitRepository *) repo {
|
||||
if (self = [super initWithDisplayName:aDisplayName parameters:[NSArray arrayWithObject:@"stash"]]) {
|
||||
self.arguments = args;
|
||||
self.repository = repo;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void) dealloc {
|
||||
[parameters release];
|
||||
[repository release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
||||
- (void) invoke {
|
||||
NSMutableArray *args = [[NSMutableArray alloc] initWithArray:super.parameters];
|
||||
[args addObjectsFromArray:self.arguments];
|
||||
[PBRemoteProgressSheet beginRemoteProgressSheetForArguments:args title:self.commandTitle description:self.commandDescription inRepository:self.repository];
|
||||
[args release];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -9,6 +9,7 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "PBCommandFactory.h"
|
||||
|
||||
|
||||
@interface PBStashCommandFactory : NSObject<PBCommandFactory> {
|
||||
|
||||
}
|
||||
|
||||
@@ -7,39 +7,81 @@
|
||||
//
|
||||
|
||||
#import "PBStashCommandFactory.h"
|
||||
#import "PBStashCommand.h"
|
||||
#import "PBCommand.h"
|
||||
#import "PBCommandWithParameter.h"
|
||||
|
||||
// model
|
||||
#import "PBGitStash.h"
|
||||
#import "PBGitRef.h"
|
||||
|
||||
@interface PBStashCommandFactory()
|
||||
+ (NSArray *) commandsForStash:(PBGitStash *) stash repository:(PBGitRepository *) repository;
|
||||
+ (NSArray *) commandsForRef:(PBGitRef *) ref repository:(PBGitRepository *) repository;
|
||||
@end
|
||||
|
||||
|
||||
@implementation PBStashCommandFactory
|
||||
|
||||
+ (NSArray *) commandsForObject:(NSObject *) object repository:(PBGitRepository *) repository {
|
||||
if (![object isKindOfClass:[PBGitStash class]]) {
|
||||
return nil;
|
||||
NSArray *cmds = nil;
|
||||
if ([object isKindOfClass:[PBGitStash class]]) {
|
||||
cmds = [PBStashCommandFactory commandsForStash:(id)object repository:repository];
|
||||
} else if ([object isKindOfClass:[PBGitRef class]]) {
|
||||
cmds = [PBStashCommandFactory commandsForRef:(id)object repository:repository];
|
||||
}
|
||||
PBGitStash *stash = (PBGitStash *) object;
|
||||
|
||||
|
||||
return cmds;
|
||||
}
|
||||
|
||||
+ (NSArray *) commandsForRef:(PBGitRef *) ref repository:(PBGitRepository *) repository {
|
||||
NSMutableArray *commands = [[NSMutableArray alloc] init];
|
||||
|
||||
NSArray *args = [NSArray arrayWithObjects:@"apply", [stash name], nil];
|
||||
PBStashCommand *command = [[PBStashCommand alloc] initWithDisplayName:@"Apply" arguments:args repository:repository];
|
||||
PBGitRef *headRef = [[repository headRef] ref];
|
||||
BOOL isHead = [ref isEqualToRef:headRef];
|
||||
|
||||
if (isHead) {
|
||||
NSArray *args = [NSArray arrayWithObject:@"stash"];
|
||||
PBCommand *command = [[PBCommand alloc] initWithDisplayName:@"Stash local changes..." parameters:args repository:repository];
|
||||
command.commandTitle = command.displayName;
|
||||
command.commandDescription = @"Stashing local changes";
|
||||
|
||||
PBCommandWithParameter *cmd = [[PBCommandWithParameter alloc] initWithCommand:command parameterName:@"save" parameterDisplayName:@"Stash message (optional)"];
|
||||
[command release];
|
||||
[commands addObject:cmd];
|
||||
[cmd release];
|
||||
|
||||
command = [[PBCommand alloc] initWithDisplayName:@"Clear stashes" parameters:[NSArray arrayWithObjects:@"stash", @"clear", nil] repository:repository];
|
||||
command.commandTitle = command.displayName;
|
||||
command.commandDescription = @"Clearing stashes";
|
||||
[commands addObject:command];
|
||||
[command release];
|
||||
}
|
||||
|
||||
return [commands autorelease];
|
||||
}
|
||||
|
||||
+ (NSArray *) commandsForStash:(PBGitStash *) stash repository:(PBGitRepository *) repository {
|
||||
NSMutableArray *commands = [[NSMutableArray alloc] init];
|
||||
|
||||
NSArray *args = [NSArray arrayWithObjects:@"stash", @"apply", [stash name], nil];
|
||||
PBCommand *command = [[PBCommand alloc] initWithDisplayName:@"Apply" parameters:args repository:repository];
|
||||
command.commandTitle = command.displayName;
|
||||
command.commandDescription = [NSString stringWithFormat:@"Applying stash: '%@'", stash];
|
||||
[commands addObject:command];
|
||||
|
||||
args = [NSArray arrayWithObjects:@"pop", [stash name], nil];
|
||||
command = [[PBStashCommand alloc] initWithDisplayName:@"Pop" arguments:args repository:repository];
|
||||
args = [NSArray arrayWithObjects:@"stash", @"pop", [stash name], nil];
|
||||
command = [[PBCommand alloc] initWithDisplayName:@"Pop" parameters:args repository:repository];
|
||||
command.commandTitle = command.displayName;
|
||||
command.commandDescription = [NSString stringWithFormat:@"Poping stash: '%@'", stash];
|
||||
[commands addObject:command];
|
||||
|
||||
args = [NSArray arrayWithObjects:@"drop", [stash name], nil];
|
||||
command = [[PBStashCommand alloc] initWithDisplayName:@"Drop" arguments:args repository:repository];
|
||||
args = [NSArray arrayWithObjects:@"stash", @"drop", [stash name], nil];
|
||||
command = [[PBCommand alloc] initWithDisplayName:@"Drop" parameters:args repository:repository];
|
||||
command.commandTitle = command.displayName;
|
||||
command.commandDescription = [NSString stringWithFormat:@"Dropping stash: '%@'", stash];
|
||||
[commands addObject:command];
|
||||
|
||||
|
||||
return [commands autorelease];
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// PBArgumentPickerController.h
|
||||
// GitX
|
||||
//
|
||||
// Created by Tomasz Krasnyk on 10-11-06.
|
||||
// Copyright 2010 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "PBCommand.h"
|
||||
#import "PBArgumentPicker.h"
|
||||
|
||||
@class PBCommandWithParameter;
|
||||
|
||||
@interface PBArgumentPickerController : NSWindowController {
|
||||
IBOutlet PBArgumentPicker *view;
|
||||
|
||||
PBCommandWithParameter *cmdWithParameter;
|
||||
}
|
||||
|
||||
- initWithCommandWithParameter:(PBCommandWithParameter *) command;
|
||||
|
||||
- (IBAction) okClicked:sender;
|
||||
- (IBAction) cancelClicked:sender;
|
||||
@end
|
||||
@@ -0,0 +1,50 @@
|
||||
//
|
||||
// PBArgumentPickerController.m
|
||||
// GitX
|
||||
//
|
||||
// Created by Tomasz Krasnyk on 10-11-06.
|
||||
// Copyright 2010 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#import "PBArgumentPickerController.h"
|
||||
#import "PBCommandWithParameter.h"
|
||||
|
||||
|
||||
@implementation PBArgumentPickerController
|
||||
|
||||
- initWithCommandWithParameter:(PBCommandWithParameter *) aCommand {
|
||||
if (self = [super initWithWindowNibName:@"PBArgumentPicker" owner:self]) {
|
||||
cmdWithParameter = [aCommand retain];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void) dealloc {
|
||||
[cmdWithParameter release];
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (void) awakeFromNib {
|
||||
NSString *stringToDisplay = [NSString stringWithFormat:@"%@:", [cmdWithParameter parameterDisplayName]];
|
||||
[view.label setTitleWithMnemonic:stringToDisplay];
|
||||
}
|
||||
|
||||
- (IBAction) okClicked:sender {
|
||||
NSString *userText = [view.textField stringValue];
|
||||
if ([userText length] > 0) {
|
||||
NSString *paramName = [cmdWithParameter parameterName];
|
||||
[cmdWithParameter.command appendParameters:[NSArray arrayWithObjects:paramName, userText, nil]];
|
||||
}
|
||||
[self cancelClicked:sender];
|
||||
|
||||
[cmdWithParameter.command invoke];
|
||||
}
|
||||
|
||||
- (IBAction) cancelClicked:sender {
|
||||
[NSApp endSheet:[self window]];
|
||||
[[self window] orderOut:self];
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// PBGitResetController.h
|
||||
// GitX
|
||||
//
|
||||
// Created by Tomasz Krasnyk on 10-11-27.
|
||||
// Copyright 2010 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@class PBGitRepository;
|
||||
|
||||
@interface PBGitResetController : NSObject {
|
||||
PBGitRepository *repository;
|
||||
}
|
||||
- (id) initWithRepository:(PBGitRepository *) repo;
|
||||
|
||||
- (NSArray *) menuItems;
|
||||
|
||||
|
||||
// actions
|
||||
- (void) resetHardToHead;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,87 @@
|
||||
//
|
||||
// PBGitResetController.m
|
||||
// GitX
|
||||
//
|
||||
// Created by Tomasz Krasnyk on 10-11-27.
|
||||
// Copyright 2010 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#import "PBGitResetController.h"
|
||||
#import "PBGitRepository.h"
|
||||
#import "PBCommand.h"
|
||||
|
||||
static NSString * const kCommandKey = @"command";
|
||||
|
||||
@implementation PBGitResetController
|
||||
|
||||
- (id) initWithRepository:(PBGitRepository *) repo {
|
||||
if (self = [super init]){
|
||||
repository = [repo retain];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void) resetHardToHead {
|
||||
NSAlert *alert = [NSAlert alertWithMessageText:@"Reseting working copy and index"
|
||||
defaultButton:@"Cancel"
|
||||
alternateButton:nil
|
||||
otherButton:@"Reset"
|
||||
informativeTextWithFormat:@"Are you sure you want to reset your working copy and index? All changes to them will be gone!"];
|
||||
|
||||
NSArray *arguments = [NSArray arrayWithObjects:@"reset", @"--hard", @"HEAD", nil];
|
||||
PBCommand *cmd = [[PBCommand alloc] initWithDisplayName:@"Reset hard to HEAD" parameters:arguments repository:repository];
|
||||
cmd.commandTitle = cmd.displayName;
|
||||
cmd.commandDescription = @"Reseting head";
|
||||
|
||||
NSMutableDictionary *info = [NSMutableDictionary dictionaryWithObject:cmd forKey:kCommandKey];
|
||||
|
||||
[alert beginSheetModalForWindow:[repository.windowController window]
|
||||
modalDelegate:self
|
||||
didEndSelector:@selector(confirmResetSheetDidEnd:returnCode:contextInfo:)
|
||||
contextInfo:info];
|
||||
}
|
||||
|
||||
- (void) reset {
|
||||
//TODO missing implementation
|
||||
}
|
||||
|
||||
- (NSArray *) menuItems {
|
||||
NSMenuItem *resetHeadHardly = [[NSMenuItem alloc] initWithTitle:@"Reset hard to HEAD" action:@selector(resetHardToHead) keyEquivalent:@""];
|
||||
[resetHeadHardly setTarget:self];
|
||||
|
||||
NSMenuItem *reset = [[NSMenuItem alloc] initWithTitle:@"Reset..." action:@selector(reset) keyEquivalent:@""];
|
||||
[reset setTarget:self];
|
||||
|
||||
return [NSArray arrayWithObjects:resetHeadHardly, reset, nil];
|
||||
}
|
||||
|
||||
- (BOOL) validateMenuItem:(NSMenuItem *)menuItem {
|
||||
BOOL shouldBeEnabled = YES;
|
||||
SEL action = [menuItem action];
|
||||
if (action == @selector(reset)) {
|
||||
shouldBeEnabled = NO;
|
||||
//TODO missing implementation
|
||||
}
|
||||
return shouldBeEnabled;
|
||||
}
|
||||
|
||||
- (void) dealloc {
|
||||
[repository release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Confirm Window
|
||||
|
||||
- (void) confirmResetSheetDidEnd:(NSAlert *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo
|
||||
{
|
||||
[[sheet window] orderOut:nil];
|
||||
|
||||
if (returnCode != NSAlertDefaultReturn) {
|
||||
PBCommand *cmd = [(NSDictionary *)contextInfo objectForKey:kCommandKey];
|
||||
[cmd invoke];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,37 @@
|
||||
//
|
||||
// PBSubmoduleController.h
|
||||
// GitX
|
||||
//
|
||||
// Created by Tomasz Krasnyk on 10-11-27.
|
||||
// Copyright 2010 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "PBGitSubmodule.h"
|
||||
|
||||
@class PBGitRepository;
|
||||
@class PBCommand;
|
||||
|
||||
@interface PBSubmoduleController : NSObject {
|
||||
NSArray *submodules;
|
||||
@private
|
||||
PBGitRepository *repository;
|
||||
}
|
||||
@property (nonatomic, retain, readonly) NSArray *submodules;
|
||||
|
||||
- (id) initWithRepository:(PBGitRepository *) repo;
|
||||
|
||||
- (void) reload;
|
||||
|
||||
- (NSArray *) menuItems;
|
||||
|
||||
|
||||
// actions
|
||||
|
||||
- (void) addNewSubmodule;
|
||||
- (void) initializeAllSubmodules;
|
||||
- (void) updateAllSubmodules;
|
||||
|
||||
- (PBCommand *) commandForOpeningSubmodule:(PBGitSubmodule *) submodule;
|
||||
- (PBCommand *) defaultCommandForSubmodule:(PBGitSubmodule *) submodule;
|
||||
@end
|
||||
@@ -0,0 +1,133 @@
|
||||
//
|
||||
// PBSubmoduleController.m
|
||||
// GitX
|
||||
//
|
||||
// Created by Tomasz Krasnyk on 10-11-27.
|
||||
// Copyright 2010 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#import "PBSubmoduleController.h"
|
||||
#import "PBGitRepository.h"
|
||||
#import "PBOpenDocumentCommand.h"
|
||||
|
||||
@interface PBSubmoduleController()
|
||||
@property (nonatomic, retain) NSArray *submodules;
|
||||
@end
|
||||
|
||||
|
||||
@implementation PBSubmoduleController
|
||||
@synthesize submodules;
|
||||
|
||||
- (id) initWithRepository:(PBGitRepository *) repo {
|
||||
if (self = [super init]){
|
||||
repository = [repo retain];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[repository release];
|
||||
[submodules release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (void) reload {
|
||||
NSArray *arguments = [NSArray arrayWithObjects:@"submodule", @"status", @"--recursive", nil];
|
||||
NSString *output = [repository outputInWorkdirForArguments:arguments];
|
||||
NSArray *lines = [output componentsSeparatedByString:@"\n"];
|
||||
|
||||
NSMutableArray *loadedSubmodules = [[NSMutableArray alloc] initWithCapacity:[lines count]];
|
||||
|
||||
for (NSString *submoduleLine in lines) {
|
||||
if ([submoduleLine length] == 0)
|
||||
continue;
|
||||
PBGitSubmodule *submodule = [[PBGitSubmodule alloc] initWithRawSubmoduleStatusString:submoduleLine];
|
||||
[loadedSubmodules addObject:submodule];
|
||||
}
|
||||
|
||||
NSMutableArray *groupedSubmodules = [[NSMutableArray alloc] init];
|
||||
for (PBGitSubmodule *submodule in loadedSubmodules) {
|
||||
BOOL added = NO;
|
||||
for (PBGitSubmodule *addedItem in groupedSubmodules) {
|
||||
if ([[submodule path] hasPrefix:[addedItem path]]) {
|
||||
[addedItem addSubmodule:submodule];
|
||||
added = YES;
|
||||
}
|
||||
}
|
||||
if (!added) {
|
||||
[groupedSubmodules addObject:submodule];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
self.submodules = loadedSubmodules;
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Actions
|
||||
|
||||
- (void) addNewSubmodule {
|
||||
//TODO implement
|
||||
}
|
||||
|
||||
- (void) initializeAllSubmodules {
|
||||
NSArray *parameters = [NSArray arrayWithObjects:@"submodule", @"init", nil];
|
||||
PBCommand *initializeSubmodules = [[PBCommand alloc] initWithDisplayName:@"Initialize All Submodules" parameters:parameters repository:repository];
|
||||
initializeSubmodules.commandTitle = initializeSubmodules.displayName;
|
||||
initializeSubmodules.commandDescription = @"Initializing submodules";
|
||||
[initializeSubmodules invoke];
|
||||
[initializeSubmodules release];
|
||||
}
|
||||
|
||||
- (void) updateAllSubmodules {
|
||||
NSArray *parameters = [NSArray arrayWithObjects:@"submodule", @"update", nil];
|
||||
PBCommand *initializeSubmodules = [[PBCommand alloc] initWithDisplayName:@"Update All Submodules" parameters:parameters repository:repository];
|
||||
initializeSubmodules.commandTitle = initializeSubmodules.displayName;
|
||||
initializeSubmodules.commandDescription = @"Updating submodules";
|
||||
[initializeSubmodules invoke];
|
||||
[initializeSubmodules release];
|
||||
}
|
||||
|
||||
- (NSArray *) menuItems {
|
||||
NSMutableArray *items = [[NSMutableArray alloc] init];
|
||||
[items addObject:[[NSMenuItem alloc] initWithTitle:@"Add Submodule..." action:@selector(addNewSubmodule) keyEquivalent:@""]];
|
||||
[items addObject:[[NSMenuItem alloc] initWithTitle:@"Initialize All Submodules" action:@selector(initializeAllSubmodules) keyEquivalent:@""]];
|
||||
[items addObject:[[NSMenuItem alloc] initWithTitle:@"Update All Submodules" action:@selector(updateAllSubmodules) keyEquivalent:@""]];
|
||||
|
||||
for (NSMenuItem *item in items) {
|
||||
[item setTarget:self];
|
||||
}
|
||||
|
||||
return items;
|
||||
}
|
||||
|
||||
- (PBCommand *) defaultCommandForSubmodule:(PBGitSubmodule *) submodule {
|
||||
return [self commandForOpeningSubmodule:submodule];
|
||||
}
|
||||
|
||||
- (PBCommand *) commandForOpeningSubmodule:(PBGitSubmodule *) submodule {
|
||||
if (!([submodule path] && [submodule submoduleState] != PBGitSubmoduleStateNotInitialized)) {
|
||||
return nil;
|
||||
}
|
||||
NSString *repoPath = [repository workingDirectory];
|
||||
NSString *path = [repoPath stringByAppendingPathComponent:[submodule path]];
|
||||
|
||||
PBOpenDocumentCommand *command = [[PBOpenDocumentCommand alloc] initWithDocumentAbsolutePath:path];
|
||||
command.commandTitle = command.displayName;
|
||||
command.commandDescription = @"Opening document";
|
||||
return [command autorelease];
|
||||
}
|
||||
|
||||
- (BOOL) validateMenuItem:(NSMenuItem *)menuItem {
|
||||
BOOL shouldBeEnabled = YES;
|
||||
SEL action = [menuItem action];
|
||||
if (action == @selector(addNewSubmodule)) {
|
||||
shouldBeEnabled = NO;
|
||||
//TODO implementation missing
|
||||
} else {
|
||||
shouldBeEnabled = [self.submodules count] > 0;
|
||||
}
|
||||
return shouldBeEnabled;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -12,6 +12,7 @@
|
||||
</object>
|
||||
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<integer value="106"/>
|
||||
</object>
|
||||
<object class="NSArray" key="IBDocument.PluginDependencies">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
@@ -921,6 +922,22 @@
|
||||
<reference key="NSOnImage" ref="889736156"/>
|
||||
<reference key="NSMixedImage" ref="37108609"/>
|
||||
</object>
|
||||
<object class="NSMenuItem" id="669832662">
|
||||
<reference key="NSMenu" ref="612917469"/>
|
||||
<string key="NSTitle">Report a problem</string>
|
||||
<string key="NSKeyEquiv"/>
|
||||
<int key="NSMnemonicLoc">2147483647</int>
|
||||
<reference key="NSOnImage" ref="889736156"/>
|
||||
<reference key="NSMixedImage" ref="37108609"/>
|
||||
</object>
|
||||
<object class="NSMenuItem" id="480405559">
|
||||
<reference key="NSMenu" ref="612917469"/>
|
||||
<string key="NSTitle">Discuss GitX</string>
|
||||
<string key="NSKeyEquiv"/>
|
||||
<int key="NSMnemonicLoc">2147483647</int>
|
||||
<reference key="NSOnImage" ref="889736156"/>
|
||||
<reference key="NSMixedImage" ref="37108609"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
@@ -1367,6 +1384,22 @@
|
||||
</object>
|
||||
<int key="connectionID">968</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBActionConnection" key="connection">
|
||||
<string key="label">reportAProblem:</string>
|
||||
<reference key="source" ref="859235683"/>
|
||||
<reference key="destination" ref="669832662"/>
|
||||
</object>
|
||||
<int key="connectionID">971</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBActionConnection" key="connection">
|
||||
<string key="label">discussGitX:</string>
|
||||
<reference key="source" ref="859235683"/>
|
||||
<reference key="destination" ref="480405559"/>
|
||||
</object>
|
||||
<int key="connectionID">973</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
<object class="NSArray" key="orderedObjects">
|
||||
@@ -1625,6 +1658,8 @@
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="303385276"/>
|
||||
<reference ref="669832662"/>
|
||||
<reference ref="480405559"/>
|
||||
</object>
|
||||
<reference key="parent" ref="180968013"/>
|
||||
</object>
|
||||
@@ -2078,6 +2113,16 @@
|
||||
<reference key="object" ref="220492206"/>
|
||||
<reference key="parent" ref="227303002"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">969</int>
|
||||
<reference key="object" ref="669832662"/>
|
||||
<reference key="parent" ref="612917469"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">972</int>
|
||||
<reference key="object" ref="480405559"/>
|
||||
<reference key="parent" ref="612917469"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="flattenedProperties">
|
||||
@@ -2280,6 +2325,8 @@
|
||||
<string>956.IBPluginDependency</string>
|
||||
<string>964.IBPluginDependency</string>
|
||||
<string>964.ImportedFromIB2</string>
|
||||
<string>969.IBPluginDependency</string>
|
||||
<string>972.IBPluginDependency</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
@@ -2287,7 +2334,7 @@
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>{{880, 713}, {135, 23}}</string>
|
||||
<string>{{778, 967}, {190, 63}}</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
@@ -2398,7 +2445,7 @@
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>{{809, 663}, {194, 73}}</string>
|
||||
<string>{{707, 957}, {194, 73}}</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
@@ -2479,6 +2526,8 @@
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="1"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="unlocalizedProperties">
|
||||
@@ -2497,7 +2546,7 @@
|
||||
</object>
|
||||
</object>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">968</int>
|
||||
<int key="maxID">973</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
@@ -2509,8 +2558,10 @@
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>discussGitX:</string>
|
||||
<string>installCliTool:</string>
|
||||
<string>openPreferencesWindow:</string>
|
||||
<string>reportAProblem:</string>
|
||||
<string>saveAction:</string>
|
||||
<string>showAboutPanel:</string>
|
||||
<string>showCloneRepository:</string>
|
||||
@@ -2524,14 +2575,18 @@
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="actionInfosByName">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>discussGitX:</string>
|
||||
<string>installCliTool:</string>
|
||||
<string>openPreferencesWindow:</string>
|
||||
<string>reportAProblem:</string>
|
||||
<string>saveAction:</string>
|
||||
<string>showAboutPanel:</string>
|
||||
<string>showCloneRepository:</string>
|
||||
@@ -2539,6 +2594,10 @@
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">discussGitX:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">installCliTool:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
@@ -2547,6 +2606,10 @@
|
||||
<string key="name">openPreferencesWindow:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">reportAProblem:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">saveAction:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
@@ -2913,6 +2976,7 @@
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>commit:</string>
|
||||
<string>forceCommit:</string>
|
||||
<string>refresh:</string>
|
||||
<string>signOff:</string>
|
||||
</object>
|
||||
@@ -2921,6 +2985,7 @@
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="actionInfosByName">
|
||||
@@ -2928,6 +2993,7 @@
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>commit:</string>
|
||||
<string>forceCommit:</string>
|
||||
<string>refresh:</string>
|
||||
<string>signOff:</string>
|
||||
</object>
|
||||
@@ -2937,6 +3003,10 @@
|
||||
<string key="name">commit:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">forceCommit:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">refresh:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
@@ -3035,6 +3105,8 @@
|
||||
<string>openSelectedFile:</string>
|
||||
<string>rebase:</string>
|
||||
<string>refresh:</string>
|
||||
<string>selectNext:</string>
|
||||
<string>selectPrevious:</string>
|
||||
<string>setBranchFilter:</string>
|
||||
<string>setDetailedView:</string>
|
||||
<string>setTreeView:</string>
|
||||
@@ -3060,6 +3132,8 @@
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="actionInfosByName">
|
||||
@@ -3074,6 +3148,8 @@
|
||||
<string>openSelectedFile:</string>
|
||||
<string>rebase:</string>
|
||||
<string>refresh:</string>
|
||||
<string>selectNext:</string>
|
||||
<string>selectPrevious:</string>
|
||||
<string>setBranchFilter:</string>
|
||||
<string>setDetailedView:</string>
|
||||
<string>setTreeView:</string>
|
||||
@@ -3116,6 +3192,14 @@
|
||||
<string key="name">refresh:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">selectNext:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">selectPrevious:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">setBranchFilter:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
@@ -3641,14 +3725,42 @@
|
||||
<string key="className">PBHistorySearchController</string>
|
||||
<string key="superclassName">NSObject</string>
|
||||
<object class="NSMutableDictionary" key="actions">
|
||||
<string key="NS.key.0">stepperPressed:</string>
|
||||
<string key="NS.object.0">id</string>
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>selectSearchMode:</string>
|
||||
<string>stepperPressed:</string>
|
||||
<string>updateSearch:</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="actionInfosByName">
|
||||
<string key="NS.key.0">stepperPressed:</string>
|
||||
<object class="IBActionInfo" key="NS.object.0">
|
||||
<string key="name">stepperPressed:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>selectSearchMode:</string>
|
||||
<string>stepperPressed:</string>
|
||||
<string>updateSearch:</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">selectSearchMode:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">stepperPressed:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">updateSearch:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="outlets">
|
||||
@@ -3658,6 +3770,7 @@
|
||||
<string>commitController</string>
|
||||
<string>historyController</string>
|
||||
<string>numberOfMatchesField</string>
|
||||
<string>progressIndicator</string>
|
||||
<string>searchField</string>
|
||||
<string>stepper</string>
|
||||
</object>
|
||||
@@ -3666,6 +3779,7 @@
|
||||
<string>NSArrayController</string>
|
||||
<string>PBGitHistoryController</string>
|
||||
<string>NSTextField</string>
|
||||
<string>NSProgressIndicator</string>
|
||||
<string>NSSearchField</string>
|
||||
<string>NSSegmentedControl</string>
|
||||
</object>
|
||||
@@ -3677,6 +3791,7 @@
|
||||
<string>commitController</string>
|
||||
<string>historyController</string>
|
||||
<string>numberOfMatchesField</string>
|
||||
<string>progressIndicator</string>
|
||||
<string>searchField</string>
|
||||
<string>stepper</string>
|
||||
</object>
|
||||
@@ -3694,6 +3809,10 @@
|
||||
<string key="name">numberOfMatchesField</string>
|
||||
<string key="candidateClassName">NSTextField</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">progressIndicator</string>
|
||||
<string key="candidateClassName">NSProgressIndicator</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">searchField</string>
|
||||
<string key="candidateClassName">NSSearchField</string>
|
||||
@@ -4655,13 +4774,6 @@
|
||||
<string key="minorKey">QuartzCore.framework/Headers/CIImageProvider.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">ScriptingBridge.framework/Headers/SBApplication.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
|
||||
@@ -2,18 +2,16 @@
|
||||
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1050</int>
|
||||
<string key="IBDocument.SystemVersion">10C540</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">759</string>
|
||||
<string key="IBDocument.AppKitVersion">1038.25</string>
|
||||
<string key="IBDocument.HIToolboxVersion">458.00</string>
|
||||
<string key="IBDocument.SystemVersion">10H574</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">804</string>
|
||||
<string key="IBDocument.AppKitVersion">1038.35</string>
|
||||
<string key="IBDocument.HIToolboxVersion">461.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="NS.object.0">759</string>
|
||||
<string key="NS.object.0">804</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<integer value="62"/>
|
||||
<integer value="87"/>
|
||||
<integer value="1"/>
|
||||
</object>
|
||||
<object class="NSArray" key="IBDocument.PluginDependencies">
|
||||
@@ -45,21 +43,74 @@
|
||||
<int key="NSvFlags">268</int>
|
||||
<object class="NSMutableArray" key="NSSubviews">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSTextField" id="63761450">
|
||||
<reference key="NSNextResponder" ref="1005"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{17, 22}, {166, 17}}</string>
|
||||
<reference key="NSSuperview" ref="1005"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="467740597">
|
||||
<int key="NSCellFlags">68288064</int>
|
||||
<int key="NSCellFlags2">272630784</int>
|
||||
<string key="NSContents">Reset all dialog warnings:</string>
|
||||
<object class="NSFont" key="NSSupport" id="734450335">
|
||||
<string key="NSName">LucidaGrande</string>
|
||||
<double key="NSSize">13</double>
|
||||
<int key="NSfFlags">1044</int>
|
||||
</object>
|
||||
<reference key="NSControlView" ref="63761450"/>
|
||||
<object class="NSColor" key="NSBackgroundColor" id="124675276">
|
||||
<int key="NSColorSpace">6</int>
|
||||
<string key="NSCatalogName">System</string>
|
||||
<string key="NSColorName">controlColor</string>
|
||||
<object class="NSColor" key="NSColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSColor" key="NSTextColor" id="716218002">
|
||||
<int key="NSColorSpace">6</int>
|
||||
<string key="NSCatalogName">System</string>
|
||||
<string key="NSColorName">controlTextColor</string>
|
||||
<object class="NSColor" key="NSColor" id="367847822">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MAA</bytes>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSButton" id="83909567">
|
||||
<reference key="NSNextResponder" ref="1005"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{182, 12}, {137, 32}}</string>
|
||||
<reference key="NSSuperview" ref="1005"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="265220935">
|
||||
<int key="NSCellFlags">-2080244224</int>
|
||||
<int key="NSCellFlags2">134217728</int>
|
||||
<string key="NSContents">Reset Warnings</string>
|
||||
<reference key="NSSupport" ref="734450335"/>
|
||||
<reference key="NSControlView" ref="83909567"/>
|
||||
<int key="NSButtonFlags">-2038021889</int>
|
||||
<int key="NSButtonFlags2">129</int>
|
||||
<reference key="NSAlternateImage" ref="734450335"/>
|
||||
<string key="NSAlternateContents"/>
|
||||
<string key="NSKeyEquivalent"/>
|
||||
<int key="NSPeriodicDelay">400</int>
|
||||
<int key="NSPeriodicInterval">75</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSTextField" id="25030403">
|
||||
<reference key="NSNextResponder" ref="1005"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{248, 100}, {41, 22}}</string>
|
||||
<string key="NSFrame">{{248, 118}, {41, 22}}</string>
|
||||
<reference key="NSSuperview" ref="1005"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="1045854608">
|
||||
<int key="NSCellFlags">-1804468671</int>
|
||||
<int key="NSCellFlags2">272630784</int>
|
||||
<string key="NSContents"/>
|
||||
<object class="NSFont" key="NSSupport" id="734450335">
|
||||
<string key="NSName">LucidaGrande</string>
|
||||
<double key="NSSize">13</double>
|
||||
<int key="NSfFlags">1044</int>
|
||||
</object>
|
||||
<reference key="NSSupport" ref="734450335"/>
|
||||
<reference key="NSControlView" ref="25030403"/>
|
||||
<bool key="NSDrawsBackground">YES</bool>
|
||||
<object class="NSColor" key="NSBackgroundColor">
|
||||
@@ -75,17 +126,14 @@
|
||||
<int key="NSColorSpace">6</int>
|
||||
<string key="NSCatalogName">System</string>
|
||||
<string key="NSColorName">textColor</string>
|
||||
<object class="NSColor" key="NSColor" id="367847822">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MAA</bytes>
|
||||
</object>
|
||||
<reference key="NSColor" ref="367847822"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSTextField" id="258144035">
|
||||
<reference key="NSNextResponder" ref="1005"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{121, 102}, {122, 17}}</string>
|
||||
<string key="NSFrame">{{121, 120}, {122, 17}}</string>
|
||||
<reference key="NSSuperview" ref="1005"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="1031567029">
|
||||
@@ -94,27 +142,14 @@
|
||||
<string key="NSContents">Display at column:</string>
|
||||
<reference key="NSSupport" ref="734450335"/>
|
||||
<reference key="NSControlView" ref="258144035"/>
|
||||
<object class="NSColor" key="NSBackgroundColor" id="124675276">
|
||||
<int key="NSColorSpace">6</int>
|
||||
<string key="NSCatalogName">System</string>
|
||||
<string key="NSColorName">controlColor</string>
|
||||
<object class="NSColor" key="NSColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSColor" key="NSTextColor" id="716218002">
|
||||
<int key="NSColorSpace">6</int>
|
||||
<string key="NSCatalogName">System</string>
|
||||
<string key="NSColorName">controlTextColor</string>
|
||||
<reference key="NSColor" ref="367847822"/>
|
||||
</object>
|
||||
<reference key="NSBackgroundColor" ref="124675276"/>
|
||||
<reference key="NSTextColor" ref="716218002"/>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSButton" id="968361983">
|
||||
<reference key="NSNextResponder" ref="1005"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{18, 125}, {273, 18}}</string>
|
||||
<string key="NSFrame">{{18, 143}, {273, 18}}</string>
|
||||
<reference key="NSSuperview" ref="1005"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="782438225">
|
||||
@@ -141,7 +176,7 @@
|
||||
<object class="NSTextField" id="441589300">
|
||||
<reference key="NSNextResponder" ref="1005"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{17, 74}, {99, 17}}</string>
|
||||
<string key="NSFrame">{{17, 92}, {99, 17}}</string>
|
||||
<reference key="NSSuperview" ref="1005"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="31526941">
|
||||
@@ -165,7 +200,7 @@
|
||||
<string>NSFilenamesPboardType</string>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrame">{{121, 70}, {179, 22}}</string>
|
||||
<string key="NSFrame">{{121, 88}, {179, 22}}</string>
|
||||
<reference key="NSSuperview" ref="1005"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSPathCell" key="NSCell" id="331807888">
|
||||
@@ -187,7 +222,7 @@
|
||||
<object class="NSTextField" id="617839596">
|
||||
<reference key="NSNextResponder" ref="1005"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{118, 20}, {192, 42}}</string>
|
||||
<string key="NSFrame">{{118, 52}, {192, 28}}</string>
|
||||
<reference key="NSSuperview" ref="1005"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="453728129">
|
||||
@@ -203,7 +238,7 @@
|
||||
<object class="NSButton" id="1032928366">
|
||||
<reference key="NSNextResponder" ref="1005"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{306, 74}, {54, 14}}</string>
|
||||
<string key="NSFrame">{{306, 92}, {54, 14}}</string>
|
||||
<reference key="NSSuperview" ref="1005"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="806993456">
|
||||
@@ -228,7 +263,7 @@
|
||||
<object class="NSButton" id="910887184">
|
||||
<reference key="NSNextResponder" ref="1005"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{18, 150}, {203, 18}}</string>
|
||||
<string key="NSFrame">{{18, 168}, {203, 18}}</string>
|
||||
<reference key="NSSuperview" ref="1005"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="709654045">
|
||||
@@ -250,7 +285,7 @@
|
||||
<object class="NSButton" id="160081910">
|
||||
<reference key="NSNextResponder" ref="1005"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{18, 175}, {279, 18}}</string>
|
||||
<string key="NSFrame">{{18, 193}, {279, 18}}</string>
|
||||
<reference key="NSSuperview" ref="1005"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="876763316">
|
||||
@@ -272,7 +307,7 @@
|
||||
<object class="NSButton" id="68472633">
|
||||
<reference key="NSNextResponder" ref="1005"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{18, 200}, {207, 18}}</string>
|
||||
<string key="NSFrame">{{18, 218}, {207, 18}}</string>
|
||||
<reference key="NSSuperview" ref="1005"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="456188813">
|
||||
@@ -292,12 +327,12 @@
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrameSize">{400, 236}</string>
|
||||
<string key="NSFrameSize">{400, 254}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<string key="NSClassName">NSView</string>
|
||||
</object>
|
||||
<object class="NSCustomView" id="970459672">
|
||||
<reference key="NSNextResponder"/>
|
||||
<nil key="NSNextResponder"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<object class="NSMutableArray" key="NSSubviews">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
@@ -306,7 +341,6 @@
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{39, 45}, {82, 14}}</string>
|
||||
<reference key="NSSuperview" ref="970459672"/>
|
||||
<reference key="NSWindow"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="439589942">
|
||||
<int key="NSCellFlags">68288064</int>
|
||||
@@ -323,7 +357,6 @@
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{18, 103}, {260, 18}}</string>
|
||||
<reference key="NSSuperview" ref="970459672"/>
|
||||
<reference key="NSWindow"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="853304857">
|
||||
<int key="NSCellFlags">-2080244224</int>
|
||||
@@ -346,7 +379,6 @@
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{130, 78}, {102, 22}}</string>
|
||||
<reference key="NSSuperview" ref="970459672"/>
|
||||
<reference key="NSWindow"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSPopUpButtonCell" key="NSCell" id="646744412">
|
||||
<int key="NSCellFlags">-2076049856</int>
|
||||
@@ -434,7 +466,6 @@
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{39, 80}, {89, 17}}</string>
|
||||
<reference key="NSSuperview" ref="970459672"/>
|
||||
<reference key="NSWindow"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="642787685">
|
||||
<int key="NSCellFlags">68288064</int>
|
||||
@@ -451,7 +482,6 @@
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{130, 45}, {251, 14}}</string>
|
||||
<reference key="NSSuperview" ref="970459672"/>
|
||||
<reference key="NSWindow"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="617642330">
|
||||
<int key="NSCellFlags">68288064</int>
|
||||
@@ -489,7 +519,6 @@
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{128, 13}, {96, 28}}</string>
|
||||
<reference key="NSSuperview" ref="970459672"/>
|
||||
<reference key="NSWindow"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="329053853">
|
||||
<int key="NSCellFlags">67239424</int>
|
||||
@@ -507,12 +536,10 @@
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrameSize">{400, 139}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSWindow"/>
|
||||
<string key="NSClassName">NSView</string>
|
||||
</object>
|
||||
<object class="NSCustomView" id="351117501">
|
||||
<reference key="NSNextResponder"/>
|
||||
<nil key="NSNextResponder"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<object class="NSMutableArray" key="NSSubviews">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
@@ -540,22 +567,16 @@
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrameSize">{239, 54}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<string key="NSClassName">NSView</string>
|
||||
</object>
|
||||
<object class="NSCustomObject" id="844257713">
|
||||
<string key="NSClassName">SUUpdater</string>
|
||||
</object>
|
||||
<object class="NSUserDefaultsController" id="557723770">
|
||||
<object class="NSMutableArray" key="NSDeclaredKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>PBCommitMessageViewHasVerticalLine</string>
|
||||
<string>PBCommitMessageViewVerticalLineLength</string>
|
||||
</object>
|
||||
<bool key="NSSharedInstance">YES</bool>
|
||||
</object>
|
||||
<object class="NSCustomView" id="263788152">
|
||||
<reference key="NSNextResponder"/>
|
||||
<nil key="NSNextResponder"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<object class="NSMutableArray" key="NSSubviews">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
@@ -649,7 +670,6 @@
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrameSize">{400, 116}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<string key="NSClassName">NSView</string>
|
||||
</object>
|
||||
</object>
|
||||
@@ -1051,6 +1071,14 @@
|
||||
</object>
|
||||
<int key="connectionID">135</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBActionConnection" key="connection">
|
||||
<string key="label">resetAllDialogWarnings:</string>
|
||||
<reference key="source" ref="1001"/>
|
||||
<reference key="destination" ref="83909567"/>
|
||||
</object>
|
||||
<int key="connectionID">140</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
<object class="NSArray" key="orderedObjects">
|
||||
@@ -1094,6 +1122,8 @@
|
||||
<reference ref="968361983"/>
|
||||
<reference ref="258144035"/>
|
||||
<reference ref="25030403"/>
|
||||
<reference ref="83909567"/>
|
||||
<reference ref="63761450"/>
|
||||
</object>
|
||||
<reference key="parent" ref="0"/>
|
||||
<string key="objectName">General</string>
|
||||
@@ -1485,6 +1515,34 @@
|
||||
<reference key="object" ref="1045854608"/>
|
||||
<reference key="parent" ref="25030403"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">136</int>
|
||||
<reference key="object" ref="83909567"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="265220935"/>
|
||||
</object>
|
||||
<reference key="parent" ref="1005"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">137</int>
|
||||
<reference key="object" ref="63761450"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="467740597"/>
|
||||
</object>
|
||||
<reference key="parent" ref="1005"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">138</int>
|
||||
<reference key="object" ref="467740597"/>
|
||||
<reference key="parent" ref="63761450"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">139</int>
|
||||
<reference key="object" ref="265220935"/>
|
||||
<reference key="parent" ref="83909567"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="flattenedProperties">
|
||||
@@ -1515,6 +1573,13 @@
|
||||
<string>13.IBPluginDependency</string>
|
||||
<string>130.IBPluginDependency</string>
|
||||
<string>131.IBPluginDependency</string>
|
||||
<string>136.IBAttributePlaceholdersKey</string>
|
||||
<string>136.IBPluginDependency</string>
|
||||
<string>136.IBViewBoundsToFrameTransform</string>
|
||||
<string>137.IBPluginDependency</string>
|
||||
<string>137.IBViewBoundsToFrameTransform</string>
|
||||
<string>138.IBPluginDependency</string>
|
||||
<string>139.IBPluginDependency</string>
|
||||
<string>14.IBPluginDependency</string>
|
||||
<string>15.IBEditorWindowLastContentRect</string>
|
||||
<string>15.IBPluginDependency</string>
|
||||
@@ -1558,7 +1623,7 @@
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>{{845, 648}, {400, 236}}</string>
|
||||
<string>{{845, 630}, {400, 254}}</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<object class="NSMutableArray">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
@@ -1588,6 +1653,24 @@
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<object class="NSMutableDictionary">
|
||||
<string key="NS.key.0">ToolTip</string>
|
||||
<object class="IBToolTipAttribute" key="NS.object.0">
|
||||
<string key="name">ToolTip</string>
|
||||
<reference key="object" ref="83909567"/>
|
||||
<string key="toolTip">Resets the of the "Don't show this again" preferences.</string>
|
||||
</object>
|
||||
</object>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<object class="NSAffineTransform">
|
||||
<bytes key="NSTransformStruct">P4AAAL+AAABDXwAAwggAAA</bytes>
|
||||
</object>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<object class="NSAffineTransform">
|
||||
<bytes key="NSTransformStruct">P4AAAL+AAABCaAAAwegAAA</bytes>
|
||||
</object>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>{{443, 712}, {103, 71}}</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
@@ -1652,7 +1735,7 @@
|
||||
</object>
|
||||
</object>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">135</int>
|
||||
<int key="maxID">140</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
@@ -1665,6 +1748,13 @@
|
||||
<string key="minorKey">DBPrefsWindowController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSApplication</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">NSApplication+GitXScripting.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">PBPrefsWindowController</string>
|
||||
<string key="superclassName">DBPrefsWindowController</string>
|
||||
@@ -1673,6 +1763,7 @@
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>checkGitValidity:</string>
|
||||
<string>resetAllDialogWarnings:</string>
|
||||
<string>resetGitPath:</string>
|
||||
<string>showHideAllFiles:</string>
|
||||
</object>
|
||||
@@ -1681,6 +1772,36 @@
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="actionInfosByName">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>checkGitValidity:</string>
|
||||
<string>resetAllDialogWarnings:</string>
|
||||
<string>resetGitPath:</string>
|
||||
<string>showHideAllFiles:</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">checkGitValidity:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">resetAllDialogWarnings:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">resetGitPath:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">showHideAllFiles:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="outlets">
|
||||
@@ -1704,6 +1825,45 @@
|
||||
<string>NSView</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>badGitPathIcon</string>
|
||||
<string>generalPrefsView</string>
|
||||
<string>gitPathController</string>
|
||||
<string>gitPathOpenAccessory</string>
|
||||
<string>integrationPrefsView</string>
|
||||
<string>updatesPrefsView</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">badGitPathIcon</string>
|
||||
<string key="candidateClassName">NSImageView</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">generalPrefsView</string>
|
||||
<string key="candidateClassName">NSView</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">gitPathController</string>
|
||||
<string key="candidateClassName">NSPathControl</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">gitPathOpenAccessory</string>
|
||||
<string key="candidateClassName">NSView</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">integrationPrefsView</string>
|
||||
<string key="candidateClassName">NSView</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">updatesPrefsView</string>
|
||||
<string key="candidateClassName">NSView</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">PBPrefsWindowController.h</string>
|
||||
@@ -1733,10 +1893,24 @@
|
||||
<string key="NS.key.0">checkForUpdates:</string>
|
||||
<string key="NS.object.0">id</string>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="actionInfosByName">
|
||||
<string key="NS.key.0">checkForUpdates:</string>
|
||||
<object class="IBActionInfo" key="NS.object.0">
|
||||
<string key="name">checkForUpdates:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="outlets">
|
||||
<string key="NS.key.0">delegate</string>
|
||||
<string key="NS.object.0">id</string>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
|
||||
<string key="NS.key.0">delegate</string>
|
||||
<object class="IBToOneOutletInfo" key="NS.object.0">
|
||||
<string key="name">delegate</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
</object>
|
||||
<reference key="sourceIdentifier" ref="657347130"/>
|
||||
</object>
|
||||
</object>
|
||||
@@ -2125,6 +2299,27 @@
|
||||
<string key="minorKey">Foundation.framework/Headers/NSURLDownload.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">QuartzCore.framework/Headers/CAAnimation.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">QuartzCore.framework/Headers/CALayer.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">QuartzCore.framework/Headers/CIImageProvider.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
@@ -2332,6 +2527,13 @@
|
||||
<string key="NS.key.0">showWindow:</string>
|
||||
<string key="NS.object.0">id</string>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="actionInfosByName">
|
||||
<string key="NS.key.0">showWindow:</string>
|
||||
<object class="IBActionInfo" key="NS.object.0">
|
||||
<string key="name">showWindow:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">AppKit.framework/Headers/NSWindowController.h</string>
|
||||
@@ -2344,10 +2546,24 @@
|
||||
<string key="NS.key.0">checkForUpdates:</string>
|
||||
<string key="NS.object.0">id</string>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="actionInfosByName">
|
||||
<string key="NS.key.0">checkForUpdates:</string>
|
||||
<object class="IBActionInfo" key="NS.object.0">
|
||||
<string key="name">checkForUpdates:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="outlets">
|
||||
<string key="NS.key.0">delegate</string>
|
||||
<string key="NS.object.0">id</string>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
|
||||
<string key="NS.key.0">delegate</string>
|
||||
<object class="IBToOneOutletInfo" key="NS.object.0">
|
||||
<string key="name">delegate</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
</object>
|
||||
<reference key="sourceIdentifier" ref="639617919"/>
|
||||
</object>
|
||||
</object>
|
||||
@@ -2370,8 +2586,21 @@
|
||||
<string key="IBDocument.LastKnownRelativeProjectPath">../GitX.xcodeproj</string>
|
||||
<int key="IBDocument.defaultPropertyAccessControl">3</int>
|
||||
<object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
|
||||
<string key="NS.key.0">NSStopProgressFreestandingTemplate</string>
|
||||
<string key="NS.object.0">{83, 83}</string>
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>NSMenuCheckmark</string>
|
||||
<string>NSMenuMixedState</string>
|
||||
<string>NSStopProgressFreestandingTemplate</string>
|
||||
<string>NSSwitch</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>{9, 8}</string>
|
||||
<string>{7, 2}</string>
|
||||
<string>{83, 83}</string>
|
||||
<string>{15, 15}</string>
|
||||
</object>
|
||||
</object>
|
||||
</data>
|
||||
</archive>
|
||||
|
||||
|
After Width: | Height: | Size: 397 B |
|
After Width: | Height: | Size: 387 B |
|
After Width: | Height: | Size: 397 B |
|
After Width: | Height: | Size: 286 B |
|
After Width: | Height: | Size: 425 B |
|
After Width: | Height: | Size: 419 B |
|
After Width: | Height: | Size: 392 B |
@@ -21,6 +21,7 @@
|
||||
NSMutableArray *groups;
|
||||
NSString *logFormat;
|
||||
IBOutlet NSView *accessoryView;
|
||||
IBOutlet NSSplitView *fileListSplitView;
|
||||
}
|
||||
|
||||
- (void)showFile;
|
||||
|
||||
@@ -16,6 +16,14 @@
|
||||
#define ITEM_IDENTIFIER @"Identifier" // string
|
||||
#define ITEM_NAME @"Name" // string
|
||||
|
||||
|
||||
@interface GLFileView ()
|
||||
|
||||
- (void)saveSplitViewPosition;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation GLFileView
|
||||
|
||||
- (void) awakeFromNib
|
||||
@@ -52,6 +60,9 @@
|
||||
items, GROUP_ITEMS,
|
||||
nil]];
|
||||
[typeBar reloadData];
|
||||
|
||||
[fileListSplitView setHidden:YES];
|
||||
[self performSelector:@selector(restoreSplitViewPositiion) withObject:nil afterDelay:0];
|
||||
}
|
||||
|
||||
- (void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
|
||||
@@ -78,7 +89,7 @@
|
||||
[script callWebScriptMethod:@"showFile" withArguments:[NSArray arrayWithObject:fileTxt]];
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
#if 0
|
||||
NSString *dom=[[[[view mainFrame] DOMDocument] documentElement] outerHTML];
|
||||
NSString *tmpFile=@"~/tmp/test.html";
|
||||
[dom writeToFile:[tmpFile stringByExpandingTildeInPath] atomically:true encoding:NSUTF8StringEncoding error:nil];
|
||||
@@ -151,6 +162,14 @@
|
||||
[self showFile];
|
||||
}
|
||||
|
||||
- (void)closeView
|
||||
{
|
||||
[historyController.treeController removeObserver:self forKeyPath:@"selection"];
|
||||
[self saveSplitViewPosition];
|
||||
|
||||
[super closeView];
|
||||
}
|
||||
|
||||
- (NSString *) parseHTML:(NSString *)txt
|
||||
{
|
||||
txt=[txt stringByReplacingOccurrencesOfString:@"&" withString:@"&"];
|
||||
@@ -234,6 +253,71 @@
|
||||
return (NSString *)res;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#pragma mark NSSplitView delegate methods
|
||||
|
||||
#define kFileListSplitViewLeftMin 120
|
||||
#define kFileListSplitViewRightMin 180
|
||||
#define kHFileListSplitViewPositionDefault @"File List SplitView Position"
|
||||
|
||||
- (CGFloat)splitView:(NSSplitView *)splitView constrainMinCoordinate:(CGFloat)proposedMin ofSubviewAt:(NSInteger)dividerIndex
|
||||
{
|
||||
return kFileListSplitViewLeftMin;
|
||||
}
|
||||
|
||||
- (CGFloat)splitView:(NSSplitView *)splitView constrainMaxCoordinate:(CGFloat)proposedMax ofSubviewAt:(NSInteger)dividerIndex
|
||||
{
|
||||
return [splitView frame].size.width - [splitView dividerThickness] - kFileListSplitViewRightMin;
|
||||
}
|
||||
|
||||
// while the user resizes the window keep the left (file list) view constant and just resize the right view
|
||||
// unless the right view gets too small
|
||||
- (void)splitView:(NSSplitView *)splitView resizeSubviewsWithOldSize:(NSSize)oldSize
|
||||
{
|
||||
NSRect newFrame = [splitView frame];
|
||||
|
||||
float dividerThickness = [splitView dividerThickness];
|
||||
|
||||
NSView *leftView = [[splitView subviews] objectAtIndex:0];
|
||||
NSRect leftFrame = [leftView frame];
|
||||
leftFrame.size.height = newFrame.size.height;
|
||||
|
||||
if ((newFrame.size.width - leftFrame.size.width - dividerThickness) < kFileListSplitViewRightMin) {
|
||||
leftFrame.size.width = newFrame.size.width - kFileListSplitViewRightMin - dividerThickness;
|
||||
}
|
||||
|
||||
NSView *rightView = [[splitView subviews] objectAtIndex:1];
|
||||
NSRect rightFrame = [rightView frame];
|
||||
rightFrame.origin.x = leftFrame.size.width + dividerThickness;
|
||||
rightFrame.size.width = newFrame.size.width - rightFrame.origin.x;
|
||||
rightFrame.size.height = newFrame.size.height;
|
||||
|
||||
[leftView setFrame:leftFrame];
|
||||
[rightView setFrame:rightFrame];
|
||||
}
|
||||
|
||||
// NSSplitView does not save and restore the position of the SplitView correctly so do it manually
|
||||
- (void)saveSplitViewPosition
|
||||
{
|
||||
float position = [[[fileListSplitView subviews] objectAtIndex:0] frame].size.width;
|
||||
[[NSUserDefaults standardUserDefaults] setFloat:position forKey:kHFileListSplitViewPositionDefault];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
}
|
||||
|
||||
// make sure this happens after awakeFromNib
|
||||
- (void)restoreSplitViewPositiion
|
||||
{
|
||||
float position = [[NSUserDefaults standardUserDefaults] floatForKey:kHFileListSplitViewPositionDefault];
|
||||
if (position < 1.0)
|
||||
position = 200;
|
||||
|
||||
[fileListSplitView setPosition:position ofDividerAtIndex:0];
|
||||
[fileListSplitView setHidden:NO];
|
||||
}
|
||||
|
||||
|
||||
|
||||
@synthesize groups;
|
||||
@synthesize logFormat;
|
||||
|
||||
|
||||
@@ -24,13 +24,36 @@
|
||||
02B41A5E123E307200DFC531 /* PBCommitHookFailedSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = 02B41A5D123E307200DFC531 /* PBCommitHookFailedSheet.m */; };
|
||||
02B41A60123E307F00DFC531 /* PBCommitHookFailedSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = 02B41A5F123E307F00DFC531 /* PBCommitHookFailedSheet.xib */; };
|
||||
056438B70ED0C40B00985397 /* DetailViewTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = 056438B60ED0C40B00985397 /* DetailViewTemplate.png */; };
|
||||
21230CB11284B26A0046E5A1 /* PBGitSVStashItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 21230CB01284B26A0046E5A1 /* PBGitSVStashItem.m */; };
|
||||
21025C1212947AB200D87200 /* sourceListAction.png in Resources */ = {isa = PBXBuildFile; fileRef = 21025C1012947AB200D87200 /* sourceListAction.png */; };
|
||||
21025C1312947AB200D87200 /* sourceListActionOver.png in Resources */ = {isa = PBXBuildFile; fileRef = 21025C1112947AB200D87200 /* sourceListActionOver.png */; };
|
||||
21230CB11284B26A0046E5A1 /* PBGitMenuItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 21230CB01284B26A0046E5A1 /* PBGitMenuItem.m */; };
|
||||
21230D351284C5080046E5A1 /* PBGitStash.m in Sources */ = {isa = PBXBuildFile; fileRef = 21230D341284C5080046E5A1 /* PBGitStash.m */; };
|
||||
21230D821284D1CC0046E5A1 /* stash-icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 21230D811284D1CC0046E5A1 /* stash-icon.png */; };
|
||||
21230D9C128552720046E5A1 /* PBCommand.m in Sources */ = {isa = PBXBuildFile; fileRef = 21230D9B128552720046E5A1 /* PBCommand.m */; };
|
||||
21230D9F128552FA0046E5A1 /* PBStashCommandFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = 21230D9E128552FA0046E5A1 /* PBStashCommandFactory.m */; };
|
||||
21230DAA1285550B0046E5A1 /* PBCommandMenuItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 21230DA91285550B0046E5A1 /* PBCommandMenuItem.m */; };
|
||||
21230DEE12855A990046E5A1 /* PBStashCommand.m in Sources */ = {isa = PBXBuildFile; fileRef = 21230DED12855A990046E5A1 /* PBStashCommand.m */; };
|
||||
21230ED21285EB5A0046E5A1 /* PBArgumentPicker.xib in Resources */ = {isa = PBXBuildFile; fileRef = 21230ED11285EB5A0046E5A1 /* PBArgumentPicker.xib */; };
|
||||
21230ED91285EDAF0046E5A1 /* PBArgumentPicker.m in Sources */ = {isa = PBXBuildFile; fileRef = 21230ED81285EDAF0046E5A1 /* PBArgumentPicker.m */; };
|
||||
21230EE21285EFB20046E5A1 /* PBArgumentPickerController.m in Sources */ = {isa = PBXBuildFile; fileRef = 21230EE11285EFB20046E5A1 /* PBArgumentPickerController.m */; };
|
||||
21230F7D1285FC6A0046E5A1 /* PBCommandWithParameter.m in Sources */ = {isa = PBXBuildFile; fileRef = 21230F7C1285FC6A0046E5A1 /* PBCommandWithParameter.m */; };
|
||||
212311DD12872BF20046E5A1 /* PBGitSubmodule.m in Sources */ = {isa = PBXBuildFile; fileRef = 212311DC12872BF20046E5A1 /* PBGitSubmodule.m */; };
|
||||
2123121E128735E90046E5A1 /* submodule-notmatching-index.png in Resources */ = {isa = PBXBuildFile; fileRef = 2123121B128735E90046E5A1 /* submodule-notmatching-index.png */; };
|
||||
2123121F128735E90046E5A1 /* submodule-matching-index.png in Resources */ = {isa = PBXBuildFile; fileRef = 2123121C128735E90046E5A1 /* submodule-matching-index.png */; };
|
||||
21231220128735E90046E5A1 /* submodule-empty.png in Resources */ = {isa = PBXBuildFile; fileRef = 2123121D128735E90046E5A1 /* submodule-empty.png */; };
|
||||
2123138A128756ED0046E5A1 /* PBRemoteCommandFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = 21231389128756ED0046E5A1 /* PBRemoteCommandFactory.m */; };
|
||||
212313B5128759C00046E5A1 /* PBOpenDocumentCommand.m in Sources */ = {isa = PBXBuildFile; fileRef = 212313B4128759C00046E5A1 /* PBOpenDocumentCommand.m */; };
|
||||
212A49A312A31292009DAFAD /* renamed_file.png in Resources */ = {isa = PBXBuildFile; fileRef = 212A49A212A31292009DAFAD /* renamed_file.png */; };
|
||||
212A49A512A312B2009DAFAD /* unversioned_file.png in Resources */ = {isa = PBXBuildFile; fileRef = 212A49A412A312B2009DAFAD /* unversioned_file.png */; };
|
||||
212A49A712A312BE009DAFAD /* added_file.png in Resources */ = {isa = PBXBuildFile; fileRef = 212A49A612A312BE009DAFAD /* added_file.png */; };
|
||||
212A49AA12A31328009DAFAD /* conflicted_file.png in Resources */ = {isa = PBXBuildFile; fileRef = 212A49A812A31328009DAFAD /* conflicted_file.png */; };
|
||||
212A49AB12A31328009DAFAD /* deleted_file.png in Resources */ = {isa = PBXBuildFile; fileRef = 212A49A912A31328009DAFAD /* deleted_file.png */; };
|
||||
212A49AD12A31350009DAFAD /* ignored_file.png in Resources */ = {isa = PBXBuildFile; fileRef = 212A49AC12A31350009DAFAD /* ignored_file.png */; };
|
||||
212A49AF12A3135C009DAFAD /* modified_file.png in Resources */ = {isa = PBXBuildFile; fileRef = 212A49AE12A3135C009DAFAD /* modified_file.png */; };
|
||||
217FF0B912A1CB3300785A65 /* PBStashController.m in Sources */ = {isa = PBXBuildFile; fileRef = 217FF0B312A1CB3300785A65 /* PBStashController.m */; };
|
||||
217FF0BA12A1CB3300785A65 /* PBSubmoduleController.m in Sources */ = {isa = PBXBuildFile; fileRef = 217FF0B512A1CB3300785A65 /* PBSubmoduleController.m */; };
|
||||
217FF0BB12A1CB3300785A65 /* PBGitResetController.m in Sources */ = {isa = PBXBuildFile; fileRef = 217FF0B712A1CB3300785A65 /* PBGitResetController.m */; };
|
||||
217FF0BE12A1CB3E00785A65 /* PBRevealWithFinderCommand.m in Sources */ = {isa = PBXBuildFile; fileRef = 217FF0BC12A1CB3E00785A65 /* PBRevealWithFinderCommand.m */; };
|
||||
21CF0B24129C7ED90065B37C /* TrackableOutlineView.m in Sources */ = {isa = PBXBuildFile; fileRef = 21CF0B23129C7ED90065B37C /* TrackableOutlineView.m */; };
|
||||
310DC1D81240599E0017A0F7 /* GLFileView.m in Sources */ = {isa = PBXBuildFile; fileRef = 310DC1D71240599E0017A0F7 /* GLFileView.m */; };
|
||||
31460CD2124185BA00B90AED /* MGRecessedPopUpButtonCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 31460CA7124185BA00B90AED /* MGRecessedPopUpButtonCell.m */; };
|
||||
31460CD3124185BA00B90AED /* MGScopeBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 31460CA9124185BA00B90AED /* MGScopeBar.m */; };
|
||||
@@ -144,7 +167,6 @@
|
||||
F56ADDD90ED19F9E002AC78F /* AddBranchTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = F56ADDD70ED19F9E002AC78F /* AddBranchTemplate.png */; };
|
||||
F56ADDDA0ED19F9E002AC78F /* AddLabelTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = F56ADDD80ED19F9E002AC78F /* AddLabelTemplate.png */; };
|
||||
F56CC7320E65E0E5004307B4 /* PBGraphCellInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = F56CC7310E65E0E5004307B4 /* PBGraphCellInfo.m */; };
|
||||
F57240BB0E9678EA00D8EE66 /* deleted_file.png in Resources */ = {isa = PBXBuildFile; fileRef = F57240BA0E9678EA00D8EE66 /* deleted_file.png */; };
|
||||
F574A2850EAE2EAC003F2CB1 /* PBRefController.m in Sources */ = {isa = PBXBuildFile; fileRef = F574A2840EAE2EAC003F2CB1 /* PBRefController.m */; };
|
||||
F574A2910EAE2FF4003F2CB1 /* PBGitConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = 93FCCBA80EA8AF450061B02B /* PBGitConfig.m */; };
|
||||
F57CC3910E05DDF2000472E2 /* PBEasyPipe.m in Sources */ = {isa = PBXBuildFile; fileRef = F57CC3900E05DDF2000472E2 /* PBEasyPipe.m */; };
|
||||
@@ -258,8 +280,10 @@
|
||||
056438B60ED0C40B00985397 /* DetailViewTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = DetailViewTemplate.png; path = Images/DetailViewTemplate.png; sourceTree = "<group>"; };
|
||||
089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
|
||||
21230CAF1284B26A0046E5A1 /* PBGitSVStashItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitSVStashItem.h; sourceTree = "<group>"; };
|
||||
21230CB01284B26A0046E5A1 /* PBGitSVStashItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitSVStashItem.m; sourceTree = "<group>"; };
|
||||
21025C1012947AB200D87200 /* sourceListAction.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = sourceListAction.png; sourceTree = "<group>"; };
|
||||
21025C1112947AB200D87200 /* sourceListActionOver.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = sourceListActionOver.png; sourceTree = "<group>"; };
|
||||
21230CAF1284B26A0046E5A1 /* PBGitMenuItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitMenuItem.h; sourceTree = "<group>"; };
|
||||
21230CB01284B26A0046E5A1 /* PBGitMenuItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitMenuItem.m; sourceTree = "<group>"; };
|
||||
21230D331284C5080046E5A1 /* PBGitStash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitStash.h; sourceTree = "<group>"; };
|
||||
21230D341284C5080046E5A1 /* PBGitStash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitStash.m; sourceTree = "<group>"; };
|
||||
21230D4D1284C92E0046E5A1 /* PBPresentable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBPresentable.h; sourceTree = "<group>"; };
|
||||
@@ -271,8 +295,40 @@
|
||||
21230DA0128553120046E5A1 /* PBCommandFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCommandFactory.h; sourceTree = "<group>"; };
|
||||
21230DA81285550B0046E5A1 /* PBCommandMenuItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCommandMenuItem.h; sourceTree = "<group>"; };
|
||||
21230DA91285550B0046E5A1 /* PBCommandMenuItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCommandMenuItem.m; sourceTree = "<group>"; };
|
||||
21230DEC12855A990046E5A1 /* PBStashCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBStashCommand.h; sourceTree = "<group>"; };
|
||||
21230DED12855A990046E5A1 /* PBStashCommand.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBStashCommand.m; sourceTree = "<group>"; };
|
||||
21230ED11285EB5A0046E5A1 /* PBArgumentPicker.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PBArgumentPicker.xib; sourceTree = "<group>"; };
|
||||
21230ED71285EDAF0046E5A1 /* PBArgumentPicker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBArgumentPicker.h; sourceTree = "<group>"; };
|
||||
21230ED81285EDAF0046E5A1 /* PBArgumentPicker.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBArgumentPicker.m; sourceTree = "<group>"; };
|
||||
21230EE01285EFB20046E5A1 /* PBArgumentPickerController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBArgumentPickerController.h; sourceTree = "<group>"; };
|
||||
21230EE11285EFB20046E5A1 /* PBArgumentPickerController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBArgumentPickerController.m; sourceTree = "<group>"; };
|
||||
21230F7B1285FC6A0046E5A1 /* PBCommandWithParameter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCommandWithParameter.h; sourceTree = "<group>"; };
|
||||
21230F7C1285FC6A0046E5A1 /* PBCommandWithParameter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCommandWithParameter.m; sourceTree = "<group>"; };
|
||||
212311DB12872BF20046E5A1 /* PBGitSubmodule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitSubmodule.h; sourceTree = "<group>"; };
|
||||
212311DC12872BF20046E5A1 /* PBGitSubmodule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitSubmodule.m; sourceTree = "<group>"; };
|
||||
2123121B128735E90046E5A1 /* submodule-notmatching-index.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "submodule-notmatching-index.png"; sourceTree = "<group>"; };
|
||||
2123121C128735E90046E5A1 /* submodule-matching-index.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "submodule-matching-index.png"; sourceTree = "<group>"; };
|
||||
2123121D128735E90046E5A1 /* submodule-empty.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "submodule-empty.png"; sourceTree = "<group>"; };
|
||||
21231388128756ED0046E5A1 /* PBRemoteCommandFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBRemoteCommandFactory.h; sourceTree = "<group>"; };
|
||||
21231389128756ED0046E5A1 /* PBRemoteCommandFactory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBRemoteCommandFactory.m; sourceTree = "<group>"; };
|
||||
212313B3128759C00046E5A1 /* PBOpenDocumentCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBOpenDocumentCommand.h; sourceTree = "<group>"; };
|
||||
212313B4128759C00046E5A1 /* PBOpenDocumentCommand.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBOpenDocumentCommand.m; sourceTree = "<group>"; };
|
||||
212A49A212A31292009DAFAD /* renamed_file.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = renamed_file.png; sourceTree = "<group>"; };
|
||||
212A49A412A312B2009DAFAD /* unversioned_file.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = unversioned_file.png; sourceTree = "<group>"; };
|
||||
212A49A612A312BE009DAFAD /* added_file.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = added_file.png; sourceTree = "<group>"; };
|
||||
212A49A812A31328009DAFAD /* conflicted_file.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = conflicted_file.png; sourceTree = "<group>"; };
|
||||
212A49A912A31328009DAFAD /* deleted_file.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = deleted_file.png; sourceTree = "<group>"; };
|
||||
212A49AC12A31350009DAFAD /* ignored_file.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ignored_file.png; sourceTree = "<group>"; };
|
||||
212A49AE12A3135C009DAFAD /* modified_file.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = modified_file.png; sourceTree = "<group>"; };
|
||||
217FF0B312A1CB3300785A65 /* PBStashController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBStashController.m; sourceTree = SOURCE_ROOT; };
|
||||
217FF0B412A1CB3300785A65 /* PBStashController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBStashController.h; sourceTree = SOURCE_ROOT; };
|
||||
217FF0B512A1CB3300785A65 /* PBSubmoduleController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBSubmoduleController.m; sourceTree = "<group>"; };
|
||||
217FF0B612A1CB3300785A65 /* PBSubmoduleController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBSubmoduleController.h; sourceTree = "<group>"; };
|
||||
217FF0B712A1CB3300785A65 /* PBGitResetController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitResetController.m; sourceTree = "<group>"; };
|
||||
217FF0B812A1CB3300785A65 /* PBGitResetController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitResetController.h; sourceTree = "<group>"; };
|
||||
217FF0BC12A1CB3E00785A65 /* PBRevealWithFinderCommand.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBRevealWithFinderCommand.m; sourceTree = "<group>"; };
|
||||
217FF0BD12A1CB3E00785A65 /* PBRevealWithFinderCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBRevealWithFinderCommand.h; sourceTree = "<group>"; };
|
||||
21CF0B22129C7ED90065B37C /* TrackableOutlineView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TrackableOutlineView.h; sourceTree = "<group>"; };
|
||||
21CF0B23129C7ED90065B37C /* TrackableOutlineView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TrackableOutlineView.m; sourceTree = "<group>"; };
|
||||
21CF0B36129C80100065B37C /* CellTrackingRect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CellTrackingRect.h; sourceTree = "<group>"; };
|
||||
29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
||||
29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
|
||||
29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
|
||||
@@ -376,7 +432,7 @@
|
||||
D8E3B38110DD4E2C001096A3 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/PBCreateTagSheet.xib; sourceTree = "<group>"; };
|
||||
D8EB6168122F643E00FCCAF4 /* GitXRelativeDateFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GitXRelativeDateFormatter.h; sourceTree = "<group>"; };
|
||||
D8EB6169122F643E00FCCAF4 /* GitXRelativeDateFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GitXRelativeDateFormatter.m; sourceTree = "<group>"; };
|
||||
D8F01C4A12182F19007F729F /* GitX.sdef */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.sdef; path = GitX.sdef; sourceTree = "<group>"; };
|
||||
D8F01C4A12182F19007F729F /* GitX.sdef */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = GitX.sdef; sourceTree = "<group>"; };
|
||||
D8F01D511218A164007F729F /* NSApplication+GitXScripting.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSApplication+GitXScripting.h"; sourceTree = "<group>"; };
|
||||
D8F01D521218A164007F729F /* NSApplication+GitXScripting.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSApplication+GitXScripting.m"; sourceTree = "<group>"; };
|
||||
D8F01D841218A406007F729F /* GitX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GitX.h; sourceTree = "<group>"; };
|
||||
@@ -566,6 +622,8 @@
|
||||
080E96DDFE201D6D7F000001 /* Classes */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
21230EDF1285EF880046E5A1 /* Controller */,
|
||||
21230ED41285ED760046E5A1 /* View */,
|
||||
21230D991285524C0046E5A1 /* Commands */,
|
||||
21230D321284C4F10046E5A1 /* Model */,
|
||||
);
|
||||
@@ -614,6 +672,8 @@
|
||||
21230D331284C5080046E5A1 /* PBGitStash.h */,
|
||||
21230D341284C5080046E5A1 /* PBGitStash.m */,
|
||||
21230D4D1284C92E0046E5A1 /* PBPresentable.h */,
|
||||
212311DB12872BF20046E5A1 /* PBGitSubmodule.h */,
|
||||
212311DC12872BF20046E5A1 /* PBGitSubmodule.m */,
|
||||
);
|
||||
path = Model;
|
||||
sourceTree = "<group>";
|
||||
@@ -621,17 +681,64 @@
|
||||
21230D991285524C0046E5A1 /* Commands */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
217FF0BC12A1CB3E00785A65 /* PBRevealWithFinderCommand.m */,
|
||||
217FF0BD12A1CB3E00785A65 /* PBRevealWithFinderCommand.h */,
|
||||
21230D9A128552720046E5A1 /* PBCommand.h */,
|
||||
21230D9B128552720046E5A1 /* PBCommand.m */,
|
||||
21230DEC12855A990046E5A1 /* PBStashCommand.h */,
|
||||
21230DED12855A990046E5A1 /* PBStashCommand.m */,
|
||||
21230D9D128552FA0046E5A1 /* PBStashCommandFactory.h */,
|
||||
21230D9E128552FA0046E5A1 /* PBStashCommandFactory.m */,
|
||||
21230DA0128553120046E5A1 /* PBCommandFactory.h */,
|
||||
21230F7B1285FC6A0046E5A1 /* PBCommandWithParameter.h */,
|
||||
21230F7C1285FC6A0046E5A1 /* PBCommandWithParameter.m */,
|
||||
21231388128756ED0046E5A1 /* PBRemoteCommandFactory.h */,
|
||||
21231389128756ED0046E5A1 /* PBRemoteCommandFactory.m */,
|
||||
212313B3128759C00046E5A1 /* PBOpenDocumentCommand.h */,
|
||||
212313B4128759C00046E5A1 /* PBOpenDocumentCommand.m */,
|
||||
);
|
||||
path = Commands;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
21230ED41285ED760046E5A1 /* View */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
21230ED71285EDAF0046E5A1 /* PBArgumentPicker.h */,
|
||||
21230ED81285EDAF0046E5A1 /* PBArgumentPicker.m */,
|
||||
21CF0B22129C7ED90065B37C /* TrackableOutlineView.h */,
|
||||
21CF0B23129C7ED90065B37C /* TrackableOutlineView.m */,
|
||||
21CF0B36129C80100065B37C /* CellTrackingRect.h */,
|
||||
);
|
||||
path = View;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
21230EDF1285EF880046E5A1 /* Controller */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
217FF0B312A1CB3300785A65 /* PBStashController.m */,
|
||||
217FF0B412A1CB3300785A65 /* PBStashController.h */,
|
||||
217FF0B512A1CB3300785A65 /* PBSubmoduleController.m */,
|
||||
217FF0B612A1CB3300785A65 /* PBSubmoduleController.h */,
|
||||
217FF0B712A1CB3300785A65 /* PBGitResetController.m */,
|
||||
217FF0B812A1CB3300785A65 /* PBGitResetController.h */,
|
||||
21230EE01285EFB20046E5A1 /* PBArgumentPickerController.h */,
|
||||
21230EE11285EFB20046E5A1 /* PBArgumentPickerController.m */,
|
||||
);
|
||||
path = Controller;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
212A499412A3121D009DAFAD /* File Markers */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
212A49A812A31328009DAFAD /* conflicted_file.png */,
|
||||
212A49A912A31328009DAFAD /* deleted_file.png */,
|
||||
212A49A612A312BE009DAFAD /* added_file.png */,
|
||||
212A49A412A312B2009DAFAD /* unversioned_file.png */,
|
||||
212A49A212A31292009DAFAD /* renamed_file.png */,
|
||||
212A49AC12A31350009DAFAD /* ignored_file.png */,
|
||||
212A49AE12A3135C009DAFAD /* modified_file.png */,
|
||||
);
|
||||
path = "File Markers";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
29B97314FDCFA39411CA2CEA /* GitTest */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -659,6 +766,10 @@
|
||||
29B97315FDCFA39411CA2CEA /* Other Sources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
212A499412A3121D009DAFAD /* File Markers */,
|
||||
2123121B128735E90046E5A1 /* submodule-notmatching-index.png */,
|
||||
2123121C128735E90046E5A1 /* submodule-matching-index.png */,
|
||||
2123121D128735E90046E5A1 /* submodule-empty.png */,
|
||||
D858108011274D28007F254B /* Branch.png */,
|
||||
D858108111274D28007F254B /* RemoteBranch.png */,
|
||||
D858108211274D28007F254B /* Tag.png */,
|
||||
@@ -691,6 +802,8 @@
|
||||
29B97317FDCFA39411CA2CEA /* Resources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
21025C1012947AB200D87200 /* sourceListAction.png */,
|
||||
21025C1112947AB200D87200 /* sourceListActionOver.png */,
|
||||
02B41A5F123E307F00DFC531 /* PBCommitHookFailedSheet.xib */,
|
||||
F5F7D0641062E7940072C81C /* UpdateKey.pem */,
|
||||
F50A41130EBB872D00208746 /* Widgets */,
|
||||
@@ -712,6 +825,7 @@
|
||||
D8FDD9F511432A12005647F6 /* PBCloneRepositoryPanel.xib */,
|
||||
47DBDB680E94EF6500671A1E /* Preferences.xib */,
|
||||
F569AE920F2CBD7C00C2FFA7 /* Credits.html */,
|
||||
21230ED11285EB5A0046E5A1 /* PBArgumentPicker.xib */,
|
||||
F58DB55F10566E3900CFDF4A /* PBGitSidebarView.xib */,
|
||||
D8022FE711E124A0003C21F6 /* PBGitXMessageSheet.xib */,
|
||||
);
|
||||
@@ -835,8 +949,8 @@
|
||||
D8FDDA63114335E8005647F6 /* PBGitSVRemoteBranchItem.m */,
|
||||
D8FDDA68114335E8005647F6 /* PBGitSVTagItem.h */,
|
||||
D8FDDA69114335E8005647F6 /* PBGitSVTagItem.m */,
|
||||
21230CAF1284B26A0046E5A1 /* PBGitSVStashItem.h */,
|
||||
21230CB01284B26A0046E5A1 /* PBGitSVStashItem.m */,
|
||||
21230CAF1284B26A0046E5A1 /* PBGitMenuItem.h */,
|
||||
21230CB01284B26A0046E5A1 /* PBGitMenuItem.m */,
|
||||
D8FDDA60114335E8005647F6 /* PBGitSVOtherRevItem.h */,
|
||||
D8FDDA61114335E8005647F6 /* PBGitSVOtherRevItem.m */,
|
||||
D8FDDA5E114335E8005647F6 /* PBGitSVFolderItem.h */,
|
||||
@@ -1249,7 +1363,6 @@
|
||||
F52BCE030E84208300AA3741 /* PBGitHistoryView.xib in Resources */,
|
||||
F59116E60E843BB50072CCB1 /* PBGitCommitView.xib in Resources */,
|
||||
F5E92A230E88569500056E75 /* new_file.png in Resources */,
|
||||
F57240BB0E9678EA00D8EE66 /* deleted_file.png in Resources */,
|
||||
F5E424110EA3E4D60046E362 /* PBDiffWindow.xib in Resources */,
|
||||
F50A411F0EBB874C00208746 /* mainSplitterBar.tiff in Resources */,
|
||||
F50A41200EBB874C00208746 /* mainSplitterDimple.tiff in Resources */,
|
||||
@@ -1289,6 +1402,19 @@
|
||||
31460CD6124185BA00B90AED /* TODO in Resources */,
|
||||
02B41A60123E307F00DFC531 /* PBCommitHookFailedSheet.xib in Resources */,
|
||||
21230D821284D1CC0046E5A1 /* stash-icon.png in Resources */,
|
||||
21230ED21285EB5A0046E5A1 /* PBArgumentPicker.xib in Resources */,
|
||||
2123121E128735E90046E5A1 /* submodule-notmatching-index.png in Resources */,
|
||||
2123121F128735E90046E5A1 /* submodule-matching-index.png in Resources */,
|
||||
21231220128735E90046E5A1 /* submodule-empty.png in Resources */,
|
||||
21025C1212947AB200D87200 /* sourceListAction.png in Resources */,
|
||||
21025C1312947AB200D87200 /* sourceListActionOver.png in Resources */,
|
||||
212A49A312A31292009DAFAD /* renamed_file.png in Resources */,
|
||||
212A49A512A312B2009DAFAD /* unversioned_file.png in Resources */,
|
||||
212A49A712A312BE009DAFAD /* added_file.png in Resources */,
|
||||
212A49AA12A31328009DAFAD /* conflicted_file.png in Resources */,
|
||||
212A49AB12A31328009DAFAD /* deleted_file.png in Resources */,
|
||||
212A49AD12A31350009DAFAD /* ignored_file.png in Resources */,
|
||||
212A49AF12A3135C009DAFAD /* modified_file.png in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -1442,12 +1568,22 @@
|
||||
31460CD2124185BA00B90AED /* MGRecessedPopUpButtonCell.m in Sources */,
|
||||
31460CD3124185BA00B90AED /* MGScopeBar.m in Sources */,
|
||||
02B41A5E123E307200DFC531 /* PBCommitHookFailedSheet.m in Sources */,
|
||||
21230CB11284B26A0046E5A1 /* PBGitSVStashItem.m in Sources */,
|
||||
21230CB11284B26A0046E5A1 /* PBGitMenuItem.m in Sources */,
|
||||
21230D351284C5080046E5A1 /* PBGitStash.m in Sources */,
|
||||
21230D9C128552720046E5A1 /* PBCommand.m in Sources */,
|
||||
21230D9F128552FA0046E5A1 /* PBStashCommandFactory.m in Sources */,
|
||||
21230DAA1285550B0046E5A1 /* PBCommandMenuItem.m in Sources */,
|
||||
21230DEE12855A990046E5A1 /* PBStashCommand.m in Sources */,
|
||||
21230ED91285EDAF0046E5A1 /* PBArgumentPicker.m in Sources */,
|
||||
21230EE21285EFB20046E5A1 /* PBArgumentPickerController.m in Sources */,
|
||||
21230F7D1285FC6A0046E5A1 /* PBCommandWithParameter.m in Sources */,
|
||||
212311DD12872BF20046E5A1 /* PBGitSubmodule.m in Sources */,
|
||||
2123138A128756ED0046E5A1 /* PBRemoteCommandFactory.m in Sources */,
|
||||
212313B5128759C00046E5A1 /* PBOpenDocumentCommand.m in Sources */,
|
||||
21CF0B24129C7ED90065B37C /* TrackableOutlineView.m in Sources */,
|
||||
217FF0B912A1CB3300785A65 /* PBStashController.m in Sources */,
|
||||
217FF0BA12A1CB3300785A65 /* PBSubmoduleController.m in Sources */,
|
||||
217FF0BB12A1CB3300785A65 /* PBGitResetController.m in Sources */,
|
||||
217FF0BE12A1CB3E00785A65 /* PBRevealWithFinderCommand.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
||||
@@ -41,11 +41,15 @@
|
||||
#pragma mark Presentable
|
||||
|
||||
- (NSString *) displayDescription {
|
||||
return self.name;
|
||||
return [NSString stringWithFormat:@"%@ (%@)", self.message, self.name];
|
||||
}
|
||||
|
||||
- (NSString *) popupDescription {
|
||||
return [self description];
|
||||
}
|
||||
|
||||
- (NSImage *) icon {
|
||||
return [NSImage imageNamed:@"stash-icon.png"];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
//
|
||||
// PBGitSubmodule.h
|
||||
// GitX
|
||||
//
|
||||
// Created by Tomasz Krasnyk on 10-11-07.
|
||||
// Copyright 2010 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "PBPresentable.h"
|
||||
|
||||
typedef enum {
|
||||
PBGitSubmoduleStateNotInitialized,
|
||||
PBGitSubmoduleStateMatchingIndex,
|
||||
PBGitSubmoduleStateDoesNotMatchIndex,
|
||||
} PBGitSubmoduleState;
|
||||
|
||||
@interface PBGitSubmodule : NSObject<PBPresentable> {
|
||||
NSString *name;
|
||||
NSString *path;
|
||||
NSString *checkedOutCommit;
|
||||
|
||||
PBGitSubmoduleState submoduleState;
|
||||
|
||||
NSMutableArray *submodules;
|
||||
}
|
||||
@property (nonatomic, retain, readonly) NSMutableArray *submodules;
|
||||
@property (nonatomic, assign, readonly) PBGitSubmoduleState submoduleState;
|
||||
@property (nonatomic, retain, readonly) NSString *name;
|
||||
@property (nonatomic, retain, readonly) NSString *path;
|
||||
@property (nonatomic, retain, readonly) NSString *checkedOutCommit;
|
||||
|
||||
- (id) initWithRawSubmoduleStatusString:(NSString *) submoduleStatusString;
|
||||
|
||||
+ (NSImage *) imageForSubmoduleState:(PBGitSubmoduleState) state;
|
||||
+ (PBGitSubmoduleState) submoduleStateFromCharacter:(unichar) character;
|
||||
|
||||
- (void) addSubmodule:(PBGitSubmodule *) submodule;
|
||||
@end
|
||||
@@ -0,0 +1,126 @@
|
||||
//
|
||||
// PBGitSubmodule.m
|
||||
// GitX
|
||||
//
|
||||
// Created by Tomasz Krasnyk on 10-11-07.
|
||||
// Copyright 2010 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#import "PBGitSubmodule.h"
|
||||
|
||||
@interface PBGitSubmodule()
|
||||
@property (nonatomic, retain) NSString *name;
|
||||
@property (nonatomic, retain) NSString *path;
|
||||
@property (nonatomic, retain) NSString *checkedOutCommit;
|
||||
@end
|
||||
|
||||
|
||||
@implementation PBGitSubmodule
|
||||
@synthesize name;
|
||||
@synthesize path;
|
||||
@synthesize checkedOutCommit;
|
||||
@synthesize submoduleState;
|
||||
@synthesize submodules;
|
||||
|
||||
- (NSMutableArray *) submodules {
|
||||
if (!submodules) {
|
||||
submodules = [[NSMutableArray alloc] init];
|
||||
}
|
||||
return submodules;
|
||||
}
|
||||
|
||||
- (id) initWithRawSubmoduleStatusString:(NSString *) submoduleStatusString {
|
||||
NSParameterAssert([submoduleStatusString length] > 0);
|
||||
|
||||
if (self = [super init]) {
|
||||
unichar status = [submoduleStatusString characterAtIndex:0];
|
||||
submoduleState = [PBGitSubmodule submoduleStateFromCharacter:status];
|
||||
NSScanner *scanner = [NSScanner scannerWithString:[submoduleStatusString substringFromIndex:1]];
|
||||
NSString *sha1 = nil;
|
||||
NSString *fullPath = nil;
|
||||
NSString *coName = nil;
|
||||
BOOL shouldContinue = [scanner scanUpToString:@" " intoString:&sha1];
|
||||
if (shouldContinue) {
|
||||
shouldContinue = [scanner scanUpToString:@"(" intoString:&fullPath];
|
||||
}
|
||||
if (shouldContinue) {
|
||||
shouldContinue = [scanner scanString:@"(" intoString:NULL];
|
||||
}
|
||||
if (shouldContinue) {
|
||||
shouldContinue = [scanner scanUpToString:@")" intoString:&coName];
|
||||
}
|
||||
self.path = [fullPath stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
|
||||
coName = [coName stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
|
||||
self.checkedOutCommit = [coName length] > 0 ? coName : nil;
|
||||
self.name = [self.path lastPathComponent];
|
||||
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void) dealloc {
|
||||
[submodules release];
|
||||
[name release];
|
||||
[path release];
|
||||
[checkedOutCommit release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (void) addSubmodule:(PBGitSubmodule *) submodule {
|
||||
[self.submodules addObject:submodule];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Presentable
|
||||
|
||||
- (NSImage *) icon {
|
||||
return [PBGitSubmodule imageForSubmoduleState:self.submoduleState];
|
||||
}
|
||||
|
||||
- (NSString *) displayDescription {
|
||||
NSMutableString *result = [[NSMutableString alloc] initWithString:self.name];
|
||||
if (self.checkedOutCommit) {
|
||||
[result appendFormat:@" (%@)", self.checkedOutCommit];
|
||||
}
|
||||
return [result autorelease];
|
||||
}
|
||||
|
||||
- (NSString *) popupDescription {
|
||||
return [self description];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Private
|
||||
|
||||
+ (NSImage *) imageForSubmoduleState:(PBGitSubmoduleState) state {
|
||||
NSString *imageName = nil;
|
||||
|
||||
if (state == PBGitSubmoduleStateMatchingIndex) {
|
||||
imageName = @"submodule-matching-index.png";
|
||||
} else if (state == PBGitSubmoduleStateNotInitialized) {
|
||||
imageName = @"submodule-empty.png";
|
||||
} else if (state == PBGitSubmoduleStateDoesNotMatchIndex) {
|
||||
imageName = @"submodule-notmatching-index.png";
|
||||
}
|
||||
|
||||
return [NSImage imageNamed:imageName];
|
||||
}
|
||||
|
||||
+ (PBGitSubmoduleState) submoduleStateFromCharacter:(unichar) character {
|
||||
PBGitSubmoduleState state = PBGitSubmoduleStateMatchingIndex;
|
||||
if (character == '-') {
|
||||
state = PBGitSubmoduleStateNotInitialized;
|
||||
} else if (character == '+') {
|
||||
state = PBGitSubmoduleStateDoesNotMatchIndex;
|
||||
} else if (character != ' ') {
|
||||
NSAssert1(NO, @"Ooops unsupported submodule status character: %c", character);
|
||||
}
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
- (NSString *) description {
|
||||
return [NSString stringWithFormat:@"[SUBMODULE] %@(%@) %@", self.name, self.path, self.checkedOutCommit];
|
||||
}
|
||||
@end
|
||||
@@ -7,7 +7,8 @@
|
||||
//
|
||||
|
||||
|
||||
@protocol PBPresentable
|
||||
@protocol PBPresentable<NSObject>
|
||||
- (NSImage *) icon;
|
||||
- (NSString *) displayDescription;
|
||||
- (NSString *) popupDescription;
|
||||
@end
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
typedef enum {
|
||||
NEW,
|
||||
MODIFIED,
|
||||
DELETED
|
||||
DELETED,
|
||||
ADDED
|
||||
} PBChangedFileStatus;
|
||||
|
||||
@interface PBChangedFile : NSObject {
|
||||
@@ -35,5 +36,6 @@ typedef enum {
|
||||
- (NSImage *)icon;
|
||||
- (NSString *)indexInfo;
|
||||
|
||||
+ (NSImage *) iconForStatus:(PBChangedFileStatus) aStatus;
|
||||
- (id) initWithPath:(NSString *)p;
|
||||
@end
|
||||
|
||||
@@ -31,24 +31,31 @@
|
||||
return [NSString stringWithFormat:@"%@ %@\t%@\0", self.commitBlobMode, self.commitBlobSHA, self.path];
|
||||
}
|
||||
|
||||
- (NSImage *) icon
|
||||
{
|
||||
+ (NSImage *) iconForStatus:(PBChangedFileStatus) aStatus {
|
||||
NSString *filename;
|
||||
switch (status) {
|
||||
switch (aStatus) {
|
||||
case NEW:
|
||||
filename = @"new_file";
|
||||
filename = @"unversioned_file";
|
||||
break;
|
||||
case DELETED:
|
||||
filename = @"deleted_file";
|
||||
break;
|
||||
case ADDED:
|
||||
filename = @"added_file";
|
||||
break;
|
||||
default:
|
||||
filename = @"empty_file";
|
||||
filename = @"modified_file";
|
||||
break;
|
||||
}
|
||||
NSString *p = [[NSBundle mainBundle] pathForResource:filename ofType:@"png"];
|
||||
return [[NSImage alloc] initByReferencingFile: p];
|
||||
}
|
||||
|
||||
- (NSImage *) icon
|
||||
{
|
||||
return [PBChangedFile iconForStatus:status];
|
||||
}
|
||||
|
||||
+ (BOOL)isSelectorExcludedFromWebScript:(SEL)aSelector
|
||||
{
|
||||
return NO;
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
super.title = [aCommand displayName];
|
||||
[self setTarget:aCommand];
|
||||
[self setAction:@selector(invoke)];
|
||||
[self setEnabled:[aCommand canBeFired]];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
@@ -22,13 +22,12 @@
|
||||
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.origin.x = padding + lineWidth;
|
||||
line.origin.y = 0;
|
||||
line.size.width = 1;
|
||||
line.size.height = aRect.size.height;
|
||||
line.size.height = [self bounds].size.height;
|
||||
NSRectFill(line);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
diffCommit = [startCommit.repository headCommit];
|
||||
|
||||
NSString *commitSelector = [NSString stringWithFormat:@"%@..%@", [startCommit realSha], [diffCommit realSha]];
|
||||
NSMutableArray *arguments = [NSMutableArray arrayWithObjects:@"diff", commitSelector, nil];
|
||||
NSMutableArray *arguments = [NSMutableArray arrayWithObjects:@"diff", @"--no-ext-diff", commitSelector, nil];
|
||||
|
||||
if (![PBGitDefaults showWhitespaceDifferences])
|
||||
[arguments insertObject:@"-w" atIndex:1];
|
||||
|
||||
@@ -18,9 +18,17 @@
|
||||
|
||||
+ (NSTask *) taskForCommand:(NSString *)cmd withArgs:(NSArray *)args inDir:(NSString *)dir
|
||||
{
|
||||
NSMutableArray *filteredArguments = [[NSMutableArray alloc] init];
|
||||
for (NSString *param in args) {
|
||||
if ([param length] > 0) {
|
||||
[filteredArguments addObject:param];
|
||||
}
|
||||
}
|
||||
|
||||
NSTask* task = [[NSTask alloc] init];
|
||||
[task setLaunchPath:cmd];
|
||||
[task setArguments:args];
|
||||
[task setArguments:filteredArguments];
|
||||
[filteredArguments release];
|
||||
if (dir)
|
||||
[task setCurrentDirectoryPath:dir];
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#import "PBViewController.h"
|
||||
|
||||
@class PBGitIndexController, PBIconAndTextCell, PBWebChangesController, PBGitIndex;
|
||||
@class PBNiceSplitView;
|
||||
|
||||
@interface PBGitCommitController : PBViewController {
|
||||
// This might have to transfer over to the PBGitRepository
|
||||
@@ -23,6 +24,7 @@
|
||||
|
||||
IBOutlet PBGitIndexController *indexController;
|
||||
IBOutlet PBWebChangesController *webController;
|
||||
IBOutlet PBNiceSplitView *commitSplitView;
|
||||
}
|
||||
|
||||
@property(readonly) PBGitIndex *index;
|
||||
|
||||
@@ -11,6 +11,10 @@
|
||||
#import "PBChangedFile.h"
|
||||
#import "PBWebChangesController.h"
|
||||
#import "PBGitIndex.h"
|
||||
#import "PBNiceSplitView.h"
|
||||
|
||||
|
||||
#define kCommitSplitViewPositionDefault @"Commit SplitView Position"
|
||||
|
||||
@interface PBGitCommitController ()
|
||||
- (void)refreshFinished:(NSNotification *)notification;
|
||||
@@ -22,6 +26,7 @@
|
||||
- (void)amendCommit:(NSNotification *)notification;
|
||||
- (void)indexChanged:(NSNotification *)notification;
|
||||
- (void)indexOperationFailed:(NSNotification *)notification;
|
||||
- (void)saveCommitSplitViewPosition;
|
||||
@end
|
||||
|
||||
@implementation PBGitCommitController
|
||||
@@ -65,10 +70,14 @@
|
||||
|
||||
[cachedFilesController setAutomaticallyRearrangesObjects:NO];
|
||||
[unstagedFilesController setAutomaticallyRearrangesObjects:NO];
|
||||
|
||||
[commitSplitView setHidden:YES];
|
||||
[self performSelector:@selector(restoreCommitSplitViewPositiion) withObject:nil afterDelay:0];
|
||||
}
|
||||
|
||||
- (void)closeView
|
||||
{
|
||||
[self saveCommitSplitViewPosition];
|
||||
[webController closeView];
|
||||
}
|
||||
|
||||
@@ -211,4 +220,78 @@
|
||||
[[repository windowController] showMessageSheet:@"Index operation failed" infoText:[[notification userInfo] objectForKey:@"description"]];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark NSSplitView delegate methods
|
||||
|
||||
#define kCommitSplitViewTopViewMin 150
|
||||
#define kCommitSplitViewBottomViewMin 100
|
||||
|
||||
- (CGFloat)splitView:(NSSplitView *)splitView constrainMinCoordinate:(CGFloat)proposedMin ofSubviewAt:(NSInteger)dividerIndex
|
||||
{
|
||||
if (splitView == commitSplitView)
|
||||
return kCommitSplitViewTopViewMin;
|
||||
|
||||
return proposedMin;
|
||||
}
|
||||
|
||||
- (CGFloat)splitView:(NSSplitView *)splitView constrainMaxCoordinate:(CGFloat)proposedMax ofSubviewAt:(NSInteger)dividerIndex
|
||||
{
|
||||
if (splitView == commitSplitView)
|
||||
return [splitView frame].size.height - [splitView dividerThickness] - kCommitSplitViewBottomViewMin;
|
||||
|
||||
return proposedMax;
|
||||
}
|
||||
|
||||
// while the user resizes the window keep the lower (changes/message) view constant and just resize the upper view
|
||||
// unless the upper view gets too small
|
||||
- (void)resizeCommitSplitView
|
||||
{
|
||||
NSRect newFrame = [commitSplitView frame];
|
||||
|
||||
float dividerThickness = [commitSplitView dividerThickness];
|
||||
|
||||
NSView *upperView = [[commitSplitView subviews] objectAtIndex:0];
|
||||
NSRect upperFrame = [upperView frame];
|
||||
upperFrame.size.width = newFrame.size.width;
|
||||
|
||||
NSView *lowerView = [[commitSplitView subviews] objectAtIndex:1];
|
||||
NSRect lowerFrame = [lowerView frame];
|
||||
lowerFrame.size.width = newFrame.size.width;
|
||||
|
||||
upperFrame.size.height = newFrame.size.height - lowerFrame.size.height - dividerThickness;
|
||||
if (upperFrame.size.height < kCommitSplitViewTopViewMin)
|
||||
upperFrame.size.height = kCommitSplitViewTopViewMin;
|
||||
|
||||
lowerFrame.size.height = newFrame.size.height - upperFrame.size.height - dividerThickness;
|
||||
lowerFrame.origin.y = newFrame.size.height - lowerFrame.size.height;
|
||||
|
||||
[upperView setFrame:upperFrame];
|
||||
[lowerView setFrame:lowerFrame];
|
||||
}
|
||||
|
||||
- (void)splitView:(NSSplitView *)splitView resizeSubviewsWithOldSize:(NSSize)oldSize
|
||||
{
|
||||
if (splitView == commitSplitView)
|
||||
[self resizeCommitSplitView];
|
||||
}
|
||||
|
||||
// NSSplitView does not save and restore the position of the splitView correctly so do it manually
|
||||
- (void)saveCommitSplitViewPosition
|
||||
{
|
||||
float position = [[[commitSplitView subviews] objectAtIndex:0] frame].size.height;
|
||||
[[NSUserDefaults standardUserDefaults] setFloat:position forKey:kCommitSplitViewPositionDefault];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
}
|
||||
|
||||
// make sure this happens after awakeFromNib
|
||||
- (void)restoreCommitSplitViewPositiion
|
||||
{
|
||||
float position = [[NSUserDefaults standardUserDefaults] floatForKey:kCommitSplitViewPositionDefault];
|
||||
if (position < 1.0)
|
||||
position = [commitSplitView frame].size.height - 225;
|
||||
|
||||
[commitSplitView setPosition:position ofDividerAtIndex:0];
|
||||
[commitSplitView setHidden:NO];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1050</int>
|
||||
<string key="IBDocument.SystemVersion">10C540</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">762</string>
|
||||
<string key="IBDocument.AppKitVersion">1038.25</string>
|
||||
<string key="IBDocument.HIToolboxVersion">458.00</string>
|
||||
<string key="IBDocument.SystemVersion">10H574</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">804</string>
|
||||
<string key="IBDocument.AppKitVersion">1038.35</string>
|
||||
<string key="IBDocument.HIToolboxVersion">461.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
@@ -15,13 +15,12 @@
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>762</string>
|
||||
<string>762</string>
|
||||
<string>804</string>
|
||||
<string>804</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<integer value="1"/>
|
||||
</object>
|
||||
<object class="NSArray" key="IBDocument.PluginDependencies">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
@@ -84,6 +83,7 @@
|
||||
</object>
|
||||
<string key="NSFrameSize">{852, 181}</string>
|
||||
<reference key="NSSuperview" ref="812432808"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
<string key="FrameName"/>
|
||||
<string key="GroupName"/>
|
||||
@@ -138,6 +138,7 @@
|
||||
<int key="NSvFlags">4352</int>
|
||||
<string key="NSFrameSize">{189, 221}</string>
|
||||
<reference key="NSSuperview" ref="614437325"/>
|
||||
<reference key="NSWindow"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="_NSCornerView" key="NSCornerView">
|
||||
<nil key="NSNextResponder"/>
|
||||
@@ -230,6 +231,7 @@
|
||||
</object>
|
||||
<string key="NSFrame">{{1, 1}, {189, 221}}</string>
|
||||
<reference key="NSSuperview" ref="563607114"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="588180404"/>
|
||||
<reference key="NSDocView" ref="588180404"/>
|
||||
<reference key="NSBGColor" ref="520920468"/>
|
||||
@@ -240,6 +242,7 @@
|
||||
<int key="NSvFlags">-2147483392</int>
|
||||
<string key="NSFrame">{{174, 1}, {15, 178}}</string>
|
||||
<reference key="NSSuperview" ref="563607114"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSTarget" ref="563607114"/>
|
||||
<string key="NSAction">_doScroller:</string>
|
||||
<double key="NSPercent">0.99337750000000002</double>
|
||||
@@ -249,6 +252,7 @@
|
||||
<int key="NSvFlags">-2147483392</int>
|
||||
<string key="NSFrame">{{1, 179}, {173, 15}}</string>
|
||||
<reference key="NSSuperview" ref="563607114"/>
|
||||
<reference key="NSWindow"/>
|
||||
<int key="NSsFlags">1</int>
|
||||
<reference key="NSTarget" ref="563607114"/>
|
||||
<string key="NSAction">_doScroller:</string>
|
||||
@@ -257,6 +261,7 @@
|
||||
</object>
|
||||
<string key="NSFrame">{{-1, -1}, {191, 223}}</string>
|
||||
<reference key="NSSuperview" ref="663963274"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="614437325"/>
|
||||
<int key="NSsFlags">562</int>
|
||||
<reference key="NSVScroller" ref="187271467"/>
|
||||
@@ -267,10 +272,12 @@
|
||||
</object>
|
||||
<string key="NSFrameSize">{190, 227}</string>
|
||||
<reference key="NSSuperview" ref="208180574"/>
|
||||
<reference key="NSWindow"/>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrameSize">{190, 242}</string>
|
||||
<reference key="NSSuperview" ref="217294340"/>
|
||||
<reference key="NSWindow"/>
|
||||
<string key="NSOffsets">{0, 0}</string>
|
||||
<object class="NSTextFieldCell" key="NSTitleCell">
|
||||
<int key="NSCellFlags">67239424</int>
|
||||
@@ -309,6 +316,7 @@
|
||||
<int key="NSvFlags">289</int>
|
||||
<string key="NSFrame">{{339, 0}, {96, 32}}</string>
|
||||
<reference key="NSSuperview" ref="154221104"/>
|
||||
<reference key="NSWindow"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="767461980">
|
||||
<int key="NSCellFlags">67239424</int>
|
||||
@@ -321,7 +329,7 @@
|
||||
</object>
|
||||
<reference key="NSControlView" ref="792511503"/>
|
||||
<int key="NSButtonFlags">-2038284033</int>
|
||||
<int key="NSButtonFlags2">301990017</int>
|
||||
<int key="NSButtonFlags2">268435585</int>
|
||||
<string key="NSAlternateContents"/>
|
||||
<string type="base64-UTF8" key="NSKeyEquivalent">DQ</string>
|
||||
<int key="NSPeriodicDelay">200</int>
|
||||
@@ -365,8 +373,9 @@
|
||||
<string>public.url</string>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrameSize">{427, 41}</string>
|
||||
<string key="NSFrame">{{0, 27}, {427, 14}}</string>
|
||||
<reference key="NSSuperview" ref="245211955"/>
|
||||
<reference key="NSWindow"/>
|
||||
<object class="NSTextContainer" key="NSTextContainer" id="311869542">
|
||||
<object class="NSLayoutManager" key="NSLayoutManager">
|
||||
<object class="NSTextStorage" key="NSTextStorage">
|
||||
@@ -441,6 +450,7 @@
|
||||
</object>
|
||||
<string key="NSFrame">{{1, 1}, {427, 184}}</string>
|
||||
<reference key="NSSuperview" ref="227052526"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="1023793991"/>
|
||||
<reference key="NSDocView" ref="1023793991"/>
|
||||
<reference key="NSBGColor" ref="818038086"/>
|
||||
@@ -455,6 +465,7 @@
|
||||
<int key="NSvFlags">-2147483392</int>
|
||||
<string key="NSFrame">{{346, 1}, {15, 164}}</string>
|
||||
<reference key="NSSuperview" ref="227052526"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSTarget" ref="227052526"/>
|
||||
<string key="NSAction">_doScroller:</string>
|
||||
<double key="NSPercent">0.99166670000000001</double>
|
||||
@@ -464,6 +475,7 @@
|
||||
<int key="NSvFlags">-2147483392</int>
|
||||
<string key="NSFrame">{{-100, -100}, {87, 18}}</string>
|
||||
<reference key="NSSuperview" ref="227052526"/>
|
||||
<reference key="NSWindow"/>
|
||||
<int key="NSsFlags">1</int>
|
||||
<reference key="NSTarget" ref="227052526"/>
|
||||
<string key="NSAction">_doScroller:</string>
|
||||
@@ -473,6 +485,7 @@
|
||||
</object>
|
||||
<string key="NSFrame">{{0, 36}, {429, 186}}</string>
|
||||
<reference key="NSSuperview" ref="154221104"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="245211955"/>
|
||||
<int key="NSsFlags">530</int>
|
||||
<reference key="NSVScroller" ref="20200144"/>
|
||||
@@ -484,6 +497,7 @@
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{-2, 9}, {82, 18}}</string>
|
||||
<reference key="NSSuperview" ref="154221104"/>
|
||||
<reference key="NSWindow"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="475684116">
|
||||
<int key="NSCellFlags">-2080244224</int>
|
||||
@@ -511,6 +525,7 @@
|
||||
<int key="NSvFlags">289</int>
|
||||
<string key="NSFrame">{{243, 0}, {96, 32}}</string>
|
||||
<reference key="NSSuperview" ref="154221104"/>
|
||||
<reference key="NSWindow"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="964972443">
|
||||
<int key="NSCellFlags">67239424</int>
|
||||
@@ -529,10 +544,12 @@
|
||||
</object>
|
||||
<string key="NSFrameSize">{429, 227}</string>
|
||||
<reference key="NSSuperview" ref="635871052"/>
|
||||
<reference key="NSWindow"/>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrame">{{199, 0}, {429, 242}}</string>
|
||||
<reference key="NSSuperview" ref="217294340"/>
|
||||
<reference key="NSWindow"/>
|
||||
<string key="NSOffsets">{0, 0}</string>
|
||||
<object class="NSTextFieldCell" key="NSTitleCell">
|
||||
<int key="NSCellFlags">67239424</int>
|
||||
@@ -576,6 +593,7 @@
|
||||
<int key="NSvFlags">4352</int>
|
||||
<string key="NSFrameSize">{214, 221}</string>
|
||||
<reference key="NSSuperview" ref="551030904"/>
|
||||
<reference key="NSWindow"/>
|
||||
<int key="NSTag">1</int>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="_NSCornerView" key="NSCornerView">
|
||||
@@ -629,6 +647,7 @@
|
||||
</object>
|
||||
<string key="NSFrame">{{1, 1}, {214, 221}}</string>
|
||||
<reference key="NSSuperview" ref="617511385"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="638535043"/>
|
||||
<reference key="NSDocView" ref="638535043"/>
|
||||
<reference key="NSBGColor" ref="520920468"/>
|
||||
@@ -639,6 +658,7 @@
|
||||
<int key="NSvFlags">-2147483392</int>
|
||||
<string key="NSFrame">{{257, 1}, {15, 246}}</string>
|
||||
<reference key="NSSuperview" ref="617511385"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSTarget" ref="617511385"/>
|
||||
<string key="NSAction">_doScroller:</string>
|
||||
<double key="NSPercent">0.99519230000000003</double>
|
||||
@@ -648,6 +668,7 @@
|
||||
<int key="NSvFlags">-2147483392</int>
|
||||
<string key="NSFrame">{{1, 247}, {256, 15}}</string>
|
||||
<reference key="NSSuperview" ref="617511385"/>
|
||||
<reference key="NSWindow"/>
|
||||
<int key="NSsFlags">1</int>
|
||||
<reference key="NSTarget" ref="617511385"/>
|
||||
<string key="NSAction">_doScroller:</string>
|
||||
@@ -656,6 +677,7 @@
|
||||
</object>
|
||||
<string key="NSFrame">{{0, -1}, {216, 223}}</string>
|
||||
<reference key="NSSuperview" ref="559277910"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="551030904"/>
|
||||
<int key="NSsFlags">562</int>
|
||||
<reference key="NSVScroller" ref="64334438"/>
|
||||
@@ -666,10 +688,12 @@
|
||||
</object>
|
||||
<string key="NSFrameSize">{215, 227}</string>
|
||||
<reference key="NSSuperview" ref="955377287"/>
|
||||
<reference key="NSWindow"/>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrame">{{637, 0}, {215, 242}}</string>
|
||||
<reference key="NSSuperview" ref="217294340"/>
|
||||
<reference key="NSWindow"/>
|
||||
<string key="NSOffsets">{0, 0}</string>
|
||||
<object class="NSTextFieldCell" key="NSTitleCell">
|
||||
<int key="NSCellFlags">67239424</int>
|
||||
@@ -691,16 +715,17 @@
|
||||
</object>
|
||||
<string key="NSFrame">{{0, 190}, {852, 242}}</string>
|
||||
<reference key="NSSuperview" ref="812432808"/>
|
||||
<reference key="NSWindow"/>
|
||||
<bool key="NSIsVertical">YES</bool>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrameSize">{852, 432}</string>
|
||||
<reference key="NSSuperview" ref="750704519"/>
|
||||
<string key="NSAutosaveName">CommitViewSplitView</string>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrameSize">{852, 432}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSWindow"/>
|
||||
<string key="NSClassName">NSView</string>
|
||||
</object>
|
||||
<object class="NSUserDefaultsController" id="58425690">
|
||||
@@ -1031,6 +1056,22 @@
|
||||
</object>
|
||||
<int key="connectionID">307</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">delegate</string>
|
||||
<reference key="source" ref="812432808"/>
|
||||
<reference key="destination" ref="1001"/>
|
||||
</object>
|
||||
<int key="connectionID">313</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">commitSplitView</string>
|
||||
<reference key="source" ref="1001"/>
|
||||
<reference key="destination" ref="812432808"/>
|
||||
</object>
|
||||
<int key="connectionID">314</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
<object class="NSArray" key="orderedObjects">
|
||||
@@ -1360,7 +1401,7 @@
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>{{1091, 655}, {852, 432}}</string>
|
||||
<string>{{393, 574}, {852, 432}}</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<integer value="0"/>
|
||||
<integer value="0"/>
|
||||
@@ -1419,11 +1460,18 @@
|
||||
</object>
|
||||
</object>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">311</int>
|
||||
<int key="maxID">314</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSApplication</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">NSApplication+GitXScripting.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">PBCommitMessageView</string>
|
||||
<string key="superclassName">NSTextView</string>
|
||||
@@ -1448,6 +1496,7 @@
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>commit:</string>
|
||||
<string>forceCommit:</string>
|
||||
<string>refresh:</string>
|
||||
<string>signOff:</string>
|
||||
</object>
|
||||
@@ -1456,6 +1505,36 @@
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
<string>id</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="actionInfosByName">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>commit:</string>
|
||||
<string>forceCommit:</string>
|
||||
<string>refresh:</string>
|
||||
<string>signOff:</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">commit:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">forceCommit:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">refresh:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">signOff:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="outlets">
|
||||
@@ -1465,6 +1544,7 @@
|
||||
<string>cachedFilesController</string>
|
||||
<string>commitButton</string>
|
||||
<string>commitMessageView</string>
|
||||
<string>commitSplitView</string>
|
||||
<string>indexController</string>
|
||||
<string>unstagedFilesController</string>
|
||||
<string>webController</string>
|
||||
@@ -1474,11 +1554,56 @@
|
||||
<string>NSArrayController</string>
|
||||
<string>NSButton</string>
|
||||
<string>NSTextView</string>
|
||||
<string>PBNiceSplitView</string>
|
||||
<string>PBGitIndexController</string>
|
||||
<string>NSArrayController</string>
|
||||
<string>PBWebChangesController</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>cachedFilesController</string>
|
||||
<string>commitButton</string>
|
||||
<string>commitMessageView</string>
|
||||
<string>commitSplitView</string>
|
||||
<string>indexController</string>
|
||||
<string>unstagedFilesController</string>
|
||||
<string>webController</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">cachedFilesController</string>
|
||||
<string key="candidateClassName">NSArrayController</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">commitButton</string>
|
||||
<string key="candidateClassName">NSButton</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">commitMessageView</string>
|
||||
<string key="candidateClassName">NSTextView</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">commitSplitView</string>
|
||||
<string key="candidateClassName">PBNiceSplitView</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">indexController</string>
|
||||
<string key="candidateClassName">PBGitIndexController</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">unstagedFilesController</string>
|
||||
<string key="candidateClassName">NSArrayController</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">webController</string>
|
||||
<string key="candidateClassName">PBWebChangesController</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">PBGitCommitController.h</string>
|
||||
@@ -1500,6 +1625,25 @@
|
||||
<string>NSTableView</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="actionInfosByName">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>rowClicked:</string>
|
||||
<string>tableClicked:</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">rowClicked:</string>
|
||||
<string key="candidateClassName">NSCell</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">tableClicked:</string>
|
||||
<string key="candidateClassName">NSTableView</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="outlets">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
@@ -1519,6 +1663,40 @@
|
||||
<string>NSTableView</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>commitController</string>
|
||||
<string>stagedFilesController</string>
|
||||
<string>stagedTable</string>
|
||||
<string>unstagedFilesController</string>
|
||||
<string>unstagedTable</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">commitController</string>
|
||||
<string key="candidateClassName">PBGitCommitController</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">stagedFilesController</string>
|
||||
<string key="candidateClassName">NSArrayController</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">stagedTable</string>
|
||||
<string key="candidateClassName">NSTableView</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">unstagedFilesController</string>
|
||||
<string key="candidateClassName">NSArrayController</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">unstagedTable</string>
|
||||
<string key="candidateClassName">NSTableView</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">PBGitIndexController.h</string>
|
||||
@@ -1547,6 +1725,13 @@
|
||||
<string key="NS.key.0">refresh:</string>
|
||||
<string key="NS.object.0">id</string>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="actionInfosByName">
|
||||
<string key="NS.key.0">refresh:</string>
|
||||
<object class="IBActionInfo" key="NS.object.0">
|
||||
<string key="name">refresh:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">PBViewController.h</string>
|
||||
@@ -1572,6 +1757,35 @@
|
||||
<string>NSArrayController</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>cachedFilesController</string>
|
||||
<string>controller</string>
|
||||
<string>indexController</string>
|
||||
<string>unstagedFilesController</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">cachedFilesController</string>
|
||||
<string key="candidateClassName">NSArrayController</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">controller</string>
|
||||
<string key="candidateClassName">PBGitCommitController</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">indexController</string>
|
||||
<string key="candidateClassName">PBGitIndexController</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">unstagedFilesController</string>
|
||||
<string key="candidateClassName">NSArrayController</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">PBWebChangesController.h</string>
|
||||
@@ -1593,6 +1807,25 @@
|
||||
<string>WebView</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>repository</string>
|
||||
<string>view</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">repository</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">view</string>
|
||||
<string key="candidateClassName">WebView</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">PBWebController.h</string>
|
||||
@@ -1976,6 +2209,34 @@
|
||||
<string key="minorKey">Foundation.framework/Headers/NSURLDownload.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">QuartzCore.framework/Headers/CAAnimation.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">QuartzCore.framework/Headers/CALayer.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">QuartzCore.framework/Headers/CIImageProvider.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">ScriptingBridge.framework/Headers/SBApplication.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
@@ -2185,6 +2446,13 @@
|
||||
<string key="NS.key.0">view</string>
|
||||
<string key="NS.object.0">NSView</string>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
|
||||
<string key="NS.key.0">view</string>
|
||||
<object class="IBToOneOutletInfo" key="NS.object.0">
|
||||
<string key="name">view</string>
|
||||
<string key="candidateClassName">NSView</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">AppKit.framework/Headers/NSViewController.h</string>
|
||||
@@ -2224,6 +2492,70 @@
|
||||
<string>id</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="actionInfosByName">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>goBack:</string>
|
||||
<string>goForward:</string>
|
||||
<string>makeTextLarger:</string>
|
||||
<string>makeTextSmaller:</string>
|
||||
<string>makeTextStandardSize:</string>
|
||||
<string>reload:</string>
|
||||
<string>reloadFromOrigin:</string>
|
||||
<string>stopLoading:</string>
|
||||
<string>takeStringURLFrom:</string>
|
||||
<string>toggleContinuousSpellChecking:</string>
|
||||
<string>toggleSmartInsertDelete:</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">goBack:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">goForward:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">makeTextLarger:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">makeTextSmaller:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">makeTextStandardSize:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">reload:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">reloadFromOrigin:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">stopLoading:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">takeStringURLFrom:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">toggleContinuousSpellChecking:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
<object class="IBActionInfo">
|
||||
<string key="name">toggleSmartInsertDelete:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">WebKit.framework/Headers/WebView.h</string>
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
+ (void) setShouldCheckoutBranch:(BOOL)shouldCheckout;
|
||||
+ (NSString *) recentCloneDestination;
|
||||
+ (void) setRecentCloneDestination:(NSString *)path;
|
||||
+ (BOOL) suppressAcceptDropRef;
|
||||
+ (void) setSuppressAcceptDropRef:(BOOL)suppress;
|
||||
+ (BOOL) showStageView;
|
||||
+ (void) setShowStageView:(BOOL)suppress;
|
||||
+ (BOOL) openPreviousDocumentsOnLaunch;
|
||||
@@ -37,4 +35,10 @@
|
||||
+ (NSInteger)historySearchMode;
|
||||
+ (void)setHistorySearchMode:(NSInteger)mode;
|
||||
|
||||
|
||||
// Suppressed Dialog Warnings
|
||||
+ (void)suppressDialogWarningForDialog:(NSString *)dialog;
|
||||
+ (BOOL)isDialogWarningSuppressedForDialog:(NSString *)dialog;
|
||||
+ (void)resetAllDialogWarnings;
|
||||
|
||||
@end
|
||||
|
||||
@@ -21,12 +21,12 @@
|
||||
#define kShowOpenPanelOnLaunch @"PBShowOpenPanelOnLaunch"
|
||||
#define kShouldCheckoutBranch @"PBShouldCheckoutBranch"
|
||||
#define kRecentCloneDestination @"PBRecentCloneDestination"
|
||||
#define kSuppressAcceptDropRef @"PBSuppressAcceptDropRef"
|
||||
#define kShowStageView @"PBShowStageView"
|
||||
#define kOpenPreviousDocumentsOnLaunch @"PBOpenPreviousDocumentsOnLaunch"
|
||||
#define kPreviousDocumentPaths @"PBPreviousDocumentPaths"
|
||||
#define kBranchFilterState @"PBBranchFilter"
|
||||
#define kHistorySearchMode @"PBHistorySearchMode"
|
||||
#define kSuppressedDialogWarnings @"Suppressed Dialog Warnings"
|
||||
|
||||
@implementation PBGitDefaults
|
||||
|
||||
@@ -125,16 +125,6 @@
|
||||
[[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];
|
||||
@@ -185,4 +175,38 @@
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Suppressed Dialog Warnings
|
||||
//
|
||||
// Represents dialogs where the user has checked the "Do not show this message again" checkbox.
|
||||
// Keep these together in an array to make it easier to reset all the warnings.
|
||||
|
||||
+ (NSSet *)suppressedDialogWarnings
|
||||
{
|
||||
NSSet *suppressedDialogWarnings = [NSSet setWithArray:[[NSUserDefaults standardUserDefaults] arrayForKey:kSuppressedDialogWarnings]];
|
||||
if (suppressedDialogWarnings == nil)
|
||||
suppressedDialogWarnings = [NSSet set];
|
||||
|
||||
return suppressedDialogWarnings;
|
||||
}
|
||||
|
||||
+ (void)suppressDialogWarningForDialog:(NSString *)dialog
|
||||
{
|
||||
NSSet *suppressedDialogWarnings = [[self suppressedDialogWarnings] setByAddingObject:dialog];
|
||||
|
||||
[[NSUserDefaults standardUserDefaults] setObject:[suppressedDialogWarnings allObjects] forKey:kSuppressedDialogWarnings];
|
||||
}
|
||||
|
||||
+ (BOOL)isDialogWarningSuppressedForDialog:(NSString *)dialog
|
||||
{
|
||||
return [[self suppressedDialogWarnings] containsObject:dialog];
|
||||
}
|
||||
|
||||
+ (void)resetAllDialogWarnings
|
||||
{
|
||||
[[NSUserDefaults standardUserDefaults] setObject:nil forKey:kSuppressedDialogWarnings];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
@class PBRefController;
|
||||
@class QLPreviewPanel;
|
||||
@class PBCommitList;
|
||||
@class GLFileView;
|
||||
@class PBGitSHA;
|
||||
|
||||
@class PBHistorySearchController;
|
||||
@@ -34,6 +35,7 @@
|
||||
IBOutlet PBWebHistoryController *webHistoryController;
|
||||
QLPreviewPanel* previewPanel;
|
||||
IBOutlet PBHistorySearchController *searchController;
|
||||
IBOutlet GLFileView *fileView;
|
||||
|
||||
IBOutlet PBGitGradientBarView *upperToolbarView;
|
||||
IBOutlet NSButton *mergeButton;
|
||||
|
||||
@@ -23,17 +23,22 @@
|
||||
#import "PBHistorySearchController.h"
|
||||
#define QLPreviewPanel NSClassFromString(@"QLPreviewPanel")
|
||||
#import "PBQLTextView.h"
|
||||
#import "GLFileView.h"
|
||||
|
||||
#import "PBSourceViewCell.h"
|
||||
|
||||
#define kHistorySelectedDetailIndexKey @"PBHistorySelectedDetailIndex"
|
||||
#define kHistoryDetailViewIndex 0
|
||||
#define kHistoryTreeViewIndex 1
|
||||
|
||||
#define kHistorySplitViewPositionDefault @"History SplitView Position"
|
||||
|
||||
@interface PBGitHistoryController ()
|
||||
|
||||
- (void) updateBranchFilterMatrix;
|
||||
- (void) restoreFileBrowserSelection;
|
||||
- (void) saveFileBrowserSelection;
|
||||
- (void)saveSplitViewPosition;
|
||||
|
||||
@end
|
||||
|
||||
@@ -76,16 +81,19 @@
|
||||
[[commitList tableColumnWithIdentifier:@"SubjectColumn"] 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:58.0 andBottomMin:100.0];
|
||||
[historySplitView uncollapse];
|
||||
[historySplitView setHidden:YES];
|
||||
[self performSelector:@selector(restoreSplitViewPositiion) withObject:nil afterDelay:0];
|
||||
|
||||
[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];
|
||||
[fileBrowser setDelegate:self];
|
||||
}
|
||||
|
||||
- (void)updateKeys
|
||||
@@ -275,6 +283,16 @@
|
||||
[[NSWorkspace sharedWorkspace] openTempFile:name];
|
||||
}
|
||||
|
||||
- (BOOL)validateMenuItem:(NSMenuItem *)menuItem
|
||||
{
|
||||
if ([menuItem action] == @selector(setDetailedView:)) {
|
||||
[menuItem setState:(self.selectedCommitDetailsIndex == kHistoryDetailViewIndex) ? NSOnState : NSOffState];
|
||||
} else if ([menuItem action] == @selector(setTreeView:)) {
|
||||
[menuItem setState:(self.selectedCommitDetailsIndex == kHistoryTreeViewIndex) ? NSOnState : NSOffState];
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (IBAction) setDetailedView:(id)sender
|
||||
{
|
||||
self.selectedCommitDetailsIndex = kHistoryDetailViewIndex;
|
||||
@@ -408,13 +426,6 @@
|
||||
[self updateKeys];
|
||||
}
|
||||
|
||||
- (void)viewLoaded
|
||||
{
|
||||
float position = [[NSUserDefaults standardUserDefaults] floatForKey:@"PBGitSplitViewPosition"];
|
||||
if (position)
|
||||
[historySplitView setPosition:position ofDividerAtIndex:0];
|
||||
}
|
||||
|
||||
- (NSResponder *)firstResponder;
|
||||
{
|
||||
return commitList;
|
||||
@@ -477,9 +488,7 @@
|
||||
|
||||
- (void)closeView
|
||||
{
|
||||
float position = [[[historySplitView subviews] objectAtIndex:0] frame].size.height;
|
||||
[[NSUserDefaults standardUserDefaults] setFloat:position forKey:@"PBGitSplitViewPosition"];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
[self saveSplitViewPosition];
|
||||
|
||||
if (commitController) {
|
||||
[commitController removeObserver:self forKeyPath:@"selection"];
|
||||
@@ -493,6 +502,7 @@
|
||||
}
|
||||
|
||||
[webHistoryController closeView];
|
||||
[fileView closeView];
|
||||
|
||||
[super closeView];
|
||||
}
|
||||
@@ -608,12 +618,17 @@
|
||||
return menuItems;
|
||||
}
|
||||
|
||||
- (BOOL)splitView:(NSSplitView *)sender canCollapseSubview:(NSView *)subview {
|
||||
|
||||
#pragma mark NSSplitView delegate methods
|
||||
|
||||
- (BOOL)splitView:(NSSplitView *)splitView canCollapseSubview:(NSView *)subview
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
- (BOOL)splitView:(NSSplitView *)splitView shouldCollapseSubview:(NSView *)subview forDoubleClickOnDividerAtIndex:(NSInteger)dividerIndex {
|
||||
int index = [[splitView subviews] indexOfObject:subview];
|
||||
- (BOOL)splitView:(NSSplitView *)splitView shouldCollapseSubview:(NSView *)subview forDoubleClickOnDividerAtIndex:(NSInteger)dividerIndex
|
||||
{
|
||||
NSUInteger index = [[splitView subviews] indexOfObject:subview];
|
||||
// this method (and canCollapse) are called by the splitView to decide how to collapse on double-click
|
||||
// we compare our two subviews, so that always the smaller one is collapsed.
|
||||
if([[[splitView subviews] objectAtIndex:index] frame].size.height < [[[splitView subviews] objectAtIndex:((index+1)%2)] frame].size.height) {
|
||||
@@ -622,14 +637,59 @@
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
- (CGFloat)splitView:(NSSplitView *)sender constrainMinCoordinate:(CGFloat)proposedMin ofSubviewAt:(NSInteger)offset {
|
||||
return proposedMin + historySplitView.topViewMin;
|
||||
- (CGFloat)splitView:(NSSplitView *)splitView constrainMinCoordinate:(CGFloat)proposedMin ofSubviewAt:(NSInteger)dividerIndex
|
||||
{
|
||||
return historySplitView.topViewMin;
|
||||
}
|
||||
|
||||
- (CGFloat)splitView:(NSSplitView *)sender constrainMaxCoordinate:(CGFloat)proposedMax ofSubviewAt:(NSInteger)offset {
|
||||
if(offset == 1)
|
||||
return proposedMax - historySplitView.bottomViewMin;
|
||||
return [sender frame].size.height;
|
||||
- (CGFloat)splitView:(NSSplitView *)splitView constrainMaxCoordinate:(CGFloat)proposedMax ofSubviewAt:(NSInteger)dividerIndex
|
||||
{
|
||||
return [splitView frame].size.height - [splitView dividerThickness] - historySplitView.bottomViewMin;
|
||||
}
|
||||
|
||||
// while the user resizes the window keep the upper (history) view constant and just resize the lower view
|
||||
// unless the lower view gets too small
|
||||
- (void)splitView:(NSSplitView *)splitView resizeSubviewsWithOldSize:(NSSize)oldSize
|
||||
{
|
||||
NSRect newFrame = [splitView frame];
|
||||
|
||||
float dividerThickness = [splitView dividerThickness];
|
||||
|
||||
NSView *upperView = [[splitView subviews] objectAtIndex:0];
|
||||
NSRect upperFrame = [upperView frame];
|
||||
upperFrame.size.width = newFrame.size.width;
|
||||
|
||||
if ((newFrame.size.height - upperFrame.size.height - dividerThickness) < historySplitView.bottomViewMin) {
|
||||
upperFrame.size.height = newFrame.size.height - historySplitView.bottomViewMin - dividerThickness;
|
||||
}
|
||||
|
||||
NSView *lowerView = [[splitView subviews] objectAtIndex:1];
|
||||
NSRect lowerFrame = [lowerView frame];
|
||||
lowerFrame.origin.y = upperFrame.size.height + dividerThickness;
|
||||
lowerFrame.size.height = newFrame.size.height - lowerFrame.origin.y;
|
||||
lowerFrame.size.width = newFrame.size.width;
|
||||
|
||||
[upperView setFrame:upperFrame];
|
||||
[lowerView setFrame:lowerFrame];
|
||||
}
|
||||
|
||||
// NSSplitView does not save and restore the position of the SplitView correctly so do it manually
|
||||
- (void)saveSplitViewPosition
|
||||
{
|
||||
float position = [[[historySplitView subviews] objectAtIndex:0] frame].size.height;
|
||||
[[NSUserDefaults standardUserDefaults] setFloat:position forKey:kHistorySplitViewPositionDefault];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
}
|
||||
|
||||
// make sure this happens after awakeFromNib
|
||||
- (void)restoreSplitViewPositiion
|
||||
{
|
||||
float position = [[NSUserDefaults standardUserDefaults] floatForKey:kHistorySplitViewPositionDefault];
|
||||
if (position < 1.0)
|
||||
position = 175;
|
||||
|
||||
[historySplitView setPosition:position ofDividerAtIndex:0];
|
||||
[historySplitView setHidden:NO];
|
||||
}
|
||||
|
||||
|
||||
@@ -756,4 +816,15 @@
|
||||
return iconRect;
|
||||
}
|
||||
|
||||
- (void)outlineView:(NSOutlineView *)outlineView willDisplayCell:(PBSourceViewCell *)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item
|
||||
{
|
||||
NSWorkspace *workspace = [NSWorkspace sharedWorkspace];
|
||||
PBGitTree *object = [item representedObject];
|
||||
NSString *workingDirectory = [[repository workingDirectory] stringByAppendingString:@"/"];
|
||||
NSString *path = [workingDirectory stringByAppendingPathComponent:[object fullPath]];
|
||||
NSImage *image = [workspace iconForFile:path];
|
||||
[image setSize:NSMakeSize(15, 15)];
|
||||
[cell setImage:image];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1050</int>
|
||||
<string key="IBDocument.SystemVersion">10F569</string>
|
||||
<string key="IBDocument.SystemVersion">10H574</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">804</string>
|
||||
<string key="IBDocument.AppKitVersion">1038.29</string>
|
||||
<string key="IBDocument.AppKitVersion">1038.35</string>
|
||||
<string key="IBDocument.HIToolboxVersion">461.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
@@ -21,6 +21,7 @@
|
||||
</object>
|
||||
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<integer value="475"/>
|
||||
</object>
|
||||
<object class="NSArray" key="IBDocument.PluginDependencies">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
@@ -502,7 +503,7 @@
|
||||
<integer value="1"/>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NS.format">d MMMM yyyy h:mm a</string>
|
||||
<string key="NS.format">d MMMM yyyy HH:mm</string>
|
||||
<bool key="NS.natural">NO</bool>
|
||||
</object>
|
||||
<reference key="NSControlView" ref="254268962"/>
|
||||
@@ -1105,7 +1106,7 @@
|
||||
</object>
|
||||
<object class="NSCustomView" id="891500945">
|
||||
<reference key="NSNextResponder" ref="626906425"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<int key="NSvFlags">274</int>
|
||||
<object class="NSMutableArray" key="NSSubviews">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSCustomView" id="375746871">
|
||||
@@ -1115,7 +1116,7 @@
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSCustomView" id="951933530">
|
||||
<reference key="NSNextResponder" ref="375746871"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<int key="NSvFlags">265</int>
|
||||
<object class="NSMutableArray" key="NSSubviews">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSButton" id="16222431">
|
||||
@@ -1237,7 +1238,6 @@
|
||||
<reference key="NSSuperview" ref="319362431"/>
|
||||
<reference key="NSWindow"/>
|
||||
<int key="NSDividerStyle">2</int>
|
||||
<string key="NSAutosaveName">HistoryViewSplitView</string>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrameSize">{955, 434}</string>
|
||||
@@ -2018,6 +2018,30 @@
|
||||
</object>
|
||||
<int key="connectionID">487</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">fileView</string>
|
||||
<reference key="source" ref="1001"/>
|
||||
<reference key="destination" ref="932676109"/>
|
||||
</object>
|
||||
<int key="connectionID">488</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">fileListSplitView</string>
|
||||
<reference key="source" ref="932676109"/>
|
||||
<reference key="destination" ref="626906425"/>
|
||||
</object>
|
||||
<int key="connectionID">489</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">delegate</string>
|
||||
<reference key="source" ref="626906425"/>
|
||||
<reference key="destination" ref="932676109"/>
|
||||
</object>
|
||||
<int key="connectionID">490</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
<object class="NSArray" key="orderedObjects">
|
||||
@@ -2651,6 +2675,7 @@
|
||||
<string>16.IBPluginDependency</string>
|
||||
<string>17.IBPluginDependency</string>
|
||||
<string>18.IBPluginDependency</string>
|
||||
<string>19.CustomClassName</string>
|
||||
<string>19.IBPluginDependency</string>
|
||||
<string>2.CustomClassName</string>
|
||||
<string>2.IBEditorWindowLastContentRect</string>
|
||||
@@ -2768,6 +2793,7 @@
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>PBIconAndTextCell</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>PBCollapsibleSplitView</string>
|
||||
<string>{{312, 577}, {852, 384}}</string>
|
||||
@@ -2932,7 +2958,7 @@
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.WebKitIBPlugin</string>
|
||||
<string>{{67, 422}, {955, 434}}</string>
|
||||
<string>{{1084, 241}, {955, 434}}</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
@@ -2970,7 +2996,7 @@
|
||||
</object>
|
||||
</object>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">499</int>
|
||||
<int key="maxID">490</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
@@ -2983,12 +3009,14 @@
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>accessoryView</string>
|
||||
<string>fileListSplitView</string>
|
||||
<string>historyController</string>
|
||||
<string>typeBar</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>NSView</string>
|
||||
<string>NSSplitView</string>
|
||||
<string>PBGitHistoryController</string>
|
||||
<string>MGScopeBar</string>
|
||||
</object>
|
||||
@@ -2998,6 +3026,7 @@
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>accessoryView</string>
|
||||
<string>fileListSplitView</string>
|
||||
<string>historyController</string>
|
||||
<string>typeBar</string>
|
||||
</object>
|
||||
@@ -3007,6 +3036,10 @@
|
||||
<string key="name">accessoryView</string>
|
||||
<string key="candidateClassName">NSView</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">fileListSplitView</string>
|
||||
<string key="candidateClassName">NSSplitView</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">historyController</string>
|
||||
<string key="candidateClassName">PBGitHistoryController</string>
|
||||
@@ -3075,6 +3108,13 @@
|
||||
<string key="minorKey">NSApplication+GitXScripting.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSCell</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">View/CellTrackingRect.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSOutlineView</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
@@ -3309,6 +3349,7 @@
|
||||
<string>commitController</string>
|
||||
<string>commitList</string>
|
||||
<string>fileBrowser</string>
|
||||
<string>fileView</string>
|
||||
<string>historySplitView</string>
|
||||
<string>localRemoteBranchesFilterItem</string>
|
||||
<string>mergeButton</string>
|
||||
@@ -3330,6 +3371,7 @@
|
||||
<string>NSArrayController</string>
|
||||
<string>PBCommitList</string>
|
||||
<string>NSOutlineView</string>
|
||||
<string>GLFileView</string>
|
||||
<string>PBCollapsibleSplitView</string>
|
||||
<string>NSButton</string>
|
||||
<string>NSButton</string>
|
||||
@@ -3354,6 +3396,7 @@
|
||||
<string>commitController</string>
|
||||
<string>commitList</string>
|
||||
<string>fileBrowser</string>
|
||||
<string>fileView</string>
|
||||
<string>historySplitView</string>
|
||||
<string>localRemoteBranchesFilterItem</string>
|
||||
<string>mergeButton</string>
|
||||
@@ -3390,6 +3433,10 @@
|
||||
<string key="name">fileBrowser</string>
|
||||
<string key="candidateClassName">NSOutlineView</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">fileView</string>
|
||||
<string key="candidateClassName">GLFileView</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">historySplitView</string>
|
||||
<string key="candidateClassName">PBCollapsibleSplitView</string>
|
||||
@@ -3604,6 +3651,14 @@
|
||||
<string key="minorKey">PBHistorySearchController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">PBIconAndTextCell</string>
|
||||
<string key="superclassName">NSTextFieldCell</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">PBIconAndTextCell.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">PBNiceSplitView</string>
|
||||
<string key="superclassName">NSSplitView</string>
|
||||
@@ -4379,6 +4434,13 @@
|
||||
<string key="minorKey">QuartzCore.framework/Headers/CIImageProvider.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">ScriptingBridge.framework/Headers/SBApplication.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
|
||||
@@ -113,6 +113,19 @@
|
||||
[ignoreItem setTarget:self];
|
||||
[ignoreItem setRepresentedObject:selectedFiles];
|
||||
[menu addItem:ignoreItem];
|
||||
|
||||
if ([selectedFiles count] == 1) {
|
||||
NSString *path = [[selectedFiles objectAtIndex:0] path];
|
||||
NSString *extension = [path pathExtension];
|
||||
if ([extension length] > 0) {
|
||||
ignoreText = [NSString stringWithFormat:@"Ignore Files with extension (.%@)", extension];
|
||||
ignoreItem = [[NSMenuItem alloc] initWithTitle:ignoreText action:@selector(ignoreFilesWithExtensionAction:) keyEquivalent:@""];
|
||||
[ignoreItem setTarget:self];
|
||||
[ignoreItem setRepresentedObject:extension];
|
||||
[menu addItem:ignoreItem];
|
||||
[ignoreItem release];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ([selectedFiles count] == 1) {
|
||||
@@ -171,6 +184,18 @@
|
||||
[commitController.index refresh];
|
||||
}
|
||||
|
||||
- (void) ignoreFilesWithExtensionAction:(id) sender {
|
||||
NSString *extension = [sender representedObject];
|
||||
if ([extension length] == 0)
|
||||
return;
|
||||
PBChangedFile *file = [[PBChangedFile alloc] initWithPath:[NSString stringWithFormat:@"*.%@", extension]];
|
||||
|
||||
|
||||
[self ignoreFiles:[NSArray arrayWithObject:file]];
|
||||
[file release];
|
||||
[commitController.index refresh];
|
||||
}
|
||||
|
||||
- (void)discardFilesAction:(id) sender
|
||||
{
|
||||
NSArray *selectedFiles = [sender representedObject];
|
||||
@@ -226,7 +251,13 @@
|
||||
- (void)tableView:(NSTableView*)tableView willDisplayCell:(id)cell forTableColumn:(NSTableColumn*)tableColumn row:(NSInteger)rowIndex
|
||||
{
|
||||
id controller = [tableView tag] == 0 ? unstagedFilesController : stagedFilesController;
|
||||
[[tableColumn dataCell] setImage:[[[controller arrangedObjects] objectAtIndex:rowIndex] icon]];
|
||||
PBChangedFile *changedFile = [[controller arrangedObjects] objectAtIndex:rowIndex];
|
||||
PBChangedFileStatus status = [changedFile status];
|
||||
NSImage *imageToSet = [changedFile icon];
|
||||
if (controller == stagedFilesController && status == NEW) {
|
||||
imageToSet = [PBChangedFile iconForStatus:ADDED];
|
||||
}
|
||||
[[tableColumn dataCell] setImage:imageToSet];
|
||||
}
|
||||
|
||||
- (void) tableClicked:(NSTableView *) tableView
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// PBGitSVStashItem.h
|
||||
// GitX
|
||||
//
|
||||
// Created by Tomasz Krasnyk on 10-11-05.
|
||||
// Copyright 2010 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "PBSourceViewItem.h"
|
||||
#import "PBPresentable.h"
|
||||
|
||||
|
||||
@interface PBGitMenuItem : PBSourceViewItem {
|
||||
id<PBPresentable> sourceObject;
|
||||
}
|
||||
@property (nonatomic, retain, readonly) id<PBPresentable> sourceObject;
|
||||
|
||||
- initWithSourceObject:(id<PBPresentable>) anObject;
|
||||
@end
|
||||
@@ -0,0 +1,62 @@
|
||||
//
|
||||
// PBGitSVStashItem.m
|
||||
// GitX
|
||||
//
|
||||
// Created by Tomasz Krasnyk on 10-11-05.
|
||||
// Copyright 2010 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#import "PBGitMenuItem.h"
|
||||
|
||||
|
||||
@implementation PBGitMenuItem
|
||||
@synthesize sourceObject;
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Inits/dealloc
|
||||
//---------------------------------------------------------------------------------------------
|
||||
|
||||
- initWithSourceObject:(id<PBPresentable>) anObject {
|
||||
if (self = [super init]) {
|
||||
super.title = [anObject displayDescription];
|
||||
sourceObject = [anObject retain];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void) dealloc {
|
||||
[sourceObject release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------
|
||||
#pragma mark -
|
||||
|
||||
|
||||
- (NSImage *) icon {
|
||||
return [self.sourceObject icon];
|
||||
}
|
||||
|
||||
|
||||
- (void) addChild:(PBGitMenuItem *)child {
|
||||
BOOL added = NO;
|
||||
for (PBGitMenuItem *item in self.children) {
|
||||
if ([[(id)child.sourceObject path] hasPrefix:[(id)[item sourceObject] path]]) {
|
||||
[item addChild:child];
|
||||
added = YES;
|
||||
}
|
||||
}
|
||||
if (!added) {
|
||||
[super addChild:child];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) expand {
|
||||
NSObject *item = self.parent;
|
||||
while (item && [item isKindOfClass:[PBGitMenuItem class]]) {
|
||||
[(id)item expand];
|
||||
item = [(id)item parent];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -12,6 +12,10 @@
|
||||
#import "PBGitConfig.h"
|
||||
#import "PBGitRefish.h"
|
||||
|
||||
#import "PBStashController.h"
|
||||
#import "PBGitResetController.h"
|
||||
#import "PBSubmoduleController.h"
|
||||
|
||||
extern NSString* PBGitRepositoryErrorDomain;
|
||||
typedef enum branchFilterTypes {
|
||||
kGitXAllBranchesFilter = 0,
|
||||
@@ -53,8 +57,13 @@ static NSString * PBStringFromBranchFilterType(PBGitXBranchFilterType type) {
|
||||
PBGitRevSpecifier *_headRef; // Caching
|
||||
PBGitSHA* _headSha;
|
||||
|
||||
NSArray *stashes;
|
||||
PBStashController *stashController;
|
||||
PBSubmoduleController *submoduleController;
|
||||
PBGitResetController *resetController;
|
||||
}
|
||||
@property (nonatomic, retain, readonly) PBStashController *stashController;
|
||||
@property (nonatomic, retain, readonly) PBSubmoduleController *submoduleController;
|
||||
@property (nonatomic, retain, readonly) PBGitResetController *resetController;
|
||||
|
||||
- (void) cloneRepositoryToPath:(NSString *)path bare:(BOOL)isBare;
|
||||
- (void) beginAddRemote:(NSString *)remoteName forURL:(NSString *)remoteURL;
|
||||
@@ -98,7 +107,6 @@ static NSString * PBStringFromBranchFilterType(PBGitXBranchFilterType type) {
|
||||
- (NSString *)gitIgnoreFilename;
|
||||
- (BOOL)isBareRepository;
|
||||
|
||||
- (void) reloadStashes;
|
||||
- (void) reloadRefs;
|
||||
- (void) addRef:(PBGitRef *)ref fromParameters:(NSArray *)params;
|
||||
- (void) lazyReload;
|
||||
@@ -137,6 +145,7 @@ static NSString * PBStringFromBranchFilterType(PBGitXBranchFilterType type) {
|
||||
// for the scripting bridge
|
||||
- (void)findInModeScriptCommand:(NSScriptCommand *)command;
|
||||
|
||||
- (NSMenu *) menu;
|
||||
|
||||
@property (assign) BOOL hasChanged;
|
||||
@property (readonly) PBGitWindowController *windowController;
|
||||
|
||||
@@ -22,20 +22,39 @@
|
||||
#import "PBHistorySearchController.h"
|
||||
|
||||
#import "PBGitStash.h"
|
||||
#import "PBGitSubmodule.h"
|
||||
|
||||
NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain";
|
||||
|
||||
@interface PBGitRepository()
|
||||
@property (nonatomic, retain) NSArray *stashes;
|
||||
@end
|
||||
|
||||
|
||||
|
||||
@implementation PBGitRepository
|
||||
@synthesize stashes;
|
||||
@synthesize stashController;
|
||||
@synthesize submoduleController;
|
||||
@synthesize resetController;
|
||||
@synthesize revisionList, branches, currentBranch, refs, hasChanged, config;
|
||||
@synthesize currentBranchFilter;
|
||||
|
||||
- (NSMenu *) menu {
|
||||
NSMenu *menu = [[NSMenu alloc] init];
|
||||
NSMutableArray *items = [[NSMutableArray alloc] init];
|
||||
[items addObjectsFromArray:[self.submoduleController menuItems]];
|
||||
[items addObject:[NSMenuItem separatorItem]];
|
||||
[items addObjectsFromArray:[self.stashController menu]];
|
||||
[items addObject:[NSMenuItem separatorItem]];
|
||||
[items addObjectsFromArray:[self.resetController menuItems]];
|
||||
|
||||
for (NSMenuItem *item in items) {
|
||||
[menu addItem:item];
|
||||
}
|
||||
|
||||
[menu setAutoenablesItems:YES];
|
||||
return menu;
|
||||
}
|
||||
|
||||
- (BOOL)readFromData:(NSData *)data ofType:(NSString *)typeName error:(NSError **)outError
|
||||
{
|
||||
if (outError) {
|
||||
@@ -143,6 +162,10 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain";
|
||||
[self reloadRefs];
|
||||
currentBranchFilter = [PBGitDefaults branchFilter];
|
||||
revisionList = [[PBGitHistoryList alloc] initWithRepository:self];
|
||||
|
||||
resetController = [[PBGitResetController alloc] initWithRepository:self];
|
||||
stashController = [[PBStashController alloc] initWithRepository:self];
|
||||
submoduleController = [[PBSubmoduleController alloc] initWithRepository:self];
|
||||
}
|
||||
|
||||
- (void)close
|
||||
@@ -255,23 +278,6 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain";
|
||||
[refs setObject:[NSMutableArray arrayWithObject:ref] forKey:sha];
|
||||
}
|
||||
|
||||
- (void) reloadStashes {
|
||||
NSArray *arguments = [NSArray arrayWithObjects:@"stash", @"list", nil];
|
||||
NSString *output = [self outputInWorkdirForArguments:arguments];
|
||||
NSArray *lines = [output componentsSeparatedByString:@"\n"];
|
||||
|
||||
NSMutableArray *loadedStashes = [[NSMutableArray alloc] init];
|
||||
|
||||
for (NSString *stashLine in lines) {
|
||||
PBGitStash *stash = [[PBGitStash alloc] initWithRawStashLine:stashLine];
|
||||
[loadedStashes addObject:stash];
|
||||
[stash release];
|
||||
}
|
||||
|
||||
self.stashes = loadedStashes;
|
||||
[loadedStashes release];
|
||||
}
|
||||
|
||||
- (void) reloadRefs
|
||||
{
|
||||
_headRef = nil;
|
||||
@@ -306,7 +312,8 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain";
|
||||
[self willChangeValueForKey:@"refs"];
|
||||
[self didChangeValueForKey:@"refs"];
|
||||
|
||||
[self reloadStashes];
|
||||
[self.stashController reload];
|
||||
[self.submoduleController reload];
|
||||
|
||||
[[[self windowController] window] setTitle:[self displayName]];
|
||||
}
|
||||
@@ -1251,11 +1258,6 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain";
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (void) dealloc {
|
||||
[stashes release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (void) finalize
|
||||
{
|
||||
NSLog(@"Dealloc of repository");
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
//
|
||||
// PBGitSVStashItem.h
|
||||
// GitX
|
||||
//
|
||||
// Created by Tomasz Krasnyk on 10-11-05.
|
||||
// Copyright 2010 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "PBSourceViewItem.h"
|
||||
#import "PBGitStash.h"
|
||||
|
||||
|
||||
@interface PBGitSVStashItem : PBSourceViewItem {
|
||||
PBGitStash *stash;
|
||||
}
|
||||
@property (nonatomic, retain, readonly) PBGitStash *stash;
|
||||
|
||||
- initWithStash:(PBGitStash *) aStash;
|
||||
@end
|
||||
@@ -1,45 +0,0 @@
|
||||
//
|
||||
// PBGitSVStashItem.m
|
||||
// GitX
|
||||
//
|
||||
// Created by Tomasz Krasnyk on 10-11-05.
|
||||
// Copyright 2010 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#import "PBGitSVStashItem.h"
|
||||
|
||||
|
||||
@implementation PBGitSVStashItem
|
||||
@synthesize stash;
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Inits/dealloc
|
||||
//---------------------------------------------------------------------------------------------
|
||||
|
||||
- initWithStash:(PBGitStash *) aStash {
|
||||
if (self = [super init]) {
|
||||
NSString *displayTitle = [NSString stringWithFormat:@"%@ (%@)", [aStash message], [aStash stashSourceMessage]];
|
||||
super.title = displayTitle;
|
||||
stash = [aStash retain];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void) dealloc {
|
||||
[stash release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------
|
||||
#pragma mark -
|
||||
|
||||
|
||||
- (NSImage *) icon {
|
||||
static NSImage *tagImage = nil;
|
||||
if (!tagImage)
|
||||
tagImage = [NSImage imageNamed:@"stash-icon.png"];
|
||||
|
||||
return tagImage;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -29,7 +29,7 @@
|
||||
/* Specific things */
|
||||
PBSourceViewItem *stage;
|
||||
|
||||
PBSourceViewItem *branches, *remotes, *tags, *others, *stashes;
|
||||
PBSourceViewItem *branches, *remotes, *tags, *others, *stashes, *submodules;
|
||||
|
||||
PBGitHistoryController *historyViewController;
|
||||
PBGitCommitController *commitViewController;
|
||||
@@ -49,4 +49,7 @@
|
||||
|
||||
@property(readonly) NSMutableArray *items;
|
||||
@property(readonly) NSView *sourceListControlsView;
|
||||
@property(readonly) PBGitHistoryController *historyViewController;
|
||||
@property(readonly) PBGitCommitController *commitViewController;
|
||||
|
||||
@end
|
||||
|
||||
@@ -16,12 +16,16 @@
|
||||
#import "PBAddRemoteSheet.h"
|
||||
#import "PBGitDefaults.h"
|
||||
#import "PBHistorySearchController.h"
|
||||
#import "PBGitSVStashItem.h"
|
||||
#import "PBGitMenuItem.h"
|
||||
|
||||
#import "PBStashCommandFactory.h"
|
||||
#import "PBRemoteCommandFactory.h"
|
||||
#import "PBCommandMenuItem.h"
|
||||
#import "PBGitStash.h"
|
||||
#import "PBGitSubmodule.h"
|
||||
|
||||
static NSString * const kObservingContextStashes = @"stashesChanged";
|
||||
static NSString * const kObservingContextSubmodules = @"submodulesChanged";
|
||||
|
||||
@interface PBGitSidebarController ()
|
||||
|
||||
@@ -36,6 +40,8 @@ static NSString * const kObservingContextStashes = @"stashesChanged";
|
||||
@implementation PBGitSidebarController
|
||||
@synthesize items;
|
||||
@synthesize sourceListControlsView;
|
||||
@synthesize historyViewController;
|
||||
@synthesize commitViewController;
|
||||
|
||||
- (id)initWithRepository:(PBGitRepository *)theRepository superController:(PBGitWindowController *)controller
|
||||
{
|
||||
@@ -57,7 +63,9 @@ static NSString * const kObservingContextStashes = @"stashesChanged";
|
||||
|
||||
[repository addObserver:self forKeyPath:@"currentBranch" options:0 context:@"currentBranchChange"];
|
||||
[repository addObserver:self forKeyPath:@"branches" options:(NSKeyValueObservingOptionOld | NSKeyValueObservingOptionNew) context:@"branchesModified"];
|
||||
[repository addObserver:self forKeyPath:@"stashes" options:NSKeyValueObservingOptionNew context:@"stashesChanged"];
|
||||
[repository addObserver:self forKeyPath:@"stashController.stashes" options:NSKeyValueObservingOptionNew context:kObservingContextStashes];
|
||||
[repository addObserver:self forKeyPath:@"submoduleController.submodules" options:NSKeyValueObservingOptionNew context:kObservingContextSubmodules];
|
||||
|
||||
|
||||
[self menuNeedsUpdate:[actionButton menu]];
|
||||
|
||||
@@ -65,6 +73,9 @@ static NSString * const kObservingContextStashes = @"stashesChanged";
|
||||
[self selectStage];
|
||||
else
|
||||
[self selectCurrentBranch];
|
||||
|
||||
[sourceView setDoubleAction:@selector(outlineDoubleClicked)];
|
||||
[sourceView setTarget:self];
|
||||
}
|
||||
|
||||
- (void)closeView
|
||||
@@ -74,7 +85,8 @@ static NSString * const kObservingContextStashes = @"stashesChanged";
|
||||
|
||||
[repository removeObserver:self forKeyPath:@"currentBranch"];
|
||||
[repository removeObserver:self forKeyPath:@"branches"];
|
||||
[repository removeObserver:self forKeyPath:@"stashes"];
|
||||
[repository removeObserver:self forKeyPath:@"stashController.stashes"];
|
||||
[repository removeObserver:self forKeyPath:@"submoduleController.submodules"];
|
||||
|
||||
[super closeView];
|
||||
}
|
||||
@@ -100,14 +112,39 @@ static NSString * const kObservingContextStashes = @"stashesChanged";
|
||||
for (PBGitRevSpecifier *rev in removedRevSpecs)
|
||||
[self removeRevSpec:rev];
|
||||
}
|
||||
} else if ([@"stashesChanged" isEqualToString:context]) { // isEqualToString: is not needed here
|
||||
} else if ([kObservingContextStashes isEqualToString:context]) { // isEqualToString: is not needed here
|
||||
[stashes.children removeAllObjects];
|
||||
NSArray *newStashes = [change objectForKey:NSKeyValueChangeNewKey];
|
||||
|
||||
PBGitMenuItem *lastItem = nil;
|
||||
for (PBGitStash *stash in newStashes) {
|
||||
PBGitSVStashItem *item = [[PBGitSVStashItem alloc] initWithStash:stash];
|
||||
PBGitMenuItem *item = [[PBGitMenuItem alloc] initWithSourceObject:stash];
|
||||
[stashes addChild:item];
|
||||
[item release];
|
||||
lastItem = item;
|
||||
}
|
||||
if (lastItem) {
|
||||
[sourceView PBExpandItem:lastItem expandParents:YES];
|
||||
}
|
||||
[sourceView reloadData];
|
||||
} else if ([kObservingContextSubmodules isEqualToString:context]) {
|
||||
[submodules.children removeAllObjects];
|
||||
NSArray *newSubmodules = [change objectForKey:NSKeyValueChangeNewKey];
|
||||
|
||||
for (PBGitSubmodule *submodule in newSubmodules) {
|
||||
PBGitMenuItem *item = [[PBGitMenuItem alloc] initWithSourceObject:submodule];
|
||||
|
||||
BOOL added = NO;
|
||||
for (PBGitMenuItem *addedItems in [submodules children]) {
|
||||
if ([[submodule path] hasPrefix:[(id)[addedItems sourceObject] path]]) {
|
||||
[addedItems addChild:item];
|
||||
added = YES;
|
||||
}
|
||||
}
|
||||
if (!added) {
|
||||
[submodules addChild:item];
|
||||
}
|
||||
[sourceView PBExpandItem:item expandParents:YES];
|
||||
}
|
||||
[sourceView reloadData];
|
||||
} else {
|
||||
@@ -158,6 +195,17 @@ static NSString * const kObservingContextStashes = @"stashesChanged";
|
||||
[sourceView selectRowIndexes:index byExtendingSelection:NO];
|
||||
}
|
||||
|
||||
- (void) outlineDoubleClicked {
|
||||
PBSourceViewItem *item = [self selectedItem];
|
||||
if ([item isKindOfClass:[PBGitMenuItem class]]) {
|
||||
PBGitMenuItem *sidebarItem = (PBGitMenuItem *) item;
|
||||
NSObject *sourceObject = [sidebarItem sourceObject];
|
||||
if ([sourceObject isKindOfClass:[PBGitSubmodule class]]) {
|
||||
[[repository.submoduleController defaultCommandForSubmodule:(id)sourceObject] invoke];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (PBSourceViewItem *) itemForRev:(PBGitRevSpecifier *)rev
|
||||
{
|
||||
PBSourceViewItem *foundItem = nil;
|
||||
@@ -237,7 +285,14 @@ static NSString * const kObservingContextStashes = @"stashesChanged";
|
||||
- (void)outlineView:(NSOutlineView *)outlineView willDisplayCell:(PBSourceViewCell *)cell forTableColumn:(NSTableColumn *)tableColumn item:(PBSourceViewItem *)item
|
||||
{
|
||||
cell.isCheckedOut = [item.revSpecifier isEqual:[repository headRef]];
|
||||
|
||||
BOOL showsActionButton = NO;
|
||||
if ([item respondsToSelector:@selector(showsActionButton)]) {
|
||||
showsActionButton = [item showsActionButton];
|
||||
[cell setTarget:self];
|
||||
cell.iInfoButtonAction = @selector(infoButtonAction:);
|
||||
}
|
||||
cell.showsActionButton = showsActionButton;
|
||||
|
||||
[cell setImage:[item icon]];
|
||||
}
|
||||
|
||||
@@ -246,6 +301,10 @@ static NSString * const kObservingContextStashes = @"stashesChanged";
|
||||
return ![item isGroupItem];
|
||||
}
|
||||
|
||||
- (BOOL)outlineView:(NSOutlineView *)outlineView shouldTrackCell:(NSCell *)cell forTableColumn:(NSTableColumn *)tableColumn item:(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.
|
||||
@@ -258,16 +317,19 @@ static NSString * const kObservingContextStashes = @"stashesChanged";
|
||||
- (void)populateList
|
||||
{
|
||||
PBSourceViewItem *project = [PBSourceViewItem groupItemWithTitle:[repository projectName]];
|
||||
project.showsActionButton = YES;
|
||||
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"];
|
||||
stashes = [PBSourceViewItem groupItemWithTitle:@"Stashes"];
|
||||
submodules = [PBSourceViewItem groupItemWithTitle:@"Submodules"];
|
||||
|
||||
for (PBGitRevSpecifier *rev in repository.branches)
|
||||
[self addRevSpec:rev];
|
||||
@@ -278,12 +340,14 @@ static NSString * const kObservingContextStashes = @"stashesChanged";
|
||||
[items addObject:tags];
|
||||
[items addObject:others];
|
||||
[items addObject:stashes];
|
||||
[items addObject:submodules];
|
||||
|
||||
[sourceView reloadData];
|
||||
[sourceView expandItem:project];
|
||||
[sourceView expandItem:branches expandChildren:YES];
|
||||
[sourceView expandItem:remotes];
|
||||
|
||||
//[sourceView expandItem:submodules expandChildren:YES];
|
||||
|
||||
[sourceView reloadItem:nil reloadChildren:YES];
|
||||
}
|
||||
|
||||
@@ -344,17 +408,22 @@ static NSString * const kObservingContextStashes = @"stashesChanged";
|
||||
|
||||
- (NSMenu *) menuForRow:(NSInteger)row
|
||||
{
|
||||
if (row == 0) {
|
||||
return [historyViewController.repository menu];
|
||||
}
|
||||
PBSourceViewItem *viewItem = [sourceView itemAtRow:row];
|
||||
if ([viewItem isKindOfClass:[PBGitSVStashItem class]]) {
|
||||
PBGitSVStashItem *stashItem = (PBGitSVStashItem *) viewItem;
|
||||
NSArray *commands = [PBStashCommandFactory commandsForObject:[stashItem stash] repository:historyViewController.repository];
|
||||
if ([viewItem isKindOfClass:[PBGitMenuItem class]]) {
|
||||
PBGitMenuItem *stashItem = (PBGitMenuItem *) viewItem;
|
||||
NSMutableArray *commands = [[NSMutableArray alloc] init];
|
||||
[commands addObjectsFromArray:[PBStashCommandFactory commandsForObject:[stashItem sourceObject] repository:historyViewController.repository]];
|
||||
[commands addObjectsFromArray:[PBRemoteCommandFactory commandsForObject:[stashItem sourceObject] repository:historyViewController.repository]];
|
||||
if (!commands) {
|
||||
return nil;
|
||||
}
|
||||
NSMenu *menu = [[NSMenu alloc] init];
|
||||
[menu setAutoenablesItems:NO];
|
||||
for (PBCommand *command in commands) {
|
||||
PBCommandMenuItem *item = [[PBCommandMenuItem alloc] initWithCommand:command];
|
||||
[item setEnabled:YES];
|
||||
[menu addItem:item];
|
||||
[item release];
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1050</int>
|
||||
<string key="IBDocument.SystemVersion">10F569</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">804</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">1222</string>
|
||||
<string key="IBDocument.AppKitVersion">1038.29</string>
|
||||
<string key="IBDocument.HIToolboxVersion">461.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
@@ -12,8 +12,19 @@
|
||||
</object>
|
||||
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<integer value="38"/>
|
||||
<integer value="36"/>
|
||||
<string>NSSegmentedControl</string>
|
||||
<string>NSPopUpButton</string>
|
||||
<string>NSScroller</string>
|
||||
<string>NSMenuItem</string>
|
||||
<string>NSMenu</string>
|
||||
<string>NSTextFieldCell</string>
|
||||
<string>NSScrollView</string>
|
||||
<string>NSOutlineView</string>
|
||||
<string>NSCustomView</string>
|
||||
<string>NSCustomObject</string>
|
||||
<string>NSPopUpButtonCell</string>
|
||||
<string>NSTableColumn</string>
|
||||
<string>NSSegmentedCell</string>
|
||||
</object>
|
||||
<object class="NSArray" key="IBDocument.PluginDependencies">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
@@ -59,6 +70,8 @@
|
||||
<int key="NSvFlags">4352</int>
|
||||
<string key="NSFrameSize">{153, 354}</string>
|
||||
<reference key="NSSuperview" ref="973377808"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="636071848"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="_NSCornerView" key="NSCornerView">
|
||||
<nil key="NSNextResponder"/>
|
||||
@@ -78,7 +91,7 @@
|
||||
<object class="NSFont" key="NSSupport">
|
||||
<string key="NSName">LucidaGrande</string>
|
||||
<double key="NSSize">11</double>
|
||||
<int key="NSfFlags">3100</int>
|
||||
<int key="NSfFlags">3088</int>
|
||||
</object>
|
||||
<object class="NSColor" key="NSBackgroundColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
@@ -161,6 +174,7 @@
|
||||
</object>
|
||||
<string key="NSFrameSize">{153, 354}</string>
|
||||
<reference key="NSSuperview" ref="631607481"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="971239525"/>
|
||||
<reference key="NSDocView" ref="971239525"/>
|
||||
<reference key="NSBGColor" ref="272980874"/>
|
||||
@@ -171,6 +185,8 @@
|
||||
<int key="NSvFlags">-2147483392</int>
|
||||
<string key="NSFrame">{{137, 1}, {15, 338}}</string>
|
||||
<reference key="NSSuperview" ref="631607481"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
<reference key="NSTarget" ref="631607481"/>
|
||||
<string key="NSAction">_doScroller:</string>
|
||||
<double key="NSPercent">0.99698790000000004</double>
|
||||
@@ -180,6 +196,8 @@
|
||||
<int key="NSvFlags">-2147483392</int>
|
||||
<string key="NSFrame">{{-100, -100}, {196, 15}}</string>
|
||||
<reference key="NSSuperview" ref="631607481"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="973377808"/>
|
||||
<int key="NSsFlags">1</int>
|
||||
<reference key="NSTarget" ref="631607481"/>
|
||||
<string key="NSAction">_doScroller:</string>
|
||||
@@ -188,7 +206,8 @@
|
||||
</object>
|
||||
<string key="NSFrameSize">{153, 354}</string>
|
||||
<reference key="NSSuperview" ref="694945622"/>
|
||||
<reference key="NSNextKeyView" ref="973377808"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="46429660"/>
|
||||
<int key="NSsFlags">528</int>
|
||||
<reference key="NSVScroller" ref="636071848"/>
|
||||
<reference key="NSHScroller" ref="46429660"/>
|
||||
@@ -198,10 +217,12 @@
|
||||
</object>
|
||||
<string key="NSFrameSize">{153, 354}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="631607481"/>
|
||||
<string key="NSClassName">NSView</string>
|
||||
</object>
|
||||
<object class="NSCustomView" id="790712736">
|
||||
<reference key="NSNextResponder"/>
|
||||
<nil key="NSNextResponder"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<object class="NSMutableArray" key="NSSubviews">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
@@ -419,7 +440,7 @@
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBObjectContainer" key="IBDocument.Objects">
|
||||
<object class="NSMutableArray" key="connectionRecords">
|
||||
<object class="NSArray" key="connectionRecords">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
@@ -745,6 +766,7 @@
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>-3.IBPluginDependency</string>
|
||||
<string>10.IBPluginDependency</string>
|
||||
<string>11.CustomClassName</string>
|
||||
<string>11.IBPluginDependency</string>
|
||||
<string>13.IBPluginDependency</string>
|
||||
<string>16.CustomClassName</string>
|
||||
@@ -782,6 +804,7 @@
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>TrackableOutlineView</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>PBSourceViewCell</string>
|
||||
@@ -1003,7 +1026,7 @@
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">PBGitSidebarController.h</string>
|
||||
<string key="minorKey">./classes-xjh84/PBGitSidebarController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
@@ -1011,7 +1034,7 @@
|
||||
<string key="superclassName">NSTextFieldCell</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">PBIconAndTextCell.h</string>
|
||||
<string key="minorKey">./classes-xjh84/PBIconAndTextCell.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
@@ -1019,7 +1042,7 @@
|
||||
<string key="superclassName">PBIconAndTextCell</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">PBSourceViewCell.h</string>
|
||||
<string key="minorKey">./classes-xjh84/PBSourceViewCell.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
@@ -1652,35 +1675,32 @@
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">AppKit.framework/Headers/NSDrawer.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSWindow</string>
|
||||
<string key="superclassName">NSResponder</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">AppKit.framework/Headers/NSWindow.h</string>
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">./classes-xjh84/PBViewController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSWindow</string>
|
||||
<string key="className">TrackableOutlineView</string>
|
||||
<string key="superclassName">NSOutlineView</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">AppKit.framework/Headers/NSWindowScripting.h</string>
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">./classes-xjh84/TrackableOutlineView.h</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<int key="IBDocument.localizationMode">0</int>
|
||||
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies">
|
||||
<object class="NSDictionary" key="IBDocument.PluginDeclaredDependencies">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
|
||||
<integer value="1050" key="NS.object.0"/>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
|
||||
<object class="NSDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
|
||||
<integer value="1050" key="NS.object.0"/>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
|
||||
<object class="NSDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string>
|
||||
<integer value="3000" key="NS.object.0"/>
|
||||
</object>
|
||||
|
||||
@@ -43,7 +43,11 @@
|
||||
|
||||
- (BOOL)validateMenuItem:(NSMenuItem *)menuItem
|
||||
{
|
||||
if ([menuItem action] == @selector(showCommitView:) || [menuItem action] == @selector(showHistoryView:)) {
|
||||
if ([menuItem action] == @selector(showCommitView:)) {
|
||||
[menuItem setState:(contentController == sidebarController.commitViewController) ? YES : NO];
|
||||
return ![repository isBareRepository];
|
||||
} else if ([menuItem action] == @selector(showHistoryView:)) {
|
||||
[menuItem setState:(contentController != sidebarController.commitViewController) ? YES : NO];
|
||||
return ![repository isBareRepository];
|
||||
}
|
||||
return YES;
|
||||
|
||||
@@ -26,12 +26,12 @@
|
||||
return cell;
|
||||
}
|
||||
|
||||
- (void)selectWithFrame:(NSRect)aRect inView:(NSView *)controlView editor:(NSText *)textObj delegate:(id)anObject start:(NSInteger)selStart length:(NSInteger)selLength
|
||||
{
|
||||
NSRect textFrame, imageFrame;
|
||||
NSDivideRect (aRect, &imageFrame, &textFrame, 3 + [image size].width, NSMinXEdge);
|
||||
[super selectWithFrame: textFrame inView: controlView editor:textObj delegate:anObject start:selStart length:selLength];
|
||||
}
|
||||
//- (void)selectWithFrame:(NSRect)aRect inView:(NSView *)controlView editor:(NSText *)textObj delegate:(id)anObject start:(NSInteger)selStart length:(NSInteger)selLength
|
||||
//{
|
||||
// NSRect textFrame, imageFrame;
|
||||
// NSDivideRect (aRect, &imageFrame, &textFrame, 3 + [image size].width, NSMinXEdge);
|
||||
// [super selectWithFrame: textFrame inView: controlView editor:textObj delegate:anObject start:selStart length:selLength];
|
||||
//}
|
||||
|
||||
- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
|
||||
{
|
||||
@@ -69,56 +69,56 @@
|
||||
// = Hit testing =
|
||||
// ===============
|
||||
// Adopted from PhotoSearch Apple sample code
|
||||
//
|
||||
//- (NSUInteger)hitTestForEvent:(NSEvent *)event inRect:(NSRect)cellFrame ofView:(NSView *)controlView
|
||||
//{
|
||||
// NSPoint point = [controlView convertPoint:[event locationInWindow] fromView:nil];
|
||||
//
|
||||
// NSRect textFrame, imageFrame;
|
||||
// NSDivideRect (cellFrame, &imageFrame, &textFrame, 3 + [image size].width, NSMinXEdge);
|
||||
// if (NSMouseInRect(point, imageFrame, [controlView isFlipped]))
|
||||
// return NSCellHitContentArea | NSCellHitTrackableArea;
|
||||
//
|
||||
// return [super hitTestForEvent:event inRect:cellFrame ofView:controlView];
|
||||
//}
|
||||
|
||||
- (NSUInteger)hitTestForEvent:(NSEvent *)event inRect:(NSRect)cellFrame ofView:(NSView *)controlView
|
||||
{
|
||||
NSPoint point = [controlView convertPoint:[event locationInWindow] fromView:nil];
|
||||
|
||||
NSRect textFrame, imageFrame;
|
||||
NSDivideRect (cellFrame, &imageFrame, &textFrame, 3 + [image size].width, NSMinXEdge);
|
||||
if (NSMouseInRect(point, imageFrame, [controlView isFlipped]))
|
||||
return NSCellHitContentArea | NSCellHitTrackableArea;
|
||||
|
||||
return [super hitTestForEvent:event inRect:cellFrame ofView:controlView];
|
||||
}
|
||||
|
||||
+ (BOOL)prefersTrackingUntilMouseUp
|
||||
{
|
||||
// NSCell returns NO for this by default. If you want to have trackMouse:inRect:ofView:untilMouseUp: always track until the mouse is up, then you MUST return YES. Otherwise, strange things will happen.
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL)trackMouse:(NSEvent *)theEvent inRect:(NSRect)cellFrame ofView:(NSView *)controlView untilMouseUp:(BOOL)flag
|
||||
{
|
||||
[self setControlView:controlView];
|
||||
|
||||
NSRect textFrame, imageFrame;
|
||||
NSDivideRect (cellFrame, &imageFrame, &textFrame, 3 + [image size].width, NSMinXEdge);
|
||||
while ([theEvent type] != NSLeftMouseUp) {
|
||||
// This is VERY simple event tracking. We simply check to see if the mouse is in the "i" button or not and dispatch entered/exited mouse events
|
||||
NSPoint point = [controlView convertPoint:[theEvent locationInWindow] fromView:nil];
|
||||
BOOL mouseInButton = NSMouseInRect(point, imageFrame, [controlView isFlipped]);
|
||||
if (mouseDownInButton != mouseInButton) {
|
||||
mouseDownInButton = mouseInButton;
|
||||
[controlView setNeedsDisplayInRect:cellFrame];
|
||||
}
|
||||
if ([theEvent type] == NSMouseEntered || [theEvent type] == NSMouseExited)
|
||||
[NSApp sendEvent:theEvent];
|
||||
// Note that we process mouse entered and exited events and dispatch them to properly handle updates
|
||||
theEvent = [[controlView window] nextEventMatchingMask:(NSLeftMouseUpMask | NSLeftMouseDraggedMask | NSMouseEnteredMask | NSMouseExitedMask)];
|
||||
}
|
||||
|
||||
// Another way of implementing the above code would be to keep an NSButtonCell as an ivar, and simply call trackMouse:inRect:ofView:untilMouseUp: on it, if the tracking area was inside of it.
|
||||
if (mouseDownInButton) {
|
||||
// Send the action, and redisplay
|
||||
mouseDownInButton = NO;
|
||||
[controlView setNeedsDisplayInRect:cellFrame];
|
||||
if (self.action)
|
||||
[NSApp sendAction:self.action to:self.target from:self];
|
||||
}
|
||||
|
||||
// We return YES since the mouse was released while we were tracking. Not returning YES when you processed the mouse up is an easy way to introduce bugs!
|
||||
return YES;
|
||||
}
|
||||
//+ (BOOL)prefersTrackingUntilMouseUp
|
||||
//{
|
||||
// // NSCell returns NO for this by default. If you want to have trackMouse:inRect:ofView:untilMouseUp: always track until the mouse is up, then you MUST return YES. Otherwise, strange things will happen.
|
||||
// return YES;
|
||||
//}
|
||||
//
|
||||
//- (BOOL)trackMouse:(NSEvent *)theEvent inRect:(NSRect)cellFrame ofView:(NSView *)controlView untilMouseUp:(BOOL)flag
|
||||
//{
|
||||
// [self setControlView:controlView];
|
||||
//
|
||||
// NSRect textFrame, imageFrame;
|
||||
// NSDivideRect (cellFrame, &imageFrame, &textFrame, 3 + [image size].width, NSMinXEdge);
|
||||
// while ([theEvent type] != NSLeftMouseUp) {
|
||||
// // This is VERY simple event tracking. We simply check to see if the mouse is in the "i" button or not and dispatch entered/exited mouse events
|
||||
// NSPoint point = [controlView convertPoint:[theEvent locationInWindow] fromView:nil];
|
||||
// BOOL mouseInButton = NSMouseInRect(point, imageFrame, [controlView isFlipped]);
|
||||
// if (mouseDownInButton != mouseInButton) {
|
||||
// mouseDownInButton = mouseInButton;
|
||||
// [controlView setNeedsDisplayInRect:cellFrame];
|
||||
// }
|
||||
// if ([theEvent type] == NSMouseEntered || [theEvent type] == NSMouseExited)
|
||||
// [NSApp sendEvent:theEvent];
|
||||
// // Note that we process mouse entered and exited events and dispatch them to properly handle updates
|
||||
// theEvent = [[controlView window] nextEventMatchingMask:(NSLeftMouseUpMask | NSLeftMouseDraggedMask | NSMouseEnteredMask | NSMouseExitedMask)];
|
||||
// }
|
||||
//
|
||||
// // Another way of implementing the above code would be to keep an NSButtonCell as an ivar, and simply call trackMouse:inRect:ofView:untilMouseUp: on it, if the tracking area was inside of it.
|
||||
// if (mouseDownInButton) {
|
||||
// // Send the action, and redisplay
|
||||
// mouseDownInButton = NO;
|
||||
// [controlView setNeedsDisplayInRect:cellFrame];
|
||||
// if (self.action)
|
||||
// [NSApp sendAction:self.action to:self.target from:self];
|
||||
// }
|
||||
//
|
||||
// // We return YES since the mouse was released while we were tracking. Not returning YES when you processed the mouse up is an easy way to introduce bugs!
|
||||
// return YES;
|
||||
//}
|
||||
|
||||
@end
|
||||
|
||||
@@ -27,5 +27,6 @@
|
||||
- (void)pathCell:(NSPathCell *)pathCell willDisplayOpenPanel:(NSOpenPanel *)openPanel;
|
||||
- (IBAction) showHideAllFiles: sender;
|
||||
- (IBAction) resetGitPath: sender;
|
||||
- (IBAction)resetAllDialogWarnings:(id)sender;
|
||||
|
||||
@end
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
#import "PBPrefsWindowController.h"
|
||||
#import "PBGitRepository.h"
|
||||
#import "PBGitDefaults.h"
|
||||
|
||||
#define kPreferenceViewIdentifier @"PBGitXPreferenceViewIdentifier"
|
||||
|
||||
@@ -68,6 +69,11 @@
|
||||
gitPathOpenPanel = openPanel;
|
||||
}
|
||||
|
||||
- (IBAction)resetAllDialogWarnings:(id)sender
|
||||
{
|
||||
[PBGitDefaults resetAllDialogWarnings];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Git Path open panel actions
|
||||
|
||||
|
||||
@@ -14,6 +14,14 @@
|
||||
#import "PBGitDefaults.h"
|
||||
#import "PBDiffWindowController.h"
|
||||
|
||||
#import "PBArgumentPickerController.h"
|
||||
|
||||
#define kDialogAcceptDroppedRef @"Accept Dropped Ref"
|
||||
#define kDialogConfirmPush @"Confirm Push"
|
||||
#define kDialogDeleteRef @"Delete Ref"
|
||||
|
||||
|
||||
|
||||
@implementation PBRefController
|
||||
|
||||
- (void)awakeFromNib
|
||||
@@ -45,13 +53,18 @@
|
||||
|
||||
#pragma mark Push
|
||||
|
||||
- (void) showConfirmPushRefSheet:(PBGitRef *)ref remote:(PBGitRef *)remoteRef
|
||||
- (void)showConfirmPushRefSheet:(PBGitRef *)ref remote:(PBGitRef *)remoteRef
|
||||
{
|
||||
if ((!ref && !remoteRef)
|
||||
|| (ref && ![ref isBranch] && ![ref isRemoteBranch])
|
||||
|| (remoteRef && !([remoteRef refishType] == kGitXRemoteType)))
|
||||
return;
|
||||
|
||||
if ([PBGitDefaults isDialogWarningSuppressedForDialog:kDialogConfirmPush]) {
|
||||
[historyController.repository beginPushRef:ref toRemote:remoteRef];
|
||||
return;
|
||||
}
|
||||
|
||||
NSString *description = nil;
|
||||
if (ref && remoteRef)
|
||||
description = [NSString stringWithFormat:@"Push %@ '%@' to remote %@", [ref refishType], [ref shortName], [remoteRef remoteName]];
|
||||
@@ -66,6 +79,7 @@
|
||||
alternateButton:@"Cancel"
|
||||
otherButton:nil
|
||||
informativeTextWithFormat:@"Are you sure you want to %@?", sdesc];
|
||||
[alert setShowsSuppressionButton:YES];
|
||||
|
||||
NSMutableDictionary *info = [NSMutableDictionary dictionary];
|
||||
if (ref)
|
||||
@@ -79,10 +93,13 @@
|
||||
contextInfo:info];
|
||||
}
|
||||
|
||||
- (void) confirmPushRefSheetDidEnd:(NSAlert *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo
|
||||
- (void)confirmPushRefSheetDidEnd:(NSAlert *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo
|
||||
{
|
||||
[[sheet window] orderOut:nil];
|
||||
|
||||
if ([[sheet suppressionButton] state] == NSOnState)
|
||||
[PBGitDefaults suppressDialogWarningForDialog:kDialogConfirmPush];
|
||||
|
||||
if (returnCode == NSAlertDefaultReturn) {
|
||||
PBGitRef *ref = [(NSDictionary *)contextInfo objectForKey:kGitXBranchType];
|
||||
PBGitRef *remoteRef = [(NSDictionary *)contextInfo objectForKey:kGitXRemoteType];
|
||||
@@ -212,7 +229,7 @@
|
||||
}
|
||||
|
||||
- (void) showTagInfoSheet:(PBRefMenuItem *)sender
|
||||
{
|
||||
{
|
||||
if ([[sender refish] refishType] != kGitXTagType)
|
||||
return;
|
||||
|
||||
@@ -230,12 +247,18 @@
|
||||
|
||||
#pragma mark Remove a branch, remote or tag
|
||||
|
||||
- (void) showDeleteRefSheet:(PBRefMenuItem *)sender
|
||||
- (void)showDeleteRefSheet:(PBRefMenuItem *)sender
|
||||
{
|
||||
if ([[sender refish] refishType] == kGitXCommitType)
|
||||
return;
|
||||
|
||||
PBGitRef *ref = (PBGitRef *)[sender refish];
|
||||
|
||||
if ([PBGitDefaults isDialogWarningSuppressedForDialog:kDialogDeleteRef]) {
|
||||
[historyController.repository deleteRef:ref];
|
||||
return;
|
||||
}
|
||||
|
||||
NSString *ref_desc = [NSString stringWithFormat:@"%@ '%@'", [ref refishType], [ref shortName]];
|
||||
|
||||
NSAlert *alert = [NSAlert alertWithMessageText:[NSString stringWithFormat:@"Delete %@?", ref_desc]
|
||||
@@ -243,6 +266,7 @@
|
||||
alternateButton:@"Cancel"
|
||||
otherButton:nil
|
||||
informativeTextWithFormat:@"Are you sure you want to remove the %@?", ref_desc];
|
||||
[alert setShowsSuppressionButton:YES];
|
||||
|
||||
[alert beginSheetModalForWindow:[historyController.repository.windowController window]
|
||||
modalDelegate:self
|
||||
@@ -250,10 +274,13 @@
|
||||
contextInfo:ref];
|
||||
}
|
||||
|
||||
- (void) deleteRefSheetDidEnd:(NSAlert *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo
|
||||
- (void)deleteRefSheetDidEnd:(NSAlert *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo
|
||||
{
|
||||
[[sheet window] orderOut:nil];
|
||||
|
||||
if ([[sheet suppressionButton] state] == NSOnState)
|
||||
[PBGitDefaults suppressDialogWarningForDialog:kDialogDeleteRef];
|
||||
|
||||
if (returnCode == NSAlertDefaultReturn) {
|
||||
PBGitRef *ref = (PBGitRef *)contextInfo;
|
||||
[historyController.repository deleteRef:ref];
|
||||
@@ -347,6 +374,7 @@
|
||||
|
||||
[dropCommit addRef:ref];
|
||||
[oldCommit removeRef:ref];
|
||||
[historyController.commitList reloadData];
|
||||
}
|
||||
|
||||
- (BOOL)tableView:(NSTableView *)aTableView
|
||||
@@ -379,7 +407,7 @@
|
||||
dropCommit, @"dropCommit",
|
||||
nil];
|
||||
|
||||
if ([PBGitDefaults suppressAcceptDropRef]) {
|
||||
if ([PBGitDefaults isDialogWarningSuppressedForDialog:kDialogAcceptDroppedRef]) {
|
||||
[self dropRef:dropInfo];
|
||||
return YES;
|
||||
}
|
||||
@@ -404,7 +432,7 @@
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void) acceptDropInfoAlertDidEnd:(NSAlert *)alert returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo
|
||||
- (void)acceptDropInfoAlertDidEnd:(NSAlert *)alert returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo
|
||||
{
|
||||
[[alert window] orderOut:nil];
|
||||
|
||||
@@ -412,7 +440,7 @@
|
||||
[self dropRef:contextInfo];
|
||||
|
||||
if ([[alert suppressionButton] state] == NSOnState)
|
||||
[PBGitDefaults setSuppressAcceptDropRef:YES];
|
||||
[PBGitDefaults suppressDialogWarningForDialog:kDialogAcceptDroppedRef];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
|
||||
#import "PBRefMenuItem.h"
|
||||
|
||||
#import "PBStashCommandFactory.h"
|
||||
#import "PBCommandMenuItem.h"
|
||||
|
||||
|
||||
@implementation PBRefMenuItem
|
||||
@synthesize refish;
|
||||
@@ -133,7 +136,7 @@
|
||||
[items addObject:[PBRefMenuItem separatorItem]];
|
||||
NSString *deleteTitle = [NSString stringWithFormat:@"Delete %@…", targetRefName];
|
||||
[items addObject:[PBRefMenuItem itemWithTitle:deleteTitle action:@selector(showDeleteRefSheet:) enabled:!isDetachedHead]];
|
||||
|
||||
|
||||
for (PBRefMenuItem *item in items) {
|
||||
[item setTarget:target];
|
||||
[item setRefish:ref];
|
||||
|
||||
@@ -12,8 +12,14 @@
|
||||
|
||||
@interface PBSourceViewCell : PBIconAndTextCell {
|
||||
BOOL isCheckedOut;
|
||||
BOOL showsActionButton;
|
||||
|
||||
BOOL iMouseDownInInfoButton;
|
||||
BOOL iMouseHoveredInInfoButton;
|
||||
SEL iInfoButtonAction;
|
||||
}
|
||||
|
||||
@property (nonatomic) BOOL showsActionButton;
|
||||
@property (nonatomic) SEL iInfoButtonAction;
|
||||
@property (assign) BOOL isCheckedOut;
|
||||
|
||||
@end
|
||||
|
||||
@@ -10,22 +10,32 @@
|
||||
#import "PBGitSidebarController.h"
|
||||
#import "PBSourceViewBadge.h"
|
||||
|
||||
|
||||
@interface PBSourceViewCell()
|
||||
- (NSRect)infoButtonRectForBounds:(NSRect)bounds;
|
||||
@end
|
||||
|
||||
|
||||
@implementation PBSourceViewCell
|
||||
|
||||
@synthesize iInfoButtonAction;
|
||||
@synthesize isCheckedOut;
|
||||
@synthesize showsActionButton;
|
||||
|
||||
# pragma mark context menu delegate methods
|
||||
|
||||
- init {
|
||||
if (self = [super init]) {
|
||||
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (NSMenu *) menuForEvent:(NSEvent *)event inRect:(NSRect)rect ofView:(NSOutlineView *)view
|
||||
{
|
||||
NSPoint point = [view convertPoint:[event locationInWindow] fromView:nil];
|
||||
NSPoint point = [self.controlView convertPoint:[event locationInWindow] fromView:nil];
|
||||
NSInteger row = [view rowAtPoint:point];
|
||||
|
||||
PBGitSidebarController *controller = [view delegate];
|
||||
|
||||
|
||||
return [controller menuForRow:row];
|
||||
}
|
||||
|
||||
@@ -33,7 +43,7 @@
|
||||
#pragma mark drawing
|
||||
|
||||
- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)outlineView
|
||||
{
|
||||
{
|
||||
if (isCheckedOut) {
|
||||
NSImage *checkedOutImage = [PBSourceViewBadge checkedOutBadgeForCell:self];
|
||||
NSSize imageSize = [checkedOutImage size];
|
||||
@@ -52,4 +62,152 @@
|
||||
[super drawWithFrame:cellFrame inView:outlineView];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Button support
|
||||
|
||||
- (NSRect)infoButtonRectForBounds:(NSRect)bounds {
|
||||
CGFloat infoButtonWidth = 17.0f;
|
||||
CGFloat infoButtonHeight = 11.0f;
|
||||
return NSMakeRect(NSMaxX(bounds) - infoButtonWidth, NSMinY(bounds) + (NSHeight(bounds) - infoButtonHeight)/2.0f, infoButtonWidth, infoButtonHeight);
|
||||
}
|
||||
|
||||
- (NSImage *)infoButtonImage {
|
||||
// Construct an image name based on our current state
|
||||
NSString *imageName = [NSString stringWithFormat:@"sourceListAction%@.png",
|
||||
//[self isHighlighted] ? @"selected" : @"normal",
|
||||
iMouseDownInInfoButton ? @"Over" :
|
||||
iMouseHoveredInInfoButton ? @"Over" : @""];
|
||||
return [NSImage imageNamed:imageName];
|
||||
}
|
||||
|
||||
- (void)drawInteriorWithFrame:(NSRect)bounds inView:(NSView *)controlView {
|
||||
[super drawInteriorWithFrame:bounds inView:controlView];
|
||||
|
||||
if (showsActionButton) {
|
||||
NSRect infoButtonRect = [self infoButtonRectForBounds:bounds];
|
||||
NSImage *anImage = [self infoButtonImage];
|
||||
[anImage setFlipped:[controlView isFlipped]];
|
||||
[anImage drawInRect:infoButtonRect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//- (NSUInteger)hitTestForEvent:(NSEvent *)event inRect:(NSRect)cellFrame ofView:(NSView *)controlView {
|
||||
// if (showsActionButton) {
|
||||
// NSPoint point = [controlView convertPoint:[event locationInWindow] fromView:nil];
|
||||
// //
|
||||
// // NSRect titleRect = [self titleRectForBounds:cellFrame];
|
||||
// // if (NSMouseInRect(point, titleRect, [controlView isFlipped])) {
|
||||
// // return NSCellHitContentArea | NSCellHitEditableTextArea;
|
||||
// // }
|
||||
// //
|
||||
// // NSRect imageRect = [self imageRectForBounds:cellFrame];
|
||||
// // if (NSMouseInRect(point, imageRect, [controlView isFlipped])) {
|
||||
// // return NSCellHitContentArea;
|
||||
// // }
|
||||
// //
|
||||
// // // Did we hit the sub title?
|
||||
// // NSAttributedString *attributedSubTitle = [self attributedSubTitle];
|
||||
// // if ([attributedSubTitle length] > 0) {
|
||||
// // NSRect attributedSubTitleRect = [self rectForSubTitleBasedOnTitleRect:titleRect inBounds:cellFrame];
|
||||
// // if (NSMouseInRect(point, attributedSubTitleRect, [controlView isFlipped])) {
|
||||
// // // Notice that this text isn't an editable area. Clicking on it won't begin an editing session.
|
||||
// // return NSCellHitContentArea;
|
||||
// // }
|
||||
// // }
|
||||
//
|
||||
// // How about the info button?
|
||||
// NSRect infoButtonRect = [self infoButtonRectForBounds:cellFrame];
|
||||
// if (NSMouseInRect(point, infoButtonRect, [controlView isFlipped])) {
|
||||
// return NSCellHitContentArea | NSCellHitTrackableArea;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return [super hitTestForEvent:event inRect:cellFrame ofView:controlView];
|
||||
//}
|
||||
|
||||
//+ (BOOL)prefersTrackingUntilMouseUp {
|
||||
// // NSCell returns NO for this by default. If you want to have trackMouse:inRect:ofView:untilMouseUp: always track until the mouse is up, then you MUST return YES. Otherwise, strange things will happen.
|
||||
// return YES;
|
||||
//}
|
||||
|
||||
// Mouse tracking -- the only part we want to track is the "info" button
|
||||
- (BOOL)trackMouse:(NSEvent *)theEvent inRect:(NSRect)cellFrame ofView:(NSView *)controlView untilMouseUp:(BOOL)flag {
|
||||
// [self setControlView:controlView];
|
||||
//
|
||||
NSRect infoButtonRect = [self infoButtonRectForBounds:cellFrame];
|
||||
if ([theEvent type] != NSLeftMouseUp) {
|
||||
// This is VERY simple event tracking. We simply check to see if the mouse is in the "i" button or not and dispatch entered/exited mouse events
|
||||
NSPoint point = [controlView convertPoint:[theEvent locationInWindow] fromView:nil];
|
||||
BOOL mouseInButton = NSMouseInRect(point, infoButtonRect, [controlView isFlipped]);
|
||||
if (iMouseDownInInfoButton != mouseInButton) {
|
||||
iMouseDownInInfoButton = mouseInButton;
|
||||
[controlView setNeedsDisplayInRect:cellFrame];
|
||||
}
|
||||
if ([theEvent type] == NSMouseEntered || [theEvent type] == NSMouseExited) {
|
||||
[NSApp sendEvent:theEvent];
|
||||
}
|
||||
// Note that we process mouse entered and exited events and dispatch them to properly handle updates
|
||||
theEvent = [[controlView window] nextEventMatchingMask:(NSLeftMouseUpMask | NSLeftMouseDraggedMask | NSMouseEnteredMask | NSMouseExitedMask)];
|
||||
}
|
||||
|
||||
// Another way of implementing the above code would be to keep an NSButtonCell as an ivar, and simply call trackMouse:inRect:ofView:untilMouseUp: on it, if the tracking area was inside of it.
|
||||
|
||||
NSPoint locationOfTouch = [controlView convertPoint:[theEvent locationInWindow] fromView:nil];
|
||||
|
||||
BOOL mouseInButton = NSMouseInRect(locationOfTouch, [self infoButtonRectForBounds:cellFrame], [controlView isFlipped]);
|
||||
if (mouseInButton) {
|
||||
// show menu
|
||||
NSMenu *menu = [self menuForEvent:theEvent inRect:cellFrame ofView:controlView];
|
||||
if (menu){
|
||||
[NSMenu popUpContextMenu:menu withEvent:theEvent forView:controlView];
|
||||
}
|
||||
}
|
||||
|
||||
if (iMouseDownInInfoButton) {
|
||||
// Send the action, and redisplay
|
||||
iMouseDownInInfoButton = NO;
|
||||
[controlView setNeedsDisplayInRect:cellFrame];
|
||||
}
|
||||
|
||||
return [super trackMouse:theEvent inRect:cellFrame ofView:controlView untilMouseUp:flag];
|
||||
|
||||
|
||||
//
|
||||
// // We return YES since the mouse was released while we were tracking. Not returning YES when you processed the mouse up is an easy way to introduce bugs!
|
||||
// return YES;
|
||||
}
|
||||
|
||||
|
||||
// Mouse movement tracking -- we have a custom NSOutlineView subclass that automatically lets us add mouseEntered:/mouseExited: support to any cell!
|
||||
- (void)addTrackingAreasForView:(NSView *)controlView inRect:(NSRect)cellFrame withUserInfo:(NSDictionary *)userInfo mouseLocation:(NSPoint)mouseLocation {
|
||||
NSRect infoButtonRect = [self infoButtonRectForBounds:cellFrame];
|
||||
|
||||
NSTrackingAreaOptions options = NSTrackingEnabledDuringMouseDrag | NSTrackingMouseEnteredAndExited | NSTrackingActiveAlways;
|
||||
|
||||
BOOL mouseIsInside = NSMouseInRect(mouseLocation, infoButtonRect, [controlView isFlipped]);
|
||||
if (mouseIsInside) {
|
||||
options |= NSTrackingAssumeInside;
|
||||
[controlView setNeedsDisplayInRect:cellFrame];
|
||||
}
|
||||
|
||||
// We make the view the owner, and it delegates the calls back to the cell after it is properly setup for the corresponding row/column in the outlineview
|
||||
NSTrackingArea *area = [[NSTrackingArea alloc] initWithRect:infoButtonRect options:options owner:controlView userInfo:userInfo];
|
||||
[controlView addTrackingArea:area];
|
||||
[area release];
|
||||
}
|
||||
|
||||
- (void)mouseEntered:(NSEvent *)event {
|
||||
iMouseHoveredInInfoButton = YES;
|
||||
[(NSControl *)[self controlView] updateCell:self];
|
||||
}
|
||||
|
||||
- (void)mouseExited:(NSEvent *)event {
|
||||
iMouseHoveredInInfoButton = NO;
|
||||
[(NSControl *)[self controlView] updateCell:self];
|
||||
}
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@@ -20,7 +20,10 @@
|
||||
|
||||
BOOL isGroupItem;
|
||||
BOOL isUncollapsible;
|
||||
|
||||
BOOL showsActionButton;
|
||||
}
|
||||
@property (nonatomic) BOOL showsActionButton;
|
||||
|
||||
+ (id)groupItemWithTitle:(NSString *)title;
|
||||
+ (id)itemWithRevSpec:(PBGitRevSpecifier *)revSpecifier;
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
|
||||
@implementation PBSourceViewItem
|
||||
@synthesize parent, title, isGroupItem, children, revSpecifier, isUncollapsible;
|
||||
@synthesize showsActionButton;
|
||||
@dynamic icon;
|
||||
|
||||
- (id)init
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// PBStashController.h
|
||||
// GitX
|
||||
//
|
||||
// Created by Tomasz Krasnyk on 10-11-27.
|
||||
// Copyright (c) 2010 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "PBGitStash.h"
|
||||
|
||||
@class PBGitRepository;
|
||||
|
||||
@interface PBStashController : NSObject {
|
||||
NSArray *stashes;
|
||||
@private
|
||||
PBGitRepository *repository;
|
||||
}
|
||||
@property (nonatomic, retain, readonly) NSArray *stashes;
|
||||
|
||||
- (id) initWithRepository:(PBGitRepository *) repo;
|
||||
|
||||
- (void) reload;
|
||||
|
||||
- (NSArray *) menu;
|
||||
|
||||
// actions
|
||||
- (void) stashLocalChanges;
|
||||
- (void) clearAllStashes;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,110 @@
|
||||
//
|
||||
// PBStashController.m
|
||||
// GitX
|
||||
//
|
||||
// Created by Tomasz Krasnyk on 10-11-27.
|
||||
// Copyright (c) 2010 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#import "PBStashController.h"
|
||||
#import "PBGitRepository.h"
|
||||
#import "PBCommand.h"
|
||||
#import "PBCommandWithParameter.h"
|
||||
|
||||
static NSString * const kCommandName = @"stash";
|
||||
|
||||
@interface PBStashController()
|
||||
@property (nonatomic, retain) NSArray *stashes;
|
||||
@end
|
||||
|
||||
|
||||
|
||||
@implementation PBStashController
|
||||
@synthesize stashes;
|
||||
|
||||
- (id) initWithRepository:(PBGitRepository *) repo {
|
||||
if (self = [super init]){
|
||||
repository = [repo retain];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[repository release];
|
||||
[stashes release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (void) reload {
|
||||
NSArray *arguments = [NSArray arrayWithObjects:kCommandName, @"list", nil];
|
||||
NSString *output = [repository outputInWorkdirForArguments:arguments];
|
||||
NSArray *lines = [output componentsSeparatedByString:@"\n"];
|
||||
|
||||
NSMutableArray *loadedStashes = [[NSMutableArray alloc] initWithCapacity:[lines count]];
|
||||
|
||||
for (NSString *stashLine in lines) {
|
||||
if ([stashLine length] == 0)
|
||||
continue;
|
||||
PBGitStash *stash = [[PBGitStash alloc] initWithRawStashLine:stashLine];
|
||||
[loadedStashes addObject:stash];
|
||||
[stash release];
|
||||
}
|
||||
|
||||
self.stashes = loadedStashes;
|
||||
[loadedStashes release];
|
||||
}
|
||||
|
||||
#pragma mark Actions
|
||||
|
||||
- (void) stashLocalChanges {
|
||||
NSArray *args = [NSArray arrayWithObject:kCommandName];
|
||||
PBCommand *command = [[PBCommand alloc] initWithDisplayName:@"Stash local changes..." parameters:args repository:repository];
|
||||
command.commandTitle = command.displayName;
|
||||
command.commandDescription = @"Stashing local changes";
|
||||
|
||||
PBCommandWithParameter *cmd = [[PBCommandWithParameter alloc] initWithCommand:command parameterName:@"save" parameterDisplayName:@"Stash message (optional)"];
|
||||
[command release];
|
||||
|
||||
[cmd invoke];
|
||||
[cmd release];
|
||||
}
|
||||
|
||||
- (void) clearAllStashes {
|
||||
PBCommand *command = [[PBCommand alloc] initWithDisplayName:@"Clear stashes" parameters:[NSArray arrayWithObjects:kCommandName, @"clear", nil] repository:repository];
|
||||
command.commandTitle = command.displayName;
|
||||
command.commandDescription = @"Clearing stashes";
|
||||
[command invoke];
|
||||
[command release];
|
||||
}
|
||||
|
||||
#pragma mark Menu
|
||||
|
||||
- (NSArray *) menu {
|
||||
NSMutableArray *array = [[NSMutableArray alloc] init];
|
||||
|
||||
NSMenuItem *stashChanges = [[NSMenuItem alloc] initWithTitle:@"Stash local changes..." action:@selector(stashLocalChanges) keyEquivalent:@""];
|
||||
[stashChanges setTarget:self];
|
||||
NSMenuItem *clearStashes = [[NSMenuItem alloc] initWithTitle:@"Clear stashes" action:@selector(clearAllStashes) keyEquivalent:@""];
|
||||
[clearStashes setTarget:self];
|
||||
|
||||
[array addObject:stashChanges];
|
||||
[array addObject:clearStashes];
|
||||
|
||||
return array;
|
||||
}
|
||||
|
||||
- (BOOL) validateMenuItem:(NSMenuItem *) item {
|
||||
SEL action = [item action];
|
||||
BOOL shouldBeEnabled = YES;
|
||||
|
||||
if (action == @selector(stashLocalChanges)) {
|
||||
//TODO: check if we have unstaged changes
|
||||
} else if (action == @selector(clearAllStashes)) {
|
||||
shouldBeEnabled = [self.stashes count] > 0;
|
||||
}
|
||||
|
||||
return shouldBeEnabled;
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
|
||||
File: CellTrackingRect.h
|
||||
|
||||
Abstract: This file provides a simple informal protocol for an NSCell.
|
||||
If the cell implements these methods, it can automatically respond
|
||||
to tracking area events generated by the TrackableOutlineView.
|
||||
|
||||
Version: 1.0
|
||||
|
||||
Disclaimer: IMPORTANT: This Apple software is supplied to you by
|
||||
Apple Inc. ("Apple") in consideration of your agreement to the
|
||||
following terms, and your use, installation, modification or
|
||||
redistribution of this Apple software constitutes acceptance of these
|
||||
terms. If you do not agree with these terms, please do not use,
|
||||
install, modify or redistribute this Apple software.
|
||||
|
||||
In consideration of your agreement to abide by the following terms, and
|
||||
subject to these terms, Apple grants you a personal, non-exclusive
|
||||
license, under Apple's copyrights in this original Apple software (the
|
||||
"Apple Software"), to use, reproduce, modify and redistribute the Apple
|
||||
Software, with or without modifications, in source and/or binary forms;
|
||||
provided that if you redistribute the Apple Software in its entirety and
|
||||
without modifications, you must retain this notice and the following
|
||||
text and disclaimers in all such redistributions of the Apple Software.
|
||||
Neither the name, trademarks, service marks or logos of Apple Inc.
|
||||
may be used to endorse or promote products derived from the Apple
|
||||
Software without specific prior written permission from Apple. Except
|
||||
as expressly stated in this notice, no other rights or licenses, express
|
||||
or implied, are granted by Apple herein, including but not limited to
|
||||
any patent rights that may be infringed by your derivative works or by
|
||||
other works in which the Apple Software may be incorporated.
|
||||
|
||||
The Apple Software is provided by Apple on an "AS IS" basis. APPLE
|
||||
MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
|
||||
THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
|
||||
FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
|
||||
OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
|
||||
|
||||
IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
|
||||
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
|
||||
MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
|
||||
AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
|
||||
STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
Copyright (C) 2006-2007 Apple Inc. All Rights Reserved.
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface NSCell (CellTrackingRect)
|
||||
|
||||
/* When called by the control, it is the cell's responsibility to add tracking areas that it wishes to respond to. The cell will then get the appropriate mouse messages sent to it from the control. The owner for the NSTrackingArea must be the control. The userInfo can be copied and have additional things added to it by the cell, if required.
|
||||
*/
|
||||
- (void)addTrackingAreasForView:(NSView *)view inRect:(NSRect)cellFrame withUserInfo:(NSDictionary *)userInfo mouseLocation:(NSPoint)currentPoint;
|
||||
|
||||
- (void)mouseEntered:(NSEvent *)event;
|
||||
- (void)mouseExited:(NSEvent *)event;
|
||||
|
||||
@end
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// PBArgumentPicker.h
|
||||
// GitX
|
||||
//
|
||||
// Created by Tomasz Krasnyk on 10-11-06.
|
||||
// Copyright 2010 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
|
||||
@interface PBArgumentPicker : NSView {
|
||||
IBOutlet NSTextField *textField;
|
||||
IBOutlet NSTextField *label;
|
||||
IBOutlet NSButton *okButton;
|
||||
IBOutlet NSButton *cancelButton;
|
||||
}
|
||||
@property (nonatomic, retain, readonly) NSTextField *textField;
|
||||
@property (nonatomic, retain, readonly) NSTextField *label;
|
||||
@property (nonatomic, retain, readonly) NSButton *okButton;
|
||||
@property (nonatomic, retain, readonly) NSButton *cancelButton;
|
||||
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,27 @@
|
||||
//
|
||||
// PBArgumentPicker.m
|
||||
// GitX
|
||||
//
|
||||
// Created by Tomasz Krasnyk on 10-11-06.
|
||||
// Copyright 2010 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#import "PBArgumentPicker.h"
|
||||
|
||||
|
||||
@implementation PBArgumentPicker
|
||||
@synthesize okButton;
|
||||
@synthesize cancelButton;
|
||||
@synthesize textField;
|
||||
@synthesize label;
|
||||
|
||||
- (id)initWithFrame:(NSRect)frame {
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
// Initialization code here.
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
|
||||
File: TrackableOutlineView.h
|
||||
|
||||
Abstract: This TrackableOutlineView class declaration.
|
||||
|
||||
Version: 1.0
|
||||
|
||||
Disclaimer: IMPORTANT: This Apple software is supplied to you by
|
||||
Apple Inc. ("Apple") in consideration of your agreement to the
|
||||
following terms, and your use, installation, modification or
|
||||
redistribution of this Apple software constitutes acceptance of these
|
||||
terms. If you do not agree with these terms, please do not use,
|
||||
install, modify or redistribute this Apple software.
|
||||
|
||||
In consideration of your agreement to abide by the following terms, and
|
||||
subject to these terms, Apple grants you a personal, non-exclusive
|
||||
license, under Apple's copyrights in this original Apple software (the
|
||||
"Apple Software"), to use, reproduce, modify and redistribute the Apple
|
||||
Software, with or without modifications, in source and/or binary forms;
|
||||
provided that if you redistribute the Apple Software in its entirety and
|
||||
without modifications, you must retain this notice and the following
|
||||
text and disclaimers in all such redistributions of the Apple Software.
|
||||
Neither the name, trademarks, service marks or logos of Apple Inc.
|
||||
may be used to endorse or promote products derived from the Apple
|
||||
Software without specific prior written permission from Apple. Except
|
||||
as expressly stated in this notice, no other rights or licenses, express
|
||||
or implied, are granted by Apple herein, including but not limited to
|
||||
any patent rights that may be infringed by your derivative works or by
|
||||
other works in which the Apple Software may be incorporated.
|
||||
|
||||
The Apple Software is provided by Apple on an "AS IS" basis. APPLE
|
||||
MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
|
||||
THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
|
||||
FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
|
||||
OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
|
||||
|
||||
IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
|
||||
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
|
||||
MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
|
||||
AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
|
||||
STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
Copyright (C) 2006-2007 Apple Inc. All Rights Reserved.
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface TrackableOutlineView : NSOutlineView
|
||||
{
|
||||
@private
|
||||
NSInteger iMouseRow, iMouseCol;
|
||||
NSCell *iMouseCell;
|
||||
}
|
||||
@end
|
||||
@@ -0,0 +1,185 @@
|
||||
/*
|
||||
|
||||
File: TrackableOutlineView.m
|
||||
|
||||
Abstract: The TrackableOutlineView provides an implementation of updateTrackingAreas
|
||||
that automatically delegates to cells which implement the informal
|
||||
CellTrackingRect protocol.
|
||||
|
||||
Version: 1.0
|
||||
|
||||
Disclaimer: IMPORTANT: This Apple software is supplied to you by
|
||||
Apple Inc. ("Apple") in consideration of your agreement to the
|
||||
following terms, and your use, installation, modification or
|
||||
redistribution of this Apple software constitutes acceptance of these
|
||||
terms. If you do not agree with these terms, please do not use,
|
||||
install, modify or redistribute this Apple software.
|
||||
|
||||
In consideration of your agreement to abide by the following terms, and
|
||||
subject to these terms, Apple grants you a personal, non-exclusive
|
||||
license, under Apple's copyrights in this original Apple software (the
|
||||
"Apple Software"), to use, reproduce, modify and redistribute the Apple
|
||||
Software, with or without modifications, in source and/or binary forms;
|
||||
provided that if you redistribute the Apple Software in its entirety and
|
||||
without modifications, you must retain this notice and the following
|
||||
text and disclaimers in all such redistributions of the Apple Software.
|
||||
Neither the name, trademarks, service marks or logos of Apple Inc.
|
||||
may be used to endorse or promote products derived from the Apple
|
||||
Software without specific prior written permission from Apple. Except
|
||||
as expressly stated in this notice, no other rights or licenses, express
|
||||
or implied, are granted by Apple herein, including but not limited to
|
||||
any patent rights that may be infringed by your derivative works or by
|
||||
other works in which the Apple Software may be incorporated.
|
||||
|
||||
The Apple Software is provided by Apple on an "AS IS" basis. APPLE
|
||||
MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
|
||||
THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
|
||||
FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
|
||||
OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
|
||||
|
||||
IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
|
||||
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
|
||||
MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
|
||||
AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
|
||||
STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
Copyright (C) 2006-2007 Apple Inc. All Rights Reserved.
|
||||
*/
|
||||
|
||||
#import "TrackableOutlineView.h"
|
||||
|
||||
#import <AppKit/NSTrackingArea.h>
|
||||
#import "CellTrackingRect.h"
|
||||
#import "PBGitSidebarController.h"
|
||||
|
||||
@implementation TrackableOutlineView
|
||||
|
||||
- (id)init {
|
||||
self = [super init];
|
||||
if (self) {
|
||||
iMouseRow = -1;
|
||||
iMouseCol = -1;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id)initWithCoder:(NSCoder *)coder {
|
||||
self = [super initWithCoder:coder];
|
||||
if (self) {
|
||||
iMouseRow = -1;
|
||||
iMouseCol = -1;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[iMouseCell release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
// Tracking rect support
|
||||
|
||||
- (void)updateTrackingAreas {
|
||||
for (NSTrackingArea *area in [self trackingAreas]) {
|
||||
// We have to uniquely identify our own tracking areas
|
||||
if (([area owner] == self) && ([[area userInfo] objectForKey:@"Row"] != nil)) {
|
||||
[self removeTrackingArea:area];
|
||||
}
|
||||
}
|
||||
|
||||
// Find the visible cells that have a non-empty tracking rect and add rects for each of them
|
||||
NSRange visibleRows = [self rowsInRect:[self visibleRect]];
|
||||
NSIndexSet *visibleColIndexes = [self columnIndexesInRect:[self visibleRect]];
|
||||
|
||||
NSPoint mouseLocation = [self convertPoint:[[self window] convertScreenToBase:[NSEvent mouseLocation]] fromView:nil];
|
||||
NSInteger row;
|
||||
for (row = visibleRows.location; row < visibleRows.location + visibleRows.length; row++ ) {
|
||||
// If it is a "full width" cell, we don't have to go through the rows
|
||||
NSCell *fullWidthCell = [self preparedCellAtColumn:-1 row:row];
|
||||
if (fullWidthCell) {
|
||||
if ([fullWidthCell respondsToSelector:@selector(addTrackingAreasForView:inRect:withUserInfo:mouseLocation:)]) {
|
||||
NSInteger col = -1;
|
||||
NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInteger:col], @"Col", [NSNumber numberWithInteger:row], @"Row", nil];
|
||||
[fullWidthCell addTrackingAreasForView:self inRect:[self frameOfCellAtColumn:col row:row] withUserInfo:userInfo mouseLocation:mouseLocation];
|
||||
}
|
||||
} else {
|
||||
NSInteger col;
|
||||
for (col = [visibleColIndexes firstIndex]; col != NSNotFound; col = [visibleColIndexes indexGreaterThanIndex:col]) {
|
||||
NSCell *cell = [self preparedCellAtColumn:col row:row];
|
||||
if ([cell respondsToSelector:@selector(addTrackingAreasForView:inRect:withUserInfo:mouseLocation:)]) {
|
||||
NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInteger:col], @"Col", [NSNumber numberWithInteger:row], @"Row", nil];
|
||||
[cell addTrackingAreasForView:self inRect:[self frameOfCellAtColumn:col row:row] withUserInfo:userInfo mouseLocation:mouseLocation];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)mouseEntered:(NSEvent *)event {
|
||||
// Delegate this to the appropriate cell. In order to allow the cell to maintain state, we copy it and use the copy until the mouse is moved outside of the cell.
|
||||
NSDictionary *userInfo = [event userData];
|
||||
NSNumber *row = [userInfo valueForKey:@"Row"];
|
||||
NSNumber *col = [userInfo valueForKey:@"Col"];
|
||||
if (row && col) {
|
||||
NSInteger rowVal = [row integerValue];
|
||||
NSInteger colVal = [col integerValue];
|
||||
NSCell *cell = [self preparedCellAtColumn:colVal row:rowVal];
|
||||
// Only set the mouseCell properties AFTER calling preparedCellAtColumn:row:.
|
||||
if (iMouseCell != cell) {
|
||||
[iMouseCell release];
|
||||
// Store off the col/row
|
||||
iMouseCol = colVal;
|
||||
iMouseRow = rowVal;
|
||||
// Store a COPY of the cell for use when tracking in an area
|
||||
iMouseCell = [cell copy];
|
||||
[iMouseCell setControlView:self];
|
||||
if ([iMouseCell respondsToSelector:@selector(mouseEntered:)]) {
|
||||
[iMouseCell mouseEntered:event];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)mouseExited:(NSEvent *)event {
|
||||
NSDictionary *userInfo = [event userData];
|
||||
NSNumber *row = [userInfo valueForKey:@"Row"];
|
||||
NSNumber *col = [userInfo valueForKey:@"Col"];
|
||||
if (row && col) {
|
||||
NSCell *cell = [self preparedCellAtColumn:[col integerValue] row:[row integerValue]];
|
||||
[cell setControlView:self];
|
||||
if ([cell respondsToSelector:@selector(mouseExited:)]) {
|
||||
[cell mouseExited:event];
|
||||
}
|
||||
// We are now done with the copied cell
|
||||
[iMouseCell release];
|
||||
iMouseCell = nil;
|
||||
iMouseCol = -1;
|
||||
iMouseRow = -1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Since NSTableView/NSOutineView uses the same cell to "stamp" out each row, we need to send the mouseEntered/mouseExited events each time it is drawn. The easy hook for this is the preparedCell method.
|
||||
*/
|
||||
- (NSCell *)preparedCellAtColumn:(NSInteger)column row:(NSInteger)row {
|
||||
// We check if the selectedCell is nil or not -- the selectedCell is a cell that is currently being edited or tracked. We don't want to return our override if we are in that state.
|
||||
if ([self selectedCell] == nil && (row == iMouseRow) && (column == iMouseCol)) {
|
||||
return iMouseCell;
|
||||
} else {
|
||||
return [super preparedCellAtColumn:column row:row];
|
||||
}
|
||||
}
|
||||
|
||||
/* In order for the cell to properly update itself with an "updateCell:" call, we must handle the "mouseCell" as a special case
|
||||
*/
|
||||
- (void)updateCell:(NSCell *)aCell {
|
||||
if (aCell == iMouseCell) {
|
||||
[self setNeedsDisplayInRect:[self frameOfCellAtColumn:iMouseCol row:iMouseRow]];
|
||||
} else {
|
||||
[super updateCell:aCell];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -124,9 +124,9 @@ void handleSTDINDiff()
|
||||
}
|
||||
}
|
||||
|
||||
void handleDiffWithArguments(NSURL *repositoryURL, NSMutableArray *arguments)
|
||||
void handleDiffWithArguments(NSURL *repositoryURL, NSArray *arguments)
|
||||
{
|
||||
[arguments insertObject:@"diff" atIndex:0];
|
||||
arguments = [[NSArray arrayWithObjects:@"diff", @"--no-ext-diff", nil] arrayByAddingObjectsFromArray:arguments];
|
||||
|
||||
int retValue = 1;
|
||||
NSString *diffOutput = [PBEasyPipe outputForCommand:[PBGitBinary path] withArgs:arguments inDir:[repositoryURL path] retValue:&retValue];
|
||||
|
||||
@@ -107,7 +107,7 @@ var gistie = function() {
|
||||
var t = new XMLHttpRequest();
|
||||
t.onreadystatechange = function() {
|
||||
if (t.readyState == 4 && t.status >= 200 && t.status < 300) {
|
||||
if (m = t.responseText.match(/gist: ([a-f0-9]+)/))
|
||||
if (m = t.responseText.match(/<a href="\/gists\/([a-f0-9]+)\/edit">/))
|
||||
notify("Code uploaded to gistie <a target='_new' href='http://gist.github.com/" + m[1] + "'>#" + m[1] + "</a>", 1);
|
||||
else {
|
||||
notify("Pasting to Gistie failed :(.", -1);
|
||||
@@ -116,7 +116,7 @@ var gistie = function() {
|
||||
}
|
||||
}
|
||||
|
||||
t.open('POST', "http://gist.github.com/gists");
|
||||
t.open('POST', "https://gist.github.com/gists");
|
||||
t.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
|
||||
t.setRequestHeader('Accept', 'text/javascript, text/html, application/xml, text/xml, */*');
|
||||
t.setRequestHeader('Content-type', 'application/x-www-form-urlencoded;charset=UTF-8');
|
||||
|
||||
|
After Width: | Height: | Size: 383 B |
|
After Width: | Height: | Size: 344 B |
|
After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 425 B |