mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 15:12:21 +00:00
Fixed #143 Save now uses dots only when prompt will be displayed
This commit is contained in:
@@ -297,7 +297,11 @@
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
<customObject id="494" customClass="MPAppDelegate"/>
|
||||
<customObject id="494" customClass="MPAppDelegate">
|
||||
<connections>
|
||||
<outlet property="saveMenuItem" destination="75" id="dsN-Im-4eZ"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="420" customClass="NSFontManager"/>
|
||||
<customObject id="EpI-0u-HQc" customClass="SUUpdater"/>
|
||||
</objects>
|
||||
|
||||
@@ -22,10 +22,11 @@
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface MPAppDelegate : NSObject <NSApplicationDelegate>
|
||||
@interface MPAppDelegate : NSObject <NSApplicationDelegate, NSMenuDelegate>
|
||||
|
||||
@property (strong) IBOutlet NSWindow *passwordCreatorWindow;
|
||||
@property (strong) IBOutlet NSWindow *welcomeWindow;
|
||||
@property (weak) IBOutlet NSMenuItem *saveMenuItem;
|
||||
|
||||
- (IBAction)showPreferences:(id)sender;
|
||||
- (IBAction)showPasswordCreator:(id)sender;
|
||||
|
||||
@@ -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
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user