diff --git a/MacPass/Base.lproj/MainMenu.xib b/MacPass/Base.lproj/MainMenu.xib index 0b417055..e51d6638 100644 --- a/MacPass/Base.lproj/MainMenu.xib +++ b/MacPass/Base.lproj/MainMenu.xib @@ -297,7 +297,11 @@ - + + + + + diff --git a/MacPass/MPAppDelegate.h b/MacPass/MPAppDelegate.h index f5af5858..fcbab992 100644 --- a/MacPass/MPAppDelegate.h +++ b/MacPass/MPAppDelegate.h @@ -22,10 +22,11 @@ #import -@interface MPAppDelegate : NSObject +@interface MPAppDelegate : NSObject @property (strong) IBOutlet NSWindow *passwordCreatorWindow; @property (strong) IBOutlet NSWindow *welcomeWindow; +@property (weak) IBOutlet NSMenuItem *saveMenuItem; - (IBAction)showPreferences:(id)sender; - (IBAction)showPasswordCreator:(id)sender; diff --git a/MacPass/MPAppDelegate.m b/MacPass/MPAppDelegate.m index e9b190f1..b53527ca 100644 --- a/MacPass/MPAppDelegate.m +++ b/MacPass/MPAppDelegate.m @@ -33,6 +33,9 @@ #import "MPAutotypeDaemon.h" #import "MPDocumentWindowController.h" +#import "MPDocument.h" +#import "KPKCompositeKey.h" + @interface MPAppDelegate () { @private MPServerDaemon *serverDaemon; @@ -60,6 +63,10 @@ [[NSNotificationCenter defaultCenter] removeObserver:self]; } +- (void)awakeFromNib { + [[self.saveMenuItem menu] setDelegate:self]; +} + - (BOOL)applicationShouldHandleReopen:(NSApplication *)sender hasVisibleWindows:(BOOL)flag { if(!flag) { BOOL reopen = [[NSUserDefaults standardUserDefaults] boolForKey:kMPSettingsKeyReopenLastDatabaseOnLaunch]; @@ -199,4 +206,14 @@ return isFileURL; } +#pragma mark NSMenuDelegate +- (void)menuNeedsUpdate:(NSMenu *)menu { + if([self.saveMenuItem menu] != menu) { + return; // wrong 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 setTitle:saveTitle]; +} @end diff --git a/MacPass/de.lproj/Localizable.strings b/MacPass/de.lproj/Localizable.strings index eb89ccd7..f170c5a7 100644 Binary files a/MacPass/de.lproj/Localizable.strings and b/MacPass/de.lproj/Localizable.strings differ diff --git a/MacPass/en.lproj/Localizable.strings b/MacPass/en.lproj/Localizable.strings index 0b198700..7af4beac 100644 Binary files a/MacPass/en.lproj/Localizable.strings and b/MacPass/en.lproj/Localizable.strings differ diff --git a/MacPass/fr.lproj/Localizable.strings b/MacPass/fr.lproj/Localizable.strings index 2cdef9a3..ea131147 100644 Binary files a/MacPass/fr.lproj/Localizable.strings and b/MacPass/fr.lproj/Localizable.strings differ