File tree Expand file tree Collapse file tree 4 files changed +20
-1
lines changed Expand file tree Collapse file tree 4 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -276,6 +276,16 @@ - (IBAction) openSelectedFile:(id)sender
276
276
[[NSWorkspace sharedWorkspace ] openTempFile: name];
277
277
}
278
278
279
+ - (BOOL )validateMenuItem : (NSMenuItem *)menuItem
280
+ {
281
+ if ([menuItem action ] == @selector (setDetailedView: )) {
282
+ [menuItem setState: (self .selectedCommitDetailsIndex == kHistoryDetailViewIndex ) ? NSOnState : NSOffState ];
283
+ } else if ([menuItem action ] == @selector (setTreeView: )) {
284
+ [menuItem setState: (self .selectedCommitDetailsIndex == kHistoryTreeViewIndex ) ? NSOnState : NSOffState ];
285
+ }
286
+ return YES ;
287
+ }
288
+
279
289
- (IBAction ) setDetailedView : (id )sender
280
290
{
281
291
self.selectedCommitDetailsIndex = kHistoryDetailViewIndex ;
Original file line number Diff line number Diff line change 42
42
43
43
@property (readonly ) NSMutableArray *items;
44
44
@property (readonly ) NSView *sourceListControlsView;
45
+ @property (readonly ) PBGitHistoryController *historyViewController;
46
+ @property (readonly ) PBGitCommitController *commitViewController;
47
+
45
48
@end
Original file line number Diff line number Diff line change @@ -30,6 +30,8 @@ - (void) updateRemoteControls;
30
30
@implementation PBGitSidebarController
31
31
@synthesize items;
32
32
@synthesize sourceListControlsView;
33
+ @synthesize historyViewController;
34
+ @synthesize commitViewController;
33
35
34
36
- (id )initWithRepository : (PBGitRepository *)theRepository superController : (PBGitWindowController *)controller
35
37
{
Original file line number Diff line number Diff line change @@ -43,7 +43,11 @@ - (void)windowWillClose:(NSNotification *)notification
43
43
44
44
- (BOOL )validateMenuItem : (NSMenuItem *)menuItem
45
45
{
46
- if ([menuItem action ] == @selector (showCommitView: ) || [menuItem action ] == @selector (showHistoryView: )) {
46
+ if ([menuItem action ] == @selector (showCommitView: )) {
47
+ [menuItem setState: (contentController == sidebarController.commitViewController) ? YES : NO ];
48
+ return ![repository isBareRepository ];
49
+ } else if ([menuItem action ] == @selector (showHistoryView: )) {
50
+ [menuItem setState: (contentController != sidebarController.commitViewController) ? YES : NO ];
47
51
return ![repository isBareRepository ];
48
52
}
49
53
return YES ;
You can’t perform that action at this time.
0 commit comments