Refactor the gitx CLI to use apple events and the scripting bridge

Sending the arguments with the openURL:... message allows the repository document to modify it's UI without the UI flashing between states as it opens.

Covers all the existing functionality of the CLI, but modifies:
    - "--all" "--local" "--branch" change the branch filter
    - cleaned up the usage (help) text and added info on missing commands
    - looks up the full ref name of refs so the name of a branch or tag can be entered (the user can enter "master" instead of "refs/heads/master")

Modified the History Controller to watch for and react to branch filter changes.

The GitX.h file is generated by the 'sdp' tool in a run script build phase called 'Generate Scripting Bridge Header' based on the content of GitX.sdef. It is used by the Scripting Bridge so that other apps (in this case the gitx CLI) can call Applescript commands on GitX in objective-c.
This commit is contained in:
Nathan Kinsinger
2010-08-19 00:20:33 -06:00
parent beaa591b53
commit e60bb3226c
13 changed files with 610 additions and 97 deletions
+5 -8
View File
@@ -10,7 +10,6 @@
#import "PBGitRevisionCell.h"
#import "PBGitWindowController.h"
#import "PBRepositoryDocumentController.h"
#import "PBCLIProxy.h"
#import "PBServicesController.h"
#import "PBGitXProtocol.h"
#import "PBPrefsWindowController.h"
@@ -20,7 +19,6 @@
#import "Sparkle/SUUpdater.h"
@implementation ApplicationController
@synthesize cliProxy;
- (ApplicationController*)init
{
@@ -28,13 +26,12 @@
[NSApp activateIgnoringOtherApps:YES];
#endif
if(self = [super init]) {
if(![[NSBundle bundleWithPath:@"/System/Library/Frameworks/Quartz.framework/Frameworks/QuickLookUI.framework"] load])
if(![[NSBundle bundleWithPath:@"/System/Library/PrivateFrameworks/QuickLookUI.framework"] load])
NSLog(@"Could not load QuickLook");
if(!(self = [super init]))
return nil;
self.cliProxy = [PBCLIProxy new];
}
if(![[NSBundle bundleWithPath:@"/System/Library/Frameworks/Quartz.framework/Frameworks/QuickLookUI.framework"] load])
if(![[NSBundle bundleWithPath:@"/System/Library/PrivateFrameworks/QuickLookUI.framework"] load])
NSLog(@"Could not load QuickLook");
/* Value Transformers */
NSValueTransformer *transformer = [[PBNSURLPathUserDefaultsTransfomer alloc] init];