diff --git a/MacPass/Base.lproj/MainMenu.xib b/MacPass/Base.lproj/MainMenu.xib index 9a5210a3..cf9e325b 100644 --- a/MacPass/Base.lproj/MainMenu.xib +++ b/MacPass/Base.lproj/MainMenu.xib @@ -115,7 +115,7 @@ - + @@ -356,6 +356,7 @@ CA + diff --git a/MacPass/MPAppDelegate.h b/MacPass/MPAppDelegate.h index 800e84f3..e217464a 100644 --- a/MacPass/MPAppDelegate.h +++ b/MacPass/MPAppDelegate.h @@ -31,6 +31,7 @@ APPKIT_EXTERN NSString *const MPDidChangeStoredKeyFilesSettings; @property (strong) IBOutlet NSWindow *passwordCreatorWindow; @property (strong) IBOutlet NSWindow *welcomeWindow; @property (weak) IBOutlet NSMenuItem *saveMenuItem; +@property (weak) IBOutlet NSMenuItem *fixAutotypeMenuItem; @property (nonatomic, assign) BOOL isAllowedToStoreKeyFile; @@ -48,4 +49,4 @@ APPKIT_EXTERN NSString *const MPDidChangeStoredKeyFilesSettings; - (void)lockAllDocuments; -@end \ No newline at end of file +@end diff --git a/MacPass/MPAppDelegate.m b/MacPass/MPAppDelegate.m index 196f4505..e637cd99 100644 --- a/MacPass/MPAppDelegate.m +++ b/MacPass/MPAppDelegate.m @@ -174,13 +174,15 @@ NSString *const MPHelpURLKey = @"MPHelpURL"; #pragma mark - #pragma mark NSMenuDelegate - (void)menuNeedsUpdate:(NSMenu *)menu { - if([self.saveMenuItem menu] != menu) { - return; // wrong menu + if(menu == self.saveMenuItem.menu) { + MPDocument *document = [NSDocumentController sharedDocumentController].currentDocument; + BOOL displayDots = (document.fileURL == nil || !document.compositeKey.hasPasswordOrKeyFile); + NSString *saveTitle = displayDots ? NSLocalizedString(@"SAVE_WITH_DOTS", "") : NSLocalizedString(@"SAVE", ""); + self.saveMenuItem.title = saveTitle; + } + if(menu == self.fixAutotypeMenuItem.menu) { + self.fixAutotypeMenuItem.hidden = !(NSEvent.modifierFlags & NSAlternateKeyMask); } - MPDocument *document = [[NSDocumentController sharedDocumentController] currentDocument]; - BOOL displayDots = (document.fileURL == nil || !document.compositeKey.hasPasswordOrKeyFile); - NSString *saveTitle = displayDots ? NSLocalizedString(@"SAVE_WITH_DOTS", "") : NSLocalizedString(@"SAVE", ""); - [self.saveMenuItem setTitle:saveTitle]; } #pragma mark - @@ -300,7 +302,7 @@ NSString *const MPHelpURLKey = @"MPHelpURL"; [documentController openDocumentWithContentsOfURL:documentUrl display:YES completionHandler:^(NSDocument *document, BOOL documentWasAlreadyOpen, NSError *error) { - + if(error != nil){ NSAlert *alert = [[NSAlert alloc] init]; @@ -313,7 +315,7 @@ NSString *const MPHelpURLKey = @"MPHelpURL"; if(document == nil){ [self _showWelcomeWindow]; } - + }]; } return isFileURL;