mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-24 08:49:42 +00:00
Stubbed custom attribute adding via context menu
Made MPContextToolbarButton usable as normal button. Added private API helper for adding buttons to NSUserNotification Remove Autotype plugin API Enhanced custom attribute plugin API Enhanced EntryActionPlugin API to decouple menu items from actual action/target setup Stubbed action on no-open documents NSUserNotifications Stubbed HMACOTP custom attribute setup
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
|
||||
#import "MPToolbarButton.h"
|
||||
#import "MPToolbarItem.h"
|
||||
#import "MPContextToolbarButton.h"
|
||||
#import "MPContextButton.h"
|
||||
#import "MPAddEntryContextMenuDelegate.h"
|
||||
|
||||
#import "MPActionHelper.h"
|
||||
@@ -103,7 +103,7 @@ NSString *const MPToolbarItemHistory = @"TOOLBAR_HISTORY";
|
||||
if(!item) {
|
||||
item = [[MPToolbarItem alloc] initWithItemIdentifier:itemIdentifier];
|
||||
NSString *itemLabel = [self _localizedLabelForToolbarItemIdentifier:itemIdentifier];
|
||||
[item setLabel:itemLabel];
|
||||
item.label = itemLabel;
|
||||
|
||||
if([itemIdentifier isEqualToString:MPToolbarItemAction]) {
|
||||
NSPopUpButton *popupButton = [[NSPopUpButton alloc] initWithFrame:NSMakeRect(0, 0, 50, 32) pullsDown:YES];
|
||||
@@ -135,8 +135,8 @@ NSString *const MPToolbarItemHistory = @"TOOLBAR_HISTORY";
|
||||
item.view = popupButton;
|
||||
}
|
||||
else if( [itemIdentifier isEqualToString:MPToolbarItemAddEntry]) {
|
||||
MPContextToolbarButton *button = [[MPContextToolbarButton alloc] initWithFrame:NSMakeRect(0, 0, 32, 32)];
|
||||
[button setAction:[self _actionForToolbarItemIdentifier:itemIdentifier]];
|
||||
MPContextButton *button = [[MPContextButton alloc] initWithFrame:NSMakeRect(0, 0, 32, 32)];
|
||||
button.action = [self _actionForToolbarItemIdentifier:itemIdentifier];
|
||||
NSImage *image = self.toolbarImages[itemIdentifier];
|
||||
image.size = NSMakeSize(16, 16);
|
||||
[button setImage:image];
|
||||
@@ -145,7 +145,7 @@ NSString *const MPToolbarItemHistory = @"TOOLBAR_HISTORY";
|
||||
NSMenu *menu = [NSMenu allocWithZone:[NSMenu menuZone]];
|
||||
[menu addItemWithTitle:NSLocalizedString(@"UNKNOWN_TOOLBAR_ITEM", @"") action:NULL keyEquivalent:@""];
|
||||
menu.delegate = _entryMenuDelegate;
|
||||
[button setContextMenu:menu];
|
||||
button.contextMenu = menu;
|
||||
|
||||
|
||||
NSRect fittingRect = button.frame;
|
||||
|
||||
Reference in New Issue
Block a user