Fixed #18. Passwords are now displayed as 8-dots or empy

This commit is contained in:
michael starke
2013-06-17 21:01:20 +02:00
parent 16878b65b3
commit 1f105c5bdb
7 changed files with 105 additions and 5 deletions

View File

@@ -0,0 +1,13 @@
//
// MPAssociateRequestHandler.h
// MacPass
//
// Created by Michael Starke on 17.06.13.
// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface MPAssociateRequestHandler : NSObject
@end

View File

@@ -0,0 +1,13 @@
//
// MPAssociateRequestHandler.m
// MacPass
//
// Created by Michael Starke on 17.06.13.
// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved.
//
#import "MPAssociateRequestHandler.h"
@implementation MPAssociateRequestHandler
@end

View File

@@ -15,15 +15,19 @@
#import "MPDocumentWindowController.h" #import "MPDocumentWindowController.h"
#import "MPPasteBoardController.h" #import "MPPasteBoardController.h"
#import "MPOverlayWindowController.h" #import "MPOverlayWindowController.h"
#import "KdbGroup+MPTreeTools.h"
#import "KdbGroup+Undo.h"
#import "KdbEntry+Undo.h"
#import "MPContextMenuHelper.h" #import "MPContextMenuHelper.h"
#import "MPConstants.h" #import "MPConstants.h"
#import "MPEntryTableDataSource.h" #import "MPEntryTableDataSource.h"
#import "MPStringLengthValueTransformer.h"
#import "HNHTableHeaderCell.h" #import "HNHTableHeaderCell.h"
#import "HNHGradientView.h" #import "HNHGradientView.h"
#import "KdbGroup+MPTreeTools.h"
#import "KdbGroup+Undo.h"
#import "KdbEntry+Undo.h"
NSString *const MPDidChangeSelectedEntryNotification = @"com.macpass.MPDidChangeSelectedEntryNotification"; NSString *const MPDidChangeSelectedEntryNotification = @"com.macpass.MPDidChangeSelectedEntryNotification";
#define STATUS_BAR_ANIMATION_TIME 0.2 #define STATUS_BAR_ANIMATION_TIME 0.2
@@ -194,7 +198,8 @@ NSString *const _toggleFilterUsernameButton = @"SearchUsername";
} }
else if( isPasswordColum ) { else if( isPasswordColum ) {
view = [tableView makeViewWithIdentifier:_MPTAbleSecurCellView owner:self]; view = [tableView makeViewWithIdentifier:_MPTAbleSecurCellView owner:self];
[[view textField] bind:NSValueBinding toObject:entry withKeyPath:MPEntryPasswordUndoableKey options:nil]; NSDictionary *options = @{ NSValueTransformerBindingOption : [NSValueTransformer valueTransformerForName:MPStringLengthValueTransformerName] };
[[view textField] bind:NSValueBinding toObject:entry withKeyPath:MPEntryPasswordUndoableKey options:options];
} }
else if( isUsernameColumn || isURLColumn ) { else if( isUsernameColumn || isURLColumn ) {
view = [tableView makeViewWithIdentifier:_MPTableStringCellView owner:self]; view = [tableView makeViewWithIdentifier:_MPTableStringCellView owner:self];

View File

@@ -0,0 +1,13 @@
//
// MPServerRequestHandler.h
// MacPass
//
// Created by Michael Starke on 17.06.13.
// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved.
//
#import <Foundation/Foundation.h>
@protocol MPServerRequestHandler <NSObject>
@end

View File

@@ -0,0 +1,17 @@
//
// MPStringLengthValueTransformer.h
// MacPass
//
// Created by Michael Starke on 17.06.13.
// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved.
//
#import <Foundation/Foundation.h>
APPKIT_EXTERN NSString *const MPStringLengthValueTransformerName;
@interface MPStringLengthValueTransformer : NSValueTransformer
+ (void)registerTransformer;
@end

View File

@@ -0,0 +1,39 @@
//
// MPStringLengthValueTransformer.m
// MacPass
//
// Created by Michael Starke on 17.06.13.
// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved.
//
#import "MPStringLengthValueTransformer.h"
#define CROP_LENGHT 10;
NSString *const MPStringLengthValueTransformerName = @"com.hicknhack.macpass.MPMPStringLengthValueTransformer";
@implementation MPStringLengthValueTransformer
+ (Class)transformedValueClass {
return [NSString class];
}
+ (BOOL)allowsReverseTransformation {
return NO;
}
+ (void)registerTransformer {
MPStringLengthValueTransformer *transformer = [[MPStringLengthValueTransformer alloc] init];
[NSValueTransformer setValueTransformer:transformer
forName:MPStringLengthValueTransformerName];
[transformer release];
}
- (id)transformedValue:(id)value {
NSUInteger length = 0;
if([value isKindOfClass:[NSString class]]) {
length = [value length];
}
return (length > 0) ? @"12345678" : @"";
}
@end

View File

@@ -8,7 +8,7 @@
#import "MPUppercaseStringValueTransformer.h" #import "MPUppercaseStringValueTransformer.h"
NSString *const MPUppsercaseStringValueTransformerName = @"StringToUppercaseStringTransformer"; NSString *const MPUppsercaseStringValueTransformerName = @"com.hicknhack.macpass.StringToUppercaseStringTransformer";
@implementation MPUppercaseStringValueTransformer @implementation MPUppercaseStringValueTransformer