Skip to content

Commit 4e0871c

Browse files
committed
Add on window selection refresh.
The changes in PBViewController is only there to supress a compiler warning.
1 parent c8a7e5b commit 4e0871c

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

PBGitWindowController.m

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#import "PBGitWindowController.h"
1010
#import "PBGitHistoryController.h"
1111
#import "PBGitCommitController.h"
12+
#import "PBGitDefaults.h"
1213

1314
@implementation PBGitWindowController
1415

@@ -137,6 +138,12 @@ - (void)showErrorSheet:(NSError *)error
137138
[[NSAlert alertWithError:error] beginSheetModalForWindow: [self window] modalDelegate:self didEndSelector:nil contextInfo:nil];
138139
}
139140

141+
- (void)windowDidBecomeKey:(NSNotification *)notification
142+
{
143+
if (self.viewController && [PBGitDefaults refreshAutomatically]) {
144+
[(PBViewController *)self.viewController refresh:nil];
145+
}
146+
}
140147

141148
#pragma mark -
142149
#pragma mark Toolbar Delegates

PBViewController.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@
2525
- (void) updateView;
2626
- (NSResponder *)firstResponder;
2727

28+
- (IBAction) refresh:(id)sender;
2829
@end

PBViewController.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,9 @@ - (NSResponder *)firstResponder;
4545
{
4646
return nil;
4747
}
48+
49+
- (IBAction) refresh:(id)sender
50+
{
51+
return;
52+
}
4853
@end

0 commit comments

Comments
 (0)