mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-13 22:52:26 +00:00
renamed history actions
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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];
|
||||
}
|
||||
|
||||
@@ -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];
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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 -
|
||||
|
||||
@@ -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]);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user