diff --git a/MacPass/Base.lproj/GeneralSettings.xib b/MacPass/Base.lproj/GeneralSettings.xib
index 24140ec9..2ffb09c5 100644
--- a/MacPass/Base.lproj/GeneralSettings.xib
+++ b/MacPass/Base.lproj/GeneralSettings.xib
@@ -1,1908 +1,224 @@
-
-
-
- 1080
- 12E55
- 3084
- 1187.39
- 626.00
-
-
- IBNSLayoutConstraint
- NSBox
- NSButton
- NSButtonCell
- NSCustomObject
- NSCustomView
- NSMenu
- NSMenuItem
- NSPopUpButton
- NSPopUpButtonCell
- NSTextField
- NSTextFieldCell
-
-
- com.apple.InterfaceBuilder.CocoaPlugin
-
-
-
-
-
-
-
-
-
-
-
-
- view
-
-
-
- 82
-
-
-
- clearPasteboardOnQuitCheckButton
-
-
-
- 520
-
-
-
- clearPasteboardTimeoutPopup
-
-
-
- 521
-
-
-
- idleTimeOutPopup
-
-
-
- 809
-
-
-
- lockOnSleepCheckButton
-
-
-
- 810
-
-
-
- reopenLastDatabase
-
-
-
- 878
-
-
-
- createUntitledOnActivation
-
-
-
- 920
-
-
-
- doubleClickURLToLaunchCheckButton
-
-
-
- 958
-
-
-
-
-
- 0
-
-
-
-
-
- -2
-
-
- File's Owner
-
-
- -1
-
-
- First Responder
-
-
- -3
-
-
- Application
-
-
- 1
-
-
-
-
- 4
- 0
-
- 4
- 1
-
- 20
-
- 1000
-
- 9
- 40
- 3
-
-
-
- 3
- 0
-
- 3
- 1
-
- 156
-
- 1000
-
- 3
- 9
- 3
-
-
-
- 3
- 0
-
- 4
- 1
-
- 8
-
- 1000
-
- 6
- 24
- 3
-
-
-
- 6
- 0
-
- 6
- 1
-
- 20
-
- 1000
-
- 9
- 40
- 3
-
-
-
- 5
- 0
-
- 5
- 1
-
- 20
-
- 1000
-
- 9
- 40
- 3
-
-
-
- 6
- 0
-
- 6
- 1
-
- 20
-
- 1000
-
- 8
- 29
- 3
-
-
-
- 5
- 0
-
- 5
- 1
-
- 20
-
- 1000
-
- 8
- 29
- 3
-
-
-
- 3
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 1000
-
- 3
- 9
- 3
-
-
-
- 5
- 0
-
- 5
- 1
-
- 16
-
- 1000
-
- 9
- 40
- 3
-
-
-
-
-
-
-
-
-
-
-
- 431
-
-
-
-
-
- 8
- 0
-
- 0
- 1
-
- 17
-
- 1000
-
- 3
- 9
- 1
-
-
-
-
-
- 432
-
-
-
-
- 475
-
-
-
-
- 419
-
-
-
-
-
- 7
- 0
-
- 0
- 1
-
- 165
-
- 1000
-
- 3
- 9
- 1
-
-
-
-
-
- 420
-
-
-
-
-
-
-
- 421
-
-
-
-
-
-
-
-
-
-
- 429
-
-
-
-
- 424
-
-
-
-
- 423
-
-
-
-
- 422
-
-
-
-
- 447
-
-
-
-
-
- 8
- 0
-
- 0
- 1
-
- 14
-
- 1000
-
- 9
- 40
- 1
-
-
-
-
-
- 448
-
-
-
-
- 499
-
-
-
-
- 584
-
-
-
-
-
-
-
- 585
-
-
-
-
-
-
-
- 586
-
-
-
-
-
-
-
-
-
-
- 588
-
-
-
-
- 589
-
-
-
-
- 603
-
-
-
-
- 630
-
-
-
-
-
-
-
- 631
-
-
-
-
- 773
-
-
-
-
- 789
-
-
-
-
- 792
-
-
-
-
- 525
-
-
-
-
- 803
-
-
-
-
- 804
-
-
-
-
- 805
-
-
-
-
-
-
-
- 806
-
-
-
-
- 861
-
-
-
-
- 867
-
-
-
-
- 868
-
-
-
-
- 870
-
-
-
-
- 871
-
-
-
-
- 873
-
-
-
-
- 875
-
-
-
-
- 876
-
-
-
-
- 877
-
-
-
-
- 888
-
-
-
-
- 4
- 0
-
- 4
- 1
-
- 11
-
- 1000
-
- 9
- 40
- 3
-
-
-
- 3
- 0
-
- 4
- 1
-
- 6
-
- 1000
-
- 9
- 40
- 3
-
-
-
- 5
- 0
-
- 5
- 1
-
- 16
-
- 1000
-
- 8
- 29
- 3
-
-
-
- 5
- 0
-
- 5
- 1
-
- 16
-
- 1000
-
- 8
- 29
- 3
-
-
-
- 3
- 0
-
- 3
- 1
-
- 25
-
- 1000
-
- 9
- 40
- 3
-
-
-
-
-
-
-
- 891
-
-
-
-
- 893
-
-
-
-
- 530
-
-
-
-
-
-
-
- 531
-
-
-
-
- 894
-
-
-
-
- 879
-
-
-
-
-
-
-
- 880
-
-
-
-
- 896
-
-
-
-
- 897
-
-
-
-
- 903
-
-
-
-
- 901
-
-
-
-
- 898
-
-
-
-
- 916
-
-
-
-
- 918
-
-
-
-
- 919
-
-
-
-
- 788
-
-
-
-
- 928
-
-
-
-
- 4
- 0
-
- 4
- 1
-
- 11
-
- 1000
-
- 9
- 40
- 3
-
-
-
- 5
- 0
-
- 5
- 1
-
- 16
-
- 1000
-
- 8
- 29
- 3
-
-
-
-
-
-
- 935
-
-
-
-
- 933
-
-
-
-
- 929
-
-
-
-
-
-
-
- 937
-
-
-
-
- 944
-
-
-
-
- 945
-
-
-
-
- 947
-
-
-
-
- 949
-
-
-
-
- 950
-
-
-
-
- 952
-
-
-
-
- 953
-
-
-
-
- 956
-
-
-
-
-
-
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- com.apple.InterfaceBuilder.CocoaPlugin
-
-
-
-
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
-
-
-
-
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
-
-
-
-
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
-
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
-
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
-
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
-
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
-
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
-
-
-
-
-
-
-
-
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
-
-
-
-
-
- com.apple.InterfaceBuilder.CocoaPlugin
-
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
- com.apple.InterfaceBuilder.CocoaPlugin
-
-
-
-
-
- 958
-
-
-
-
- MPGeneralSettingsController
- MPViewController
-
- NSButton
- NSPopUpButton
- NSButton
- NSButton
- NSPopUpButton
- NSButton
- NSButton
-
-
-
- clearPasteboardOnQuitCheckButton
- NSButton
-
-
- clearPasteboardTimeoutPopup
- NSPopUpButton
-
-
- createUntitledOnActivation
- NSButton
-
-
- doubleClickURLToLaunchCheckButton
- NSButton
-
-
- idleTimeOutPopup
- NSPopUpButton
-
-
- lockOnSleepCheckButton
- NSButton
-
-
- reopenLastDatabase
- NSButton
-
-
-
- IBProjectSource
- ./Classes/MPGeneralSettingsController.h
-
-
-
- MPViewController
- NSViewController
-
- IBProjectSource
- ./Classes/MPViewController.h
-
-
-
- NSLayoutConstraint
- NSObject
-
- IBProjectSource
- ./Classes/NSLayoutConstraint.h
-
-
-
-
- 0
- IBCocoaFramework
- YES
- 3
-
- {11, 11}
- {10, 3}
- {15, 15}
-
- YES
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/MacPass/MPGeneralSettingsController.h b/MacPass/MPGeneralSettingsController.h
index 99d1d1b7..95d7aa34 100644
--- a/MacPass/MPGeneralSettingsController.h
+++ b/MacPass/MPGeneralSettingsController.h
@@ -19,5 +19,6 @@
@property (weak) IBOutlet NSButton *lockOnSleepCheckButton;
@property (weak) IBOutlet NSButton *reopenLastDatabase;
@property (weak) IBOutlet NSButton *createUntitledOnActivation;
+@property (weak) IBOutlet NSButton *rememberKeyFileCheckButton;
@end
diff --git a/MacPass/MPGeneralSettingsController.m b/MacPass/MPGeneralSettingsController.m
index 9380d0f4..5e2d93b0 100644
--- a/MacPass/MPGeneralSettingsController.m
+++ b/MacPass/MPGeneralSettingsController.m
@@ -32,19 +32,15 @@ NSString *const MPGeneralSetingsIdentifier = @"GeneralSettingsTab";
- (void)didLoadView {
NSUserDefaultsController *defaultsController = [NSUserDefaultsController sharedUserDefaultsController];
- NSString *reopenLastFilePath = [NSString stringWithFormat:@"values.%@", kMPSettingsKeyReopenLastDatabaseOnLaunch];
- //NSString *createUntitledOnActivatePaht = [NSString stringWithFormat:@"values.%@", kMPSettingsKeyOpenEmptyDatabaseOnLaunch];
- NSString *clearPasteboardKeyPath = [NSString stringWithFormat:@"values.%@", kMPSettingsKeyClearPasteboardOnQuit];
- NSString *doubleClickURLToLaunchKeyPath = [NSString stringWithFormat:@"values.%@", kMPSettingsKeyDoubleClickURLToLaunch];
- NSString *clearPasteboardTimeOutKeyPath = [NSString stringWithFormat:@"values.%@", kMPSettingsKeyPasteboardClearTimeout];
- NSString *idleTimeOutKeyPath = [NSString stringWithFormat:@"values.%@", kMPSettingsKeyIdleLockTimeOut];
- NSString *lockOnSleepKeyPath = [NSString stringWithFormat:@"values.%@", kMPSettingsKeyLockOnSleep];
- [self.clearPasteboardOnQuitCheckButton bind:NSValueBinding toObject:defaultsController withKeyPath:clearPasteboardKeyPath options:nil];
- [self.doubleClickURLToLaunchCheckButton bind:NSValueBinding toObject:defaultsController withKeyPath:doubleClickURLToLaunchKeyPath options:nil];
- [self.clearPasteboardTimeoutPopup bind:NSSelectedTagBinding toObject:defaultsController withKeyPath:clearPasteboardTimeOutKeyPath options:nil];
- [self.lockOnSleepCheckButton bind:NSValueBinding toObject:defaultsController withKeyPath:lockOnSleepKeyPath options:nil];
- [self.idleTimeOutPopup bind:NSSelectedTagBinding toObject:defaultsController withKeyPath:idleTimeOutKeyPath options:nil];
- [self.reopenLastDatabase bind:NSValueBinding toObject:defaultsController withKeyPath:reopenLastFilePath options:nil];
+
+ [self.clearPasteboardOnQuitCheckButton bind:NSValueBinding toObject:defaultsController withKeyPath:[MPSettingsHelper defaultControllerPathForKey:kMPSettingsKeyClearPasteboardOnQuit] options:nil];
+ [self.doubleClickURLToLaunchCheckButton bind:NSValueBinding toObject:defaultsController withKeyPath:[MPSettingsHelper defaultControllerPathForKey:kMPSettingsKeyDoubleClickURLToLaunch] options:nil];
+ [self.clearPasteboardTimeoutPopup bind:NSSelectedTagBinding toObject:defaultsController withKeyPath:[MPSettingsHelper defaultControllerPathForKey:kMPSettingsKeyPasteboardClearTimeout] options:nil];
+ [self.lockOnSleepCheckButton bind:NSValueBinding toObject:defaultsController withKeyPath:[MPSettingsHelper defaultControllerPathForKey:kMPSettingsKeyLockOnSleep] options:nil];
+ [self.idleTimeOutPopup bind:NSSelectedTagBinding toObject:defaultsController withKeyPath:[MPSettingsHelper defaultControllerPathForKey:kMPSettingsKeyIdleLockTimeOut] options:nil];
+ [self.reopenLastDatabase bind:NSValueBinding toObject:defaultsController withKeyPath:[MPSettingsHelper defaultControllerPathForKey:kMPSettingsKeyReopenLastDatabaseOnLaunch] options:nil];
+ [self.rememberKeyFileCheckButton bind:NSValueBinding toObject:defaultsController withKeyPath:[MPSettingsHelper defaultControllerPathForKey:kMPSettingsKeyRememberKeyFilesForDatabases] options:nil];
+
[self.createUntitledOnActivation setState:NSOffState];
//[self.createUntitledOnActivation bind:NSValueBinding toObject:defaultsController withKeyPath:createUntitledOnActivatePaht options:nil];
}
diff --git a/MacPass/MPSettingsHelper.h b/MacPass/MPSettingsHelper.h
index 48245e88..e44ae93b 100644
--- a/MacPass/MPSettingsHelper.h
+++ b/MacPass/MPSettingsHelper.h
@@ -39,6 +39,8 @@ APPKIT_EXTERN NSString *const kMPSettingsKeyLegacyHideURL;
/* Document/Key Location store */
APPKIT_EXTERN NSString *const kMPSettingsKeyLastDatabasePath;
+APPKIT_EXTERN NSString *const kMPSettingsKeyFilesForDatabases;
+APPKIT_EXTERN NSString *const kMPSettingsKeyRememberKeyFilesForDatabases;
/*
APPKIT_EXTERN NSString *const kMPSettingsKeyLastKeyURL;
APPKIT_EXTERN NSString *const kMPSettingsKeyRememberLastKey;
@@ -52,5 +54,6 @@ typedef NS_ENUM(NSUInteger, MPPasswordEncoding) {
@interface MPSettingsHelper : NSObject
+ (void)setupDefaults;
++ (NSString *)defaultControllerPathForKey:(NSString *)key;
@end
\ No newline at end of file
diff --git a/MacPass/MPSettingsHelper.m b/MacPass/MPSettingsHelper.m
index 4ceb2bf0..ed96da0b 100644
--- a/MacPass/MPSettingsHelper.m
+++ b/MacPass/MPSettingsHelper.m
@@ -27,6 +27,8 @@ NSString *const kMPSettingsKeyLegacyHideNotes = @"LegacyHideNotes";
NSString *const kMPSettingsKeyLegacyHideURL = @"LegacyHideURL";
NSString *const kMPSettingsKeyLastDatabasePath = @"MPLastDatabasePath";
+NSString *const kMPSettingsKeyFilesForDatabases = @"MPKeyFilesForDatabases";
+NSString *const kMPSettingsKeyRememberKeyFilesForDatabases = @"kMPSettingsKeyRememberKeyFilesForDatabases";
@implementation MPSettingsHelper
@@ -34,6 +36,10 @@ NSString *const kMPSettingsKeyLastDatabasePath = @"MPLastDatabasePath";
[[NSUserDefaults standardUserDefaults] registerDefaults:[self _standardDefaults]];
}
++ (NSString *)defaultControllerPathForKey:(NSString *)key {
+ return [NSString stringWithFormat:@"values.%@", key];
+}
+
+ (NSDictionary *)_standardDefaults {
return @{
kMPSettingsKeyShowInspector: @YES, // Show the Inspector by default
@@ -51,8 +57,9 @@ NSString *const kMPSettingsKeyLastDatabasePath = @"MPLastDatabasePath";
kMPSettingsKeyLegacyHidePassword: @YES,
kMPSettingsKeyLegacyHideTitle: @NO,
kMPSettingsKeyLegacyHideURL: @NO,
- kMPSettingsKeyLegacyHideUsername: @NO
+ kMPSettingsKeyLegacyHideUsername: @NO,
+ kMPSettingsKeyRememberKeyFilesForDatabases: @NO
};
}
-@end
\ No newline at end of file
+@end