Skip to content

Commit b4f6ba2

Browse files
author
glaullon
committed
Only Commit / All Files
1 parent ed8ad4b commit b4f6ba2

File tree

5 files changed

+276
-147
lines changed

5 files changed

+276
-147
lines changed

PBGitHistoryController.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
@class PBCommitList;
2323
@class PBSourceViewItem;
2424

25-
@interface PBGitHistoryController : PBViewController {
25+
@interface PBGitHistoryController : PBViewController <MGScopeBarDelegate>{
2626
IBOutlet PBRefController *refController;
2727
IBOutlet PBCommitList* commitList;
2828
IBOutlet PBCollapsibleSplitView *historySplitView;
@@ -54,6 +54,8 @@
5454
BOOL forceSelectionUpdate;
5555
NSArray *currentFileBrowserSelectionPath;
5656

57+
IBOutlet MGScopeBar *treeStyle;
58+
NSArray *treeOpts;
5759
PBGitTree *gitTree;
5860
PBGitCommit *webCommit;
5961
PBGitCommit *selectedCommit;

PBGitHistoryController.m

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,13 @@ - (void) updateKeys
142142
}
143143

144144
if (self.selectedCommitDetailsIndex == kHistoryTreeViewIndex) {
145-
self.gitTree = selectedCommit.tree;
145+
PBGitTree *pt = selectedCommit.tree;
146+
147+
NSString *show=[[[treeStyle selectedItems] objectAtIndex:0] objectAtIndex:0];
148+
pt.onlyCommit=[show isEqualToString:@"Only Commit"];
149+
150+
self.gitTree=pt;
151+
146152
[self restoreFileBrowserSelection];
147153
}
148154
else // kHistoryDetailViewIndex
@@ -854,5 +860,38 @@ + (BOOL)isSelectorExcludedFromWebScript:(SEL)sel
854860
return YES;
855861
}
856862

863+
#pragma mark <MGScopeBarDelegate>
864+
865+
- (int)numberOfGroupsInScopeBar:(MGScopeBar *)theScopeBar
866+
{
867+
return 1;
868+
}
869+
870+
- (NSArray *)scopeBar:(MGScopeBar *)theScopeBar itemIdentifiersForGroup:(int)groupNumber
871+
{
872+
return [NSArray arrayWithObjects:@"Only Commit",@"All Files",nil];
873+
}
874+
875+
- (NSString *)scopeBar:(MGScopeBar *)theScopeBar labelForGroup:(int)groupNumber
876+
{
877+
return nil;
878+
}
879+
880+
- (MGScopeBarGroupSelectionMode)scopeBar:(MGScopeBar *)theScopeBar selectionModeForGroup:(int)groupNumber
881+
{
882+
return MGRadioSelectionMode;
883+
}
884+
885+
- (NSString *)scopeBar:(MGScopeBar *)theScopeBar titleOfItem:(NSString *)identifier inGroup:(int)groupNumber
886+
{
887+
return identifier;
888+
}
889+
890+
- (void)scopeBar:(MGScopeBar *)theScopeBar selectedStateChanged:(BOOL)selected forItem:(NSString *)identifier inGroup:(int)groupNumber
891+
{
892+
[self updateKeys];
893+
}
894+
895+
857896
@end
858897

0 commit comments

Comments
 (0)