diff --git a/PBGitCommitController.h b/PBGitCommitController.h index cbc85b9..bfa04a7 100644 --- a/PBGitCommitController.h +++ b/PBGitCommitController.h @@ -26,6 +26,9 @@ IBOutlet PBIconAndTextCell* unstagedButtonCell; IBOutlet PBIconAndTextCell* cachedButtonCell; + + IBOutlet NSTableView *unstagedTable; + IBOutlet NSTableView *cachedTable; } @property (retain) NSMutableArray *files; diff --git a/PBGitCommitController.m b/PBGitCommitController.m index c17957c..4d0e280 100644 --- a/PBGitCommitController.m +++ b/PBGitCommitController.m @@ -19,8 +19,11 @@ [super awakeFromNib]; self.busy = 0; - [unstagedButtonCell setAction:@selector(cellClicked:)]; - [cachedButtonCell setAction:@selector(cellClicked:)]; + [unstagedButtonCell setAction:@selector(rowClicked:)]; + [cachedButtonCell setAction:@selector(rowClicked:)]; + + [unstagedTable setDoubleAction:@selector(tableClicked:)]; + [cachedTable setDoubleAction:@selector(tableClicked:)]; [self refresh:self]; @@ -236,12 +239,8 @@ [self refresh:self]; } -- (void) cellClicked:(NSCell*) sender +- (void) tableClicked:(NSTableView *) tableView { - NSTableView *tableView = (NSTableView *)[sender controlView]; - if([tableView numberOfSelectedRows] != 1) - return; - NSUInteger selectionIndex = [[tableView selectedRowIndexes] firstIndex]; NSArrayController *controller, *otherController; if ([tableView tag] == 0) { @@ -268,6 +267,14 @@ [otherController addObject:selectedItem]; } +- (void) rowClicked:(NSCell *)sender +{ + NSTableView *tableView = (NSTableView *)[sender controlView]; + if([tableView numberOfSelectedRows] != 1) + return; + [self tableClicked: tableView]; +} + - (void)tableView:(NSTableView*)tableView willDisplayCell:(id)cell forTableColumn:(NSTableColumn*)tableColumn row:(int)rowIndex { [[tableColumn dataCell] setImage:[[[(([tableView tag] == 0) ? unstagedFilesController : cachedFilesController) arrangedObjects] objectAtIndex:rowIndex] icon]]; diff --git a/PBGitCommitView.xib b/PBGitCommitView.xib index 869825b..0260e41 100644 --- a/PBGitCommitView.xib +++ b/PBGitCommitView.xib @@ -8,7 +8,7 @@ 352.00 YES - + YES @@ -1110,6 +1110,22 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 222 + + + unstagedTable + + + + 223 + + + + cachedTable + + + + 224 + @@ -1500,7 +1516,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA - 222 + 224 @@ -1527,17 +1543,21 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA YES cachedButtonCell cachedFilesController + cachedTable commitMessageView unstagedButtonCell unstagedFilesController + unstagedTable YES PBIconAndTextCell NSArrayController + NSTableView NSTextView PBIconAndTextCell NSArrayController + NSTableView @@ -1556,6 +1576,10 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA PBViewController NSViewController + + viewToolbar + NSToolbar + IBProjectSource PBViewController.h