mirror of
https://github.com/MacPass/MacPass.git
synced 2026-01-31 08:18:18 +00:00
Compare commits
7 Commits
0.3.3-alph
...
0.3.5-alph
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8d34f77a1f | ||
|
|
859fe5ede8 | ||
|
|
fef291df88 | ||
|
|
c1b47bdb77 | ||
|
|
0e102d3f0f | ||
|
|
d4c7d49d6f | ||
|
|
0144e3c21f |
2
HNHUi
2
HNHUi
Submodule HNHUi updated: 32be9c7cea...c32f87da30
@@ -72,6 +72,8 @@
|
||||
4C431BCD16E2A82800700A81 /* MPPasteBoardController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C431BCC16E2A82700700A81 /* MPPasteBoardController.m */; };
|
||||
4C431BCF16E2BAB000700A81 /* OverlayWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4C431BCE16E2BAB000700A81 /* OverlayWindow.xib */; };
|
||||
4C4436771792BE810099E220 /* KPKFormat.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C4436761792BE810099E220 /* KPKFormat.m */; };
|
||||
4C4510091798C53700219998 /* StringField+Validation.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C4510081798C53700219998 /* StringField+Validation.m */; };
|
||||
4C45100C1798C65C00219998 /* Kdb4Entry+MPAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C45100B1798C65C00219998 /* Kdb4Entry+MPAdditions.m */; };
|
||||
4C45FB1C178E09ED0010007D /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C45FB1B178E09ED0010007D /* SenTestingKit.framework */; };
|
||||
4C45FB1D178E09ED0010007D /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C77E36615B84A240093A587 /* Cocoa.framework */; };
|
||||
4C45FB23178E09ED0010007D /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 4C45FB21178E09ED0010007D /* InfoPlist.strings */; };
|
||||
@@ -138,6 +140,8 @@
|
||||
4C669B9F16760ED100DD0774 /* RandomStream.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C669B7516760ED100DD0774 /* RandomStream.m */; };
|
||||
4C669BA016760ED100DD0774 /* Salsa20RandomStream.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C669B7716760ED100DD0774 /* Salsa20RandomStream.m */; };
|
||||
4C669BA216760ED100DD0774 /* UUID.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C669B7B16760ED100DD0774 /* UUID.m */; };
|
||||
4C67D33017981A2B00A7BDFC /* HNHTokenField.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C67D32F17981A2B00A7BDFC /* HNHTokenField.m */; };
|
||||
4C67D33317981ABA00A7BDFC /* HNHTokenFieldCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C67D33217981ABA00A7BDFC /* HNHTokenFieldCell.m */; };
|
||||
4C69A73A16D589DF00EC1B1A /* HNHGradientView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C69A73916D589DF00EC1B1A /* HNHGradientView.m */; };
|
||||
4C6D1D25178579570014C5A5 /* 48_FolderTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 4C6D1D24178579570014C5A5 /* 48_FolderTemplate.pdf */; };
|
||||
4C6D1D27178586CA0014C5A5 /* 99_AddFolderTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 4C6D1D26178586CA0014C5A5 /* 99_AddFolderTemplate.pdf */; };
|
||||
@@ -350,6 +354,10 @@
|
||||
4C431BCE16E2BAB000700A81 /* OverlayWindow.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = OverlayWindow.xib; sourceTree = "<group>"; };
|
||||
4C4436751792BE810099E220 /* KPKFormat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KPKFormat.h; sourceTree = "<group>"; };
|
||||
4C4436761792BE810099E220 /* KPKFormat.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KPKFormat.m; sourceTree = "<group>"; };
|
||||
4C4510071798C53700219998 /* StringField+Validation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "StringField+Validation.h"; sourceTree = "<group>"; };
|
||||
4C4510081798C53700219998 /* StringField+Validation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "StringField+Validation.m"; sourceTree = "<group>"; };
|
||||
4C45100A1798C65C00219998 /* Kdb4Entry+MPAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Kdb4Entry+MPAdditions.h"; sourceTree = "<group>"; };
|
||||
4C45100B1798C65C00219998 /* Kdb4Entry+MPAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "Kdb4Entry+MPAdditions.m"; sourceTree = "<group>"; };
|
||||
4C45FB1A178E09ED0010007D /* MacPassTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MacPassTests.octest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
4C45FB1B178E09ED0010007D /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; };
|
||||
4C45FB20178E09ED0010007D /* MacPassTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "MacPassTests-Info.plist"; sourceTree = "<group>"; };
|
||||
@@ -477,6 +485,10 @@
|
||||
4C669B7716760ED100DD0774 /* Salsa20RandomStream.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Salsa20RandomStream.m; sourceTree = "<group>"; };
|
||||
4C669B7A16760ED100DD0774 /* UUID.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UUID.h; sourceTree = "<group>"; };
|
||||
4C669B7B16760ED100DD0774 /* UUID.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UUID.m; sourceTree = "<group>"; };
|
||||
4C67D32E17981A2B00A7BDFC /* HNHTokenField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HNHTokenField.h; sourceTree = "<group>"; };
|
||||
4C67D32F17981A2B00A7BDFC /* HNHTokenField.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HNHTokenField.m; sourceTree = "<group>"; };
|
||||
4C67D33117981ABA00A7BDFC /* HNHTokenFieldCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HNHTokenFieldCell.h; sourceTree = "<group>"; };
|
||||
4C67D33217981ABA00A7BDFC /* HNHTokenFieldCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HNHTokenFieldCell.m; sourceTree = "<group>"; };
|
||||
4C69A73816D589DF00EC1B1A /* HNHGradientView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HNHGradientView.h; sourceTree = "<group>"; };
|
||||
4C69A73916D589DF00EC1B1A /* HNHGradientView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HNHGradientView.m; sourceTree = "<group>"; };
|
||||
4C6D1D24178579570014C5A5 /* 48_FolderTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = 48_FolderTemplate.pdf; sourceTree = "<group>"; };
|
||||
@@ -925,6 +937,10 @@
|
||||
4C83F4A91774B155006C5FC0 /* Kdb3Tree+NewTree.m */,
|
||||
4C83F4AB1774B25F006C5FC0 /* Kdb4Tree+NewTree.h */,
|
||||
4C83F4AC1774B25F006C5FC0 /* Kdb4Tree+NewTree.m */,
|
||||
4C4510071798C53700219998 /* StringField+Validation.h */,
|
||||
4C4510081798C53700219998 /* StringField+Validation.m */,
|
||||
4C45100A1798C65C00219998 /* Kdb4Entry+MPAdditions.h */,
|
||||
4C45100B1798C65C00219998 /* Kdb4Entry+MPAdditions.m */,
|
||||
);
|
||||
name = "KeePassLib Categories";
|
||||
sourceTree = "<group>";
|
||||
@@ -1329,6 +1345,10 @@
|
||||
4CC3AAB9175F4983003EF01B /* HNHRoundedTextFieldCell.m */,
|
||||
4C9D6AA717615199001C660C /* HNHRoundedSecureTextFieldCell.h */,
|
||||
4C9D6AA817615199001C660C /* HNHRoundedSecureTextFieldCell.m */,
|
||||
4C67D32E17981A2B00A7BDFC /* HNHTokenField.h */,
|
||||
4C67D32F17981A2B00A7BDFC /* HNHTokenField.m */,
|
||||
4C67D33117981ABA00A7BDFC /* HNHTokenFieldCell.h */,
|
||||
4C67D33217981ABA00A7BDFC /* HNHTokenFieldCell.m */,
|
||||
4C58BD4D176370B100B8178C /* HNHBadgedTextField.h */,
|
||||
4C58BD4E176370B100B8178C /* HNHBadgedTextField.m */,
|
||||
4CAF62FA1763604000CD7084 /* HNHBadgedTextFieldCell.h */,
|
||||
@@ -1808,6 +1828,10 @@
|
||||
4C055E74179620BF00BD2BAB /* NSString+CommandString.m in Sources */,
|
||||
4CC0D2CE17974A47000B4BDA /* MPCustomFieldTableViewDelegate.m in Sources */,
|
||||
4CC0D2D117974A5A000B4BDA /* MPAttachmentTableViewDelegate.m in Sources */,
|
||||
4C67D33017981A2B00A7BDFC /* HNHTokenField.m in Sources */,
|
||||
4C67D33317981ABA00A7BDFC /* HNHTokenFieldCell.m in Sources */,
|
||||
4C4510091798C53700219998 /* StringField+Validation.m in Sources */,
|
||||
4C45100C1798C65C00219998 /* Kdb4Entry+MPAdditions.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -50,7 +50,7 @@
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSWindow"/>
|
||||
</object>
|
||||
<string key="NSScreenRect">{{0, 0}, {1920, 1058}}</string>
|
||||
<string key="NSScreenRect">{{0, 0}, {2560, 1418}}</string>
|
||||
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
|
||||
<string key="NSFrameAutosaveName">DatabaseWindow</string>
|
||||
<bool key="NSWindowIsRestorable">YES</bool>
|
||||
@@ -65,6 +65,7 @@
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<bool key="NSIsVertical">YES</bool>
|
||||
<int key="NSDividerStyle">2</int>
|
||||
<string key="NSAutosaveName"/>
|
||||
</object>
|
||||
</array>
|
||||
<object class="IBObjectContainer" key="IBDocument.Objects">
|
||||
|
||||
15
MacPass/Kdb4Entry+MPAdditions.h
Normal file
15
MacPass/Kdb4Entry+MPAdditions.h
Normal file
@@ -0,0 +1,15 @@
|
||||
//
|
||||
// Kdb4Entry+MPAdditions.h
|
||||
// MacPass
|
||||
//
|
||||
// Created by Michael Starke on 19.07.13.
|
||||
// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved.
|
||||
//
|
||||
|
||||
#import "Kdb4Node.h"
|
||||
|
||||
@interface Kdb4Entry (MPAdditions)
|
||||
|
||||
- (NSString *)uniqueKeyForProposal:(NSString *)key;
|
||||
|
||||
@end
|
||||
34
MacPass/Kdb4Entry+MPAdditions.m
Normal file
34
MacPass/Kdb4Entry+MPAdditions.m
Normal file
@@ -0,0 +1,34 @@
|
||||
//
|
||||
// Kdb4Entry+MPAdditions.m
|
||||
// MacPass
|
||||
//
|
||||
// Created by Michael Starke on 19.07.13.
|
||||
// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved.
|
||||
//
|
||||
|
||||
#import "Kdb4Entry+MPAdditions.h"
|
||||
|
||||
@implementation Kdb4Entry (MPAdditions)
|
||||
|
||||
- (NSString *)uniqueKeyForProposal:(NSString *)key {
|
||||
/*
|
||||
FIXME: Introduce some cachin behaviour. We iterate over after every single edit
|
||||
*/
|
||||
NSArray *defaultKeys = @[ FIELD_TITLE,
|
||||
FIELD_USER_NAME,
|
||||
FIELD_PASSWORD,
|
||||
FIELD_URL,
|
||||
FIELD_NOTES ];
|
||||
NSMutableSet *keys = [[NSMutableSet alloc] initWithArray:defaultKeys];
|
||||
for(StringField *field in self.stringFields) {
|
||||
[keys addObject:field.key];
|
||||
}
|
||||
NSUInteger counter = 1;
|
||||
NSString *base = key;
|
||||
while([keys containsObject:key]) {
|
||||
key = [NSString stringWithFormat:@"%@-%ld", base, counter++];
|
||||
}
|
||||
return key;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -24,7 +24,8 @@
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_customFieldFrameChanged:) name:NSViewFrameDidChangeNotification object:view];
|
||||
if([self.viewController.selectedEntry isKindOfClass:[Kdb4Entry class]]) {
|
||||
StringField *stringField = entry.stringFields[row];
|
||||
[view.labelTextField bind:NSValueBinding toObject:stringField withKeyPath:MPStringFieldKeyUndoableKey options:nil];
|
||||
NSDictionary *validateOptions = @{ NSValidatesImmediatelyBindingOption: @YES };
|
||||
[view.labelTextField bind:NSValueBinding toObject:stringField withKeyPath:MPStringFieldKeyUndoableKey options:validateOptions];
|
||||
[view.valueTextField bind:NSValueBinding toObject:stringField withKeyPath:MPStringFieldValueUndoableKey options:nil];
|
||||
[view.removeButton setTarget:self.viewController];
|
||||
[view.removeButton setAction:@selector(removeCustomField:)];
|
||||
|
||||
@@ -18,9 +18,11 @@ typedef NS_ENUM(NSUInteger, MPDatabaseSettingsTab) {
|
||||
@class MPDocument;
|
||||
@class HNHRoundedSecureTextField;
|
||||
|
||||
@interface MPDatabaseSettingsWindowController : NSWindowController
|
||||
@interface MPDatabaseSettingsWindowController : NSWindowController <NSTextFieldDelegate>
|
||||
|
||||
@property (weak) IBOutlet NSTabView *sectionTabView;
|
||||
@property (weak) IBOutlet NSButton *saveButton;
|
||||
@property (weak) IBOutlet NSButton *cancelButton;
|
||||
|
||||
/* General Tab */
|
||||
@property (weak) IBOutlet NSTextField *databaseNameTextField;
|
||||
@@ -28,8 +30,11 @@ typedef NS_ENUM(NSUInteger, MPDatabaseSettingsTab) {
|
||||
|
||||
/* Protection */
|
||||
@property (weak) IBOutlet HNHRoundedSecureTextField *passwordTextField;
|
||||
@property (weak) IBOutlet HNHRoundedSecureTextField *passwordRepeatTextField;
|
||||
@property (weak) IBOutlet NSPathControl *keyfilePathControl;
|
||||
@property (weak) IBOutlet NSButton *togglePasswordButton;
|
||||
@property (weak) IBOutlet NSTextField *errorTextField;
|
||||
|
||||
|
||||
- (IBAction)clearKey:(id)sender;
|
||||
- (IBAction)generateKey:(id)sender;
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
|
||||
#import "HNHRoundedSecureTextField.h"
|
||||
|
||||
#import "NSString+Empty.h"
|
||||
|
||||
#import "Kdb.h"
|
||||
#import "Kdb4Node.h"
|
||||
#import "KdbGroup+MPAdditions.h"
|
||||
@@ -24,6 +26,8 @@
|
||||
|
||||
@property (nonatomic,assign) BOOL trashEnabled;
|
||||
@property (nonatomic,assign) BOOL showPassword;
|
||||
@property (nonatomic,assign) BOOL hasValidPasswordOrKey;
|
||||
@property (nonatomic,weak) NSURL *keyURL;
|
||||
|
||||
@end
|
||||
|
||||
@@ -38,6 +42,7 @@
|
||||
if(self) {
|
||||
_document = document;
|
||||
_showPassword = NO;
|
||||
_hasValidPasswordOrKey = NO;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
@@ -47,6 +52,9 @@
|
||||
|
||||
NSAssert(_document != nil, @"Document needs to be present");
|
||||
|
||||
[self.saveButton bind:NSEnabledBinding toObject:self withKeyPath:@"hasValidPasswordOrKey" options:nil];
|
||||
[self.cancelButton bind:NSEnabledBinding toObject:self withKeyPath:@"hasValidPasswordOrKey" options:nil];
|
||||
|
||||
Kdb4Tree *tree = _document.treeV4;
|
||||
if( tree ) {
|
||||
[self _setupDatabase:tree];
|
||||
@@ -109,15 +117,68 @@
|
||||
[self.sectionTabView selectTabViewItemAtIndex:tab];
|
||||
}
|
||||
|
||||
- (void)setShowPassword:(BOOL)showPassword {
|
||||
if(_showPassword != showPassword) {
|
||||
_showPassword = showPassword;
|
||||
|
||||
[self.passwordRepeatTextField setStringValue:@""];
|
||||
[self _verifyPasswordAndKey];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setKeyURL:(NSURL *)keyURL {
|
||||
_keyURL = keyURL;
|
||||
[self _verifyPasswordAndKey];
|
||||
}
|
||||
|
||||
#pragma mark Actions
|
||||
- (IBAction)clearKey:(id)sender {
|
||||
[self.keyfilePathControl setURL:nil];
|
||||
self.keyURL = nil;
|
||||
}
|
||||
|
||||
- (IBAction)generateKey:(id)sender {
|
||||
}
|
||||
|
||||
#pragma makr NSTextFieldDelegate
|
||||
- (void)controlTextDidChange:(NSNotification *)obj {
|
||||
[self _verifyPasswordAndKey];
|
||||
}
|
||||
|
||||
#pragma mark Private Helper
|
||||
- (void)_verifyPasswordAndKey {
|
||||
NSString *password = [self.passwordTextField stringValue];
|
||||
NSString *repeat = [self.passwordRepeatTextField stringValue];
|
||||
BOOL hasKey = (self.keyURL != nil);
|
||||
BOOL keyOk = YES;
|
||||
if(hasKey) {
|
||||
keyOk = [self.keyURL checkResourceIsReachableAndReturnError:nil];
|
||||
}
|
||||
BOOL hasPassword = ![password isEmpty];
|
||||
BOOL passwordOk = YES;
|
||||
if(hasPassword ) {
|
||||
passwordOk = [password isEqualToString:repeat] || self.showPassword;
|
||||
}
|
||||
BOOL hasPasswordOrKey = (hasKey || hasPassword);
|
||||
keyOk = hasKey ? keyOk : YES;
|
||||
passwordOk = hasPassword ? passwordOk : YES;
|
||||
self.hasValidPasswordOrKey = hasPasswordOrKey && passwordOk && keyOk;
|
||||
|
||||
if(!hasPasswordOrKey) {
|
||||
[self.errorTextField setStringValue:NSLocalizedString(@"ERROR_NO_PASSWORD_OR_KEYFILE", "Missing Key or Password")];
|
||||
return; // alldone
|
||||
}
|
||||
if(!passwordOk && !keyOk ) {
|
||||
[self.errorTextField setStringValue:NSLocalizedString(@"ERROR_PASSWORD_MISSMATCH_INVALID_KEYFILE", "Passwords do not match, keyfile is invalid")];
|
||||
}
|
||||
else if(!passwordOk) {
|
||||
[self.errorTextField setStringValue:NSLocalizedString(@"ERROR_PASSWORD_MISSMATCH", "Passwords do not match")];
|
||||
}
|
||||
else {
|
||||
[self.errorTextField setStringValue:NSLocalizedString(@"ERROR_INVALID_KEYFILE", "Keyfile not valid")];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
- (void)_setupDatabase:(Kdb4Tree *)tree {
|
||||
[self.databaseNameTextField setStringValue:tree.databaseName];
|
||||
[self.databaseDescriptionTextView setString:tree.databaseDescription];
|
||||
@@ -140,10 +201,21 @@
|
||||
|
||||
- (void)_setupPasswordTab:(Kdb4Tree *)tree {
|
||||
[self.passwordTextField setStringValue:_document.password ? _document.password : @""];
|
||||
[self.keyfilePathControl setURL:_document.key];
|
||||
[self.passwordRepeatTextField setStringValue:[self.passwordRepeatTextField stringValue]];
|
||||
self.keyURL = _document.key;
|
||||
|
||||
NSDictionary *negateOption = @{ NSValueTransformerNameBindingOption : NSNegateBooleanTransformerName };
|
||||
[self.passwordTextField bind:@"showPassword" toObject:self withKeyPath:@"showPassword" options:nil];
|
||||
[self.togglePasswordButton bind:NSValueBinding toObject:self withKeyPath:@"showPassword" options:nil];
|
||||
[self.passwordRepeatTextField bind:NSEnabledBinding toObject:self withKeyPath:@"showPassword" options:negateOption];
|
||||
[self.errorTextField bind:NSHiddenBinding toObject:self withKeyPath:@"hasValidPasswordOrKey" options:nil];
|
||||
[self.keyfilePathControl bind:NSValueBinding toObject:self withKeyPath:@"keyURL" options:nil];
|
||||
|
||||
[self.passwordRepeatTextField setDelegate:self];
|
||||
[self.passwordTextField setDelegate:self];
|
||||
|
||||
/* Manually initate the first check */
|
||||
[self _verifyPasswordAndKey];
|
||||
}
|
||||
|
||||
- (void)_updateTrashFolders:(Kdb4Tree *)tree {
|
||||
|
||||
@@ -19,14 +19,18 @@
|
||||
#import "Kdb4Node.h"
|
||||
#import "Kdb4Persist.h"
|
||||
#import "KdbPassword.h"
|
||||
#import "KdbGroup+Undo.h"
|
||||
|
||||
#import "KdbGroup+KVOAdditions.h"
|
||||
#import "Kdb4Entry+KVOAdditions.h"
|
||||
#import "KdbGroup+MPTreeTools.h"
|
||||
#import "KdbGroup+MPAdditions.h"
|
||||
|
||||
#import "KdbEntry+Undo.h"
|
||||
#import "KdbGroup+Undo.h"
|
||||
|
||||
#import "Kdb3Tree+NewTree.h"
|
||||
#import "Kdb4Tree+NewTree.h"
|
||||
#import "Kdb4Entry+MPAdditions.h"
|
||||
#import "KdbGroup+MPTreeTools.h"
|
||||
#import "KdbGroup+MPAdditions.h"
|
||||
|
||||
#import "DataOutputStream.h"
|
||||
|
||||
@@ -349,6 +353,7 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey";
|
||||
Kdb4Entry *entryV4 = (Kdb4Entry *)entry;
|
||||
NSString *title = NSLocalizedString(@"DEFAULT_CUSTOM_FIELD_TITLE", @"Default Titel for new Custom-Fields");
|
||||
NSString *value = NSLocalizedString(@"DEFAULT_CUSTOM_FIELD_VALUE", @"Default Value for new Custom-Fields");
|
||||
title = [entryV4 uniqueKeyForProposal:title];
|
||||
StringField *newStringField = [StringField stringFieldWithKey:title andValue:value];
|
||||
[self addStringField:newStringField toEntry:entryV4 atIndex:[entryV4.stringFields count]];
|
||||
return newStringField;
|
||||
@@ -419,6 +424,7 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey";
|
||||
- (void)addStringField:(StringField *)field toEntry:(Kdb4Entry *)entry atIndex:(NSUInteger)index {
|
||||
[[[self undoManager] prepareWithInvocationTarget:self] removeStringField:field formEntry:entry];
|
||||
[[self undoManager] setActionName:NSLocalizedString(@"UNDO_ADD_STRING_FIELD", @"Add Stringfield Undo")];
|
||||
field.entry = entry;
|
||||
[entry insertObject:field inStringFieldsAtIndex:index];
|
||||
}
|
||||
|
||||
@@ -429,6 +435,7 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey";
|
||||
}
|
||||
[[[self undoManager] prepareWithInvocationTarget:self] addStringField:field toEntry:entry atIndex:index];
|
||||
[[self undoManager] setActionName:NSLocalizedString(@"UNDO_DELETE_STRING_FIELD", @"Delte Stringfield undo")];
|
||||
field.entry = nil;
|
||||
[entry removeObjectFromStringFieldsAtIndex:index];
|
||||
}
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#import "MPActionHelper.h"
|
||||
#import "MPDatabaseSettingsWindowController.h"
|
||||
#import "MPConstants.h"
|
||||
#import "MPSettingsHelper.h"
|
||||
|
||||
NSString *const MPCurrentItemChangedNotification = @"com.hicknhack.macpass.MPCurrentItemChangedNotification";
|
||||
|
||||
@@ -62,9 +63,6 @@ NSString *const MPCurrentItemChangedNotification = @"com.hicknhack.macpass.MPCur
|
||||
|
||||
- (void)dealloc {
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
#pragma mark View Handling
|
||||
@@ -94,6 +92,11 @@ NSString *const MPCurrentItemChangedNotification = @"com.hicknhack.macpass.MPCur
|
||||
[_splitView setHoldingPriority:NSLayoutPriorityDefaultLow+2 forSubviewAtIndex:0];
|
||||
[_splitView setHoldingPriority:NSLayoutPriorityDefaultLow+1 forSubviewAtIndex:2];
|
||||
|
||||
BOOL showInspector = [[NSUserDefaults standardUserDefaults] boolForKey:kMPSettingsKeyShowInspector];
|
||||
if(!showInspector) {
|
||||
[inspectorView removeFromSuperview];
|
||||
}
|
||||
|
||||
[[self window] setDelegate:self];
|
||||
|
||||
MPDocument *document = [self document];
|
||||
@@ -103,6 +106,8 @@ NSString *const MPCurrentItemChangedNotification = @"com.hicknhack.macpass.MPCur
|
||||
else {
|
||||
[self showEntries];
|
||||
}
|
||||
|
||||
[_splitView setAutosaveName:@"SplitView"];
|
||||
}
|
||||
|
||||
- (void)_setContentViewController:(MPViewController *)viewController {
|
||||
@@ -252,18 +257,21 @@ NSString *const MPCurrentItemChangedNotification = @"com.hicknhack.macpass.MPCur
|
||||
|
||||
- (void)toggleInspector:(id)sender {
|
||||
NSView *inspectorView = [_inspectorViewController view];
|
||||
BOOL inspectorVisible = NO;
|
||||
if([inspectorView superview]) {
|
||||
//[inspectorView animator]
|
||||
[inspectorView removeFromSuperview];
|
||||
}
|
||||
else {
|
||||
// Remove contraint on view removal.
|
||||
inspectorVisible = YES;
|
||||
[_splitView addSubview:inspectorView];
|
||||
[_splitView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"[inspectorView(>=200)]"
|
||||
options:0
|
||||
metrics:nil
|
||||
views:NSDictionaryOfVariableBindings(inspectorView)]];
|
||||
}
|
||||
[[NSUserDefaults standardUserDefaults] setBool:inspectorVisible forKey:kMPSettingsKeyShowInspector];
|
||||
}
|
||||
|
||||
- (void)showEntries {
|
||||
@@ -275,7 +283,7 @@ NSString *const MPCurrentItemChangedNotification = @"com.hicknhack.macpass.MPCur
|
||||
[[contentView subviews][0] removeFromSuperviewWithoutNeedingDisplay];
|
||||
}
|
||||
[contentView addSubview:_splitView];
|
||||
[_splitView adjustSubviews];
|
||||
//[_splitView adjustSubviews];
|
||||
NSView *outlineView = [_outlineViewController view];
|
||||
NSView *inspectorView = [_inspectorViewController view];
|
||||
NSView *entryView = [_entryViewController view];
|
||||
@@ -321,7 +329,7 @@ NSString *const MPCurrentItemChangedNotification = @"com.hicknhack.macpass.MPCur
|
||||
if(removeInspector) {
|
||||
[inspectorView removeFromSuperview];
|
||||
}
|
||||
[contentView layout];
|
||||
[contentView layoutSubtreeIfNeeded];
|
||||
|
||||
MPDocument *document = [self document];
|
||||
document.locked = NO;
|
||||
@@ -332,6 +340,7 @@ NSString *const MPCurrentItemChangedNotification = @"com.hicknhack.macpass.MPCur
|
||||
[_outlineViewController showOutline];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark NSWindowDelegate
|
||||
- (void)windowDidUpdate:(NSNotification *)notification {
|
||||
id firstResonder = [[self window] firstResponder];
|
||||
@@ -340,10 +349,16 @@ NSString *const MPCurrentItemChangedNotification = @"com.hicknhack.macpass.MPCur
|
||||
}
|
||||
_firstResponder = firstResonder;
|
||||
if([_firstResponder isKindOfClass:[NSView class]]) {
|
||||
[self _updateCurrentItem:[NSNotification notificationWithName:@"dummy" object:_firstResponder ]];
|
||||
//self _updateCurrentItem:[NSNotification notificationWithName:@"dummy" object:_firstResponder ]];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)windowDidBecomeKey:(NSNotification *)notification {
|
||||
MPDocument *document = [self document];
|
||||
if(!document.hasPasswordOrKey && document.decrypted) {
|
||||
[self performSelector:@selector(editPassword:) withObject:nil afterDelay:0.5];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark Helper
|
||||
|
||||
|
||||
@@ -27,6 +27,9 @@ APPKIT_EXTERN NSString *const kMPSettingsKeyLockOnSleep;
|
||||
APPKIT_EXTERN NSString *const kMPSettingsKeyIdleLockTimeOut;
|
||||
|
||||
|
||||
/* Autosaving states */
|
||||
APPKIT_EXTERN NSString *const kMPSettingsKeyShowInspector;
|
||||
|
||||
typedef NS_ENUM(NSUInteger, MPPasswordEncoding) {
|
||||
MPPasswordEncodingUTF8,
|
||||
MPPasswordEncodingASCII,
|
||||
|
||||
@@ -17,6 +17,7 @@ NSString *const kMPSettingsKeyEnableHttpServer = @"EnableHttpServer";
|
||||
NSString *const kMPSettingsKeyShowMenuItem = @"ShowMenuItem";
|
||||
NSString *const kMPSettingsKeyLockOnSleep = @"LockOnSleep";
|
||||
NSString *const kMPSettingsKeyIdleLockTimeOut = @"IdleLockTimeOut";
|
||||
NSString *const kMPSettingsKeyShowInspector = @"ShowInspector";
|
||||
|
||||
@implementation MPSettingsHelper
|
||||
|
||||
@@ -26,6 +27,7 @@ NSString *const kMPSettingsKeyIdleLockTimeOut = @"IdleLockTimeOut";
|
||||
|
||||
+ (NSDictionary *)_standardDefaults {
|
||||
return @{
|
||||
kMPSettingsKeyShowInspector: @YES, // Show the Inspector by default
|
||||
kMPSettingsKeyPasteboardClearTimeout: @30, // 30 seconds
|
||||
kMPSettingsKeyClearPasteboardOnQuit: @YES,
|
||||
kMPSettingsKeyOpenEmptyDatabaseOnLaunch: @NO,
|
||||
|
||||
@@ -44,11 +44,11 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.3.3</string>
|
||||
<string>0.3.5</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>2508</string>
|
||||
<string>2516</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
|
||||
13
MacPass/StringField+Validation.h
Normal file
13
MacPass/StringField+Validation.h
Normal file
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// StringField+Validation.h
|
||||
// MacPass
|
||||
//
|
||||
// Created by Michael Starke on 19.07.13.
|
||||
// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved.
|
||||
//
|
||||
|
||||
#import "Kdb4Node.h"
|
||||
|
||||
@interface StringField (Validation)
|
||||
|
||||
@end
|
||||
19
MacPass/StringField+Validation.m
Normal file
19
MacPass/StringField+Validation.m
Normal file
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// StringField+Validation.m
|
||||
// MacPass
|
||||
//
|
||||
// Created by Michael Starke on 19.07.13.
|
||||
// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved.
|
||||
//
|
||||
|
||||
#import "StringField+Validation.h"
|
||||
#import "Kdb4Entry+MPAdditions.h"
|
||||
|
||||
@implementation StringField (Validation)
|
||||
|
||||
- (BOOL)validateValue:(inout __autoreleasing id *)ioValue forKey:(NSString *)inKey error:(out NSError *__autoreleasing *)outError {
|
||||
*ioValue = [self.entry uniqueKeyForProposal:*ioValue];
|
||||
return YES;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,7 +1,7 @@
|
||||
{\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf390
|
||||
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
|
||||
{\colortbl;\red255\green255\blue255;\red52\green110\blue183;\red38\green38\blue38;}
|
||||
\paperw11900\paperh16840\vieww28040\viewh7240\viewkind0
|
||||
\paperw11900\paperh16840\vieww19440\viewh14240\viewkind0
|
||||
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720
|
||||
|
||||
\f0\b\fs24 \cf0 Projekt Webseite:\
|
||||
@@ -37,6 +37,7 @@ You should have received a copy of the GNU General Public License along with thi
|
||||
\b0 \cf3 \
|
||||
Copyright \'a9 2012 Robbie Hanson. Alle Rechte vorbehalten.\
|
||||
\
|
||||
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720
|
||||
{\field{\*\fldinst{HYPERLINK "https://github.com/MiniKeePass/MiniKeePass"}}{\fldrslt \cf2 MiniKeePass}}\
|
||||
Copyright \'a9 2011 Jason Rush und John Flanagan. Alle Rechte vorbehalten.\
|
||||
\
|
||||
@@ -50,9 +51,16 @@ Copyright \'a9 2011, Alex Rozanski. Alle Rechte vorbehalten.\
|
||||
\
|
||||
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720
|
||||
{\field{\*\fldinst{HYPERLINK "http://stackoverflow.com/questions/11386876/how-to-encode-and-decode-files-as-base64-in-cocoa-objective-c"}}{\fldrslt \cf3 Base64 Encoding Category}}\
|
||||
Copyright @2013, {\field{\*\fldinst{HYPERLINK "http://stackoverflow.com/users/200321/denis2342"}}{\fldrslt denis2342}}\
|
||||
Copyright \'a92013, {\field{\*\fldinst{HYPERLINK "http://stackoverflow.com/users/200321/denis2342"}}{\fldrslt denis2342}}\
|
||||
\
|
||||
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720
|
||||
{\field{\*\fldinst{HYPERLINK "http://www.cocoadev.com/index.pl?NSDataCategory"}}{\fldrslt \cf3 NSData+Gzip}}\
|
||||
Basierend auf dem Code im CocoaDev Wiki\
|
||||
}
|
||||
\
|
||||
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720
|
||||
{\field{\*\fldinst{HYPERLINK "https://github.com/karelia/SecurityInterface"}}{\fldrslt \cf3 KSPasswordField}}\kerning1\expnd0\expndtw3
|
||||
\
|
||||
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720
|
||||
\cf3 \kerning1\expnd0\expndtw0 Quelltext wird in HNHRoundedSecureTextField verwendet\kerning1\expnd0\expndtw3
|
||||
\
|
||||
\kerning1\expnd0\expndtw0 Copyright \'a92012 Mike Abdullah, Karelia Software. Alle Rechte vorbehalten.}
|
||||
Binary file not shown.
@@ -11,8 +11,9 @@
|
||||
|
||||
\b \
|
||||
License:\
|
||||
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720
|
||||
|
||||
\b0 MacPass KeePass compatible client for OS X\
|
||||
\b0 \cf0 MacPass KeePass compatible client for OS X\
|
||||
Copyright (c) 2012-2013 Michael Starke, HicknHack Software GmbH\
|
||||
\
|
||||
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by\
|
||||
@@ -40,6 +41,7 @@ You should have received a copy of the GNU General Public License along with thi
|
||||
{\field{\*\fldinst{HYPERLINK "https://github.com/robbiehanson/KissXML"}}{\fldrslt \cf2 KissXML}}\cf3 \
|
||||
Copyright \'a9 2012 Robbie Hanson. All rights reserved.\
|
||||
\
|
||||
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720
|
||||
{\field{\*\fldinst{HYPERLINK "https://github.com/MiniKeePass/MiniKeePass"}}{\fldrslt \cf2 MiniKeePass}}\
|
||||
Copyright \'a9 2011 Jason Rush and John Flanagan. All rights reserved.\
|
||||
\
|
||||
@@ -53,9 +55,13 @@ Copyright \'a9 2011, Alex Rozanski. All rights reserved.\
|
||||
\
|
||||
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720
|
||||
{\field{\*\fldinst{HYPERLINK "http://stackoverflow.com/questions/11386876/how-to-encode-and-decode-files-as-base64-in-cocoa-objective-c"}}{\fldrslt \cf3 NSData+Base64}}\
|
||||
Copyright @2013, {\field{\*\fldinst{HYPERLINK "http://stackoverflow.com/users/200321/denis2342"}}{\fldrslt denis2342}}\
|
||||
Copyright \'a92013, {\field{\*\fldinst{HYPERLINK "http://stackoverflow.com/users/200321/denis2342"}}{\fldrslt denis2342}}\
|
||||
\
|
||||
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720
|
||||
{\field{\*\fldinst{HYPERLINK "http://www.cocoadev.com/index.pl?NSDataCategory"}}{\fldrslt \cf3 NSData+Gzip}}\
|
||||
Extracted from code on the CocoaDev Wiki\
|
||||
}
|
||||
\
|
||||
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720
|
||||
{\field{\*\fldinst{HYPERLINK "https://github.com/karelia/SecurityInterface"}}{\fldrslt \cf3 KSPasswordField}}\
|
||||
Code reused in HNHRoundedSecureTextField\
|
||||
Copyright \'a92012 Mike Abdullah, Karelia Software. All rights reserved.}
|
||||
Binary file not shown.
Submodule MiniKeePassLib updated: def7d0c27d...f23dd68cb4
Reference in New Issue
Block a user