mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
Completing the document-based app setup.
Multiple repositories can now be opened by using the File → Open… menu option. Each document is a PBGitRepository with a PBDetailController controlling the window. PBRepositoryDocumentController is the document controller. When launched, the application will attempt to open a repository with the current directory as its path. If this fails it will display an open panel to allow the user to select one.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// PBRepositoryDocumentController.mm
|
||||
// GitX
|
||||
//
|
||||
// Created by Ciarán Walsh on 15/08/2008.
|
||||
// Copyright 2008 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#import "PBRepositoryDocumentController.h"
|
||||
|
||||
|
||||
@implementation PBRepositoryDocumentController
|
||||
// This method is overridden to configure the open panel to only allow
|
||||
// selection of directories
|
||||
- (NSInteger)runModalOpenPanel:(NSOpenPanel *)openPanel forTypes:(NSArray *)extensions
|
||||
{
|
||||
[openPanel setCanChooseFiles:NO];
|
||||
[openPanel setCanChooseDirectories:YES];
|
||||
return [openPanel runModalForDirectory:nil file:nil types:nil];
|
||||
}
|
||||
@end
|
||||
Reference in New Issue
Block a user