mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
Add a NSUserDefaultsDidChangeNotification listener to PBGitHistoryController.
Add method decl signatures for updateKeys and scrollSelectionToTopOfViewFrom: - Call preferencesChangedWithNotification: on self when the notification is received. This gives us the opportunity to refresh the history controller's commit list in case defaults like the relative dates option have changed. This makes the effect of switching that option while the prefs panel is still open instant.
This commit is contained in:
@@ -76,9 +76,11 @@
|
||||
- (IBAction) openSelectedFile:(id)sender;
|
||||
|
||||
- (BOOL) selectCommit: (NSString*) commit;
|
||||
- (void) updateKeys;
|
||||
|
||||
- (void) updateQuicklookForce: (BOOL) force;
|
||||
|
||||
- (void) scrollSelectionToTopOfViewFrom:(NSInteger)oldIndex;
|
||||
|
||||
// Moved over Sidebar methods
|
||||
- (IBAction) fetchPullPushAction:(id)sender;
|
||||
|
||||
@@ -82,6 +82,12 @@
|
||||
[repository addObserver:self forKeyPath:@"currentBranch" options:0 context:@"branchChange"];
|
||||
[repository addObserver:self forKeyPath:@"refs" options:0 context:@"updateRefs"];
|
||||
|
||||
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
||||
[nc addObserver:self
|
||||
selector:@selector(preferencesChangedWithNotification:)
|
||||
name:NSUserDefaultsDidChangeNotification
|
||||
object:nil];
|
||||
|
||||
forceSelectionUpdate = YES;
|
||||
NSSize cellSpacing = [commitList intercellSpacing];
|
||||
cellSpacing.height = 0;
|
||||
@@ -183,6 +189,10 @@
|
||||
self.status = [NSString stringWithFormat:@"%d commits loaded", [[commitController arrangedObjects] count]];
|
||||
}
|
||||
|
||||
- (void) preferencesChangedWithNotification:(NSNotification *)notification {
|
||||
[[[repository windowForSheet] contentView] setNeedsDisplay:YES];
|
||||
}
|
||||
|
||||
- (void) restoreFileBrowserSelection
|
||||
{
|
||||
if (self.selectedCommitDetailsIndex != kHistoryTreeViewIndex)
|
||||
|
||||
Reference in New Issue
Block a user