mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-23 10:19:26 +00:00
Exired entries and groups now get updates at runtime
This commit is contained in:
@@ -18,6 +18,8 @@
|
||||
#import "MPOutlineContextMenuDelegate.h"
|
||||
|
||||
#import "KPKTree.h"
|
||||
#import "KPKNode.h"
|
||||
#import "KPKTimeInfo.h"
|
||||
#import "KPKGroup.h"
|
||||
#import "KPKNode+IconImage.h"
|
||||
#import "KPKMetaData.h"
|
||||
@@ -25,6 +27,8 @@
|
||||
|
||||
#import "HNHGradientView.h"
|
||||
|
||||
#define EXPIRED_GROUP_REFRESH_SECONDS 60
|
||||
|
||||
NSString *const MPOutlineViewDidChangeGroupSelection = @"com.macpass.MPOutlineViewDidChangeGroupSelection";
|
||||
|
||||
NSString *const _MPOutlineViewDataViewIdentifier = @"DataCell";
|
||||
@@ -104,6 +108,8 @@ NSString *const _MPOutlinveViewHeaderViewIdentifier = @"HeaderCell";
|
||||
[self bind:NSStringFromSelector(@selector(databaseNameWrapper)) toObject:document.tree.metaData withKeyPath:NSStringFromSelector(@selector(databaseName)) options:nil];
|
||||
[_outlineView setDataSource:self.datasource];
|
||||
_bindingEstablished = YES;
|
||||
[self _updateExpirationDisplay];
|
||||
|
||||
}
|
||||
NSTreeNode *node = [_outlineView itemAtRow:0];
|
||||
[self _expandItems:node];
|
||||
@@ -301,4 +307,13 @@ NSString *const _MPOutlinveViewHeaderViewIdentifier = @"HeaderCell";
|
||||
return [node isKindOfClass:[KPKTree class]];
|
||||
}
|
||||
|
||||
- (void)_updateExpirationDisplay {
|
||||
MPDocument *document = [[self windowController] document];
|
||||
[document.root.timeInfo isExpired];
|
||||
[[document.tree allGroups] enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
|
||||
[[obj timeInfo] isExpired];
|
||||
}];
|
||||
[self performSelector:@selector(_updateExpirationDisplay) withObject:nil afterDelay:EXPIRED_GROUP_REFRESH_SECONDS];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user