mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
Fix the 'parent' link in commits
This allows you to click on the parent link to select a parent. Also fixes an issue that the NSTableView would not scroll to the correct commit.
This commit is contained in:
@@ -39,6 +39,7 @@
|
||||
- (IBAction) setRawView: sender;
|
||||
- (IBAction) setTreeView: sender;
|
||||
|
||||
- (void) selectCommit: (NSString*) commit;
|
||||
- (IBAction) refresh: sender;
|
||||
- (IBAction) toggleQuickView: sender;
|
||||
- (IBAction) openSelectedFile: sender;
|
||||
|
||||
@@ -152,6 +152,14 @@
|
||||
repository.currentBranch = repository.currentBranch;
|
||||
}
|
||||
|
||||
- (void) selectCommit: (NSString*) commit
|
||||
{
|
||||
NSPredicate* selection = [NSPredicate predicateWithFormat:@"sha == %@", commit];
|
||||
NSArray* selectedCommits = [repository.revisionList.commits filteredArrayUsingPredicate:selection];
|
||||
[commitController setSelectedObjects: selectedCommits];
|
||||
int index = [[commitController selectionIndexes] firstIndex];
|
||||
[commitList scrollRowToVisible: index];
|
||||
}
|
||||
|
||||
- (void)tableView:(NSTableView *)aTableView willDisplayCell:(id)aCell forTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex
|
||||
{
|
||||
|
||||
@@ -64,9 +64,7 @@
|
||||
|
||||
- (void) selectCommit: (NSString*) sha
|
||||
{
|
||||
NSPredicate* selection = [NSPredicate predicateWithFormat:@"sha == %@", sha];
|
||||
NSArray* selectedCommits = [detailController.repository.revisionList.commits filteredArrayUsingPredicate:selection];
|
||||
// TODO: reimplement this. How can we set the new commit? Our detailscontroller is read-only
|
||||
[detailController selectCommit:sha];
|
||||
}
|
||||
|
||||
+ (BOOL)isSelectorExcludedFromWebScript:(SEL)aSelector
|
||||
|
||||
Reference in New Issue
Block a user