renamed history actions

This commit is contained in:
michael starke
2017-04-18 17:55:18 +02:00
parent e805324d0c
commit 56af1da2dd
7 changed files with 23 additions and 24 deletions

View File

@@ -198,9 +198,6 @@
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="smallSystem"/>
</buttonCell>
<connections>
<action selector="exitHistory:" target="-1" id="yy9-6g-Gma"/>
</connections>
</button>
</subviews>
<constraints>

View File

@@ -98,7 +98,7 @@ typedef NS_ENUM(NSUInteger, MPContextTab) {
- (void)registerNotificationsForDocument:(MPDocument *)document {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_updateFilterButtons) name:MPDocumentDidChangeSearchFlags object:document];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_didEnterSearch:) name:MPDocumentDidEnterSearchNotification object:document];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_didEnterHistory:) name:MPDocumentDidEnterHistoryNotification object:document];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_showEntryHistory:) name:MPDocumentShowEntryHistoryNotification object:document];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_didChangeCurrentItem:) name:MPDocumentCurrentItemChangedNotification object:document];
}
@@ -108,7 +108,7 @@ typedef NS_ENUM(NSUInteger, MPContextTab) {
[self _updateFilterButtons];
}
- (void)_didEnterHistory:(NSNotification *)notification {
- (void)_showEntryHistory:(NSNotification *)notification {
self.activeTab = MPContextTabHistory;
[self _updateBindings];
}

View File

@@ -8,17 +8,17 @@
#import "MPDocument.h"
NSString *const MPDocumentDidEnterHistoryNotification = @"MPDocumentDidEnterHistoryNotification";
NSString *const MPDocumentDidExitHistoryNotification = @"MPDocumentDidExitHistoryNotification";
NSString *const MPDocumentShowEntryHistoryNotification = @"MPDocumentShowEntryHistoryNotification";
NSString *const MPDocumentHideEntryHistoryNotification = @"MPDocumentHideEntryHistoryNotification";
@implementation MPDocument (HistoryBrowsing)
- (void)showHistory:(id)sender {
[[NSNotificationCenter defaultCenter] postNotificationName:MPDocumentDidEnterHistoryNotification object:self];
- (void)showEntryHistory:(id)sender {
[[NSNotificationCenter defaultCenter] postNotificationName:MPDocumentShowEntryHistoryNotification object:self];
}
- (void)exitHistory:(id)sender {
[[NSNotificationCenter defaultCenter] postNotificationName:MPDocumentDidExitHistoryNotification object:self];
- (void)hideEntryHistory:(id)sender {
[[NSNotificationCenter defaultCenter] postNotificationName:MPDocumentHideEntryHistoryNotification object:self];
}

View File

@@ -222,11 +222,14 @@ FOUNDATION_EXPORT NSString *const MPDocumentGroupKey;
#pragma mark -
#pragma mark History Browsing
FOUNDATION_EXPORT NSString *const MPDocumentDidEnterHistoryNotification;
FOUNDATION_EXPORT NSString *const MPDocumentDidExitHistoryNotification;
FOUNDATION_EXPORT NSString *const MPDocumentShowEntryHistoryNotification;
FOUNDATION_EXPORT NSString *const MPDocumentHideEntryHistoryNotification;
@interface MPDocument (HistoryBrowsing)
- (IBAction)showEntryHistory:(id)sender;
- (IBAction)hideEntryHistory:(id)sender;
@end
#pragma mark -

View File

@@ -496,14 +496,13 @@ typedef void (^MPPasswordChangedBlock)(BOOL didChangePassword);
}
- (void)showEntryHistory:(id)sender {
id<MPTargetNodeResolving> resolver = [NSApp targetForAction:@selector(currentTargetEntries)];
NSArray *entries = resolver.currentTargetEntries;
if(entries.count != 1) {
return; // only single selection is used
}
}
- (void)hideEntryHistory:(id)sender {
}
#pragma mark Validation
- (BOOL)validateMenuItem:(NSMenuItem *)menuItem {
return ([self.document validateMenuItem:menuItem]);

View File

@@ -222,8 +222,8 @@ NSString *const _MPTableSecurCellView = @"PasswordCell";
selector:@selector(_didUnlockDatabase:)
name:MPDocumentDidUnlockDatabaseNotification
object:document];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_didEnterHistory:) name:MPDocumentDidEnterHistoryNotification object:document];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_didExitHistory:) name:MPDocumentDidExitHistoryNotification object:document];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_showEntryHistory:) name:MPDocumentShowEntryHistoryNotification object:document];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_hideEntryHistory:) name:MPDocumentHideEntryHistoryNotification object:document];
[self.contextBarViewController registerNotificationsForDocument:document];
}
@@ -474,11 +474,11 @@ NSString *const _MPTableSecurCellView = @"PasswordCell";
}
}
- (void)_didEnterHistory:(NSNotification *)notification {
- (void)_showEntryHistory:(NSNotification *)notification {
[self _showContextBar];
}
- (void)_didExitHistory:(NSNotification *)notification {
- (void)_hideEntryHistory:(NSNotification *)notification {
[self _hideContextBar];
}
#pragma mark ContextBar

View File

@@ -34,7 +34,7 @@
}
- (void)didLoadView {
[self.pluginDataController bind:NSContentDictionaryBinding toObject:self.representedObject withKeyPath:NSStringFromSelector(@selector(mutableCustomData)) options:nil];
[self.pluginDataController bind:NSContentDictionaryBinding toObject:self.representedObject withKeyPath:NSStringFromSelector(@selector(customData)) options:nil];
[self.pluginDataTabelView bind:NSContentBinding toObject:self.pluginDataController withKeyPath:NSStringFromSelector(@selector(arrangedObjects)) options:nil];
self.pluginDataTabelView.backgroundColor = [NSColor clearColor];
}