mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 05:52:58 +00:00
added reference builder menu item to textfields.
Reference builder is not working at the moment
This commit is contained in:
@@ -21,6 +21,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import "MPEntryInspectorViewController.h"
|
#import "MPEntryInspectorViewController.h"
|
||||||
|
#import "MPInspectorViewController.h"
|
||||||
#import "MPAttachmentTableDataSource.h"
|
#import "MPAttachmentTableDataSource.h"
|
||||||
#import "MPAttachmentTableViewDelegate.h"
|
#import "MPAttachmentTableViewDelegate.h"
|
||||||
#import "MPCustomFieldTableViewDelegate.h"
|
#import "MPCustomFieldTableViewDelegate.h"
|
||||||
@@ -515,6 +516,10 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) {
|
|||||||
#pragma mark -
|
#pragma mark -
|
||||||
#pragma mark HNHUITextFieldDelegate
|
#pragma mark HNHUITextFieldDelegate
|
||||||
- (NSMenu *)textField:(NSTextField *)textField textView:(NSTextView *)view menu:(NSMenu *)menu {
|
- (NSMenu *)textField:(NSTextField *)textField textView:(NSTextView *)view menu:(NSMenu *)menu {
|
||||||
|
|
||||||
|
NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"SHOW_REFERENCE_BUILDER", @"Menu item to show the reference builder in a text view's context menu")action:@selector(showReferenceBuilder:) keyEquivalent:@""];
|
||||||
|
item.representedObject = textField;
|
||||||
|
[menu addItem:item];
|
||||||
return menu;
|
return menu;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,6 +39,7 @@
|
|||||||
- (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,6 +30,7 @@
|
|||||||
#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"
|
||||||
|
|
||||||
@@ -182,17 +183,28 @@ typedef NS_ENUM(NSUInteger, MPContentTab) {
|
|||||||
#pragma mark Popup
|
#pragma mark Popup
|
||||||
- (IBAction)pickIcon:(id)sender {
|
- (IBAction)pickIcon:(id)sender {
|
||||||
NSAssert([sender isKindOfClass:NSView.class], @"");
|
NSAssert([sender isKindOfClass:NSView.class], @"");
|
||||||
[self _popupViewController:[[MPIconSelectViewController alloc] init] atView:(NSView *)sender];
|
[self _popupViewController:[[MPIconSelectViewController alloc] init] atView:sender];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (IBAction)pickExpiryDate:(id)sender {
|
- (IBAction)pickExpiryDate:(id)sender {
|
||||||
NSAssert([sender isKindOfClass:NSView.class], @"");
|
NSAssert([sender isKindOfClass:NSView.class], @"");
|
||||||
[self _popupViewController:[[MPDatePickingViewController alloc] init] atView:(NSView *)sender];
|
[self _popupViewController:[[MPDatePickingViewController alloc] init] atView:sender];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (IBAction)showPluginData:(id)sender {
|
- (IBAction)showPluginData:(id)sender {
|
||||||
NSAssert([sender isKindOfClass:[NSView class]], @"");
|
NSAssert([sender isKindOfClass:NSView.class], @"");
|
||||||
[self _popupViewController:[[MPPluginDataViewController alloc] init] atView:(NSView *)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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user