Skip to content

Commit fc9c452

Browse files
committed
Remove scope bar
1 parent 878f93c commit fc9c452

File tree

3 files changed

+22
-189
lines changed

3 files changed

+22
-189
lines changed

Classes/Views/GLFileView.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,12 @@
77
//
88

99
#import <Cocoa/Cocoa.h>
10-
#import <MGScopeBar/MGScopeBarDelegateProtocol.h>
11-
1210
#import "PBWebController.h"
1311

1412
@class PBGitHistoryController;
1513

16-
@interface GLFileView : PBWebController <MGScopeBarDelegate> {
14+
@interface GLFileView : PBWebController {
1715
__weak IBOutlet PBGitHistoryController* historyController;
18-
__weak IBOutlet MGScopeBar *typeBar;
19-
NSMutableArray *groups;
2016
__weak IBOutlet NSView *accessoryView;
2117
__weak IBOutlet NSSplitView *fileListSplitView;
2218
}

Classes/Views/GLFileView.m

Lines changed: 0 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
// Copyright 2010 __MyCompanyName__. All rights reserved.
77
//
88

9-
#import <MGScopeBar/MGScopeBar.h>
10-
119
#import "GLFileView.h"
1210
#import "PBGitTree.h"
1311
#import "PBGitCommit.h"
@@ -41,29 +39,6 @@ - (void) awakeFromNib
4139
[super awakeFromNib];
4240
[historyController.treeController addObserver:self forKeyPath:@"selection" options:0 context:@"treeController"];
4341

44-
self.groups = [NSMutableArray arrayWithCapacity:0];
45-
46-
NSArray *items = [NSArray arrayWithObjects:
47-
[NSDictionary dictionaryWithObjectsAndKeys:
48-
startFile, ITEM_IDENTIFIER,
49-
@"Source", ITEM_NAME,
50-
nil],
51-
[NSDictionary dictionaryWithObjectsAndKeys:
52-
GROUP_ID_BLAME, ITEM_IDENTIFIER,
53-
@"Blame", ITEM_NAME,
54-
nil],
55-
[NSDictionary dictionaryWithObjectsAndKeys:
56-
GROUP_ID_LOG, ITEM_IDENTIFIER,
57-
@"History", ITEM_NAME,
58-
nil],
59-
nil];
60-
[self.groups addObject:[NSDictionary dictionaryWithObjectsAndKeys:
61-
[NSNumber numberWithBool:NO], GROUP_SEPARATOR,
62-
[NSNumber numberWithInt:MGScopeBarGroupSelectionModeRadio], GROUP_SELECTION_MODE, // single selection group.
63-
items, GROUP_ITEMS,
64-
nil]];
65-
[typeBar reloadData];
66-
6742
[fileListSplitView setHidden:YES];
6843
[self performSelector:@selector(restoreSplitViewPositiion) withObject:nil afterDelay:0];
6944
}
@@ -107,60 +82,6 @@ - (void) selectCommit:(NSString*)c
10782
[historyController selectCommit: [GTOID oidWithSHA: c]];
10883
}
10984

110-
#pragma mark MGScopeBarDelegate methods
111-
112-
- (NSInteger)numberOfGroupsInScopeBar:(MGScopeBar *)theScopeBar
113-
{
114-
return [self.groups count];
115-
}
116-
117-
118-
- (NSArray *)scopeBar:(MGScopeBar *)theScopeBar itemIdentifiersForGroup:(NSInteger)groupNumber
119-
{
120-
return [[self.groups objectAtIndex:groupNumber] valueForKeyPath:[NSString stringWithFormat:@"%@.%@", GROUP_ITEMS, ITEM_IDENTIFIER]];
121-
}
122-
123-
124-
- (NSString *)scopeBar:(MGScopeBar *)theScopeBar labelForGroup:(NSInteger)groupNumber
125-
{
126-
return [[self.groups objectAtIndex:groupNumber] objectForKey:GROUP_LABEL]; // might be nil, which is fine (nil means no label).
127-
}
128-
129-
130-
- (NSString *)scopeBar:(MGScopeBar *)theScopeBar titleOfItem:(NSString *)identifier inGroup:(NSInteger)groupNumber
131-
{
132-
NSArray *items = [[self.groups objectAtIndex:groupNumber] objectForKey:GROUP_ITEMS];
133-
if (items) {
134-
for (NSDictionary *item in items) {
135-
if ([[item objectForKey:ITEM_IDENTIFIER] isEqualToString:identifier]) {
136-
return [item objectForKey:ITEM_NAME];
137-
break;
138-
}
139-
}
140-
}
141-
return nil;
142-
}
143-
144-
145-
- (MGScopeBarGroupSelectionMode)scopeBar:(MGScopeBar *)theScopeBar selectionModeForGroup:(NSInteger)groupNumber
146-
{
147-
return [[[self.groups objectAtIndex:groupNumber] objectForKey:GROUP_SELECTION_MODE] intValue];
148-
}
149-
150-
- (void)scopeBar:(MGScopeBar *)theScopeBar selectedStateChanged:(BOOL)selected forItem:(NSString *)identifier inGroup:(NSInteger)groupNumber
151-
{
152-
startFile=identifier;
153-
NSString *path = [NSString stringWithFormat:@"html/views/%@", identifier];
154-
NSString *html = [[NSBundle mainBundle] pathForResource:@"index" ofType:@"html" inDirectory:path];
155-
NSURLRequest * request = [NSURLRequest requestWithURL:[NSURL fileURLWithPath:html]];
156-
[self.view.mainFrame loadRequest:request];
157-
}
158-
159-
- (NSView *)accessoryViewForScopeBar:(MGScopeBar *)scopeBar
160-
{
161-
return accessoryView;
162-
}
163-
16485
- (void) didLoad
16586
{
16687
[self showFile];

0 commit comments

Comments
 (0)