mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-17 19:29:24 +00:00
Fixed #143 Save now uses dots only when prompt will be displayed
This commit is contained in:
@@ -297,7 +297,11 @@
|
|||||||
</menuItem>
|
</menuItem>
|
||||||
</items>
|
</items>
|
||||||
</menu>
|
</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="420" customClass="NSFontManager"/>
|
||||||
<customObject id="EpI-0u-HQc" customClass="SUUpdater"/>
|
<customObject id="EpI-0u-HQc" customClass="SUUpdater"/>
|
||||||
</objects>
|
</objects>
|
||||||
|
|||||||
@@ -22,10 +22,11 @@
|
|||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|
||||||
@interface MPAppDelegate : NSObject <NSApplicationDelegate>
|
@interface MPAppDelegate : NSObject <NSApplicationDelegate, NSMenuDelegate>
|
||||||
|
|
||||||
@property (strong) IBOutlet NSWindow *passwordCreatorWindow;
|
@property (strong) IBOutlet NSWindow *passwordCreatorWindow;
|
||||||
@property (strong) IBOutlet NSWindow *welcomeWindow;
|
@property (strong) IBOutlet NSWindow *welcomeWindow;
|
||||||
|
@property (weak) IBOutlet NSMenuItem *saveMenuItem;
|
||||||
|
|
||||||
- (IBAction)showPreferences:(id)sender;
|
- (IBAction)showPreferences:(id)sender;
|
||||||
- (IBAction)showPasswordCreator:(id)sender;
|
- (IBAction)showPasswordCreator:(id)sender;
|
||||||
|
|||||||
@@ -33,6 +33,9 @@
|
|||||||
#import "MPAutotypeDaemon.h"
|
#import "MPAutotypeDaemon.h"
|
||||||
#import "MPDocumentWindowController.h"
|
#import "MPDocumentWindowController.h"
|
||||||
|
|
||||||
|
#import "MPDocument.h"
|
||||||
|
#import "KPKCompositeKey.h"
|
||||||
|
|
||||||
@interface MPAppDelegate () {
|
@interface MPAppDelegate () {
|
||||||
@private
|
@private
|
||||||
MPServerDaemon *serverDaemon;
|
MPServerDaemon *serverDaemon;
|
||||||
@@ -60,6 +63,10 @@
|
|||||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)awakeFromNib {
|
||||||
|
[[self.saveMenuItem menu] setDelegate:self];
|
||||||
|
}
|
||||||
|
|
||||||
- (BOOL)applicationShouldHandleReopen:(NSApplication *)sender hasVisibleWindows:(BOOL)flag {
|
- (BOOL)applicationShouldHandleReopen:(NSApplication *)sender hasVisibleWindows:(BOOL)flag {
|
||||||
if(!flag) {
|
if(!flag) {
|
||||||
BOOL reopen = [[NSUserDefaults standardUserDefaults] boolForKey:kMPSettingsKeyReopenLastDatabaseOnLaunch];
|
BOOL reopen = [[NSUserDefaults standardUserDefaults] boolForKey:kMPSettingsKeyReopenLastDatabaseOnLaunch];
|
||||||
@@ -199,4 +206,14 @@
|
|||||||
return isFileURL;
|
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
|
@end
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user