Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

72 lines (51 sloc) 1.88 KB
// PBCloneRepsitoryToSheet.m
// GitX
// Created by Nathan Kinsinger on 2/7/10.
// Copyright 2010 Nathan Kinsinger. All rights reserved.
#import "PBCloneRepsitoryToSheet.h"
#import "PBGitRepository.h"
@interface PBCloneRepsitoryToSheet ()
- (void) beginCloneRepsitoryToSheetForRepository:(PBGitRepository *)repo;
@implementation PBCloneRepsitoryToSheet
@synthesize repository;
@synthesize isBare;
@synthesize message;
@synthesize cloneToAccessoryView;
#pragma mark -
#pragma mark PBCloneRepsitoryToSheet
+ (void) beginCloneRepsitoryToSheetForRepository:(PBGitRepository *)repo
PBCloneRepsitoryToSheet *sheet = [[self alloc] initWithWindowNibName:@"PBCloneRepsitoryToSheet"];
[sheet beginCloneRepsitoryToSheetForRepository:repo];
- (void) beginCloneRepsitoryToSheetForRepository:(PBGitRepository *)repo
self.repository = repo;
[self window];
- (void) awakeFromNib
NSOpenPanel *cloneToSheet = [NSOpenPanel openPanel];
[cloneToSheet setTitle:@"Clone Repository To"];
[cloneToSheet setPrompt:@"Clone"];
[self.message setStringValue:[NSString stringWithFormat:@"Select a folder to clone %@ into", [self.repository projectName]]];
[cloneToSheet setCanSelectHiddenExtension:NO];
[cloneToSheet setCanChooseFiles:NO];
[cloneToSheet setCanChooseDirectories:YES];
[cloneToSheet setAllowsMultipleSelection:NO];
[cloneToSheet setCanCreateDirectories:YES];
[cloneToSheet setAccessoryView:cloneToAccessoryView];
[cloneToSheet beginSheetModalForWindow:[(NSWindowController *)self.repository.windowController window] completionHandler:^(NSInteger result) {
[cloneToSheet orderOut:self];
if (result == NSOKButton) {
NSString *clonePath = [[cloneToSheet URL] absoluteString];
NSLog(@"clone path = %@", clonePath);
[self.repository cloneRepositoryToPath:clonePath bare:self.isBare];
Jump to Line
Something went wrong with that request. Please try again.