From c59d68bb3ec415880b3186e77990ba08428602e6 Mon Sep 17 00:00:00 2001 From: Pieter de Bie Date: Thu, 10 Sep 2009 01:42:13 +0200 Subject: [PATCH] Sidebar: Handle selection changes --- PBGitSidebarController.m | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/PBGitSidebarController.m b/PBGitSidebarController.m index 6e5bd43..6fbf58c 100644 --- a/PBGitSidebarController.m +++ b/PBGitSidebarController.m @@ -69,6 +69,21 @@ [sourceView selectRow:index byExtendingSelection:NO]; } +#pragma mark NSOutlineView delegate methods + +- (void)outlineViewSelectionDidChange:(NSNotification *)notification +{ + NSInteger index = [sourceView selectedRow]; + PBSourceViewItem *item = [sourceView itemAtRow:index]; + + if ([item revSpecifier]) { + [[repository windowController] showHistoryView:self]; + repository.currentBranch = [item revSpecifier]; + return; + } + + /* Handle Remotes etc */ +} #pragma mark NSOutlineView delegate methods - (BOOL)outlineView:(NSOutlineView *)outlineView isGroupItem:(id)item