mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-13 19:22:25 +00:00
added item menu to MainMenu. Enabled copy actions in main menu if no focus is on entryView
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="13196" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="13771" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="13196"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="13771"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
|
||||
@@ -250,6 +250,14 @@ CA
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Item" id="3st-rv-EeQ">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Item" id="Ttt-tR-emo">
|
||||
<connections>
|
||||
<outlet property="delegate" destination="494" id="8Tk-fd-paV"/>
|
||||
</connections>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="View" id="295">
|
||||
<menu key="submenu" title="View" id="296">
|
||||
<items>
|
||||
@@ -336,12 +344,13 @@ CA
|
||||
</menu>
|
||||
</menuItem>
|
||||
</items>
|
||||
<point key="canvasLocation" x="-452" y="80"/>
|
||||
<point key="canvasLocation" x="-600" y="98"/>
|
||||
</menu>
|
||||
<customObject id="494" customClass="MPAppDelegate">
|
||||
<connections>
|
||||
<outlet property="fileNewMenuItem" destination="82" id="BUX-dy-HS2"/>
|
||||
<outlet property="fixAutotypeMenuItem" destination="nx7-Vf-LiD" id="5n1-bG-JxJ"/>
|
||||
<outlet property="itemMenu" destination="Ttt-tR-emo" id="cdF-dt-2h9"/>
|
||||
<outlet property="saveMenuItem" destination="75" id="dsN-Im-4eZ"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
|
||||
@@ -33,6 +33,7 @@ APPKIT_EXTERN NSString *const MPDidChangeStoredKeyFilesSettings;
|
||||
@property (weak) IBOutlet NSMenuItem *saveMenuItem;
|
||||
@property (weak) IBOutlet NSMenuItem *fixAutotypeMenuItem;
|
||||
@property (weak) IBOutlet NSMenuItem *fileNewMenuItem;
|
||||
@property (weak) IBOutlet NSMenu *itemMenu;
|
||||
|
||||
@property (nonatomic, assign) BOOL isAllowedToStoreKeyFile;
|
||||
|
||||
|
||||
@@ -197,6 +197,12 @@ NSString *const MPDidChangeStoredKeyFilesSettings = @"com.hicknhack.macpass.MPDi
|
||||
if(menu == self.fixAutotypeMenuItem.menu) {
|
||||
self.fixAutotypeMenuItem.hidden = !(NSEvent.modifierFlags & NSAlternateKeyMask);
|
||||
}
|
||||
if(menu == self.itemMenu) {
|
||||
[menu removeAllItems];
|
||||
for(NSMenuItem *item in [MPContextMenuHelper contextMenuItemsWithItems:MPContextMenuFull]) {
|
||||
[menu addItem:item];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
||||
@@ -44,9 +44,8 @@
|
||||
|
||||
- (void)showEntries;
|
||||
- (void)showPasswordInput;
|
||||
|
||||
|
||||
- (void)editPasswordWithCompetionHandler:(void (^)(NSInteger result))handler;
|
||||
|
||||
#pragma mark Actions
|
||||
- (IBAction)saveDocument:(id)sender;
|
||||
- (IBAction)saveDocumentAs:(id)sender;
|
||||
@@ -71,6 +70,12 @@
|
||||
|
||||
- (IBAction)performAutotypeForEntry:(id)sender;
|
||||
|
||||
- (IBAction)copyUsername:(id)sender;
|
||||
- (IBAction)copyPassword:(id)sender;
|
||||
- (IBAction)copyCustomAttribute:(id)sender;
|
||||
- (IBAction)copyURL:(id)sender;
|
||||
- (IBAction)openURL:(id)sender;
|
||||
|
||||
#pragma mark Helper
|
||||
- (IBAction)fixAutotype:(id)sender;
|
||||
|
||||
|
||||
@@ -514,6 +514,28 @@ typedef void (^MPPasswordChangedBlock)(BOOL didChangePassword);
|
||||
[contentView layoutSubtreeIfNeeded];
|
||||
}
|
||||
|
||||
- (void)copyUsername:(id)sender {
|
||||
[self.entryViewController copyUsername:sender];
|
||||
}
|
||||
|
||||
- (void)copyPassword:(id)sender {
|
||||
[self.entryViewController copyPassword:sender];
|
||||
}
|
||||
|
||||
- (void)copyCustomAttribute:(id)sender {
|
||||
[self.entryViewController copyCustomAttribute:sender];
|
||||
}
|
||||
|
||||
- (void)copyURL:(id)sender {
|
||||
[self.entryViewController copyURL:sender];
|
||||
}
|
||||
|
||||
- (void)openURL:(id)sender {
|
||||
[self.entryViewController openURL:sender];
|
||||
}
|
||||
|
||||
|
||||
|
||||
#pragma mark Validation
|
||||
- (BOOL)validateMenuItem:(NSMenuItem *)menuItem {
|
||||
return ([self.document validateMenuItem:menuItem]);
|
||||
|
||||
Reference in New Issue
Block a user