From 98f99f6cbfaa35f552d8448e76949e8e24e071e9 Mon Sep 17 00:00:00 2001 From: Michael Starke Date: Wed, 13 Feb 2019 18:25:46 +0100 Subject: [PATCH] =?UTF-8?q?Populate=20Action=20menu=20with=20the=20same=20?= =?UTF-8?q?copy=20actions=20as=20the=20entry=20table=20context=20menu?= =?UTF-8?q?=CC=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MacPass/MPToolbarDelegate.m | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/MacPass/MPToolbarDelegate.m b/MacPass/MPToolbarDelegate.m index 83d53ddc..7f70597f 100644 --- a/MacPass/MPToolbarDelegate.m +++ b/MacPass/MPToolbarDelegate.m @@ -26,6 +26,7 @@ #import "MPToolbarItem.h" #import "MPContextButton.h" #import "MPAddEntryContextMenuDelegate.h" +#import "MPEntryContextMenuDelegate.h" #import "MPActionHelper.h" #import "MPContextMenuHelper.h" @@ -47,7 +48,8 @@ NSString *const MPToolbarItemHistory = @"TOOLBAR_HISTORY"; NSString *const MPToolbarItemAutotype = @"TOOLBAR_AUTOTYPE"; @interface MPToolbarDelegate() { - MPAddEntryContextMenuDelegate *_entryMenuDelegate; + MPAddEntryContextMenuDelegate *_addEntryMenuDelegate; + MPEntryContextMenuDelegate * _entryActionContextMenuDelegate; BOOL _didShowToolbarForSearch; BOOL _didAddSearchfieldForSearch; NSToolbarDisplayMode _displayModeBeforeSearch; @@ -91,7 +93,8 @@ NSString *const MPToolbarItemAutotype = @"TOOLBAR_AUTOTYPE"; MPToolbarItemInspector ]; _toolbarImages = [self createToolbarImages]; _toolbarItems = [[NSMutableDictionary alloc] initWithCapacity:[self.toolbarIdentifiers count]]; - _entryMenuDelegate = [[MPAddEntryContextMenuDelegate alloc] init]; + _addEntryMenuDelegate = [[MPAddEntryContextMenuDelegate alloc] init]; + _entryActionContextMenuDelegate = [[MPEntryContextMenuDelegate alloc] init]; } return self; } @@ -134,6 +137,7 @@ NSString *const MPToolbarItemAutotype = @"TOOLBAR_AUTOTYPE"; popupButton.frame = newFrame; popupButton.menu = menu; + menu.delegate = _entryActionContextMenuDelegate; item.menuFormRepresentation = menuRepresentation; item.view = popupButton; } @@ -147,7 +151,7 @@ NSString *const MPToolbarItemAutotype = @"TOOLBAR_AUTOTYPE"; NSMenu *menu = [[NSMenu alloc] init]; [menu addItemWithTitle:NSLocalizedString(@"UNKNOWN_TOOLBAR_ITEM", @"") action:NULL keyEquivalent:@""]; - menu.delegate = _entryMenuDelegate; + menu.delegate = _addEntryMenuDelegate; button.contextMenu = menu;