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