mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-13 08:52:20 +00:00
moved reference builder popup code to entry inspector
This commit is contained in:
@@ -24,6 +24,9 @@
|
||||
|
||||
@interface MPAutotypeBuilderViewController : NSViewController
|
||||
|
||||
- (void)presentBuilderWithSequence:(NSString *)sequence;
|
||||
/**
|
||||
Populate the autotype builder with a sequence.
|
||||
*/
|
||||
@property (nonatomic,copy) NSString *sequence;
|
||||
|
||||
@end
|
||||
|
||||
@@ -69,9 +69,8 @@
|
||||
self.commandBuilderTokenField.delegate = self;
|
||||
}
|
||||
|
||||
- (void)presentBuilderWithSequence:(NSString *)sequence {
|
||||
// TODO: tokenize input sequence!
|
||||
//self.commandBuilderTokenField.stringValue = sequence;
|
||||
- (void)setSequence:(NSString *)sequence {
|
||||
self.commandBuilderTokenField.stringValue = sequence;
|
||||
}
|
||||
|
||||
- (IBAction)addCustomKeyPlaceholder:(id)sender {
|
||||
|
||||
@@ -77,6 +77,8 @@
|
||||
- (void)registerNotificationsForDocument:(MPDocument *)document;
|
||||
|
||||
- (IBAction)showPasswordGenerator:(id)sender;
|
||||
- (IBAction)showReferenceBuilder:(id)sender;
|
||||
- (IBAction)showAutotypeBuilder:(id)sender;
|
||||
|
||||
- (IBAction)saveAttachment:(id)sender;
|
||||
- (IBAction)addAttachment:(id)sender;
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#import "MPWindowAssociationsTableViewDelegate.h"
|
||||
#import "MPWindowTitleComboBoxDelegate.h"
|
||||
#import "MPAutotypeBuilderViewController.h"
|
||||
#import "MPReferenceBuilderViewController.h"
|
||||
|
||||
#import "NSString+MPPasswordCreation.h"
|
||||
|
||||
@@ -317,11 +318,29 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) {
|
||||
#pragma mark -
|
||||
#pragma mark Popovers
|
||||
|
||||
- (IBAction)showReferenceBuilder:(id)sender {
|
||||
NSView *location;
|
||||
if([sender isKindOfClass:NSView.class]) {
|
||||
location = sender;
|
||||
}
|
||||
else if([sender isKindOfClass:NSMenuItem.class]) {
|
||||
location = [sender representedObject];
|
||||
}
|
||||
[self _showPopopver:[[MPReferenceBuilderViewController alloc] init] atView:location onEdge:NSMinYEdge];
|
||||
}
|
||||
|
||||
- (IBAction)showAutotypeBuilder:(id)sender {
|
||||
[sender setEnabled:NO];
|
||||
NSView *location;
|
||||
if([sender isKindOfClass:NSButton.class]) {
|
||||
location = sender;
|
||||
[sender setEnabled:NO];
|
||||
}
|
||||
if([sender isKindOfClass:NSMenuItem.class]){
|
||||
location = [sender representedObject];
|
||||
}
|
||||
MPAutotypeBuilderViewController *autotypeBuilder = [[MPAutotypeBuilderViewController alloc] init];
|
||||
autotypeBuilder.representedObject = self.representedObject;
|
||||
[self _showPopopver:autotypeBuilder atView:sender onEdge:NSMinYEdge];
|
||||
[self _showPopopver:autotypeBuilder atView:location onEdge:NSMinYEdge];
|
||||
}
|
||||
|
||||
- (IBAction)showPasswordGenerator:(id)sender {
|
||||
|
||||
@@ -120,7 +120,7 @@ typedef NS_ENUM(NSInteger, MPIconDownloadStatus) {
|
||||
if(error) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
self.downloadStatus = MPIconDownloadStatusError;
|
||||
[NSApp presentError:error];
|
||||
//[NSApp presentError:error];
|
||||
});
|
||||
}
|
||||
if(data.length > 0) {
|
||||
|
||||
@@ -39,7 +39,6 @@
|
||||
- (IBAction)pickIcon:(id)sender;
|
||||
- (IBAction)pickExpiryDate:(id)sender;
|
||||
- (IBAction)showPluginData:(id)sender;
|
||||
- (IBAction)showReferenceBuilder:(id)sender;
|
||||
|
||||
/* Separate call to ensure all registered objects are in place */
|
||||
- (void)registerNotificationsForDocument:(NSDocument *)document;
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
#import "MPIconImageView.h"
|
||||
#import "MPNotifications.h"
|
||||
#import "MPPluginDataViewController.h"
|
||||
#import "MPReferenceBuilderViewController.h"
|
||||
|
||||
#import "KeePassKit/KeePassKit.h"
|
||||
|
||||
@@ -196,17 +195,6 @@ typedef NS_ENUM(NSUInteger, MPContentTab) {
|
||||
[self _popupViewController:[[MPPluginDataViewController alloc] init] atView:sender];
|
||||
}
|
||||
|
||||
- (IBAction)showReferenceBuilder:(id)sender {
|
||||
NSView *location;
|
||||
if([sender isKindOfClass:NSView.class]) {
|
||||
location = sender;
|
||||
}
|
||||
else if([sender isKindOfClass:NSMenuItem.class]) {
|
||||
location = [sender representedObject];
|
||||
}
|
||||
[self _popupViewController:[[MPReferenceBuilderViewController alloc] init] atView:location];
|
||||
}
|
||||
|
||||
- (void)_popupViewController:(MPViewController *)vc atView:(NSView *)view {
|
||||
if(self.popover) {
|
||||
return; // Popover still active, abort
|
||||
|
||||
Reference in New Issue
Block a user